diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 19:50:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 19:50:35 -0500 |
commit | 3c0cb7c31c206aaedb967e44b98442bbeb17a6c4 (patch) | |
tree | 3ecba45d7ffae4fba4a5aafaef4af5b0b1105bde | |
parent | f70f5b9dc74ca7d0a64c4ead3fb28da09dc1b234 (diff) | |
parent | 404a02cbd2ae8bf256a2fa1169bdfe86bb5ebb34 (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (416 commits)
ARM: DMA: add support for DMA debugging
ARM: PL011: add DMA burst threshold support for ST variants
ARM: PL011: Add support for transmit DMA
ARM: PL011: Ensure IRQs are disabled in UART interrupt handler
ARM: PL011: Separate hardware FIFO size from TTY FIFO size
ARM: PL011: Allow better handling of vendor data
ARM: PL011: Ensure error flags are clear at startup
ARM: PL011: include revision number in boot-time port printk
ARM: vexpress: add sched_clock() for Versatile Express
ARM i.MX53: Make MX53 EVK bootable
ARM i.MX53: Some bug fix about MX53 MSL code
ARM: 6607/1: sa1100: Update platform device registration
ARM: 6606/1: sa1100: Fix platform device registration
ARM i.MX51: rename IPU irqs
ARM i.MX51: Add ipu clock support
ARM: imx/mx27_3ds: Add PMIC support
ARM: DMA: Replace page_to_dma()/dma_to_page() with pfn_to_dma()/dma_to_pfn()
mx51: fix usb clock support
MX51: Add support for usb host 2
arch/arm/plat-mxc/ehci.c: fix errors/typos
...
661 files changed, 30869 insertions, 12081 deletions
diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX index ecf7d04bca26..91c24a1e8a9e 100644 --- a/Documentation/arm/00-INDEX +++ b/Documentation/arm/00-INDEX | |||
@@ -34,3 +34,5 @@ memory.txt | |||
34 | - description of the virtual memory layout | 34 | - description of the virtual memory layout |
35 | nwfpe/ | 35 | nwfpe/ |
36 | - NWFPE floating point emulator documentation | 36 | - NWFPE floating point emulator documentation |
37 | swp_emulation | ||
38 | - SWP/SWPB emulation handler/logging description | ||
diff --git a/Documentation/arm/swp_emulation b/Documentation/arm/swp_emulation new file mode 100644 index 000000000000..af903d22fd93 --- /dev/null +++ b/Documentation/arm/swp_emulation | |||
@@ -0,0 +1,27 @@ | |||
1 | Software emulation of deprecated SWP instruction (CONFIG_SWP_EMULATE) | ||
2 | --------------------------------------------------------------------- | ||
3 | |||
4 | ARMv6 architecture deprecates use of the SWP/SWPB instructions, and recommeds | ||
5 | moving to the load-locked/store-conditional instructions LDREX and STREX. | ||
6 | |||
7 | ARMv7 multiprocessing extensions introduce the ability to disable these | ||
8 | instructions, triggering an undefined instruction exception when executed. | ||
9 | Trapped instructions are emulated using an LDREX/STREX or LDREXB/STREXB | ||
10 | sequence. If a memory access fault (an abort) occurs, a segmentation fault is | ||
11 | signalled to the triggering process. | ||
12 | |||
13 | /proc/cpu/swp_emulation holds some statistics/information, including the PID of | ||
14 | the last process to trigger the emulation to be invocated. For example: | ||
15 | --- | ||
16 | Emulated SWP: 12 | ||
17 | Emulated SWPB: 0 | ||
18 | Aborted SWP{B}: 1 | ||
19 | Last process: 314 | ||
20 | --- | ||
21 | |||
22 | NOTE: when accessing uncached shared regions, LDREX/STREX rely on an external | ||
23 | transaction monitoring block called a global monitor to maintain update | ||
24 | atomicity. If your system does not implement a global monitor, this option can | ||
25 | cause programs that perform SWP operations to uncached memory to deadlock, as | ||
26 | the STREX operation will always fail. | ||
27 | |||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index d56d21c0573b..a3fb23be87f3 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -2,6 +2,7 @@ config ARM | |||
2 | bool | 2 | bool |
3 | default y | 3 | default y |
4 | select HAVE_AOUT | 4 | select HAVE_AOUT |
5 | select HAVE_DMA_API_DEBUG | ||
5 | select HAVE_IDE | 6 | select HAVE_IDE |
6 | select HAVE_MEMBLOCK | 7 | select HAVE_MEMBLOCK |
7 | select RTC_LIB | 8 | select RTC_LIB |
@@ -14,6 +15,7 @@ config ARM | |||
14 | select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) | 15 | select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) |
15 | select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) | 16 | select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) |
16 | select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) | 17 | select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) |
18 | select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL) | ||
17 | select HAVE_GENERIC_DMA_COHERENT | 19 | select HAVE_GENERIC_DMA_COHERENT |
18 | select HAVE_KERNEL_GZIP | 20 | select HAVE_KERNEL_GZIP |
19 | select HAVE_KERNEL_LZO | 21 | select HAVE_KERNEL_LZO |
@@ -23,6 +25,7 @@ config ARM | |||
23 | select PERF_USE_VMALLOC | 25 | select PERF_USE_VMALLOC |
24 | select HAVE_REGS_AND_STACK_ACCESS_API | 26 | select HAVE_REGS_AND_STACK_ACCESS_API |
25 | select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7)) | 27 | select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7)) |
28 | select HAVE_C_RECORDMCOUNT | ||
26 | help | 29 | help |
27 | The ARM series is a line of low-power-consumption RISC chip designs | 30 | The ARM series is a line of low-power-consumption RISC chip designs |
28 | licensed by ARM Ltd and targeted at embedded applications and | 31 | licensed by ARM Ltd and targeted at embedded applications and |
@@ -34,9 +37,15 @@ config ARM | |||
34 | config HAVE_PWM | 37 | config HAVE_PWM |
35 | bool | 38 | bool |
36 | 39 | ||
40 | config MIGHT_HAVE_PCI | ||
41 | bool | ||
42 | |||
37 | config SYS_SUPPORTS_APM_EMULATION | 43 | config SYS_SUPPORTS_APM_EMULATION |
38 | bool | 44 | bool |
39 | 45 | ||
46 | config HAVE_SCHED_CLOCK | ||
47 | bool | ||
48 | |||
40 | config GENERIC_GPIO | 49 | config GENERIC_GPIO |
41 | bool | 50 | bool |
42 | 51 | ||
@@ -221,7 +230,7 @@ config ARCH_INTEGRATOR | |||
221 | bool "ARM Ltd. Integrator family" | 230 | bool "ARM Ltd. Integrator family" |
222 | select ARM_AMBA | 231 | select ARM_AMBA |
223 | select ARCH_HAS_CPUFREQ | 232 | select ARCH_HAS_CPUFREQ |
224 | select COMMON_CLKDEV | 233 | select CLKDEV_LOOKUP |
225 | select ICST | 234 | select ICST |
226 | select GENERIC_CLOCKEVENTS | 235 | select GENERIC_CLOCKEVENTS |
227 | select PLAT_VERSATILE | 236 | select PLAT_VERSATILE |
@@ -231,7 +240,8 @@ config ARCH_INTEGRATOR | |||
231 | config ARCH_REALVIEW | 240 | config ARCH_REALVIEW |
232 | bool "ARM Ltd. RealView family" | 241 | bool "ARM Ltd. RealView family" |
233 | select ARM_AMBA | 242 | select ARM_AMBA |
234 | select COMMON_CLKDEV | 243 | select CLKDEV_LOOKUP |
244 | select HAVE_SCHED_CLOCK | ||
235 | select ICST | 245 | select ICST |
236 | select GENERIC_CLOCKEVENTS | 246 | select GENERIC_CLOCKEVENTS |
237 | select ARCH_WANT_OPTIONAL_GPIOLIB | 247 | select ARCH_WANT_OPTIONAL_GPIOLIB |
@@ -245,7 +255,8 @@ config ARCH_VERSATILE | |||
245 | bool "ARM Ltd. Versatile family" | 255 | bool "ARM Ltd. Versatile family" |
246 | select ARM_AMBA | 256 | select ARM_AMBA |
247 | select ARM_VIC | 257 | select ARM_VIC |
248 | select COMMON_CLKDEV | 258 | select CLKDEV_LOOKUP |
259 | select HAVE_SCHED_CLOCK | ||
249 | select ICST | 260 | select ICST |
250 | select GENERIC_CLOCKEVENTS | 261 | select GENERIC_CLOCKEVENTS |
251 | select ARCH_WANT_OPTIONAL_GPIOLIB | 262 | select ARCH_WANT_OPTIONAL_GPIOLIB |
@@ -259,9 +270,10 @@ config ARCH_VEXPRESS | |||
259 | select ARCH_WANT_OPTIONAL_GPIOLIB | 270 | select ARCH_WANT_OPTIONAL_GPIOLIB |
260 | select ARM_AMBA | 271 | select ARM_AMBA |
261 | select ARM_TIMER_SP804 | 272 | select ARM_TIMER_SP804 |
262 | select COMMON_CLKDEV | 273 | select CLKDEV_LOOKUP |
263 | select GENERIC_CLOCKEVENTS | 274 | select GENERIC_CLOCKEVENTS |
264 | select HAVE_CLK | 275 | select HAVE_CLK |
276 | select HAVE_SCHED_CLOCK | ||
265 | select ICST | 277 | select ICST |
266 | select PLAT_VERSATILE | 278 | select PLAT_VERSATILE |
267 | help | 279 | help |
@@ -280,7 +292,7 @@ config ARCH_BCMRING | |||
280 | depends on MMU | 292 | depends on MMU |
281 | select CPU_V6 | 293 | select CPU_V6 |
282 | select ARM_AMBA | 294 | select ARM_AMBA |
283 | select COMMON_CLKDEV | 295 | select CLKDEV_LOOKUP |
284 | select GENERIC_CLOCKEVENTS | 296 | select GENERIC_CLOCKEVENTS |
285 | select ARCH_WANT_OPTIONAL_GPIOLIB | 297 | select ARCH_WANT_OPTIONAL_GPIOLIB |
286 | help | 298 | help |
@@ -298,6 +310,7 @@ config ARCH_CNS3XXX | |||
298 | select CPU_V6 | 310 | select CPU_V6 |
299 | select GENERIC_CLOCKEVENTS | 311 | select GENERIC_CLOCKEVENTS |
300 | select ARM_GIC | 312 | select ARM_GIC |
313 | select MIGHT_HAVE_PCI | ||
301 | select PCI_DOMAINS if PCI | 314 | select PCI_DOMAINS if PCI |
302 | help | 315 | help |
303 | Support for Cavium Networks CNS3XXX platform. | 316 | Support for Cavium Networks CNS3XXX platform. |
@@ -327,7 +340,7 @@ config ARCH_EP93XX | |||
327 | select CPU_ARM920T | 340 | select CPU_ARM920T |
328 | select ARM_AMBA | 341 | select ARM_AMBA |
329 | select ARM_VIC | 342 | select ARM_VIC |
330 | select COMMON_CLKDEV | 343 | select CLKDEV_LOOKUP |
331 | select ARCH_REQUIRE_GPIOLIB | 344 | select ARCH_REQUIRE_GPIOLIB |
332 | select ARCH_HAS_HOLES_MEMORYMODEL | 345 | select ARCH_HAS_HOLES_MEMORYMODEL |
333 | select ARCH_USES_GETTIMEOFFSET | 346 | select ARCH_USES_GETTIMEOFFSET |
@@ -347,14 +360,22 @@ config ARCH_MXC | |||
347 | bool "Freescale MXC/iMX-based" | 360 | bool "Freescale MXC/iMX-based" |
348 | select GENERIC_CLOCKEVENTS | 361 | select GENERIC_CLOCKEVENTS |
349 | select ARCH_REQUIRE_GPIOLIB | 362 | select ARCH_REQUIRE_GPIOLIB |
350 | select COMMON_CLKDEV | 363 | select CLKDEV_LOOKUP |
351 | help | 364 | help |
352 | Support for Freescale MXC/iMX-based family of processors | 365 | Support for Freescale MXC/iMX-based family of processors |
353 | 366 | ||
367 | config ARCH_MXS | ||
368 | bool "Freescale MXS-based" | ||
369 | select GENERIC_CLOCKEVENTS | ||
370 | select ARCH_REQUIRE_GPIOLIB | ||
371 | select COMMON_CLKDEV | ||
372 | help | ||
373 | Support for Freescale MXS-based family of processors | ||
374 | |||
354 | config ARCH_STMP3XXX | 375 | config ARCH_STMP3XXX |
355 | bool "Freescale STMP3xxx" | 376 | bool "Freescale STMP3xxx" |
356 | select CPU_ARM926T | 377 | select CPU_ARM926T |
357 | select COMMON_CLKDEV | 378 | select CLKDEV_LOOKUP |
358 | select ARCH_REQUIRE_GPIOLIB | 379 | select ARCH_REQUIRE_GPIOLIB |
359 | select GENERIC_CLOCKEVENTS | 380 | select GENERIC_CLOCKEVENTS |
360 | select USB_ARCH_HAS_EHCI | 381 | select USB_ARCH_HAS_EHCI |
@@ -433,6 +454,8 @@ config ARCH_IXP4XX | |||
433 | select CPU_XSCALE | 454 | select CPU_XSCALE |
434 | select GENERIC_GPIO | 455 | select GENERIC_GPIO |
435 | select GENERIC_CLOCKEVENTS | 456 | select GENERIC_CLOCKEVENTS |
457 | select HAVE_SCHED_CLOCK | ||
458 | select MIGHT_HAVE_PCI | ||
436 | select DMABOUNCE if PCI | 459 | select DMABOUNCE if PCI |
437 | help | 460 | help |
438 | Support for Intel's IXP4XX (XScale) family of processors. | 461 | Support for Intel's IXP4XX (XScale) family of processors. |
@@ -472,7 +495,7 @@ config ARCH_LPC32XX | |||
472 | select HAVE_IDE | 495 | select HAVE_IDE |
473 | select ARM_AMBA | 496 | select ARM_AMBA |
474 | select USB_ARCH_HAS_OHCI | 497 | select USB_ARCH_HAS_OHCI |
475 | select COMMON_CLKDEV | 498 | select CLKDEV_LOOKUP |
476 | select GENERIC_TIME | 499 | select GENERIC_TIME |
477 | select GENERIC_CLOCKEVENTS | 500 | select GENERIC_CLOCKEVENTS |
478 | help | 501 | help |
@@ -506,8 +529,9 @@ config ARCH_MMP | |||
506 | bool "Marvell PXA168/910/MMP2" | 529 | bool "Marvell PXA168/910/MMP2" |
507 | depends on MMU | 530 | depends on MMU |
508 | select ARCH_REQUIRE_GPIOLIB | 531 | select ARCH_REQUIRE_GPIOLIB |
509 | select COMMON_CLKDEV | 532 | select CLKDEV_LOOKUP |
510 | select GENERIC_CLOCKEVENTS | 533 | select GENERIC_CLOCKEVENTS |
534 | select HAVE_SCHED_CLOCK | ||
511 | select TICK_ONESHOT | 535 | select TICK_ONESHOT |
512 | select PLAT_PXA | 536 | select PLAT_PXA |
513 | select SPARSE_IRQ | 537 | select SPARSE_IRQ |
@@ -539,7 +563,7 @@ config ARCH_W90X900 | |||
539 | bool "Nuvoton W90X900 CPU" | 563 | bool "Nuvoton W90X900 CPU" |
540 | select CPU_ARM926T | 564 | select CPU_ARM926T |
541 | select ARCH_REQUIRE_GPIOLIB | 565 | select ARCH_REQUIRE_GPIOLIB |
542 | select COMMON_CLKDEV | 566 | select CLKDEV_LOOKUP |
543 | select GENERIC_CLOCKEVENTS | 567 | select GENERIC_CLOCKEVENTS |
544 | help | 568 | help |
545 | Support for Nuvoton (Winbond logic dept.) ARM9 processor, | 569 | Support for Nuvoton (Winbond logic dept.) ARM9 processor, |
@@ -553,18 +577,19 @@ config ARCH_W90X900 | |||
553 | config ARCH_NUC93X | 577 | config ARCH_NUC93X |
554 | bool "Nuvoton NUC93X CPU" | 578 | bool "Nuvoton NUC93X CPU" |
555 | select CPU_ARM926T | 579 | select CPU_ARM926T |
556 | select COMMON_CLKDEV | 580 | select CLKDEV_LOOKUP |
557 | help | 581 | help |
558 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a | 582 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a |
559 | low-power and high performance MPEG-4/JPEG multimedia controller chip. | 583 | low-power and high performance MPEG-4/JPEG multimedia controller chip. |
560 | 584 | ||
561 | config ARCH_TEGRA | 585 | config ARCH_TEGRA |
562 | bool "NVIDIA Tegra" | 586 | bool "NVIDIA Tegra" |
587 | select CLKDEV_LOOKUP | ||
563 | select GENERIC_TIME | 588 | select GENERIC_TIME |
564 | select GENERIC_CLOCKEVENTS | 589 | select GENERIC_CLOCKEVENTS |
565 | select GENERIC_GPIO | 590 | select GENERIC_GPIO |
566 | select HAVE_CLK | 591 | select HAVE_CLK |
567 | select COMMON_CLKDEV | 592 | select HAVE_SCHED_CLOCK |
568 | select ARCH_HAS_BARRIERS if CACHE_L2X0 | 593 | select ARCH_HAS_BARRIERS if CACHE_L2X0 |
569 | select ARCH_HAS_CPUFREQ | 594 | select ARCH_HAS_CPUFREQ |
570 | help | 595 | help |
@@ -574,7 +599,7 @@ config ARCH_TEGRA | |||
574 | config ARCH_PNX4008 | 599 | config ARCH_PNX4008 |
575 | bool "Philips Nexperia PNX4008 Mobile" | 600 | bool "Philips Nexperia PNX4008 Mobile" |
576 | select CPU_ARM926T | 601 | select CPU_ARM926T |
577 | select COMMON_CLKDEV | 602 | select CLKDEV_LOOKUP |
578 | select ARCH_USES_GETTIMEOFFSET | 603 | select ARCH_USES_GETTIMEOFFSET |
579 | help | 604 | help |
580 | This enables support for Philips PNX4008 mobile platform. | 605 | This enables support for Philips PNX4008 mobile platform. |
@@ -584,9 +609,10 @@ config ARCH_PXA | |||
584 | depends on MMU | 609 | depends on MMU |
585 | select ARCH_MTD_XIP | 610 | select ARCH_MTD_XIP |
586 | select ARCH_HAS_CPUFREQ | 611 | select ARCH_HAS_CPUFREQ |
587 | select COMMON_CLKDEV | 612 | select CLKDEV_LOOKUP |
588 | select ARCH_REQUIRE_GPIOLIB | 613 | select ARCH_REQUIRE_GPIOLIB |
589 | select GENERIC_CLOCKEVENTS | 614 | select GENERIC_CLOCKEVENTS |
615 | select HAVE_SCHED_CLOCK | ||
590 | select TICK_ONESHOT | 616 | select TICK_ONESHOT |
591 | select PLAT_PXA | 617 | select PLAT_PXA |
592 | select SPARSE_IRQ | 618 | select SPARSE_IRQ |
@@ -635,6 +661,7 @@ config ARCH_SA1100 | |||
635 | select CPU_FREQ | 661 | select CPU_FREQ |
636 | select GENERIC_CLOCKEVENTS | 662 | select GENERIC_CLOCKEVENTS |
637 | select HAVE_CLK | 663 | select HAVE_CLK |
664 | select HAVE_SCHED_CLOCK | ||
638 | select TICK_ONESHOT | 665 | select TICK_ONESHOT |
639 | select ARCH_REQUIRE_GPIOLIB | 666 | select ARCH_REQUIRE_GPIOLIB |
640 | help | 667 | help |
@@ -761,7 +788,7 @@ config ARCH_TCC_926 | |||
761 | bool "Telechips TCC ARM926-based systems" | 788 | bool "Telechips TCC ARM926-based systems" |
762 | select CPU_ARM926T | 789 | select CPU_ARM926T |
763 | select HAVE_CLK | 790 | select HAVE_CLK |
764 | select COMMON_CLKDEV | 791 | select CLKDEV_LOOKUP |
765 | select GENERIC_CLOCKEVENTS | 792 | select GENERIC_CLOCKEVENTS |
766 | help | 793 | help |
767 | Support for Telechips TCC ARM926-based systems. | 794 | Support for Telechips TCC ARM926-based systems. |
@@ -781,11 +808,12 @@ config ARCH_U300 | |||
781 | bool "ST-Ericsson U300 Series" | 808 | bool "ST-Ericsson U300 Series" |
782 | depends on MMU | 809 | depends on MMU |
783 | select CPU_ARM926T | 810 | select CPU_ARM926T |
811 | select HAVE_SCHED_CLOCK | ||
784 | select HAVE_TCM | 812 | select HAVE_TCM |
785 | select ARM_AMBA | 813 | select ARM_AMBA |
786 | select ARM_VIC | 814 | select ARM_VIC |
787 | select GENERIC_CLOCKEVENTS | 815 | select GENERIC_CLOCKEVENTS |
788 | select COMMON_CLKDEV | 816 | select CLKDEV_LOOKUP |
789 | select GENERIC_GPIO | 817 | select GENERIC_GPIO |
790 | help | 818 | help |
791 | Support for ST-Ericsson U300 series mobile platforms. | 819 | Support for ST-Ericsson U300 series mobile platforms. |
@@ -795,8 +823,9 @@ config ARCH_U8500 | |||
795 | select CPU_V7 | 823 | select CPU_V7 |
796 | select ARM_AMBA | 824 | select ARM_AMBA |
797 | select GENERIC_CLOCKEVENTS | 825 | select GENERIC_CLOCKEVENTS |
798 | select COMMON_CLKDEV | 826 | select CLKDEV_LOOKUP |
799 | select ARCH_REQUIRE_GPIOLIB | 827 | select ARCH_REQUIRE_GPIOLIB |
828 | select ARCH_HAS_CPUFREQ | ||
800 | help | 829 | help |
801 | Support for ST-Ericsson's Ux500 architecture | 830 | Support for ST-Ericsson's Ux500 architecture |
802 | 831 | ||
@@ -805,7 +834,7 @@ config ARCH_NOMADIK | |||
805 | select ARM_AMBA | 834 | select ARM_AMBA |
806 | select ARM_VIC | 835 | select ARM_VIC |
807 | select CPU_ARM926T | 836 | select CPU_ARM926T |
808 | select COMMON_CLKDEV | 837 | select CLKDEV_LOOKUP |
809 | select GENERIC_CLOCKEVENTS | 838 | select GENERIC_CLOCKEVENTS |
810 | select ARCH_REQUIRE_GPIOLIB | 839 | select ARCH_REQUIRE_GPIOLIB |
811 | help | 840 | help |
@@ -817,7 +846,7 @@ config ARCH_DAVINCI | |||
817 | select ARCH_REQUIRE_GPIOLIB | 846 | select ARCH_REQUIRE_GPIOLIB |
818 | select ZONE_DMA | 847 | select ZONE_DMA |
819 | select HAVE_IDE | 848 | select HAVE_IDE |
820 | select COMMON_CLKDEV | 849 | select CLKDEV_LOOKUP |
821 | select GENERIC_ALLOCATOR | 850 | select GENERIC_ALLOCATOR |
822 | select ARCH_HAS_HOLES_MEMORYMODEL | 851 | select ARCH_HAS_HOLES_MEMORYMODEL |
823 | help | 852 | help |
@@ -829,6 +858,7 @@ config ARCH_OMAP | |||
829 | select ARCH_REQUIRE_GPIOLIB | 858 | select ARCH_REQUIRE_GPIOLIB |
830 | select ARCH_HAS_CPUFREQ | 859 | select ARCH_HAS_CPUFREQ |
831 | select GENERIC_CLOCKEVENTS | 860 | select GENERIC_CLOCKEVENTS |
861 | select HAVE_SCHED_CLOCK | ||
832 | select ARCH_HAS_HOLES_MEMORYMODEL | 862 | select ARCH_HAS_HOLES_MEMORYMODEL |
833 | help | 863 | help |
834 | Support for TI's OMAP platform (OMAP1/2/3/4). | 864 | Support for TI's OMAP platform (OMAP1/2/3/4). |
@@ -837,7 +867,7 @@ config PLAT_SPEAR | |||
837 | bool "ST SPEAr" | 867 | bool "ST SPEAr" |
838 | select ARM_AMBA | 868 | select ARM_AMBA |
839 | select ARCH_REQUIRE_GPIOLIB | 869 | select ARCH_REQUIRE_GPIOLIB |
840 | select COMMON_CLKDEV | 870 | select CLKDEV_LOOKUP |
841 | select GENERIC_CLOCKEVENTS | 871 | select GENERIC_CLOCKEVENTS |
842 | select HAVE_CLK | 872 | select HAVE_CLK |
843 | help | 873 | help |
@@ -902,6 +932,8 @@ source "arch/arm/mach-mv78xx0/Kconfig" | |||
902 | 932 | ||
903 | source "arch/arm/plat-mxc/Kconfig" | 933 | source "arch/arm/plat-mxc/Kconfig" |
904 | 934 | ||
935 | source "arch/arm/mach-mxs/Kconfig" | ||
936 | |||
905 | source "arch/arm/mach-netx/Kconfig" | 937 | source "arch/arm/mach-netx/Kconfig" |
906 | 938 | ||
907 | source "arch/arm/mach-nomadik/Kconfig" | 939 | source "arch/arm/mach-nomadik/Kconfig" |
@@ -982,9 +1014,11 @@ config ARCH_ACORN | |||
982 | config PLAT_IOP | 1014 | config PLAT_IOP |
983 | bool | 1015 | bool |
984 | select GENERIC_CLOCKEVENTS | 1016 | select GENERIC_CLOCKEVENTS |
1017 | select HAVE_SCHED_CLOCK | ||
985 | 1018 | ||
986 | config PLAT_ORION | 1019 | config PLAT_ORION |
987 | bool | 1020 | bool |
1021 | select HAVE_SCHED_CLOCK | ||
988 | 1022 | ||
989 | config PLAT_PXA | 1023 | config PLAT_PXA |
990 | bool | 1024 | bool |
@@ -999,8 +1033,8 @@ source arch/arm/mm/Kconfig | |||
999 | 1033 | ||
1000 | config IWMMXT | 1034 | config IWMMXT |
1001 | bool "Enable iWMMXt support" | 1035 | bool "Enable iWMMXt support" |
1002 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK | 1036 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 |
1003 | default y if PXA27x || PXA3xx || ARCH_MMP | 1037 | default y if PXA27x || PXA3xx || PXA95x || ARCH_MMP |
1004 | help | 1038 | help |
1005 | Enable support for iWMMXt context switching at run time if | 1039 | Enable support for iWMMXt context switching at run time if |
1006 | running on a CPU that supports it. | 1040 | running on a CPU that supports it. |
@@ -1017,6 +1051,11 @@ config CPU_HAS_PMU | |||
1017 | default y | 1051 | default y |
1018 | bool | 1052 | bool |
1019 | 1053 | ||
1054 | config MULTI_IRQ_HANDLER | ||
1055 | bool | ||
1056 | help | ||
1057 | Allow each machine to specify it's own IRQ handler at run time. | ||
1058 | |||
1020 | if !MMU | 1059 | if !MMU |
1021 | source "arch/arm/Kconfig-nommu" | 1060 | source "arch/arm/Kconfig-nommu" |
1022 | endif | 1061 | endif |
@@ -1164,7 +1203,7 @@ config ISA_DMA_API | |||
1164 | bool | 1203 | bool |
1165 | 1204 | ||
1166 | config PCI | 1205 | config PCI |
1167 | bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695 || MACH_ARMCORE || ARCH_CNS3XXX | 1206 | bool "PCI support" if MIGHT_HAVE_PCI |
1168 | help | 1207 | help |
1169 | Find out whether you have a PCI motherboard. PCI is the name of a | 1208 | Find out whether you have a PCI motherboard. PCI is the name of a |
1170 | bus system, i.e. the way the CPU talks to the other stuff inside | 1209 | bus system, i.e. the way the CPU talks to the other stuff inside |
@@ -1175,6 +1214,12 @@ config PCI_DOMAINS | |||
1175 | bool | 1214 | bool |
1176 | depends on PCI | 1215 | depends on PCI |
1177 | 1216 | ||
1217 | config PCI_NANOENGINE | ||
1218 | bool "BSE nanoEngine PCI support" | ||
1219 | depends on SA1100_NANOENGINE | ||
1220 | help | ||
1221 | Enable PCI on the BSE nanoEngine board. | ||
1222 | |||
1178 | config PCI_SYSCALL | 1223 | config PCI_SYSCALL |
1179 | def_bool PCI | 1224 | def_bool PCI |
1180 | 1225 | ||
@@ -1205,10 +1250,11 @@ config SMP | |||
1205 | depends on EXPERIMENTAL | 1250 | depends on EXPERIMENTAL |
1206 | depends on GENERIC_CLOCKEVENTS | 1251 | depends on GENERIC_CLOCKEVENTS |
1207 | depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \ | 1252 | depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \ |
1208 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 ||\ | 1253 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \ |
1209 | ARCH_S5PV310 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 | 1254 | ARCH_S5PV310 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \ |
1255 | ARCH_MSM_SCORPIONMP | ||
1210 | select USE_GENERIC_SMP_HELPERS | 1256 | select USE_GENERIC_SMP_HELPERS |
1211 | select HAVE_ARM_SCU | 1257 | select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP |
1212 | help | 1258 | help |
1213 | This enables support for systems with more than one CPU. If you have | 1259 | This enables support for systems with more than one CPU. If you have |
1214 | a system with only one CPU, like most personal computers, say N. If | 1260 | a system with only one CPU, like most personal computers, say N. If |
@@ -1229,7 +1275,7 @@ config SMP | |||
1229 | config SMP_ON_UP | 1275 | config SMP_ON_UP |
1230 | bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)" | 1276 | bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)" |
1231 | depends on EXPERIMENTAL | 1277 | depends on EXPERIMENTAL |
1232 | depends on SMP && !XIP && !THUMB2_KERNEL | 1278 | depends on SMP && !XIP |
1233 | default y | 1279 | default y |
1234 | help | 1280 | help |
1235 | SMP kernels contain instructions which fail on non-SMP processors. | 1281 | SMP kernels contain instructions which fail on non-SMP processors. |
@@ -1248,6 +1294,7 @@ config HAVE_ARM_SCU | |||
1248 | config HAVE_ARM_TWD | 1294 | config HAVE_ARM_TWD |
1249 | bool | 1295 | bool |
1250 | depends on SMP | 1296 | depends on SMP |
1297 | select TICK_ONESHOT | ||
1251 | help | 1298 | help |
1252 | This options enables support for the ARM timer and watchdog unit | 1299 | This options enables support for the ARM timer and watchdog unit |
1253 | 1300 | ||
@@ -1283,6 +1330,7 @@ config NR_CPUS | |||
1283 | config HOTPLUG_CPU | 1330 | config HOTPLUG_CPU |
1284 | bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" | 1331 | bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" |
1285 | depends on SMP && HOTPLUG && EXPERIMENTAL | 1332 | depends on SMP && HOTPLUG && EXPERIMENTAL |
1333 | depends on !ARCH_MSM | ||
1286 | help | 1334 | help |
1287 | Say Y here to experiment with turning CPUs off and on. CPUs | 1335 | Say Y here to experiment with turning CPUs off and on. CPUs |
1288 | can be controlled through /sys/devices/system/cpu. | 1336 | can be controlled through /sys/devices/system/cpu. |
@@ -1291,7 +1339,7 @@ config LOCAL_TIMERS | |||
1291 | bool "Use local timer interrupts" | 1339 | bool "Use local timer interrupts" |
1292 | depends on SMP | 1340 | depends on SMP |
1293 | default y | 1341 | default y |
1294 | select HAVE_ARM_TWD | 1342 | select HAVE_ARM_TWD if !ARCH_MSM_SCORPIONMP |
1295 | help | 1343 | help |
1296 | Enable support for local timers on SMP platforms, rather then the | 1344 | Enable support for local timers on SMP platforms, rather then the |
1297 | legacy IPI broadcast method. Local timers allows the system | 1345 | legacy IPI broadcast method. Local timers allows the system |
@@ -1310,7 +1358,7 @@ config HZ | |||
1310 | default 100 | 1358 | default 100 |
1311 | 1359 | ||
1312 | config THUMB2_KERNEL | 1360 | config THUMB2_KERNEL |
1313 | bool "Compile the kernel in Thumb-2 mode" | 1361 | bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)" |
1314 | depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL | 1362 | depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL |
1315 | select AEABI | 1363 | select AEABI |
1316 | select ARM_ASM_UNIFIED | 1364 | select ARM_ASM_UNIFIED |
@@ -1524,6 +1572,7 @@ config SECCOMP | |||
1524 | 1572 | ||
1525 | config CC_STACKPROTECTOR | 1573 | config CC_STACKPROTECTOR |
1526 | bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" | 1574 | bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" |
1575 | depends on EXPERIMENTAL | ||
1527 | help | 1576 | help |
1528 | This option turns on the -fstack-protector GCC feature. This | 1577 | This option turns on the -fstack-protector GCC feature. This |
1529 | feature puts, at the beginning of functions, a canary value on | 1578 | feature puts, at the beginning of functions, a canary value on |
@@ -1650,6 +1699,19 @@ config ATAGS_PROC | |||
1650 | Should the atags used to boot the kernel be exported in an "atags" | 1699 | Should the atags used to boot the kernel be exported in an "atags" |
1651 | file in procfs. Useful with kexec. | 1700 | file in procfs. Useful with kexec. |
1652 | 1701 | ||
1702 | config CRASH_DUMP | ||
1703 | bool "Build kdump crash kernel (EXPERIMENTAL)" | ||
1704 | depends on EXPERIMENTAL | ||
1705 | help | ||
1706 | Generate crash dump after being started by kexec. This should | ||
1707 | be normally only set in special crash dump kernels which are | ||
1708 | loaded in the main kernel with kexec-tools into a specially | ||
1709 | reserved region and then later executed after a crash by | ||
1710 | kdump/kexec. The crash dump kernel must be compiled to a | ||
1711 | memory address not used by the main kernel | ||
1712 | |||
1713 | For more details see Documentation/kdump/kdump.txt | ||
1714 | |||
1653 | config AUTO_ZRELADDR | 1715 | config AUTO_ZRELADDR |
1654 | bool "Auto calculation of the decompressed kernel image address" | 1716 | bool "Auto calculation of the decompressed kernel image address" |
1655 | depends on !ZBOOT_ROM && !ARCH_U300 | 1717 | depends on !ZBOOT_ROM && !ARCH_U300 |
@@ -1707,7 +1769,7 @@ config CPU_FREQ_S3C | |||
1707 | Internal configuration node for common cpufreq on Samsung SoC | 1769 | Internal configuration node for common cpufreq on Samsung SoC |
1708 | 1770 | ||
1709 | config CPU_FREQ_S3C24XX | 1771 | config CPU_FREQ_S3C24XX |
1710 | bool "CPUfreq driver for Samsung S3C24XX series CPUs" | 1772 | bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)" |
1711 | depends on ARCH_S3C2410 && CPU_FREQ && EXPERIMENTAL | 1773 | depends on ARCH_S3C2410 && CPU_FREQ && EXPERIMENTAL |
1712 | select CPU_FREQ_S3C | 1774 | select CPU_FREQ_S3C |
1713 | help | 1775 | help |
@@ -1719,7 +1781,7 @@ config CPU_FREQ_S3C24XX | |||
1719 | If in doubt, say N. | 1781 | If in doubt, say N. |
1720 | 1782 | ||
1721 | config CPU_FREQ_S3C24XX_PLL | 1783 | config CPU_FREQ_S3C24XX_PLL |
1722 | bool "Support CPUfreq changing of PLL frequency" | 1784 | bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" |
1723 | depends on CPU_FREQ_S3C24XX && EXPERIMENTAL | 1785 | depends on CPU_FREQ_S3C24XX && EXPERIMENTAL |
1724 | help | 1786 | help |
1725 | Compile in support for changing the PLL frequency from the | 1787 | Compile in support for changing the PLL frequency from the |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 2fd0b99afc4b..494224a9b459 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -23,7 +23,7 @@ config STRICT_DEVMEM | |||
23 | config FRAME_POINTER | 23 | config FRAME_POINTER |
24 | bool | 24 | bool |
25 | depends on !THUMB2_KERNEL | 25 | depends on !THUMB2_KERNEL |
26 | default y if !ARM_UNWIND | 26 | default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER |
27 | help | 27 | help |
28 | If you say N here, the resulting kernel will be slightly smaller and | 28 | If you say N here, the resulting kernel will be slightly smaller and |
29 | faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled, | 29 | faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled, |
@@ -31,7 +31,7 @@ config FRAME_POINTER | |||
31 | reported is severely limited. | 31 | reported is severely limited. |
32 | 32 | ||
33 | config ARM_UNWIND | 33 | config ARM_UNWIND |
34 | bool "Enable stack unwinding support" | 34 | bool "Enable stack unwinding support (EXPERIMENTAL)" |
35 | depends on AEABI && EXPERIMENTAL | 35 | depends on AEABI && EXPERIMENTAL |
36 | default y | 36 | default y |
37 | help | 37 | help |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index b87aed028eef..c22c1adfedd6 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -154,10 +154,11 @@ machine-$(CONFIG_ARCH_MSM) := msm | |||
154 | machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 | 154 | machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 |
155 | machine-$(CONFIG_ARCH_MX1) := imx | 155 | machine-$(CONFIG_ARCH_MX1) := imx |
156 | machine-$(CONFIG_ARCH_MX2) := imx | 156 | machine-$(CONFIG_ARCH_MX2) := imx |
157 | machine-$(CONFIG_ARCH_MX25) := mx25 | 157 | machine-$(CONFIG_ARCH_MX25) := imx |
158 | machine-$(CONFIG_ARCH_MX3) := mx3 | 158 | machine-$(CONFIG_ARCH_MX3) := mx3 |
159 | machine-$(CONFIG_ARCH_MX5) := mx5 | 159 | machine-$(CONFIG_ARCH_MX5) := mx5 |
160 | machine-$(CONFIG_ARCH_MXC91231) := mxc91231 | 160 | machine-$(CONFIG_ARCH_MXC91231) := mxc91231 |
161 | machine-$(CONFIG_ARCH_MXS) := mxs | ||
161 | machine-$(CONFIG_ARCH_NETX) := netx | 162 | machine-$(CONFIG_ARCH_NETX) := netx |
162 | machine-$(CONFIG_ARCH_NOMADIK) := nomadik | 163 | machine-$(CONFIG_ARCH_NOMADIK) := nomadik |
163 | machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx | 164 | machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 65a7c1c588a9..0a8f748e506a 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -45,6 +45,10 @@ else | |||
45 | endif | 45 | endif |
46 | endif | 46 | endif |
47 | 47 | ||
48 | ifeq ($(CONFIG_ARCH_SHMOBILE),y) | ||
49 | OBJS += head-shmobile.o | ||
50 | endif | ||
51 | |||
48 | # | 52 | # |
49 | # We now have a PIC decompressor implementation. Decompressors running | 53 | # We now have a PIC decompressor implementation. Decompressors running |
50 | # from RAM should not define ZTEXTADDR. Decompressors running directly | 54 | # from RAM should not define ZTEXTADDR. Decompressors running directly |
diff --git a/arch/arm/boot/compressed/head-shmobile.S b/arch/arm/boot/compressed/head-shmobile.S new file mode 100644 index 000000000000..30973b76e6ae --- /dev/null +++ b/arch/arm/boot/compressed/head-shmobile.S | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * The head-file for SH-Mobile ARM platforms | ||
3 | * | ||
4 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
5 | * Simon Horman <horms@verge.net.au> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; version 2 of the License. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | |||
21 | #ifdef CONFIG_ZBOOT_ROM | ||
22 | |||
23 | .section ".start", "ax" | ||
24 | |||
25 | /* load board-specific initialization code */ | ||
26 | #include <mach/zboot.h> | ||
27 | |||
28 | b 1f | ||
29 | __atags:@ tag #1 | ||
30 | .long 12 @ tag->hdr.size = tag_size(tag_core); | ||
31 | .long 0x54410001 @ tag->hdr.tag = ATAG_CORE; | ||
32 | .long 0 @ tag->u.core.flags = 0; | ||
33 | .long 0 @ tag->u.core.pagesize = 0; | ||
34 | .long 0 @ tag->u.core.rootdev = 0; | ||
35 | @ tag #2 | ||
36 | .long 8 @ tag->hdr.size = tag_size(tag_mem32); | ||
37 | .long 0x54410002 @ tag->hdr.tag = ATAG_MEM; | ||
38 | .long CONFIG_MEMORY_SIZE @ tag->u.mem.size = CONFIG_MEMORY_SIZE; | ||
39 | .long CONFIG_MEMORY_START @ @ tag->u.mem.start = CONFIG_MEMORY_START; | ||
40 | @ tag #3 | ||
41 | .long 0 @ tag->hdr.size = 0 | ||
42 | .long 0 @ tag->hdr.tag = ATAG_NONE; | ||
43 | 1: | ||
44 | |||
45 | /* Set board ID necessary for boot */ | ||
46 | ldr r7, 1f @ Set machine type register | ||
47 | adr r8, __atags @ Set atag register | ||
48 | b 2f | ||
49 | |||
50 | 1 : .long MACH_TYPE | ||
51 | 2 : | ||
52 | |||
53 | #endif /* CONFIG_ZBOOT_ROM */ | ||
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 0a34c8186924..778655f0257a 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig | |||
@@ -37,7 +37,3 @@ config SHARP_PARAM | |||
37 | 37 | ||
38 | config SHARP_SCOOP | 38 | config SHARP_SCOOP |
39 | bool | 39 | bool |
40 | |||
41 | config COMMON_CLKDEV | ||
42 | bool | ||
43 | select HAVE_CLK | ||
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile index e6e8664a9413..e7521bca2c35 100644 --- a/arch/arm/common/Makefile +++ b/arch/arm/common/Makefile | |||
@@ -17,3 +17,4 @@ obj-$(CONFIG_ARCH_IXP2000) += uengine.o | |||
17 | obj-$(CONFIG_ARCH_IXP23XX) += uengine.o | 17 | obj-$(CONFIG_ARCH_IXP23XX) += uengine.o |
18 | obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o | 18 | obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o |
19 | obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o | 19 | obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o |
20 | obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o | ||
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index cc0a932bbea9..e5681636626f 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
@@ -328,7 +328,7 @@ static inline void unmap_single(struct device *dev, dma_addr_t dma_addr, | |||
328 | * substitute the safe buffer for the unsafe one. | 328 | * substitute the safe buffer for the unsafe one. |
329 | * (basically move the buffer from an unsafe area to a safe one) | 329 | * (basically move the buffer from an unsafe area to a safe one) |
330 | */ | 330 | */ |
331 | dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, | 331 | dma_addr_t __dma_map_single(struct device *dev, void *ptr, size_t size, |
332 | enum dma_data_direction dir) | 332 | enum dma_data_direction dir) |
333 | { | 333 | { |
334 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", | 334 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", |
@@ -338,7 +338,7 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, | |||
338 | 338 | ||
339 | return map_single(dev, ptr, size, dir); | 339 | return map_single(dev, ptr, size, dir); |
340 | } | 340 | } |
341 | EXPORT_SYMBOL(dma_map_single); | 341 | EXPORT_SYMBOL(__dma_map_single); |
342 | 342 | ||
343 | /* | 343 | /* |
344 | * see if a mapped address was really a "safe" buffer and if so, copy | 344 | * see if a mapped address was really a "safe" buffer and if so, copy |
@@ -346,7 +346,7 @@ EXPORT_SYMBOL(dma_map_single); | |||
346 | * the safe buffer. (basically return things back to the way they | 346 | * the safe buffer. (basically return things back to the way they |
347 | * should be) | 347 | * should be) |
348 | */ | 348 | */ |
349 | void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | 349 | void __dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, |
350 | enum dma_data_direction dir) | 350 | enum dma_data_direction dir) |
351 | { | 351 | { |
352 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", | 352 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", |
@@ -354,9 +354,9 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
354 | 354 | ||
355 | unmap_single(dev, dma_addr, size, dir); | 355 | unmap_single(dev, dma_addr, size, dir); |
356 | } | 356 | } |
357 | EXPORT_SYMBOL(dma_unmap_single); | 357 | EXPORT_SYMBOL(__dma_unmap_single); |
358 | 358 | ||
359 | dma_addr_t dma_map_page(struct device *dev, struct page *page, | 359 | dma_addr_t __dma_map_page(struct device *dev, struct page *page, |
360 | unsigned long offset, size_t size, enum dma_data_direction dir) | 360 | unsigned long offset, size_t size, enum dma_data_direction dir) |
361 | { | 361 | { |
362 | dev_dbg(dev, "%s(page=%p,off=%#lx,size=%zx,dir=%x)\n", | 362 | dev_dbg(dev, "%s(page=%p,off=%#lx,size=%zx,dir=%x)\n", |
@@ -372,7 +372,7 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
372 | 372 | ||
373 | return map_single(dev, page_address(page) + offset, size, dir); | 373 | return map_single(dev, page_address(page) + offset, size, dir); |
374 | } | 374 | } |
375 | EXPORT_SYMBOL(dma_map_page); | 375 | EXPORT_SYMBOL(__dma_map_page); |
376 | 376 | ||
377 | /* | 377 | /* |
378 | * see if a mapped address was really a "safe" buffer and if so, copy | 378 | * see if a mapped address was really a "safe" buffer and if so, copy |
@@ -380,7 +380,7 @@ EXPORT_SYMBOL(dma_map_page); | |||
380 | * the safe buffer. (basically return things back to the way they | 380 | * the safe buffer. (basically return things back to the way they |
381 | * should be) | 381 | * should be) |
382 | */ | 382 | */ |
383 | void dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, | 383 | void __dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, |
384 | enum dma_data_direction dir) | 384 | enum dma_data_direction dir) |
385 | { | 385 | { |
386 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", | 386 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", |
@@ -388,7 +388,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
388 | 388 | ||
389 | unmap_single(dev, dma_addr, size, dir); | 389 | unmap_single(dev, dma_addr, size, dir); |
390 | } | 390 | } |
391 | EXPORT_SYMBOL(dma_unmap_page); | 391 | EXPORT_SYMBOL(__dma_unmap_page); |
392 | 392 | ||
393 | int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr, | 393 | int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr, |
394 | unsigned long off, size_t sz, enum dma_data_direction dir) | 394 | unsigned long off, size_t sz, enum dma_data_direction dir) |
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index e6388dcd8cfa..0b89ef001330 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c | |||
@@ -35,6 +35,9 @@ | |||
35 | 35 | ||
36 | static DEFINE_SPINLOCK(irq_controller_lock); | 36 | static DEFINE_SPINLOCK(irq_controller_lock); |
37 | 37 | ||
38 | /* Address of GIC 0 CPU interface */ | ||
39 | void __iomem *gic_cpu_base_addr __read_mostly; | ||
40 | |||
38 | struct gic_chip_data { | 41 | struct gic_chip_data { |
39 | unsigned int irq_offset; | 42 | unsigned int irq_offset; |
40 | void __iomem *dist_base; | 43 | void __iomem *dist_base; |
@@ -45,7 +48,7 @@ struct gic_chip_data { | |||
45 | #define MAX_GIC_NR 1 | 48 | #define MAX_GIC_NR 1 |
46 | #endif | 49 | #endif |
47 | 50 | ||
48 | static struct gic_chip_data gic_data[MAX_GIC_NR]; | 51 | static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly; |
49 | 52 | ||
50 | static inline void __iomem *gic_dist_base(unsigned int irq) | 53 | static inline void __iomem *gic_dist_base(unsigned int irq) |
51 | { | 54 | { |
@@ -213,21 +216,16 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq) | |||
213 | set_irq_chained_handler(irq, gic_handle_cascade_irq); | 216 | set_irq_chained_handler(irq, gic_handle_cascade_irq); |
214 | } | 217 | } |
215 | 218 | ||
216 | void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | 219 | static void __init gic_dist_init(struct gic_chip_data *gic, |
217 | unsigned int irq_start) | 220 | unsigned int irq_start) |
218 | { | 221 | { |
219 | unsigned int gic_irqs, irq_limit, i; | 222 | unsigned int gic_irqs, irq_limit, i; |
223 | void __iomem *base = gic->dist_base; | ||
220 | u32 cpumask = 1 << smp_processor_id(); | 224 | u32 cpumask = 1 << smp_processor_id(); |
221 | 225 | ||
222 | if (gic_nr >= MAX_GIC_NR) | ||
223 | BUG(); | ||
224 | |||
225 | cpumask |= cpumask << 8; | 226 | cpumask |= cpumask << 8; |
226 | cpumask |= cpumask << 16; | 227 | cpumask |= cpumask << 16; |
227 | 228 | ||
228 | gic_data[gic_nr].dist_base = base; | ||
229 | gic_data[gic_nr].irq_offset = (irq_start - 1) & ~31; | ||
230 | |||
231 | writel(0, base + GIC_DIST_CTRL); | 229 | writel(0, base + GIC_DIST_CTRL); |
232 | 230 | ||
233 | /* | 231 | /* |
@@ -267,7 +265,7 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
267 | /* | 265 | /* |
268 | * Limit number of interrupts registered to the platform maximum | 266 | * Limit number of interrupts registered to the platform maximum |
269 | */ | 267 | */ |
270 | irq_limit = gic_data[gic_nr].irq_offset + gic_irqs; | 268 | irq_limit = gic->irq_offset + gic_irqs; |
271 | if (WARN_ON(irq_limit > NR_IRQS)) | 269 | if (WARN_ON(irq_limit > NR_IRQS)) |
272 | irq_limit = NR_IRQS; | 270 | irq_limit = NR_IRQS; |
273 | 271 | ||
@@ -276,7 +274,7 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
276 | */ | 274 | */ |
277 | for (i = irq_start; i < irq_limit; i++) { | 275 | for (i = irq_start; i < irq_limit; i++) { |
278 | set_irq_chip(i, &gic_chip); | 276 | set_irq_chip(i, &gic_chip); |
279 | set_irq_chip_data(i, &gic_data[gic_nr]); | 277 | set_irq_chip_data(i, gic); |
280 | set_irq_handler(i, handle_level_irq); | 278 | set_irq_handler(i, handle_level_irq); |
281 | set_irq_flags(i, IRQF_VALID | IRQF_PROBE); | 279 | set_irq_flags(i, IRQF_VALID | IRQF_PROBE); |
282 | } | 280 | } |
@@ -284,19 +282,12 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
284 | writel(1, base + GIC_DIST_CTRL); | 282 | writel(1, base + GIC_DIST_CTRL); |
285 | } | 283 | } |
286 | 284 | ||
287 | void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base) | 285 | static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) |
288 | { | 286 | { |
289 | void __iomem *dist_base; | 287 | void __iomem *dist_base = gic->dist_base; |
288 | void __iomem *base = gic->cpu_base; | ||
290 | int i; | 289 | int i; |
291 | 290 | ||
292 | if (gic_nr >= MAX_GIC_NR) | ||
293 | BUG(); | ||
294 | |||
295 | dist_base = gic_data[gic_nr].dist_base; | ||
296 | BUG_ON(!dist_base); | ||
297 | |||
298 | gic_data[gic_nr].cpu_base = base; | ||
299 | |||
300 | /* | 291 | /* |
301 | * Deal with the banked PPI and SGI interrupts - disable all | 292 | * Deal with the banked PPI and SGI interrupts - disable all |
302 | * PPI interrupts, ensure all SGI interrupts are enabled. | 293 | * PPI interrupts, ensure all SGI interrupts are enabled. |
@@ -314,6 +305,42 @@ void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base) | |||
314 | writel(1, base + GIC_CPU_CTRL); | 305 | writel(1, base + GIC_CPU_CTRL); |
315 | } | 306 | } |
316 | 307 | ||
308 | void __init gic_init(unsigned int gic_nr, unsigned int irq_start, | ||
309 | void __iomem *dist_base, void __iomem *cpu_base) | ||
310 | { | ||
311 | struct gic_chip_data *gic; | ||
312 | |||
313 | BUG_ON(gic_nr >= MAX_GIC_NR); | ||
314 | |||
315 | gic = &gic_data[gic_nr]; | ||
316 | gic->dist_base = dist_base; | ||
317 | gic->cpu_base = cpu_base; | ||
318 | gic->irq_offset = (irq_start - 1) & ~31; | ||
319 | |||
320 | if (gic_nr == 0) | ||
321 | gic_cpu_base_addr = cpu_base; | ||
322 | |||
323 | gic_dist_init(gic, irq_start); | ||
324 | gic_cpu_init(gic); | ||
325 | } | ||
326 | |||
327 | void __cpuinit gic_secondary_init(unsigned int gic_nr) | ||
328 | { | ||
329 | BUG_ON(gic_nr >= MAX_GIC_NR); | ||
330 | |||
331 | gic_cpu_init(&gic_data[gic_nr]); | ||
332 | } | ||
333 | |||
334 | void __cpuinit gic_enable_ppi(unsigned int irq) | ||
335 | { | ||
336 | unsigned long flags; | ||
337 | |||
338 | local_irq_save(flags); | ||
339 | irq_to_desc(irq)->status |= IRQ_NOPROBE; | ||
340 | gic_unmask_irq(irq); | ||
341 | local_irq_restore(flags); | ||
342 | } | ||
343 | |||
317 | #ifdef CONFIG_SMP | 344 | #ifdef CONFIG_SMP |
318 | void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) | 345 | void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) |
319 | { | 346 | { |
diff --git a/arch/arm/plat-versatile/timer-sp.c b/arch/arm/common/timer-sp.c index fb0d1c299718..6ef3342153b9 100644 --- a/arch/arm/plat-versatile/timer-sp.c +++ b/arch/arm/common/timer-sp.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/plat-versatile/timer-sp.c | 2 | * linux/arch/arm/common/timer-sp.c |
3 | * | 3 | * |
4 | * Copyright (C) 1999 - 2003 ARM Limited | 4 | * Copyright (C) 1999 - 2003 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd |
@@ -26,8 +26,6 @@ | |||
26 | 26 | ||
27 | #include <asm/hardware/arm_timer.h> | 27 | #include <asm/hardware/arm_timer.h> |
28 | 28 | ||
29 | #include <plat/timer-sp.h> | ||
30 | |||
31 | /* | 29 | /* |
32 | * These timers are currently always setup to be clocked at 1MHz. | 30 | * These timers are currently always setup to be clocked at 1MHz. |
33 | */ | 31 | */ |
@@ -46,7 +44,6 @@ static struct clocksource clocksource_sp804 = { | |||
46 | .rating = 200, | 44 | .rating = 200, |
47 | .read = sp804_read, | 45 | .read = sp804_read, |
48 | .mask = CLOCKSOURCE_MASK(32), | 46 | .mask = CLOCKSOURCE_MASK(32), |
49 | .shift = 20, | ||
50 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 47 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
51 | }; | 48 | }; |
52 | 49 | ||
@@ -63,8 +60,7 @@ void __init sp804_clocksource_init(void __iomem *base) | |||
63 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | 60 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, |
64 | clksrc_base + TIMER_CTRL); | 61 | clksrc_base + TIMER_CTRL); |
65 | 62 | ||
66 | cs->mult = clocksource_khz2mult(TIMER_FREQ_KHZ, cs->shift); | 63 | clocksource_register_khz(cs, TIMER_FREQ_KHZ); |
67 | clocksource_register(cs); | ||
68 | } | 64 | } |
69 | 65 | ||
70 | 66 | ||
diff --git a/arch/arm/configs/mx3_defconfig b/arch/arm/configs/mx3_defconfig index f0c339fd5d21..e648ea3429be 100644 --- a/arch/arm/configs/mx3_defconfig +++ b/arch/arm/configs/mx3_defconfig | |||
@@ -84,6 +84,7 @@ CONFIG_SERIAL_IMX_CONSOLE=y | |||
84 | CONFIG_I2C=y | 84 | CONFIG_I2C=y |
85 | CONFIG_I2C_CHARDEV=y | 85 | CONFIG_I2C_CHARDEV=y |
86 | CONFIG_I2C_IMX=y | 86 | CONFIG_I2C_IMX=y |
87 | CONFIG_SPI=y | ||
87 | CONFIG_W1=y | 88 | CONFIG_W1=y |
88 | CONFIG_W1_MASTER_MXC=y | 89 | CONFIG_W1_MASTER_MXC=y |
89 | CONFIG_W1_SLAVE_THERM=y | 90 | CONFIG_W1_SLAVE_THERM=y |
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 749bb6622404..bc2d2d75f706 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
21 | #include <asm/domain.h> | ||
21 | 22 | ||
22 | /* | 23 | /* |
23 | * Endian independent macros for shifting bytes within registers. | 24 | * Endian independent macros for shifting bytes within registers. |
@@ -157,16 +158,24 @@ | |||
157 | #ifdef CONFIG_SMP | 158 | #ifdef CONFIG_SMP |
158 | #define ALT_SMP(instr...) \ | 159 | #define ALT_SMP(instr...) \ |
159 | 9998: instr | 160 | 9998: instr |
161 | /* | ||
162 | * Note: if you get assembler errors from ALT_UP() when building with | ||
163 | * CONFIG_THUMB2_KERNEL, you almost certainly need to use | ||
164 | * ALT_SMP( W(instr) ... ) | ||
165 | */ | ||
160 | #define ALT_UP(instr...) \ | 166 | #define ALT_UP(instr...) \ |
161 | .pushsection ".alt.smp.init", "a" ;\ | 167 | .pushsection ".alt.smp.init", "a" ;\ |
162 | .long 9998b ;\ | 168 | .long 9998b ;\ |
163 | instr ;\ | 169 | 9997: instr ;\ |
170 | .if . - 9997b != 4 ;\ | ||
171 | .error "ALT_UP() content must assemble to exactly 4 bytes";\ | ||
172 | .endif ;\ | ||
164 | .popsection | 173 | .popsection |
165 | #define ALT_UP_B(label) \ | 174 | #define ALT_UP_B(label) \ |
166 | .equ up_b_offset, label - 9998b ;\ | 175 | .equ up_b_offset, label - 9998b ;\ |
167 | .pushsection ".alt.smp.init", "a" ;\ | 176 | .pushsection ".alt.smp.init", "a" ;\ |
168 | .long 9998b ;\ | 177 | .long 9998b ;\ |
169 | b . + up_b_offset ;\ | 178 | W(b) . + up_b_offset ;\ |
170 | .popsection | 179 | .popsection |
171 | #else | 180 | #else |
172 | #define ALT_SMP(instr...) | 181 | #define ALT_SMP(instr...) |
@@ -177,16 +186,24 @@ | |||
177 | /* | 186 | /* |
178 | * SMP data memory barrier | 187 | * SMP data memory barrier |
179 | */ | 188 | */ |
180 | .macro smp_dmb | 189 | .macro smp_dmb mode |
181 | #ifdef CONFIG_SMP | 190 | #ifdef CONFIG_SMP |
182 | #if __LINUX_ARM_ARCH__ >= 7 | 191 | #if __LINUX_ARM_ARCH__ >= 7 |
192 | .ifeqs "\mode","arm" | ||
183 | ALT_SMP(dmb) | 193 | ALT_SMP(dmb) |
194 | .else | ||
195 | ALT_SMP(W(dmb)) | ||
196 | .endif | ||
184 | #elif __LINUX_ARM_ARCH__ == 6 | 197 | #elif __LINUX_ARM_ARCH__ == 6 |
185 | ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb | 198 | ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb |
186 | #else | 199 | #else |
187 | #error Incompatible SMP platform | 200 | #error Incompatible SMP platform |
188 | #endif | 201 | #endif |
202 | .ifeqs "\mode","arm" | ||
189 | ALT_UP(nop) | 203 | ALT_UP(nop) |
204 | .else | ||
205 | ALT_UP(W(nop)) | ||
206 | .endif | ||
190 | #endif | 207 | #endif |
191 | .endm | 208 | .endm |
192 | 209 | ||
@@ -206,12 +223,12 @@ | |||
206 | */ | 223 | */ |
207 | #ifdef CONFIG_THUMB2_KERNEL | 224 | #ifdef CONFIG_THUMB2_KERNEL |
208 | 225 | ||
209 | .macro usraccoff, instr, reg, ptr, inc, off, cond, abort | 226 | .macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T() |
210 | 9999: | 227 | 9999: |
211 | .if \inc == 1 | 228 | .if \inc == 1 |
212 | \instr\cond\()bt \reg, [\ptr, #\off] | 229 | \instr\cond\()b\()\t\().w \reg, [\ptr, #\off] |
213 | .elseif \inc == 4 | 230 | .elseif \inc == 4 |
214 | \instr\cond\()t \reg, [\ptr, #\off] | 231 | \instr\cond\()\t\().w \reg, [\ptr, #\off] |
215 | .else | 232 | .else |
216 | .error "Unsupported inc macro argument" | 233 | .error "Unsupported inc macro argument" |
217 | .endif | 234 | .endif |
@@ -246,13 +263,13 @@ | |||
246 | 263 | ||
247 | #else /* !CONFIG_THUMB2_KERNEL */ | 264 | #else /* !CONFIG_THUMB2_KERNEL */ |
248 | 265 | ||
249 | .macro usracc, instr, reg, ptr, inc, cond, rept, abort | 266 | .macro usracc, instr, reg, ptr, inc, cond, rept, abort, t=T() |
250 | .rept \rept | 267 | .rept \rept |
251 | 9999: | 268 | 9999: |
252 | .if \inc == 1 | 269 | .if \inc == 1 |
253 | \instr\cond\()bt \reg, [\ptr], #\inc | 270 | \instr\cond\()b\()\t \reg, [\ptr], #\inc |
254 | .elseif \inc == 4 | 271 | .elseif \inc == 4 |
255 | \instr\cond\()t \reg, [\ptr], #\inc | 272 | \instr\cond\()\t \reg, [\ptr], #\inc |
256 | .else | 273 | .else |
257 | .error "Unsupported inc macro argument" | 274 | .error "Unsupported inc macro argument" |
258 | .endif | 275 | .endif |
diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h index 9d6122096fbe..75fe66bc02b4 100644 --- a/arch/arm/include/asm/cache.h +++ b/arch/arm/include/asm/cache.h | |||
@@ -23,4 +23,6 @@ | |||
23 | #define ARCH_SLAB_MINALIGN 8 | 23 | #define ARCH_SLAB_MINALIGN 8 |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) | ||
27 | |||
26 | #endif | 28 | #endif |
diff --git a/arch/arm/include/asm/clkdev.h b/arch/arm/include/asm/clkdev.h index b56c1389b6fa..765d33222369 100644 --- a/arch/arm/include/asm/clkdev.h +++ b/arch/arm/include/asm/clkdev.h | |||
@@ -12,23 +12,13 @@ | |||
12 | #ifndef __ASM_CLKDEV_H | 12 | #ifndef __ASM_CLKDEV_H |
13 | #define __ASM_CLKDEV_H | 13 | #define __ASM_CLKDEV_H |
14 | 14 | ||
15 | struct clk; | 15 | #include <linux/slab.h> |
16 | struct device; | ||
17 | 16 | ||
18 | struct clk_lookup { | 17 | #include <mach/clkdev.h> |
19 | struct list_head node; | ||
20 | const char *dev_id; | ||
21 | const char *con_id; | ||
22 | struct clk *clk; | ||
23 | }; | ||
24 | 18 | ||
25 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | 19 | static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size) |
26 | const char *dev_fmt, ...); | 20 | { |
27 | 21 | return kzalloc(size, GFP_KERNEL); | |
28 | void clkdev_add(struct clk_lookup *cl); | 22 | } |
29 | void clkdev_drop(struct clk_lookup *cl); | ||
30 | |||
31 | void clkdev_add_table(struct clk_lookup *, size_t); | ||
32 | int clk_add_alias(const char *, const char *, char *, struct device *); | ||
33 | 23 | ||
34 | #endif | 24 | #endif |
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index c568da7dcae4..4fff837363ed 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -5,24 +5,29 @@ | |||
5 | 5 | ||
6 | #include <linux/mm_types.h> | 6 | #include <linux/mm_types.h> |
7 | #include <linux/scatterlist.h> | 7 | #include <linux/scatterlist.h> |
8 | #include <linux/dma-debug.h> | ||
8 | 9 | ||
9 | #include <asm-generic/dma-coherent.h> | 10 | #include <asm-generic/dma-coherent.h> |
10 | #include <asm/memory.h> | 11 | #include <asm/memory.h> |
11 | 12 | ||
13 | #ifdef __arch_page_to_dma | ||
14 | #error Please update to __arch_pfn_to_dma | ||
15 | #endif | ||
16 | |||
12 | /* | 17 | /* |
13 | * page_to_dma/dma_to_virt/virt_to_dma are architecture private functions | 18 | * dma_to_pfn/pfn_to_dma/dma_to_virt/virt_to_dma are architecture private |
14 | * used internally by the DMA-mapping API to provide DMA addresses. They | 19 | * functions used internally by the DMA-mapping API to provide DMA |
15 | * must not be used by drivers. | 20 | * addresses. They must not be used by drivers. |
16 | */ | 21 | */ |
17 | #ifndef __arch_page_to_dma | 22 | #ifndef __arch_pfn_to_dma |
18 | static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) | 23 | static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn) |
19 | { | 24 | { |
20 | return (dma_addr_t)__pfn_to_bus(page_to_pfn(page)); | 25 | return (dma_addr_t)__pfn_to_bus(pfn); |
21 | } | 26 | } |
22 | 27 | ||
23 | static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr) | 28 | static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr) |
24 | { | 29 | { |
25 | return pfn_to_page(__bus_to_pfn(addr)); | 30 | return __bus_to_pfn(addr); |
26 | } | 31 | } |
27 | 32 | ||
28 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) | 33 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) |
@@ -35,14 +40,14 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr) | |||
35 | return (dma_addr_t)__virt_to_bus((unsigned long)(addr)); | 40 | return (dma_addr_t)__virt_to_bus((unsigned long)(addr)); |
36 | } | 41 | } |
37 | #else | 42 | #else |
38 | static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) | 43 | static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn) |
39 | { | 44 | { |
40 | return __arch_page_to_dma(dev, page); | 45 | return __arch_pfn_to_dma(dev, pfn); |
41 | } | 46 | } |
42 | 47 | ||
43 | static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr) | 48 | static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr) |
44 | { | 49 | { |
45 | return __arch_dma_to_page(dev, addr); | 50 | return __arch_dma_to_pfn(dev, addr); |
46 | } | 51 | } |
47 | 52 | ||
48 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) | 53 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) |
@@ -293,13 +298,13 @@ extern int dma_needs_bounce(struct device*, dma_addr_t, size_t); | |||
293 | /* | 298 | /* |
294 | * The DMA API, implemented by dmabounce.c. See below for descriptions. | 299 | * The DMA API, implemented by dmabounce.c. See below for descriptions. |
295 | */ | 300 | */ |
296 | extern dma_addr_t dma_map_single(struct device *, void *, size_t, | 301 | extern dma_addr_t __dma_map_single(struct device *, void *, size_t, |
297 | enum dma_data_direction); | 302 | enum dma_data_direction); |
298 | extern void dma_unmap_single(struct device *, dma_addr_t, size_t, | 303 | extern void __dma_unmap_single(struct device *, dma_addr_t, size_t, |
299 | enum dma_data_direction); | 304 | enum dma_data_direction); |
300 | extern dma_addr_t dma_map_page(struct device *, struct page *, | 305 | extern dma_addr_t __dma_map_page(struct device *, struct page *, |
301 | unsigned long, size_t, enum dma_data_direction); | 306 | unsigned long, size_t, enum dma_data_direction); |
302 | extern void dma_unmap_page(struct device *, dma_addr_t, size_t, | 307 | extern void __dma_unmap_page(struct device *, dma_addr_t, size_t, |
303 | enum dma_data_direction); | 308 | enum dma_data_direction); |
304 | 309 | ||
305 | /* | 310 | /* |
@@ -323,6 +328,34 @@ static inline int dmabounce_sync_for_device(struct device *d, dma_addr_t addr, | |||
323 | } | 328 | } |
324 | 329 | ||
325 | 330 | ||
331 | static inline dma_addr_t __dma_map_single(struct device *dev, void *cpu_addr, | ||
332 | size_t size, enum dma_data_direction dir) | ||
333 | { | ||
334 | __dma_single_cpu_to_dev(cpu_addr, size, dir); | ||
335 | return virt_to_dma(dev, cpu_addr); | ||
336 | } | ||
337 | |||
338 | static inline dma_addr_t __dma_map_page(struct device *dev, struct page *page, | ||
339 | unsigned long offset, size_t size, enum dma_data_direction dir) | ||
340 | { | ||
341 | __dma_page_cpu_to_dev(page, offset, size, dir); | ||
342 | return pfn_to_dma(dev, page_to_pfn(page)) + offset; | ||
343 | } | ||
344 | |||
345 | static inline void __dma_unmap_single(struct device *dev, dma_addr_t handle, | ||
346 | size_t size, enum dma_data_direction dir) | ||
347 | { | ||
348 | __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir); | ||
349 | } | ||
350 | |||
351 | static inline void __dma_unmap_page(struct device *dev, dma_addr_t handle, | ||
352 | size_t size, enum dma_data_direction dir) | ||
353 | { | ||
354 | __dma_page_dev_to_cpu(pfn_to_page(dma_to_pfn(dev, handle)), | ||
355 | handle & ~PAGE_MASK, size, dir); | ||
356 | } | ||
357 | #endif /* CONFIG_DMABOUNCE */ | ||
358 | |||
326 | /** | 359 | /** |
327 | * dma_map_single - map a single buffer for streaming DMA | 360 | * dma_map_single - map a single buffer for streaming DMA |
328 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices | 361 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices |
@@ -340,11 +373,16 @@ static inline int dmabounce_sync_for_device(struct device *d, dma_addr_t addr, | |||
340 | static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, | 373 | static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, |
341 | size_t size, enum dma_data_direction dir) | 374 | size_t size, enum dma_data_direction dir) |
342 | { | 375 | { |
376 | dma_addr_t addr; | ||
377 | |||
343 | BUG_ON(!valid_dma_direction(dir)); | 378 | BUG_ON(!valid_dma_direction(dir)); |
344 | 379 | ||
345 | __dma_single_cpu_to_dev(cpu_addr, size, dir); | 380 | addr = __dma_map_single(dev, cpu_addr, size, dir); |
381 | debug_dma_map_page(dev, virt_to_page(cpu_addr), | ||
382 | (unsigned long)cpu_addr & ~PAGE_MASK, size, | ||
383 | dir, addr, true); | ||
346 | 384 | ||
347 | return virt_to_dma(dev, cpu_addr); | 385 | return addr; |
348 | } | 386 | } |
349 | 387 | ||
350 | /** | 388 | /** |
@@ -364,11 +402,14 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, | |||
364 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | 402 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, |
365 | unsigned long offset, size_t size, enum dma_data_direction dir) | 403 | unsigned long offset, size_t size, enum dma_data_direction dir) |
366 | { | 404 | { |
405 | dma_addr_t addr; | ||
406 | |||
367 | BUG_ON(!valid_dma_direction(dir)); | 407 | BUG_ON(!valid_dma_direction(dir)); |
368 | 408 | ||
369 | __dma_page_cpu_to_dev(page, offset, size, dir); | 409 | addr = __dma_map_page(dev, page, offset, size, dir); |
410 | debug_dma_map_page(dev, page, offset, size, dir, addr, false); | ||
370 | 411 | ||
371 | return page_to_dma(dev, page) + offset; | 412 | return addr; |
372 | } | 413 | } |
373 | 414 | ||
374 | /** | 415 | /** |
@@ -388,7 +429,8 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
388 | static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, | 429 | static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, |
389 | size_t size, enum dma_data_direction dir) | 430 | size_t size, enum dma_data_direction dir) |
390 | { | 431 | { |
391 | __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir); | 432 | debug_dma_unmap_page(dev, handle, size, dir, true); |
433 | __dma_unmap_single(dev, handle, size, dir); | ||
392 | } | 434 | } |
393 | 435 | ||
394 | /** | 436 | /** |
@@ -408,10 +450,9 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, | |||
408 | static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, | 450 | static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, |
409 | size_t size, enum dma_data_direction dir) | 451 | size_t size, enum dma_data_direction dir) |
410 | { | 452 | { |
411 | __dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK, | 453 | debug_dma_unmap_page(dev, handle, size, dir, false); |
412 | size, dir); | 454 | __dma_unmap_page(dev, handle, size, dir); |
413 | } | 455 | } |
414 | #endif /* CONFIG_DMABOUNCE */ | ||
415 | 456 | ||
416 | /** | 457 | /** |
417 | * dma_sync_single_range_for_cpu | 458 | * dma_sync_single_range_for_cpu |
@@ -437,6 +478,8 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, | |||
437 | { | 478 | { |
438 | BUG_ON(!valid_dma_direction(dir)); | 479 | BUG_ON(!valid_dma_direction(dir)); |
439 | 480 | ||
481 | debug_dma_sync_single_for_cpu(dev, handle + offset, size, dir); | ||
482 | |||
440 | if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir)) | 483 | if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir)) |
441 | return; | 484 | return; |
442 | 485 | ||
@@ -449,6 +492,8 @@ static inline void dma_sync_single_range_for_device(struct device *dev, | |||
449 | { | 492 | { |
450 | BUG_ON(!valid_dma_direction(dir)); | 493 | BUG_ON(!valid_dma_direction(dir)); |
451 | 494 | ||
495 | debug_dma_sync_single_for_device(dev, handle + offset, size, dir); | ||
496 | |||
452 | if (!dmabounce_sync_for_device(dev, handle, offset, size, dir)) | 497 | if (!dmabounce_sync_for_device(dev, handle, offset, size, dir)) |
453 | return; | 498 | return; |
454 | 499 | ||
diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h index cc7ef4080711..af18ceaacf5d 100644 --- a/arch/arm/include/asm/domain.h +++ b/arch/arm/include/asm/domain.h | |||
@@ -45,13 +45,17 @@ | |||
45 | */ | 45 | */ |
46 | #define DOMAIN_NOACCESS 0 | 46 | #define DOMAIN_NOACCESS 0 |
47 | #define DOMAIN_CLIENT 1 | 47 | #define DOMAIN_CLIENT 1 |
48 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
48 | #define DOMAIN_MANAGER 3 | 49 | #define DOMAIN_MANAGER 3 |
50 | #else | ||
51 | #define DOMAIN_MANAGER 1 | ||
52 | #endif | ||
49 | 53 | ||
50 | #define domain_val(dom,type) ((type) << (2*(dom))) | 54 | #define domain_val(dom,type) ((type) << (2*(dom))) |
51 | 55 | ||
52 | #ifndef __ASSEMBLY__ | 56 | #ifndef __ASSEMBLY__ |
53 | 57 | ||
54 | #ifdef CONFIG_MMU | 58 | #ifdef CONFIG_CPU_USE_DOMAINS |
55 | #define set_domain(x) \ | 59 | #define set_domain(x) \ |
56 | do { \ | 60 | do { \ |
57 | __asm__ __volatile__( \ | 61 | __asm__ __volatile__( \ |
@@ -74,5 +78,28 @@ | |||
74 | #define modify_domain(dom,type) do { } while (0) | 78 | #define modify_domain(dom,type) do { } while (0) |
75 | #endif | 79 | #endif |
76 | 80 | ||
81 | /* | ||
82 | * Generate the T (user) versions of the LDR/STR and related | ||
83 | * instructions (inline assembly) | ||
84 | */ | ||
85 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
86 | #define T(instr) #instr "t" | ||
87 | #else | ||
88 | #define T(instr) #instr | ||
77 | #endif | 89 | #endif |
78 | #endif /* !__ASSEMBLY__ */ | 90 | |
91 | #else /* __ASSEMBLY__ */ | ||
92 | |||
93 | /* | ||
94 | * Generate the T (user) versions of the LDR/STR and related | ||
95 | * instructions | ||
96 | */ | ||
97 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
98 | #define T(instr) instr ## t | ||
99 | #else | ||
100 | #define T(instr) instr | ||
101 | #endif | ||
102 | |||
103 | #endif /* __ASSEMBLY__ */ | ||
104 | |||
105 | #endif /* !__ASM_PROC_DOMAIN_H */ | ||
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h index 8bb66bca2e3e..c3cd8755e648 100644 --- a/arch/arm/include/asm/elf.h +++ b/arch/arm/include/asm/elf.h | |||
@@ -99,6 +99,8 @@ struct elf32_hdr; | |||
99 | extern int elf_check_arch(const struct elf32_hdr *); | 99 | extern int elf_check_arch(const struct elf32_hdr *); |
100 | #define elf_check_arch elf_check_arch | 100 | #define elf_check_arch elf_check_arch |
101 | 101 | ||
102 | #define vmcore_elf64_check_arch(x) (0) | ||
103 | |||
102 | extern int arm_elf_read_implies_exec(const struct elf32_hdr *, int); | 104 | extern int arm_elf_read_implies_exec(const struct elf32_hdr *, int); |
103 | #define elf_read_implies_exec(ex,stk) arm_elf_read_implies_exec(&(ex), stk) | 105 | #define elf_read_implies_exec(ex,stk) arm_elf_read_implies_exec(&(ex), stk) |
104 | 106 | ||
diff --git a/arch/arm/include/asm/entry-macro-multi.S b/arch/arm/include/asm/entry-macro-multi.S new file mode 100644 index 000000000000..ec0bbf79c71f --- /dev/null +++ b/arch/arm/include/asm/entry-macro-multi.S | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Interrupt handling. Preserves r7, r8, r9 | ||
3 | */ | ||
4 | .macro arch_irq_handler_default | ||
5 | get_irqnr_preamble r5, lr | ||
6 | 1: get_irqnr_and_base r0, r6, r5, lr | ||
7 | movne r1, sp | ||
8 | @ | ||
9 | @ routine called with r0 = irq number, r1 = struct pt_regs * | ||
10 | @ | ||
11 | adrne lr, BSYM(1b) | ||
12 | bne asm_do_IRQ | ||
13 | |||
14 | #ifdef CONFIG_SMP | ||
15 | /* | ||
16 | * XXX | ||
17 | * | ||
18 | * this macro assumes that irqstat (r6) and base (r5) are | ||
19 | * preserved from get_irqnr_and_base above | ||
20 | */ | ||
21 | ALT_SMP(test_for_ipi r0, r6, r5, lr) | ||
22 | ALT_UP_B(9997f) | ||
23 | movne r1, sp | ||
24 | adrne lr, BSYM(1b) | ||
25 | bne do_IPI | ||
26 | |||
27 | #ifdef CONFIG_LOCAL_TIMERS | ||
28 | test_for_ltirq r0, r6, r5, lr | ||
29 | movne r0, sp | ||
30 | adrne lr, BSYM(1b) | ||
31 | bne do_local_timer | ||
32 | #endif | ||
33 | #endif | ||
34 | 9997: | ||
35 | .endm | ||
36 | |||
37 | .macro arch_irq_handler, symbol_name | ||
38 | .align 5 | ||
39 | .global \symbol_name | ||
40 | \symbol_name: | ||
41 | mov r4, lr | ||
42 | arch_irq_handler_default | ||
43 | mov pc, r4 | ||
44 | .endm | ||
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h index 540a044153a5..b33fe7065b38 100644 --- a/arch/arm/include/asm/futex.h +++ b/arch/arm/include/asm/futex.h | |||
@@ -13,12 +13,13 @@ | |||
13 | #include <linux/preempt.h> | 13 | #include <linux/preempt.h> |
14 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
15 | #include <asm/errno.h> | 15 | #include <asm/errno.h> |
16 | #include <asm/domain.h> | ||
16 | 17 | ||
17 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 18 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ |
18 | __asm__ __volatile__( \ | 19 | __asm__ __volatile__( \ |
19 | "1: ldrt %1, [%2]\n" \ | 20 | "1: " T(ldr) " %1, [%2]\n" \ |
20 | " " insn "\n" \ | 21 | " " insn "\n" \ |
21 | "2: strt %0, [%2]\n" \ | 22 | "2: " T(str) " %0, [%2]\n" \ |
22 | " mov %0, #0\n" \ | 23 | " mov %0, #0\n" \ |
23 | "3:\n" \ | 24 | "3:\n" \ |
24 | " .pushsection __ex_table,\"a\"\n" \ | 25 | " .pushsection __ex_table,\"a\"\n" \ |
@@ -97,10 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | |||
97 | pagefault_disable(); /* implies preempt_disable() */ | 98 | pagefault_disable(); /* implies preempt_disable() */ |
98 | 99 | ||
99 | __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" | 100 | __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" |
100 | "1: ldrt %0, [%3]\n" | 101 | "1: " T(ldr) " %0, [%3]\n" |
101 | " teq %0, %1\n" | 102 | " teq %0, %1\n" |
102 | " it eq @ explicit IT needed for the 2b label\n" | 103 | " it eq @ explicit IT needed for the 2b label\n" |
103 | "2: streqt %2, [%3]\n" | 104 | "2: " T(streq) " %2, [%3]\n" |
104 | "3:\n" | 105 | "3:\n" |
105 | " .pushsection __ex_table,\"a\"\n" | 106 | " .pushsection __ex_table,\"a\"\n" |
106 | " .align 3\n" | 107 | " .align 3\n" |
diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index 6d7485aff955..89ad1805e579 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h | |||
@@ -5,13 +5,31 @@ | |||
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <asm/irq.h> | 6 | #include <asm/irq.h> |
7 | 7 | ||
8 | #define NR_IPI 5 | ||
9 | |||
8 | typedef struct { | 10 | typedef struct { |
9 | unsigned int __softirq_pending; | 11 | unsigned int __softirq_pending; |
12 | #ifdef CONFIG_LOCAL_TIMERS | ||
10 | unsigned int local_timer_irqs; | 13 | unsigned int local_timer_irqs; |
14 | #endif | ||
15 | #ifdef CONFIG_SMP | ||
16 | unsigned int ipi_irqs[NR_IPI]; | ||
17 | #endif | ||
11 | } ____cacheline_aligned irq_cpustat_t; | 18 | } ____cacheline_aligned irq_cpustat_t; |
12 | 19 | ||
13 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 20 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
14 | 21 | ||
22 | #define __inc_irq_stat(cpu, member) __IRQ_STAT(cpu, member)++ | ||
23 | #define __get_irq_stat(cpu, member) __IRQ_STAT(cpu, member) | ||
24 | |||
25 | #ifdef CONFIG_SMP | ||
26 | u64 smp_irq_stat_cpu(unsigned int cpu); | ||
27 | #else | ||
28 | #define smp_irq_stat_cpu(cpu) 0 | ||
29 | #endif | ||
30 | |||
31 | #define arch_irq_stat_cpu smp_irq_stat_cpu | ||
32 | |||
15 | #if NR_IRQS > 512 | 33 | #if NR_IRQS > 512 |
16 | #define HARDIRQ_BITS 10 | 34 | #define HARDIRQ_BITS 10 |
17 | #elif NR_IRQS > 256 | 35 | #elif NR_IRQS > 256 |
diff --git a/arch/arm/include/asm/hardware/entry-macro-gic.S b/arch/arm/include/asm/hardware/entry-macro-gic.S new file mode 100644 index 000000000000..c115b82fe80a --- /dev/null +++ b/arch/arm/include/asm/hardware/entry-macro-gic.S | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/entry-macro-gic.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for GIC | ||
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 <asm/hardware/gic.h> | ||
12 | |||
13 | #ifndef HAVE_GET_IRQNR_PREAMBLE | ||
14 | .macro get_irqnr_preamble, base, tmp | ||
15 | ldr \base, =gic_cpu_base_addr | ||
16 | ldr \base, [\base] | ||
17 | .endm | ||
18 | #endif | ||
19 | |||
20 | /* | ||
21 | * The interrupt numbering scheme is defined in the | ||
22 | * interrupt controller spec. To wit: | ||
23 | * | ||
24 | * Interrupts 0-15 are IPI | ||
25 | * 16-28 are reserved | ||
26 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
27 | * 32-1020 are global | ||
28 | * 1021-1022 are reserved | ||
29 | * 1023 is "spurious" (no interrupt) | ||
30 | * | ||
31 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
32 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
33 | * | ||
34 | * A simple read from the controller will tell us the number of the highest | ||
35 | * priority enabled interrupt. We then just need to check whether it is in the | ||
36 | * valid range for an IRQ (30-1020 inclusive). | ||
37 | */ | ||
38 | |||
39 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
40 | |||
41 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
42 | /* bits 12-10 = src CPU, 9-0 = int # */ | ||
43 | |||
44 | ldr \tmp, =1021 | ||
45 | bic \irqnr, \irqstat, #0x1c00 | ||
46 | cmp \irqnr, #29 | ||
47 | cmpcc \irqnr, \irqnr | ||
48 | cmpne \irqnr, \tmp | ||
49 | cmpcs \irqnr, \irqnr | ||
50 | .endm | ||
51 | |||
52 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
53 | * register) is preserved from the macro above. | ||
54 | * If there is an IPI, we immediately signal end of interrupt on the | ||
55 | * controller, since this requires the original irqstat value which | ||
56 | * we won't easily be able to recreate later. | ||
57 | */ | ||
58 | |||
59 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
60 | bic \irqnr, \irqstat, #0x1c00 | ||
61 | cmp \irqnr, #16 | ||
62 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
63 | cmpcs \irqnr, \irqnr | ||
64 | .endm | ||
65 | |||
66 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
67 | |||
68 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
69 | bic \irqnr, \irqstat, #0x1c00 | ||
70 | mov \tmp, #0 | ||
71 | cmp \irqnr, #29 | ||
72 | moveq \tmp, #1 | ||
73 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
74 | cmp \tmp, #0 | ||
75 | .endm | ||
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h index 7f34333bb545..84557d321001 100644 --- a/arch/arm/include/asm/hardware/gic.h +++ b/arch/arm/include/asm/hardware/gic.h | |||
@@ -33,10 +33,13 @@ | |||
33 | #define GIC_DIST_SOFTINT 0xf00 | 33 | #define GIC_DIST_SOFTINT 0xf00 |
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start); | 36 | extern void __iomem *gic_cpu_base_addr; |
37 | void gic_cpu_init(unsigned int gic_nr, void __iomem *base); | 37 | |
38 | void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *); | ||
39 | void gic_secondary_init(unsigned int); | ||
38 | void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); | 40 | void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); |
39 | void gic_raise_softirq(const struct cpumask *mask, unsigned int irq); | 41 | void gic_raise_softirq(const struct cpumask *mask, unsigned int irq); |
42 | void gic_enable_ppi(unsigned int); | ||
40 | #endif | 43 | #endif |
41 | 44 | ||
42 | #endif | 45 | #endif |
diff --git a/arch/arm/plat-versatile/include/plat/timer-sp.h b/arch/arm/include/asm/hardware/timer-sp.h index 21e75e30d497..21e75e30d497 100644 --- a/arch/arm/plat-versatile/include/plat/timer-sp.h +++ b/arch/arm/include/asm/hardware/timer-sp.h | |||
diff --git a/arch/arm/include/asm/hw_breakpoint.h b/arch/arm/include/asm/hw_breakpoint.h index 4d8ae9d67abe..f389b2704d82 100644 --- a/arch/arm/include/asm/hw_breakpoint.h +++ b/arch/arm/include/asm/hw_breakpoint.h | |||
@@ -20,8 +20,8 @@ struct arch_hw_breakpoint_ctrl { | |||
20 | struct arch_hw_breakpoint { | 20 | struct arch_hw_breakpoint { |
21 | u32 address; | 21 | u32 address; |
22 | u32 trigger; | 22 | u32 trigger; |
23 | struct perf_event *suspended_wp; | 23 | struct arch_hw_breakpoint_ctrl step_ctrl; |
24 | struct arch_hw_breakpoint_ctrl ctrl; | 24 | struct arch_hw_breakpoint_ctrl ctrl; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | static inline u32 encode_ctrl_reg(struct arch_hw_breakpoint_ctrl ctrl) | 27 | static inline u32 encode_ctrl_reg(struct arch_hw_breakpoint_ctrl ctrl) |
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 815efa2d4e07..20e0f7c9e03e 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -241,18 +241,15 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
241 | * | 241 | * |
242 | */ | 242 | */ |
243 | #ifndef __arch_ioremap | 243 | #ifndef __arch_ioremap |
244 | #define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) | 244 | #define __arch_ioremap __arm_ioremap |
245 | #define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) | 245 | #define __arch_iounmap __iounmap |
246 | #define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED) | 246 | #endif |
247 | #define ioremap_wc(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_WC) | 247 | |
248 | #define iounmap(cookie) __iounmap(cookie) | ||
249 | #else | ||
250 | #define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) | 248 | #define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) |
251 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) | 249 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) |
252 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED) | 250 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED) |
253 | #define ioremap_wc(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_WC) | 251 | #define ioremap_wc(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_WC) |
254 | #define iounmap(cookie) __arch_iounmap(cookie) | 252 | #define iounmap __arch_iounmap |
255 | #endif | ||
256 | 253 | ||
257 | /* | 254 | /* |
258 | * io{read,write}{8,16,32} macros | 255 | * io{read,write}{8,16,32} macros |
diff --git a/arch/arm/include/asm/kexec.h b/arch/arm/include/asm/kexec.h index 8ec9ef5c3c7b..c0094d8edae4 100644 --- a/arch/arm/include/asm/kexec.h +++ b/arch/arm/include/asm/kexec.h | |||
@@ -33,10 +33,20 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
33 | if (oldregs) { | 33 | if (oldregs) { |
34 | memcpy(newregs, oldregs, sizeof(*newregs)); | 34 | memcpy(newregs, oldregs, sizeof(*newregs)); |
35 | } else { | 35 | } else { |
36 | __asm__ __volatile__ ("stmia %0, {r0 - r15}" | 36 | __asm__ __volatile__ ( |
37 | : : "r" (&newregs->ARM_r0)); | 37 | "stmia %[regs_base], {r0-r12}\n\t" |
38 | __asm__ __volatile__ ("mrs %0, cpsr" | 38 | "mov %[_ARM_sp], sp\n\t" |
39 | : "=r" (newregs->ARM_cpsr)); | 39 | "str lr, %[_ARM_lr]\n\t" |
40 | "adr %[_ARM_pc], 1f\n\t" | ||
41 | "mrs %[_ARM_cpsr], cpsr\n\t" | ||
42 | "1:" | ||
43 | : [_ARM_pc] "=r" (newregs->ARM_pc), | ||
44 | [_ARM_cpsr] "=r" (newregs->ARM_cpsr), | ||
45 | [_ARM_sp] "=r" (newregs->ARM_sp), | ||
46 | [_ARM_lr] "=o" (newregs->ARM_lr) | ||
47 | : [regs_base] "r" (&newregs->ARM_r0) | ||
48 | : "memory" | ||
49 | ); | ||
40 | } | 50 | } |
41 | } | 51 | } |
42 | 52 | ||
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h index 50c7e7cfd670..6bc63ab498ce 100644 --- a/arch/arm/include/asm/localtimer.h +++ b/arch/arm/include/asm/localtimer.h | |||
@@ -30,7 +30,6 @@ asmlinkage void do_local_timer(struct pt_regs *); | |||
30 | #include "smp_twd.h" | 30 | #include "smp_twd.h" |
31 | 31 | ||
32 | #define local_timer_ack() twd_timer_ack() | 32 | #define local_timer_ack() twd_timer_ack() |
33 | #define local_timer_stop() twd_timer_stop() | ||
34 | 33 | ||
35 | #else | 34 | #else |
36 | 35 | ||
@@ -40,11 +39,6 @@ asmlinkage void do_local_timer(struct pt_regs *); | |||
40 | */ | 39 | */ |
41 | int local_timer_ack(void); | 40 | int local_timer_ack(void); |
42 | 41 | ||
43 | /* | ||
44 | * Stop a local timer interrupt. | ||
45 | */ | ||
46 | void local_timer_stop(void); | ||
47 | |||
48 | #endif | 42 | #endif |
49 | 43 | ||
50 | /* | 44 | /* |
@@ -52,12 +46,6 @@ void local_timer_stop(void); | |||
52 | */ | 46 | */ |
53 | void local_timer_setup(struct clock_event_device *); | 47 | void local_timer_setup(struct clock_event_device *); |
54 | 48 | ||
55 | #else | ||
56 | |||
57 | static inline void local_timer_stop(void) | ||
58 | { | ||
59 | } | ||
60 | |||
61 | #endif | 49 | #endif |
62 | 50 | ||
63 | #endif | 51 | #endif |
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index d97a964207fa..3a0893a76a3b 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h | |||
@@ -37,12 +37,21 @@ struct machine_desc { | |||
37 | struct meminfo *); | 37 | struct meminfo *); |
38 | void (*reserve)(void);/* reserve mem blocks */ | 38 | void (*reserve)(void);/* reserve mem blocks */ |
39 | void (*map_io)(void);/* IO mapping function */ | 39 | void (*map_io)(void);/* IO mapping function */ |
40 | void (*init_early)(void); | ||
40 | void (*init_irq)(void); | 41 | void (*init_irq)(void); |
41 | struct sys_timer *timer; /* system tick timer */ | 42 | struct sys_timer *timer; /* system tick timer */ |
42 | void (*init_machine)(void); | 43 | void (*init_machine)(void); |
44 | #ifdef CONFIG_MULTI_IRQ_HANDLER | ||
45 | void (*handle_irq)(struct pt_regs *); | ||
46 | #endif | ||
43 | }; | 47 | }; |
44 | 48 | ||
45 | /* | 49 | /* |
50 | * Current machine - only accessible during boot. | ||
51 | */ | ||
52 | extern struct machine_desc *machine_desc; | ||
53 | |||
54 | /* | ||
46 | * Set of macros to define architecture features. This is built into | 55 | * Set of macros to define architecture features. This is built into |
47 | * a table by the linker. | 56 | * a table by the linker. |
48 | */ | 57 | */ |
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h index ce3eee9fe26c..22ac140edd9e 100644 --- a/arch/arm/include/asm/mach/irq.h +++ b/arch/arm/include/asm/mach/irq.h | |||
@@ -17,10 +17,12 @@ struct seq_file; | |||
17 | /* | 17 | /* |
18 | * This is internal. Do not use it. | 18 | * This is internal. Do not use it. |
19 | */ | 19 | */ |
20 | extern unsigned int arch_nr_irqs; | ||
21 | extern void (*init_arch_irq)(void); | ||
22 | extern void init_FIQ(void); | 20 | extern void init_FIQ(void); |
23 | extern int show_fiq_list(struct seq_file *, void *); | 21 | extern int show_fiq_list(struct seq_file *, int); |
22 | |||
23 | #ifdef CONFIG_MULTI_IRQ_HANDLER | ||
24 | extern void (*handle_arch_irq)(struct pt_regs *); | ||
25 | #endif | ||
24 | 26 | ||
25 | /* | 27 | /* |
26 | * This is for easy migration, but should be changed in the source | 28 | * This is for easy migration, but should be changed in the source |
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 35d408f6dccf..883f6be5117a 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h | |||
@@ -43,7 +43,6 @@ struct sys_timer { | |||
43 | #endif | 43 | #endif |
44 | }; | 44 | }; |
45 | 45 | ||
46 | extern struct sys_timer *system_timer; | ||
47 | extern void timer_tick(void); | 46 | extern void timer_tick(void); |
48 | 47 | ||
49 | #endif | 48 | #endif |
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h index cbb0bc295d2b..12c8e680cbff 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h | |||
@@ -8,11 +8,6 @@ | |||
8 | struct unwind_table; | 8 | struct unwind_table; |
9 | 9 | ||
10 | #ifdef CONFIG_ARM_UNWIND | 10 | #ifdef CONFIG_ARM_UNWIND |
11 | struct arm_unwind_mapping { | ||
12 | Elf_Shdr *unw_sec; | ||
13 | Elf_Shdr *sec_text; | ||
14 | struct unwind_table *unwind; | ||
15 | }; | ||
16 | enum { | 11 | enum { |
17 | ARM_SEC_INIT, | 12 | ARM_SEC_INIT, |
18 | ARM_SEC_DEVINIT, | 13 | ARM_SEC_DEVINIT, |
@@ -21,13 +16,13 @@ enum { | |||
21 | ARM_SEC_DEVEXIT, | 16 | ARM_SEC_DEVEXIT, |
22 | ARM_SEC_MAX, | 17 | ARM_SEC_MAX, |
23 | }; | 18 | }; |
19 | #endif | ||
20 | |||
24 | struct mod_arch_specific { | 21 | struct mod_arch_specific { |
25 | struct arm_unwind_mapping map[ARM_SEC_MAX]; | 22 | #ifdef CONFIG_ARM_UNWIND |
26 | }; | 23 | struct unwind_table *unwind[ARM_SEC_MAX]; |
27 | #else | ||
28 | struct mod_arch_specific { | ||
29 | }; | ||
30 | #endif | 24 | #endif |
25 | }; | ||
31 | 26 | ||
32 | /* | 27 | /* |
33 | * Include the ARM architecture version. | 28 | * Include the ARM architecture version. |
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h index a485ac3c8696..f51a69595f6e 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h | |||
@@ -151,13 +151,15 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from, | |||
151 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) | 151 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) |
152 | extern void copy_page(void *to, const void *from); | 152 | extern void copy_page(void *to, const void *from); |
153 | 153 | ||
154 | typedef unsigned long pteval_t; | ||
155 | |||
154 | #undef STRICT_MM_TYPECHECKS | 156 | #undef STRICT_MM_TYPECHECKS |
155 | 157 | ||
156 | #ifdef STRICT_MM_TYPECHECKS | 158 | #ifdef STRICT_MM_TYPECHECKS |
157 | /* | 159 | /* |
158 | * These are used to make use of C type-checking.. | 160 | * These are used to make use of C type-checking.. |
159 | */ | 161 | */ |
160 | typedef struct { unsigned long pte; } pte_t; | 162 | typedef struct { pteval_t pte; } pte_t; |
161 | typedef struct { unsigned long pmd; } pmd_t; | 163 | typedef struct { unsigned long pmd; } pmd_t; |
162 | typedef struct { unsigned long pgd[2]; } pgd_t; | 164 | typedef struct { unsigned long pgd[2]; } pgd_t; |
163 | typedef struct { unsigned long pgprot; } pgprot_t; | 165 | typedef struct { unsigned long pgprot; } pgprot_t; |
@@ -175,7 +177,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
175 | /* | 177 | /* |
176 | * .. while these make it easier on the compiler | 178 | * .. while these make it easier on the compiler |
177 | */ | 179 | */ |
178 | typedef unsigned long pte_t; | 180 | typedef pteval_t pte_t; |
179 | typedef unsigned long pmd_t; | 181 | typedef unsigned long pmd_t; |
180 | typedef unsigned long pgd_t[2]; | 182 | typedef unsigned long pgd_t[2]; |
181 | typedef unsigned long pgprot_t; | 183 | typedef unsigned long pgprot_t; |
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h index b12cc98bbe04..9763be04f77e 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h | |||
@@ -30,14 +30,16 @@ | |||
30 | #define pmd_free(mm, pmd) do { } while (0) | 30 | #define pmd_free(mm, pmd) do { } while (0) |
31 | #define pgd_populate(mm,pmd,pte) BUG() | 31 | #define pgd_populate(mm,pmd,pte) BUG() |
32 | 32 | ||
33 | extern pgd_t *get_pgd_slow(struct mm_struct *mm); | 33 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
34 | extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd); | 34 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |
35 | |||
36 | #define pgd_alloc(mm) get_pgd_slow(mm) | ||
37 | #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) | ||
38 | 35 | ||
39 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO) | 36 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO) |
40 | 37 | ||
38 | static inline void clean_pte_table(pte_t *pte) | ||
39 | { | ||
40 | clean_dcache_area(pte + PTE_HWTABLE_PTRS, PTE_HWTABLE_SIZE); | ||
41 | } | ||
42 | |||
41 | /* | 43 | /* |
42 | * Allocate one PTE table. | 44 | * Allocate one PTE table. |
43 | * | 45 | * |
@@ -45,14 +47,14 @@ extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd); | |||
45 | * into one table thus: | 47 | * into one table thus: |
46 | * | 48 | * |
47 | * +------------+ | 49 | * +------------+ |
48 | * | h/w pt 0 | | ||
49 | * +------------+ | ||
50 | * | h/w pt 1 | | ||
51 | * +------------+ | ||
52 | * | Linux pt 0 | | 50 | * | Linux pt 0 | |
53 | * +------------+ | 51 | * +------------+ |
54 | * | Linux pt 1 | | 52 | * | Linux pt 1 | |
55 | * +------------+ | 53 | * +------------+ |
54 | * | h/w pt 0 | | ||
55 | * +------------+ | ||
56 | * | h/w pt 1 | | ||
57 | * +------------+ | ||
56 | */ | 58 | */ |
57 | static inline pte_t * | 59 | static inline pte_t * |
58 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) | 60 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) |
@@ -60,10 +62,8 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) | |||
60 | pte_t *pte; | 62 | pte_t *pte; |
61 | 63 | ||
62 | pte = (pte_t *)__get_free_page(PGALLOC_GFP); | 64 | pte = (pte_t *)__get_free_page(PGALLOC_GFP); |
63 | if (pte) { | 65 | if (pte) |
64 | clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE); | 66 | clean_pte_table(pte); |
65 | pte += PTRS_PER_PTE; | ||
66 | } | ||
67 | 67 | ||
68 | return pte; | 68 | return pte; |
69 | } | 69 | } |
@@ -79,10 +79,8 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
79 | pte = alloc_pages(PGALLOC_GFP, 0); | 79 | pte = alloc_pages(PGALLOC_GFP, 0); |
80 | #endif | 80 | #endif |
81 | if (pte) { | 81 | if (pte) { |
82 | if (!PageHighMem(pte)) { | 82 | if (!PageHighMem(pte)) |
83 | void *page = page_address(pte); | 83 | clean_pte_table(page_address(pte)); |
84 | clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE); | ||
85 | } | ||
86 | pgtable_page_ctor(pte); | 84 | pgtable_page_ctor(pte); |
87 | } | 85 | } |
88 | 86 | ||
@@ -94,10 +92,8 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
94 | */ | 92 | */ |
95 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) | 93 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
96 | { | 94 | { |
97 | if (pte) { | 95 | if (pte) |
98 | pte -= PTRS_PER_PTE; | ||
99 | free_page((unsigned long)pte); | 96 | free_page((unsigned long)pte); |
100 | } | ||
101 | } | 97 | } |
102 | 98 | ||
103 | static inline void pte_free(struct mm_struct *mm, pgtable_t pte) | 99 | static inline void pte_free(struct mm_struct *mm, pgtable_t pte) |
@@ -106,8 +102,10 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte) | |||
106 | __free_page(pte); | 102 | __free_page(pte); |
107 | } | 103 | } |
108 | 104 | ||
109 | static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval) | 105 | static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte, |
106 | unsigned long prot) | ||
110 | { | 107 | { |
108 | unsigned long pmdval = (pte + PTE_HWTABLE_OFF) | prot; | ||
111 | pmdp[0] = __pmd(pmdval); | 109 | pmdp[0] = __pmd(pmdval); |
112 | pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t)); | 110 | pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t)); |
113 | flush_pmd_entry(pmdp); | 111 | flush_pmd_entry(pmdp); |
@@ -122,20 +120,16 @@ static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval) | |||
122 | static inline void | 120 | static inline void |
123 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) | 121 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) |
124 | { | 122 | { |
125 | unsigned long pte_ptr = (unsigned long)ptep; | ||
126 | |||
127 | /* | 123 | /* |
128 | * The pmd must be loaded with the physical | 124 | * The pmd must be loaded with the physical address of the PTE table |
129 | * address of the PTE table | ||
130 | */ | 125 | */ |
131 | pte_ptr -= PTRS_PER_PTE * sizeof(void *); | 126 | __pmd_populate(pmdp, __pa(ptep), _PAGE_KERNEL_TABLE); |
132 | __pmd_populate(pmdp, __pa(pte_ptr) | _PAGE_KERNEL_TABLE); | ||
133 | } | 127 | } |
134 | 128 | ||
135 | static inline void | 129 | static inline void |
136 | pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) | 130 | pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep) |
137 | { | 131 | { |
138 | __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE); | 132 | __pmd_populate(pmdp, page_to_phys(ptep), _PAGE_USER_TABLE); |
139 | } | 133 | } |
140 | #define pmd_pgtable(pmd) pmd_page(pmd) | 134 | #define pmd_pgtable(pmd) pmd_page(pmd) |
141 | 135 | ||
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 53d1d5deb111..ebcb6432f45f 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #ifndef _ASMARM_PGTABLE_H | 10 | #ifndef _ASMARM_PGTABLE_H |
11 | #define _ASMARM_PGTABLE_H | 11 | #define _ASMARM_PGTABLE_H |
12 | 12 | ||
13 | #include <linux/const.h> | ||
13 | #include <asm-generic/4level-fixup.h> | 14 | #include <asm-generic/4level-fixup.h> |
14 | #include <asm/proc-fns.h> | 15 | #include <asm/proc-fns.h> |
15 | 16 | ||
@@ -54,7 +55,7 @@ | |||
54 | * Therefore, we tweak the implementation slightly - we tell Linux that we | 55 | * Therefore, we tweak the implementation slightly - we tell Linux that we |
55 | * have 2048 entries in the first level, each of which is 8 bytes (iow, two | 56 | * have 2048 entries in the first level, each of which is 8 bytes (iow, two |
56 | * hardware pointers to the second level.) The second level contains two | 57 | * hardware pointers to the second level.) The second level contains two |
57 | * hardware PTE tables arranged contiguously, followed by Linux versions | 58 | * hardware PTE tables arranged contiguously, preceded by Linux versions |
58 | * which contain the state information Linux needs. We, therefore, end up | 59 | * which contain the state information Linux needs. We, therefore, end up |
59 | * with 512 entries in the "PTE" level. | 60 | * with 512 entries in the "PTE" level. |
60 | * | 61 | * |
@@ -62,15 +63,15 @@ | |||
62 | * | 63 | * |
63 | * pgd pte | 64 | * pgd pte |
64 | * | | | 65 | * | | |
65 | * +--------+ +0 | 66 | * +--------+ |
66 | * | |-----> +------------+ +0 | 67 | * | | +------------+ +0 |
68 | * +- - - - + | Linux pt 0 | | ||
69 | * | | +------------+ +1024 | ||
70 | * +--------+ +0 | Linux pt 1 | | ||
71 | * | |-----> +------------+ +2048 | ||
67 | * +- - - - + +4 | h/w pt 0 | | 72 | * +- - - - + +4 | h/w pt 0 | |
68 | * | |-----> +------------+ +1024 | 73 | * | |-----> +------------+ +3072 |
69 | * +--------+ +8 | h/w pt 1 | | 74 | * +--------+ +8 | h/w pt 1 | |
70 | * | | +------------+ +2048 | ||
71 | * +- - - - + | Linux pt 0 | | ||
72 | * | | +------------+ +3072 | ||
73 | * +--------+ | Linux pt 1 | | ||
74 | * | | +------------+ +4096 | 75 | * | | +------------+ +4096 |
75 | * | 76 | * |
76 | * See L_PTE_xxx below for definitions of bits in the "Linux pt", and | 77 | * See L_PTE_xxx below for definitions of bits in the "Linux pt", and |
@@ -102,6 +103,10 @@ | |||
102 | #define PTRS_PER_PMD 1 | 103 | #define PTRS_PER_PMD 1 |
103 | #define PTRS_PER_PGD 2048 | 104 | #define PTRS_PER_PGD 2048 |
104 | 105 | ||
106 | #define PTE_HWTABLE_PTRS (PTRS_PER_PTE) | ||
107 | #define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t)) | ||
108 | #define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u32)) | ||
109 | |||
105 | /* | 110 | /* |
106 | * PMD_SHIFT determines the size of the area a second-level page table can map | 111 | * PMD_SHIFT determines the size of the area a second-level page table can map |
107 | * PGDIR_SHIFT determines what a third-level page table entry can map | 112 | * PGDIR_SHIFT determines what a third-level page table entry can map |
@@ -112,13 +117,13 @@ | |||
112 | #define LIBRARY_TEXT_START 0x0c000000 | 117 | #define LIBRARY_TEXT_START 0x0c000000 |
113 | 118 | ||
114 | #ifndef __ASSEMBLY__ | 119 | #ifndef __ASSEMBLY__ |
115 | extern void __pte_error(const char *file, int line, unsigned long val); | 120 | extern void __pte_error(const char *file, int line, pte_t); |
116 | extern void __pmd_error(const char *file, int line, unsigned long val); | 121 | extern void __pmd_error(const char *file, int line, pmd_t); |
117 | extern void __pgd_error(const char *file, int line, unsigned long val); | 122 | extern void __pgd_error(const char *file, int line, pgd_t); |
118 | 123 | ||
119 | #define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte)) | 124 | #define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte) |
120 | #define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd_val(pmd)) | 125 | #define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd) |
121 | #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd)) | 126 | #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd) |
122 | #endif /* !__ASSEMBLY__ */ | 127 | #endif /* !__ASSEMBLY__ */ |
123 | 128 | ||
124 | #define PMD_SIZE (1UL << PMD_SHIFT) | 129 | #define PMD_SIZE (1UL << PMD_SHIFT) |
@@ -133,8 +138,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
133 | */ | 138 | */ |
134 | #define FIRST_USER_ADDRESS PAGE_SIZE | 139 | #define FIRST_USER_ADDRESS PAGE_SIZE |
135 | 140 | ||
136 | #define FIRST_USER_PGD_NR 1 | 141 | #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) |
137 | #define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR) | ||
138 | 142 | ||
139 | /* | 143 | /* |
140 | * section address mask and size definitions. | 144 | * section address mask and size definitions. |
@@ -161,30 +165,30 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
161 | * The PTE table pointer refers to the hardware entries; the "Linux" | 165 | * The PTE table pointer refers to the hardware entries; the "Linux" |
162 | * entries are stored 1024 bytes below. | 166 | * entries are stored 1024 bytes below. |
163 | */ | 167 | */ |
164 | #define L_PTE_PRESENT (1 << 0) | 168 | #define L_PTE_PRESENT (_AT(pteval_t, 1) << 0) |
165 | #define L_PTE_YOUNG (1 << 1) | 169 | #define L_PTE_YOUNG (_AT(pteval_t, 1) << 1) |
166 | #define L_PTE_FILE (1 << 2) /* only when !PRESENT */ | 170 | #define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !PRESENT */ |
167 | #define L_PTE_DIRTY (1 << 6) | 171 | #define L_PTE_DIRTY (_AT(pteval_t, 1) << 6) |
168 | #define L_PTE_WRITE (1 << 7) | 172 | #define L_PTE_RDONLY (_AT(pteval_t, 1) << 7) |
169 | #define L_PTE_USER (1 << 8) | 173 | #define L_PTE_USER (_AT(pteval_t, 1) << 8) |
170 | #define L_PTE_EXEC (1 << 9) | 174 | #define L_PTE_XN (_AT(pteval_t, 1) << 9) |
171 | #define L_PTE_SHARED (1 << 10) /* shared(v6), coherent(xsc3) */ | 175 | #define L_PTE_SHARED (_AT(pteval_t, 1) << 10) /* shared(v6), coherent(xsc3) */ |
172 | 176 | ||
173 | /* | 177 | /* |
174 | * These are the memory types, defined to be compatible with | 178 | * These are the memory types, defined to be compatible with |
175 | * pre-ARMv6 CPUs cacheable and bufferable bits: XXCB | 179 | * pre-ARMv6 CPUs cacheable and bufferable bits: XXCB |
176 | */ | 180 | */ |
177 | #define L_PTE_MT_UNCACHED (0x00 << 2) /* 0000 */ | 181 | #define L_PTE_MT_UNCACHED (_AT(pteval_t, 0x00) << 2) /* 0000 */ |
178 | #define L_PTE_MT_BUFFERABLE (0x01 << 2) /* 0001 */ | 182 | #define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 0x01) << 2) /* 0001 */ |
179 | #define L_PTE_MT_WRITETHROUGH (0x02 << 2) /* 0010 */ | 183 | #define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 0x02) << 2) /* 0010 */ |
180 | #define L_PTE_MT_WRITEBACK (0x03 << 2) /* 0011 */ | 184 | #define L_PTE_MT_WRITEBACK (_AT(pteval_t, 0x03) << 2) /* 0011 */ |
181 | #define L_PTE_MT_MINICACHE (0x06 << 2) /* 0110 (sa1100, xscale) */ | 185 | #define L_PTE_MT_MINICACHE (_AT(pteval_t, 0x06) << 2) /* 0110 (sa1100, xscale) */ |
182 | #define L_PTE_MT_WRITEALLOC (0x07 << 2) /* 0111 */ | 186 | #define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 0x07) << 2) /* 0111 */ |
183 | #define L_PTE_MT_DEV_SHARED (0x04 << 2) /* 0100 */ | 187 | #define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 0x04) << 2) /* 0100 */ |
184 | #define L_PTE_MT_DEV_NONSHARED (0x0c << 2) /* 1100 */ | 188 | #define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 0x0c) << 2) /* 1100 */ |
185 | #define L_PTE_MT_DEV_WC (0x09 << 2) /* 1001 */ | 189 | #define L_PTE_MT_DEV_WC (_AT(pteval_t, 0x09) << 2) /* 1001 */ |
186 | #define L_PTE_MT_DEV_CACHED (0x0b << 2) /* 1011 */ | 190 | #define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */ |
187 | #define L_PTE_MT_MASK (0x0f << 2) | 191 | #define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) |
188 | 192 | ||
189 | #ifndef __ASSEMBLY__ | 193 | #ifndef __ASSEMBLY__ |
190 | 194 | ||
@@ -201,23 +205,44 @@ extern pgprot_t pgprot_kernel; | |||
201 | 205 | ||
202 | #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b)) | 206 | #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b)) |
203 | 207 | ||
204 | #define PAGE_NONE pgprot_user | 208 | #define PAGE_NONE _MOD_PROT(pgprot_user, L_PTE_XN | L_PTE_RDONLY) |
205 | #define PAGE_SHARED _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_WRITE) | 209 | #define PAGE_SHARED _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_XN) |
206 | #define PAGE_SHARED_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_WRITE | L_PTE_EXEC) | 210 | #define PAGE_SHARED_EXEC _MOD_PROT(pgprot_user, L_PTE_USER) |
207 | #define PAGE_COPY _MOD_PROT(pgprot_user, L_PTE_USER) | 211 | #define PAGE_COPY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY | L_PTE_XN) |
208 | #define PAGE_COPY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_EXEC) | 212 | #define PAGE_COPY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY) |
209 | #define PAGE_READONLY _MOD_PROT(pgprot_user, L_PTE_USER) | 213 | #define PAGE_READONLY _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY | L_PTE_XN) |
210 | #define PAGE_READONLY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_EXEC) | 214 | #define PAGE_READONLY_EXEC _MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY) |
211 | #define PAGE_KERNEL pgprot_kernel | 215 | #define PAGE_KERNEL _MOD_PROT(pgprot_kernel, L_PTE_XN) |
212 | #define PAGE_KERNEL_EXEC _MOD_PROT(pgprot_kernel, L_PTE_EXEC) | 216 | #define PAGE_KERNEL_EXEC pgprot_kernel |
213 | 217 | ||
214 | #define __PAGE_NONE __pgprot(_L_PTE_DEFAULT) | 218 | #define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN) |
215 | #define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_WRITE) | 219 | #define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN) |
216 | #define __PAGE_SHARED_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_WRITE | L_PTE_EXEC) | 220 | #define __PAGE_SHARED_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER) |
217 | #define __PAGE_COPY __pgprot(_L_PTE_DEFAULT | L_PTE_USER) | 221 | #define __PAGE_COPY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY | L_PTE_XN) |
218 | #define __PAGE_COPY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_EXEC) | 222 | #define __PAGE_COPY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY) |
219 | #define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | L_PTE_USER) | 223 | #define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY | L_PTE_XN) |
220 | #define __PAGE_READONLY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_EXEC) | 224 | #define __PAGE_READONLY_EXEC __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_RDONLY) |
225 | |||
226 | #define __pgprot_modify(prot,mask,bits) \ | ||
227 | __pgprot((pgprot_val(prot) & ~(mask)) | (bits)) | ||
228 | |||
229 | #define pgprot_noncached(prot) \ | ||
230 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) | ||
231 | |||
232 | #define pgprot_writecombine(prot) \ | ||
233 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) | ||
234 | |||
235 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | ||
236 | #define pgprot_dmacoherent(prot) \ | ||
237 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE | L_PTE_XN) | ||
238 | #define __HAVE_PHYS_MEM_ACCESS_PROT | ||
239 | struct file; | ||
240 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
241 | unsigned long size, pgprot_t vma_prot); | ||
242 | #else | ||
243 | #define pgprot_dmacoherent(prot) \ | ||
244 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED | L_PTE_XN) | ||
245 | #endif | ||
221 | 246 | ||
222 | #endif /* __ASSEMBLY__ */ | 247 | #endif /* __ASSEMBLY__ */ |
223 | 248 | ||
@@ -255,26 +280,84 @@ extern pgprot_t pgprot_kernel; | |||
255 | extern struct page *empty_zero_page; | 280 | extern struct page *empty_zero_page; |
256 | #define ZERO_PAGE(vaddr) (empty_zero_page) | 281 | #define ZERO_PAGE(vaddr) (empty_zero_page) |
257 | 282 | ||
258 | #define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) | ||
259 | #define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) | ||
260 | 283 | ||
261 | #define pte_none(pte) (!pte_val(pte)) | 284 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; |
262 | #define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0) | 285 | |
263 | #define pte_page(pte) (pfn_to_page(pte_pfn(pte))) | 286 | /* to find an entry in a page-table-directory */ |
264 | #define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr)) | 287 | #define pgd_index(addr) ((addr) >> PGDIR_SHIFT) |
288 | |||
289 | #define pgd_offset(mm, addr) ((mm)->pgd + pgd_index(addr)) | ||
290 | |||
291 | /* to find an entry in a kernel page-table-directory */ | ||
292 | #define pgd_offset_k(addr) pgd_offset(&init_mm, addr) | ||
293 | |||
294 | /* | ||
295 | * The "pgd_xxx()" functions here are trivial for a folded two-level | ||
296 | * setup: the pgd is never bad, and a pmd always exists (as it's folded | ||
297 | * into the pgd entry) | ||
298 | */ | ||
299 | #define pgd_none(pgd) (0) | ||
300 | #define pgd_bad(pgd) (0) | ||
301 | #define pgd_present(pgd) (1) | ||
302 | #define pgd_clear(pgdp) do { } while (0) | ||
303 | #define set_pgd(pgd,pgdp) do { } while (0) | ||
304 | |||
305 | |||
306 | /* Find an entry in the second-level page table.. */ | ||
307 | #define pmd_offset(dir, addr) ((pmd_t *)(dir)) | ||
308 | |||
309 | #define pmd_none(pmd) (!pmd_val(pmd)) | ||
310 | #define pmd_present(pmd) (pmd_val(pmd)) | ||
311 | #define pmd_bad(pmd) (pmd_val(pmd) & 2) | ||
312 | |||
313 | #define copy_pmd(pmdpd,pmdps) \ | ||
314 | do { \ | ||
315 | pmdpd[0] = pmdps[0]; \ | ||
316 | pmdpd[1] = pmdps[1]; \ | ||
317 | flush_pmd_entry(pmdpd); \ | ||
318 | } while (0) | ||
319 | |||
320 | #define pmd_clear(pmdp) \ | ||
321 | do { \ | ||
322 | pmdp[0] = __pmd(0); \ | ||
323 | pmdp[1] = __pmd(0); \ | ||
324 | clean_pmd_entry(pmdp); \ | ||
325 | } while (0) | ||
326 | |||
327 | static inline pte_t *pmd_page_vaddr(pmd_t pmd) | ||
328 | { | ||
329 | return __va(pmd_val(pmd) & PAGE_MASK); | ||
330 | } | ||
331 | |||
332 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd))) | ||
333 | |||
334 | /* we don't need complex calculations here as the pmd is folded into the pgd */ | ||
335 | #define pmd_addr_end(addr,end) (end) | ||
265 | 336 | ||
266 | #define pte_offset_map(dir,addr) (__pte_map(dir) + __pte_index(addr)) | ||
267 | #define pte_unmap(pte) __pte_unmap(pte) | ||
268 | 337 | ||
269 | #ifndef CONFIG_HIGHPTE | 338 | #ifndef CONFIG_HIGHPTE |
270 | #define __pte_map(dir) pmd_page_vaddr(*(dir)) | 339 | #define __pte_map(pmd) pmd_page_vaddr(*(pmd)) |
271 | #define __pte_unmap(pte) do { } while (0) | 340 | #define __pte_unmap(pte) do { } while (0) |
272 | #else | 341 | #else |
273 | #define __pte_map(dir) ((pte_t *)kmap_atomic(pmd_page(*(dir))) + PTRS_PER_PTE) | 342 | #define __pte_map(pmd) (pte_t *)kmap_atomic(pmd_page(*(pmd))) |
274 | #define __pte_unmap(pte) kunmap_atomic((pte - PTRS_PER_PTE)) | 343 | #define __pte_unmap(pte) kunmap_atomic(pte) |
275 | #endif | 344 | #endif |
276 | 345 | ||
346 | #define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | ||
347 | |||
348 | #define pte_offset_kernel(pmd,addr) (pmd_page_vaddr(*(pmd)) + pte_index(addr)) | ||
349 | |||
350 | #define pte_offset_map(pmd,addr) (__pte_map(pmd) + pte_index(addr)) | ||
351 | #define pte_unmap(pte) __pte_unmap(pte) | ||
352 | |||
353 | #define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) | ||
354 | #define pfn_pte(pfn,prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | ||
355 | |||
356 | #define pte_page(pte) pfn_to_page(pte_pfn(pte)) | ||
357 | #define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot) | ||
358 | |||
277 | #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext) | 359 | #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext) |
360 | #define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0) | ||
278 | 361 | ||
279 | #if __LINUX_ARM_ARCH__ < 6 | 362 | #if __LINUX_ARM_ARCH__ < 6 |
280 | static inline void __sync_icache_dcache(pte_t pteval) | 363 | static inline void __sync_icache_dcache(pte_t pteval) |
@@ -295,15 +378,12 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
295 | } | 378 | } |
296 | } | 379 | } |
297 | 380 | ||
298 | /* | 381 | #define pte_none(pte) (!pte_val(pte)) |
299 | * The following only work if pte_present() is true. | ||
300 | * Undefined behaviour if not.. | ||
301 | */ | ||
302 | #define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT) | 382 | #define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT) |
303 | #define pte_write(pte) (pte_val(pte) & L_PTE_WRITE) | 383 | #define pte_write(pte) (!(pte_val(pte) & L_PTE_RDONLY)) |
304 | #define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY) | 384 | #define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY) |
305 | #define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) | 385 | #define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) |
306 | #define pte_exec(pte) (pte_val(pte) & L_PTE_EXEC) | 386 | #define pte_exec(pte) (!(pte_val(pte) & L_PTE_XN)) |
307 | #define pte_special(pte) (0) | 387 | #define pte_special(pte) (0) |
308 | 388 | ||
309 | #define pte_present_user(pte) \ | 389 | #define pte_present_user(pte) \ |
@@ -313,8 +393,8 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
313 | #define PTE_BIT_FUNC(fn,op) \ | 393 | #define PTE_BIT_FUNC(fn,op) \ |
314 | static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } | 394 | static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } |
315 | 395 | ||
316 | PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE); | 396 | PTE_BIT_FUNC(wrprotect, |= L_PTE_RDONLY); |
317 | PTE_BIT_FUNC(mkwrite, |= L_PTE_WRITE); | 397 | PTE_BIT_FUNC(mkwrite, &= ~L_PTE_RDONLY); |
318 | PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY); | 398 | PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY); |
319 | PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY); | 399 | PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY); |
320 | PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG); | 400 | PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG); |
@@ -322,101 +402,13 @@ PTE_BIT_FUNC(mkyoung, |= L_PTE_YOUNG); | |||
322 | 402 | ||
323 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | 403 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } |
324 | 404 | ||
325 | #define __pgprot_modify(prot,mask,bits) \ | ||
326 | __pgprot((pgprot_val(prot) & ~(mask)) | (bits)) | ||
327 | |||
328 | /* | ||
329 | * Mark the prot value as uncacheable and unbufferable. | ||
330 | */ | ||
331 | #define pgprot_noncached(prot) \ | ||
332 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) | ||
333 | #define pgprot_writecombine(prot) \ | ||
334 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) | ||
335 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | ||
336 | #define pgprot_dmacoherent(prot) \ | ||
337 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) | ||
338 | #define __HAVE_PHYS_MEM_ACCESS_PROT | ||
339 | struct file; | ||
340 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | ||
341 | unsigned long size, pgprot_t vma_prot); | ||
342 | #else | ||
343 | #define pgprot_dmacoherent(prot) \ | ||
344 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED) | ||
345 | #endif | ||
346 | |||
347 | #define pmd_none(pmd) (!pmd_val(pmd)) | ||
348 | #define pmd_present(pmd) (pmd_val(pmd)) | ||
349 | #define pmd_bad(pmd) (pmd_val(pmd) & 2) | ||
350 | |||
351 | #define copy_pmd(pmdpd,pmdps) \ | ||
352 | do { \ | ||
353 | pmdpd[0] = pmdps[0]; \ | ||
354 | pmdpd[1] = pmdps[1]; \ | ||
355 | flush_pmd_entry(pmdpd); \ | ||
356 | } while (0) | ||
357 | |||
358 | #define pmd_clear(pmdp) \ | ||
359 | do { \ | ||
360 | pmdp[0] = __pmd(0); \ | ||
361 | pmdp[1] = __pmd(0); \ | ||
362 | clean_pmd_entry(pmdp); \ | ||
363 | } while (0) | ||
364 | |||
365 | static inline pte_t *pmd_page_vaddr(pmd_t pmd) | ||
366 | { | ||
367 | unsigned long ptr; | ||
368 | |||
369 | ptr = pmd_val(pmd) & ~(PTRS_PER_PTE * sizeof(void *) - 1); | ||
370 | ptr += PTRS_PER_PTE * sizeof(void *); | ||
371 | |||
372 | return __va(ptr); | ||
373 | } | ||
374 | |||
375 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd))) | ||
376 | |||
377 | /* we don't need complex calculations here as the pmd is folded into the pgd */ | ||
378 | #define pmd_addr_end(addr,end) (end) | ||
379 | |||
380 | /* | ||
381 | * Conversion functions: convert a page and protection to a page entry, | ||
382 | * and a page entry and page directory to the page they refer to. | ||
383 | */ | ||
384 | #define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot) | ||
385 | |||
386 | /* | ||
387 | * The "pgd_xxx()" functions here are trivial for a folded two-level | ||
388 | * setup: the pgd is never bad, and a pmd always exists (as it's folded | ||
389 | * into the pgd entry) | ||
390 | */ | ||
391 | #define pgd_none(pgd) (0) | ||
392 | #define pgd_bad(pgd) (0) | ||
393 | #define pgd_present(pgd) (1) | ||
394 | #define pgd_clear(pgdp) do { } while (0) | ||
395 | #define set_pgd(pgd,pgdp) do { } while (0) | ||
396 | |||
397 | /* to find an entry in a page-table-directory */ | ||
398 | #define pgd_index(addr) ((addr) >> PGDIR_SHIFT) | ||
399 | |||
400 | #define pgd_offset(mm, addr) ((mm)->pgd+pgd_index(addr)) | ||
401 | |||
402 | /* to find an entry in a kernel page-table-directory */ | ||
403 | #define pgd_offset_k(addr) pgd_offset(&init_mm, addr) | ||
404 | |||
405 | /* Find an entry in the second-level page table.. */ | ||
406 | #define pmd_offset(dir, addr) ((pmd_t *)(dir)) | ||
407 | |||
408 | /* Find an entry in the third-level page table.. */ | ||
409 | #define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | ||
410 | |||
411 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 405 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
412 | { | 406 | { |
413 | const unsigned long mask = L_PTE_EXEC | L_PTE_WRITE | L_PTE_USER; | 407 | const pteval_t mask = L_PTE_XN | L_PTE_RDONLY | L_PTE_USER; |
414 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); | 408 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); |
415 | return pte; | 409 | return pte; |
416 | } | 410 | } |
417 | 411 | ||
418 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | ||
419 | |||
420 | /* | 412 | /* |
421 | * Encode and decode a swap entry. Swap entries are stored in the Linux | 413 | * Encode and decode a swap entry. Swap entries are stored in the Linux |
422 | * page tables as follows: | 414 | * page tables as follows: |
@@ -481,6 +473,9 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
481 | 473 | ||
482 | #define pgtable_cache_init() do { } while (0) | 474 | #define pgtable_cache_init() do { } while (0) |
483 | 475 | ||
476 | void identity_mapping_add(pgd_t *, unsigned long, unsigned long); | ||
477 | void identity_mapping_del(pgd_t *, unsigned long, unsigned long); | ||
478 | |||
484 | #endif /* !__ASSEMBLY__ */ | 479 | #endif /* !__ASSEMBLY__ */ |
485 | 480 | ||
486 | #endif /* CONFIG_MMU */ | 481 | #endif /* CONFIG_MMU */ |
diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h new file mode 100644 index 000000000000..a84628be1a7b --- /dev/null +++ b/arch/arm/include/asm/sched_clock.h | |||
@@ -0,0 +1,118 @@ | |||
1 | /* | ||
2 | * sched_clock.h: support for extending counters to full 64-bit ns counter | ||
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 | #ifndef ASM_SCHED_CLOCK | ||
9 | #define ASM_SCHED_CLOCK | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/types.h> | ||
13 | |||
14 | struct clock_data { | ||
15 | u64 epoch_ns; | ||
16 | u32 epoch_cyc; | ||
17 | u32 epoch_cyc_copy; | ||
18 | u32 mult; | ||
19 | u32 shift; | ||
20 | }; | ||
21 | |||
22 | #define DEFINE_CLOCK_DATA(name) struct clock_data name | ||
23 | |||
24 | static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift) | ||
25 | { | ||
26 | return (cyc * mult) >> shift; | ||
27 | } | ||
28 | |||
29 | /* | ||
30 | * Atomically update the sched_clock epoch. Your update callback will | ||
31 | * be called from a timer before the counter wraps - read the current | ||
32 | * counter value, and call this function to safely move the epochs | ||
33 | * forward. Only use this from the update callback. | ||
34 | */ | ||
35 | static inline void update_sched_clock(struct clock_data *cd, u32 cyc, u32 mask) | ||
36 | { | ||
37 | unsigned long flags; | ||
38 | u64 ns = cd->epoch_ns + | ||
39 | cyc_to_ns((cyc - cd->epoch_cyc) & mask, cd->mult, cd->shift); | ||
40 | |||
41 | /* | ||
42 | * Write epoch_cyc and epoch_ns in a way that the update is | ||
43 | * detectable in cyc_to_fixed_sched_clock(). | ||
44 | */ | ||
45 | raw_local_irq_save(flags); | ||
46 | cd->epoch_cyc = cyc; | ||
47 | smp_wmb(); | ||
48 | cd->epoch_ns = ns; | ||
49 | smp_wmb(); | ||
50 | cd->epoch_cyc_copy = cyc; | ||
51 | raw_local_irq_restore(flags); | ||
52 | } | ||
53 | |||
54 | /* | ||
55 | * If your clock rate is known at compile time, using this will allow | ||
56 | * you to optimize the mult/shift loads away. This is paired with | ||
57 | * init_fixed_sched_clock() to ensure that your mult/shift are correct. | ||
58 | */ | ||
59 | static inline unsigned long long cyc_to_fixed_sched_clock(struct clock_data *cd, | ||
60 | u32 cyc, u32 mask, u32 mult, u32 shift) | ||
61 | { | ||
62 | u64 epoch_ns; | ||
63 | u32 epoch_cyc; | ||
64 | |||
65 | /* | ||
66 | * Load the epoch_cyc and epoch_ns atomically. We do this by | ||
67 | * ensuring that we always write epoch_cyc, epoch_ns and | ||
68 | * epoch_cyc_copy in strict order, and read them in strict order. | ||
69 | * If epoch_cyc and epoch_cyc_copy are not equal, then we're in | ||
70 | * the middle of an update, and we should repeat the load. | ||
71 | */ | ||
72 | do { | ||
73 | epoch_cyc = cd->epoch_cyc; | ||
74 | smp_rmb(); | ||
75 | epoch_ns = cd->epoch_ns; | ||
76 | smp_rmb(); | ||
77 | } while (epoch_cyc != cd->epoch_cyc_copy); | ||
78 | |||
79 | return epoch_ns + cyc_to_ns((cyc - epoch_cyc) & mask, mult, shift); | ||
80 | } | ||
81 | |||
82 | /* | ||
83 | * Otherwise, you need to use this, which will obtain the mult/shift | ||
84 | * from the clock_data structure. Use init_sched_clock() with this. | ||
85 | */ | ||
86 | static inline unsigned long long cyc_to_sched_clock(struct clock_data *cd, | ||
87 | u32 cyc, u32 mask) | ||
88 | { | ||
89 | return cyc_to_fixed_sched_clock(cd, cyc, mask, cd->mult, cd->shift); | ||
90 | } | ||
91 | |||
92 | /* | ||
93 | * Initialize the clock data - calculate the appropriate multiplier | ||
94 | * and shift. Also setup a timer to ensure that the epoch is refreshed | ||
95 | * at the appropriate time interval, which will call your update | ||
96 | * handler. | ||
97 | */ | ||
98 | void init_sched_clock(struct clock_data *, void (*)(void), | ||
99 | unsigned int, unsigned long); | ||
100 | |||
101 | /* | ||
102 | * Use this initialization function rather than init_sched_clock() if | ||
103 | * you're using cyc_to_fixed_sched_clock, which will warn if your | ||
104 | * constants are incorrect. | ||
105 | */ | ||
106 | static inline void init_fixed_sched_clock(struct clock_data *cd, | ||
107 | void (*update)(void), unsigned int bits, unsigned long rate, | ||
108 | u32 mult, u32 shift) | ||
109 | { | ||
110 | init_sched_clock(cd, update, bits, rate); | ||
111 | if (cd->mult != mult || cd->shift != shift) { | ||
112 | pr_crit("sched_clock: wrong multiply/shift: %u>>%u vs calculated %u>>%u\n" | ||
113 | "sched_clock: fix multiply/shift to avoid scheduler hiccups\n", | ||
114 | mult, shift, cd->mult, cd->shift); | ||
115 | } | ||
116 | } | ||
117 | |||
118 | #endif | ||
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 3d05190797cb..96ed521f2408 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
@@ -33,27 +33,23 @@ struct seq_file; | |||
33 | /* | 33 | /* |
34 | * generate IPI list text | 34 | * generate IPI list text |
35 | */ | 35 | */ |
36 | extern void show_ipi_list(struct seq_file *p); | 36 | extern void show_ipi_list(struct seq_file *, int); |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * Called from assembly code, this handles an IPI. | 39 | * Called from assembly code, this handles an IPI. |
40 | */ | 40 | */ |
41 | asmlinkage void do_IPI(struct pt_regs *regs); | 41 | asmlinkage void do_IPI(int ipinr, struct pt_regs *regs); |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * Setup the set of possible CPUs (via set_cpu_possible) | 44 | * Setup the set of possible CPUs (via set_cpu_possible) |
45 | */ | 45 | */ |
46 | extern void smp_init_cpus(void); | 46 | extern void smp_init_cpus(void); |
47 | 47 | ||
48 | /* | ||
49 | * Move global data into per-processor storage. | ||
50 | */ | ||
51 | extern void smp_store_cpu_info(unsigned int cpuid); | ||
52 | 48 | ||
53 | /* | 49 | /* |
54 | * Raise an IPI cross call on CPUs in callmap. | 50 | * Raise an IPI cross call on CPUs in callmap. |
55 | */ | 51 | */ |
56 | extern void smp_cross_call(const struct cpumask *mask); | 52 | extern void smp_cross_call(const struct cpumask *mask, int ipi); |
57 | 53 | ||
58 | /* | 54 | /* |
59 | * Boot a secondary CPU, and assign it the specified idle task. | 55 | * Boot a secondary CPU, and assign it the specified idle task. |
@@ -73,6 +69,11 @@ asmlinkage void secondary_start_kernel(void); | |||
73 | extern void platform_secondary_init(unsigned int cpu); | 69 | extern void platform_secondary_init(unsigned int cpu); |
74 | 70 | ||
75 | /* | 71 | /* |
72 | * Initialize cpu_possible map, and enable coherency | ||
73 | */ | ||
74 | extern void platform_smp_prepare_cpus(unsigned int); | ||
75 | |||
76 | /* | ||
76 | * Initial data for bringing up a secondary CPU. | 77 | * Initial data for bringing up a secondary CPU. |
77 | */ | 78 | */ |
78 | struct secondary_data { | 79 | struct secondary_data { |
@@ -97,6 +98,6 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | |||
97 | /* | 98 | /* |
98 | * show local interrupt info | 99 | * show local interrupt info |
99 | */ | 100 | */ |
100 | extern void show_local_irqs(struct seq_file *); | 101 | extern void show_local_irqs(struct seq_file *, int); |
101 | 102 | ||
102 | #endif /* ifndef __ASM_ARM_SMP_H */ | 103 | #endif /* ifndef __ASM_ARM_SMP_H */ |
diff --git a/arch/arm/include/asm/smp_mpidr.h b/arch/arm/include/asm/smp_mpidr.h deleted file mode 100644 index 6a9307d64900..000000000000 --- a/arch/arm/include/asm/smp_mpidr.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef ASMARM_SMP_MIDR_H | ||
2 | #define ASMARM_SMP_MIDR_H | ||
3 | |||
4 | #define hard_smp_processor_id() \ | ||
5 | ({ \ | ||
6 | unsigned int cpunum; \ | ||
7 | __asm__("\n" \ | ||
8 | "1: mrc p15, 0, %0, c0, c0, 5\n" \ | ||
9 | " .pushsection \".alt.smp.init\", \"a\"\n"\ | ||
10 | " .long 1b\n" \ | ||
11 | " mov %0, #0\n" \ | ||
12 | " .popsection" \ | ||
13 | : "=r" (cpunum)); \ | ||
14 | cpunum &= 0x0F; \ | ||
15 | }) | ||
16 | |||
17 | #endif | ||
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h index 634f357be6bb..fed9981fba08 100644 --- a/arch/arm/include/asm/smp_twd.h +++ b/arch/arm/include/asm/smp_twd.h | |||
@@ -22,7 +22,6 @@ struct clock_event_device; | |||
22 | 22 | ||
23 | extern void __iomem *twd_base; | 23 | extern void __iomem *twd_base; |
24 | 24 | ||
25 | void twd_timer_stop(void); | ||
26 | int twd_timer_ack(void); | 25 | int twd_timer_ack(void); |
27 | void twd_timer_setup(struct clock_event_device *); | 26 | void twd_timer_setup(struct clock_event_device *); |
28 | 27 | ||
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 80025948b8ad..97f6d60297d5 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
@@ -63,6 +63,11 @@ | |||
63 | #include <asm/outercache.h> | 63 | #include <asm/outercache.h> |
64 | 64 | ||
65 | #define __exception __attribute__((section(".exception.text"))) | 65 | #define __exception __attribute__((section(".exception.text"))) |
66 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
67 | #define __exception_irq_entry __irq_entry | ||
68 | #else | ||
69 | #define __exception_irq_entry __exception | ||
70 | #endif | ||
66 | 71 | ||
67 | struct thread_info; | 72 | struct thread_info; |
68 | struct task_struct; | 73 | struct task_struct; |
@@ -119,6 +124,13 @@ extern unsigned int user_debug; | |||
119 | #define vectors_high() (0) | 124 | #define vectors_high() (0) |
120 | #endif | 125 | #endif |
121 | 126 | ||
127 | #if __LINUX_ARM_ARCH__ >= 7 || \ | ||
128 | (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K)) | ||
129 | #define sev() __asm__ __volatile__ ("sev" : : : "memory") | ||
130 | #define wfe() __asm__ __volatile__ ("wfe" : : : "memory") | ||
131 | #define wfi() __asm__ __volatile__ ("wfi" : : : "memory") | ||
132 | #endif | ||
133 | |||
122 | #if __LINUX_ARM_ARCH__ >= 7 | 134 | #if __LINUX_ARM_ARCH__ >= 7 |
123 | #define isb() __asm__ __volatile__ ("isb" : : : "memory") | 135 | #define isb() __asm__ __volatile__ ("isb" : : : "memory") |
124 | #define dsb() __asm__ __volatile__ ("dsb" : : : "memory") | 136 | #define dsb() __asm__ __volatile__ ("dsb" : : : "memory") |
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h index 491960bf4260..1b960d5ef6a5 100644 --- a/arch/arm/include/asm/traps.h +++ b/arch/arm/include/asm/traps.h | |||
@@ -15,16 +15,37 @@ struct undef_hook { | |||
15 | void register_undef_hook(struct undef_hook *hook); | 15 | void register_undef_hook(struct undef_hook *hook); |
16 | void unregister_undef_hook(struct undef_hook *hook); | 16 | void unregister_undef_hook(struct undef_hook *hook); |
17 | 17 | ||
18 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
19 | static inline int __in_irqentry_text(unsigned long ptr) | ||
20 | { | ||
21 | extern char __irqentry_text_start[]; | ||
22 | extern char __irqentry_text_end[]; | ||
23 | |||
24 | return ptr >= (unsigned long)&__irqentry_text_start && | ||
25 | ptr < (unsigned long)&__irqentry_text_end; | ||
26 | } | ||
27 | #else | ||
28 | static inline int __in_irqentry_text(unsigned long ptr) | ||
29 | { | ||
30 | return 0; | ||
31 | } | ||
32 | #endif | ||
33 | |||
18 | static inline int in_exception_text(unsigned long ptr) | 34 | static inline int in_exception_text(unsigned long ptr) |
19 | { | 35 | { |
20 | extern char __exception_text_start[]; | 36 | extern char __exception_text_start[]; |
21 | extern char __exception_text_end[]; | 37 | extern char __exception_text_end[]; |
38 | int in; | ||
22 | 39 | ||
23 | return ptr >= (unsigned long)&__exception_text_start && | 40 | in = ptr >= (unsigned long)&__exception_text_start && |
24 | ptr < (unsigned long)&__exception_text_end; | 41 | ptr < (unsigned long)&__exception_text_end; |
42 | |||
43 | return in ? : __in_irqentry_text(ptr); | ||
25 | } | 44 | } |
26 | 45 | ||
27 | extern void __init early_trap_init(void); | 46 | extern void __init early_trap_init(void); |
28 | extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); | 47 | extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); |
29 | 48 | ||
49 | extern void *vectors_page; | ||
50 | |||
30 | #endif | 51 | #endif |
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 33e4a48fe103..b293616a1a1a 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h | |||
@@ -227,7 +227,7 @@ do { \ | |||
227 | 227 | ||
228 | #define __get_user_asm_byte(x,addr,err) \ | 228 | #define __get_user_asm_byte(x,addr,err) \ |
229 | __asm__ __volatile__( \ | 229 | __asm__ __volatile__( \ |
230 | "1: ldrbt %1,[%2]\n" \ | 230 | "1: " T(ldrb) " %1,[%2],#0\n" \ |
231 | "2:\n" \ | 231 | "2:\n" \ |
232 | " .pushsection .fixup,\"ax\"\n" \ | 232 | " .pushsection .fixup,\"ax\"\n" \ |
233 | " .align 2\n" \ | 233 | " .align 2\n" \ |
@@ -263,7 +263,7 @@ do { \ | |||
263 | 263 | ||
264 | #define __get_user_asm_word(x,addr,err) \ | 264 | #define __get_user_asm_word(x,addr,err) \ |
265 | __asm__ __volatile__( \ | 265 | __asm__ __volatile__( \ |
266 | "1: ldrt %1,[%2]\n" \ | 266 | "1: " T(ldr) " %1,[%2],#0\n" \ |
267 | "2:\n" \ | 267 | "2:\n" \ |
268 | " .pushsection .fixup,\"ax\"\n" \ | 268 | " .pushsection .fixup,\"ax\"\n" \ |
269 | " .align 2\n" \ | 269 | " .align 2\n" \ |
@@ -308,7 +308,7 @@ do { \ | |||
308 | 308 | ||
309 | #define __put_user_asm_byte(x,__pu_addr,err) \ | 309 | #define __put_user_asm_byte(x,__pu_addr,err) \ |
310 | __asm__ __volatile__( \ | 310 | __asm__ __volatile__( \ |
311 | "1: strbt %1,[%2]\n" \ | 311 | "1: " T(strb) " %1,[%2],#0\n" \ |
312 | "2:\n" \ | 312 | "2:\n" \ |
313 | " .pushsection .fixup,\"ax\"\n" \ | 313 | " .pushsection .fixup,\"ax\"\n" \ |
314 | " .align 2\n" \ | 314 | " .align 2\n" \ |
@@ -341,7 +341,7 @@ do { \ | |||
341 | 341 | ||
342 | #define __put_user_asm_word(x,__pu_addr,err) \ | 342 | #define __put_user_asm_word(x,__pu_addr,err) \ |
343 | __asm__ __volatile__( \ | 343 | __asm__ __volatile__( \ |
344 | "1: strt %1,[%2]\n" \ | 344 | "1: " T(str) " %1,[%2],#0\n" \ |
345 | "2:\n" \ | 345 | "2:\n" \ |
346 | " .pushsection .fixup,\"ax\"\n" \ | 346 | " .pushsection .fixup,\"ax\"\n" \ |
347 | " .align 2\n" \ | 347 | " .align 2\n" \ |
@@ -366,10 +366,10 @@ do { \ | |||
366 | 366 | ||
367 | #define __put_user_asm_dword(x,__pu_addr,err) \ | 367 | #define __put_user_asm_dword(x,__pu_addr,err) \ |
368 | __asm__ __volatile__( \ | 368 | __asm__ __volatile__( \ |
369 | ARM( "1: strt " __reg_oper1 ", [%1], #4\n" ) \ | 369 | ARM( "1: " T(str) " " __reg_oper1 ", [%1], #4\n" ) \ |
370 | ARM( "2: strt " __reg_oper0 ", [%1]\n" ) \ | 370 | ARM( "2: " T(str) " " __reg_oper0 ", [%1]\n" ) \ |
371 | THUMB( "1: strt " __reg_oper1 ", [%1]\n" ) \ | 371 | THUMB( "1: " T(str) " " __reg_oper1 ", [%1]\n" ) \ |
372 | THUMB( "2: strt " __reg_oper0 ", [%1, #4]\n" ) \ | 372 | THUMB( "2: " T(str) " " __reg_oper0 ", [%1, #4]\n" ) \ |
373 | "3:\n" \ | 373 | "3:\n" \ |
374 | " .pushsection .fixup,\"ax\"\n" \ | 374 | " .pushsection .fixup,\"ax\"\n" \ |
375 | " .align 2\n" \ | 375 | " .align 2\n" \ |
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 5b9b268f4fbb..185ee822c935 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET) | 5 | CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET) |
6 | AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) | 6 | AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) |
7 | 7 | ||
8 | ifdef CONFIG_DYNAMIC_FTRACE | 8 | ifdef CONFIG_FUNCTION_TRACER |
9 | CFLAGS_REMOVE_ftrace.o = -pg | 9 | CFLAGS_REMOVE_ftrace.o = -pg |
10 | endif | 10 | endif |
11 | 11 | ||
@@ -29,10 +29,12 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o | |||
29 | obj-$(CONFIG_ARTHUR) += arthur.o | 29 | obj-$(CONFIG_ARTHUR) += arthur.o |
30 | obj-$(CONFIG_ISA_DMA) += dma-isa.o | 30 | obj-$(CONFIG_ISA_DMA) += dma-isa.o |
31 | obj-$(CONFIG_PCI) += bios32.o isa.o | 31 | obj-$(CONFIG_PCI) += bios32.o isa.o |
32 | obj-$(CONFIG_SMP) += smp.o | 32 | obj-$(CONFIG_HAVE_SCHED_CLOCK) += sched_clock.o |
33 | obj-$(CONFIG_SMP) += smp.o smp_tlb.o | ||
33 | obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o | 34 | obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o |
34 | obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o | 35 | obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o |
35 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | 36 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o |
37 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o | ||
36 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | 38 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o |
37 | obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o | 39 | obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o |
38 | obj-$(CONFIG_ATAGS_PROC) += atags.o | 40 | obj-$(CONFIG_ATAGS_PROC) += atags.o |
@@ -42,6 +44,8 @@ obj-$(CONFIG_KGDB) += kgdb.o | |||
42 | obj-$(CONFIG_ARM_UNWIND) += unwind.o | 44 | obj-$(CONFIG_ARM_UNWIND) += unwind.o |
43 | obj-$(CONFIG_HAVE_TCM) += tcm.o | 45 | obj-$(CONFIG_HAVE_TCM) += tcm.o |
44 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 46 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
47 | obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o | ||
48 | CFLAGS_swp_emulate.o := -Wa,-march=armv7-a | ||
45 | obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o | 49 | obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o |
46 | 50 | ||
47 | obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o | 51 | obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o |
@@ -50,6 +54,7 @@ AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 | |||
50 | obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o | 54 | obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o |
51 | obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o | 55 | obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o |
52 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o | 56 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o |
57 | obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o | ||
53 | obj-$(CONFIG_IWMMXT) += iwmmxt.o | 58 | obj-$(CONFIG_IWMMXT) += iwmmxt.o |
54 | obj-$(CONFIG_CPU_HAS_PMU) += pmu.o | 59 | obj-$(CONFIG_CPU_HAS_PMU) += pmu.o |
55 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o | 60 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index bb96a7d4bbf5..2b46fea36c9f 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -25,42 +25,22 @@ | |||
25 | #include <asm/tls.h> | 25 | #include <asm/tls.h> |
26 | 26 | ||
27 | #include "entry-header.S" | 27 | #include "entry-header.S" |
28 | #include <asm/entry-macro-multi.S> | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Interrupt handling. Preserves r7, r8, r9 | 31 | * Interrupt handling. Preserves r7, r8, r9 |
31 | */ | 32 | */ |
32 | .macro irq_handler | 33 | .macro irq_handler |
33 | get_irqnr_preamble r5, lr | 34 | #ifdef CONFIG_MULTI_IRQ_HANDLER |
34 | 1: get_irqnr_and_base r0, r6, r5, lr | 35 | ldr r5, =handle_arch_irq |
35 | movne r1, sp | 36 | mov r0, sp |
36 | @ | 37 | ldr r5, [r5] |
37 | @ routine called with r0 = irq number, r1 = struct pt_regs * | 38 | adr lr, BSYM(9997f) |
38 | @ | 39 | teq r5, #0 |
39 | adrne lr, BSYM(1b) | 40 | movne pc, r5 |
40 | bne asm_do_IRQ | ||
41 | |||
42 | #ifdef CONFIG_SMP | ||
43 | /* | ||
44 | * XXX | ||
45 | * | ||
46 | * this macro assumes that irqstat (r6) and base (r5) are | ||
47 | * preserved from get_irqnr_and_base above | ||
48 | */ | ||
49 | ALT_SMP(test_for_ipi r0, r6, r5, lr) | ||
50 | ALT_UP_B(9997f) | ||
51 | movne r0, sp | ||
52 | adrne lr, BSYM(1b) | ||
53 | bne do_IPI | ||
54 | |||
55 | #ifdef CONFIG_LOCAL_TIMERS | ||
56 | test_for_ltirq r0, r6, r5, lr | ||
57 | movne r0, sp | ||
58 | adrne lr, BSYM(1b) | ||
59 | bne do_local_timer | ||
60 | #endif | 41 | #endif |
42 | arch_irq_handler_default | ||
61 | 9997: | 43 | 9997: |
62 | #endif | ||
63 | |||
64 | .endm | 44 | .endm |
65 | 45 | ||
66 | #ifdef CONFIG_KPROBES | 46 | #ifdef CONFIG_KPROBES |
@@ -198,6 +178,7 @@ __dabt_svc: | |||
198 | @ | 178 | @ |
199 | @ set desired IRQ state, then call main handler | 179 | @ set desired IRQ state, then call main handler |
200 | @ | 180 | @ |
181 | debug_entry r1 | ||
201 | msr cpsr_c, r9 | 182 | msr cpsr_c, r9 |
202 | mov r2, sp | 183 | mov r2, sp |
203 | bl do_DataAbort | 184 | bl do_DataAbort |
@@ -324,6 +305,7 @@ __pabt_svc: | |||
324 | #else | 305 | #else |
325 | bl CPU_PABORT_HANDLER | 306 | bl CPU_PABORT_HANDLER |
326 | #endif | 307 | #endif |
308 | debug_entry r1 | ||
327 | msr cpsr_c, r9 @ Maybe enable interrupts | 309 | msr cpsr_c, r9 @ Maybe enable interrupts |
328 | mov r2, sp @ regs | 310 | mov r2, sp @ regs |
329 | bl do_PrefetchAbort @ call abort handler | 311 | bl do_PrefetchAbort @ call abort handler |
@@ -439,6 +421,7 @@ __dabt_usr: | |||
439 | @ | 421 | @ |
440 | @ IRQs on, then call the main handler | 422 | @ IRQs on, then call the main handler |
441 | @ | 423 | @ |
424 | debug_entry r1 | ||
442 | enable_irq | 425 | enable_irq |
443 | mov r2, sp | 426 | mov r2, sp |
444 | adr lr, BSYM(ret_from_exception) | 427 | adr lr, BSYM(ret_from_exception) |
@@ -703,6 +686,7 @@ __pabt_usr: | |||
703 | #else | 686 | #else |
704 | bl CPU_PABORT_HANDLER | 687 | bl CPU_PABORT_HANDLER |
705 | #endif | 688 | #endif |
689 | debug_entry r1 | ||
706 | enable_irq @ Enable interrupts | 690 | enable_irq @ Enable interrupts |
707 | mov r2, sp @ regs | 691 | mov r2, sp @ regs |
708 | bl do_PrefetchAbort @ call abort handler | 692 | bl do_PrefetchAbort @ call abort handler |
@@ -735,7 +719,7 @@ ENTRY(__switch_to) | |||
735 | THUMB( stmia ip!, {r4 - sl, fp} ) @ Store most regs on stack | 719 | THUMB( stmia ip!, {r4 - sl, fp} ) @ Store most regs on stack |
736 | THUMB( str sp, [ip], #4 ) | 720 | THUMB( str sp, [ip], #4 ) |
737 | THUMB( str lr, [ip], #4 ) | 721 | THUMB( str lr, [ip], #4 ) |
738 | #ifdef CONFIG_MMU | 722 | #ifdef CONFIG_CPU_USE_DOMAINS |
739 | ldr r6, [r2, #TI_CPU_DOMAIN] | 723 | ldr r6, [r2, #TI_CPU_DOMAIN] |
740 | #endif | 724 | #endif |
741 | set_tls r3, r4, r5 | 725 | set_tls r3, r4, r5 |
@@ -744,7 +728,7 @@ ENTRY(__switch_to) | |||
744 | ldr r8, =__stack_chk_guard | 728 | ldr r8, =__stack_chk_guard |
745 | ldr r7, [r7, #TSK_STACK_CANARY] | 729 | ldr r7, [r7, #TSK_STACK_CANARY] |
746 | #endif | 730 | #endif |
747 | #ifdef CONFIG_MMU | 731 | #ifdef CONFIG_CPU_USE_DOMAINS |
748 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register | 732 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register |
749 | #endif | 733 | #endif |
750 | mov r5, r0 | 734 | mov r5, r0 |
@@ -842,7 +826,7 @@ __kuser_helper_start: | |||
842 | */ | 826 | */ |
843 | 827 | ||
844 | __kuser_memory_barrier: @ 0xffff0fa0 | 828 | __kuser_memory_barrier: @ 0xffff0fa0 |
845 | smp_dmb | 829 | smp_dmb arm |
846 | usr_ret lr | 830 | usr_ret lr |
847 | 831 | ||
848 | .align 5 | 832 | .align 5 |
@@ -959,7 +943,7 @@ kuser_cmpxchg_fixup: | |||
959 | 943 | ||
960 | #else | 944 | #else |
961 | 945 | ||
962 | smp_dmb | 946 | smp_dmb arm |
963 | 1: ldrex r3, [r2] | 947 | 1: ldrex r3, [r2] |
964 | subs r3, r3, r0 | 948 | subs r3, r3, r0 |
965 | strexeq r3, r1, [r2] | 949 | strexeq r3, r1, [r2] |
@@ -1245,3 +1229,9 @@ cr_alignment: | |||
1245 | .space 4 | 1229 | .space 4 |
1246 | cr_no_alignment: | 1230 | cr_no_alignment: |
1247 | .space 4 | 1231 | .space 4 |
1232 | |||
1233 | #ifdef CONFIG_MULTI_IRQ_HANDLER | ||
1234 | .globl handle_arch_irq | ||
1235 | handle_arch_irq: | ||
1236 | .space 4 | ||
1237 | #endif | ||
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 80bf8cd88d7c..1e7b04a40a31 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -147,98 +147,170 @@ ENDPROC(ret_from_fork) | |||
147 | #endif | 147 | #endif |
148 | #endif | 148 | #endif |
149 | 149 | ||
150 | #ifdef CONFIG_DYNAMIC_FTRACE | 150 | .macro __mcount suffix |
151 | ENTRY(__gnu_mcount_nc) | 151 | mcount_enter |
152 | mov ip, lr | 152 | ldr r0, =ftrace_trace_function |
153 | ldmia sp!, {lr} | 153 | ldr r2, [r0] |
154 | mov pc, ip | 154 | adr r0, .Lftrace_stub |
155 | ENDPROC(__gnu_mcount_nc) | 155 | cmp r0, r2 |
156 | bne 1f | ||
157 | |||
158 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
159 | ldr r1, =ftrace_graph_return | ||
160 | ldr r2, [r1] | ||
161 | cmp r0, r2 | ||
162 | bne ftrace_graph_caller\suffix | ||
163 | |||
164 | ldr r1, =ftrace_graph_entry | ||
165 | ldr r2, [r1] | ||
166 | ldr r0, =ftrace_graph_entry_stub | ||
167 | cmp r0, r2 | ||
168 | bne ftrace_graph_caller\suffix | ||
169 | #endif | ||
156 | 170 | ||
157 | ENTRY(ftrace_caller) | 171 | mcount_exit |
158 | stmdb sp!, {r0-r3, lr} | 172 | |
159 | mov r0, lr | 173 | 1: mcount_get_lr r1 @ lr of instrumented func |
174 | mov r0, lr @ instrumented function | ||
175 | sub r0, r0, #MCOUNT_INSN_SIZE | ||
176 | adr lr, BSYM(2f) | ||
177 | mov pc, r2 | ||
178 | 2: mcount_exit | ||
179 | .endm | ||
180 | |||
181 | .macro __ftrace_caller suffix | ||
182 | mcount_enter | ||
183 | |||
184 | mcount_get_lr r1 @ lr of instrumented func | ||
185 | mov r0, lr @ instrumented function | ||
160 | sub r0, r0, #MCOUNT_INSN_SIZE | 186 | sub r0, r0, #MCOUNT_INSN_SIZE |
161 | ldr r1, [sp, #20] | ||
162 | 187 | ||
163 | .global ftrace_call | 188 | .globl ftrace_call\suffix |
164 | ftrace_call: | 189 | ftrace_call\suffix: |
165 | bl ftrace_stub | 190 | bl ftrace_stub |
166 | ldmia sp!, {r0-r3, ip, lr} | 191 | |
167 | mov pc, ip | 192 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
168 | ENDPROC(ftrace_caller) | 193 | .globl ftrace_graph_call\suffix |
194 | ftrace_graph_call\suffix: | ||
195 | mov r0, r0 | ||
196 | #endif | ||
197 | |||
198 | mcount_exit | ||
199 | .endm | ||
200 | |||
201 | .macro __ftrace_graph_caller | ||
202 | sub r0, fp, #4 @ &lr of instrumented routine (&parent) | ||
203 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
204 | @ called from __ftrace_caller, saved in mcount_enter | ||
205 | ldr r1, [sp, #16] @ instrumented routine (func) | ||
206 | #else | ||
207 | @ called from __mcount, untouched in lr | ||
208 | mov r1, lr @ instrumented routine (func) | ||
209 | #endif | ||
210 | sub r1, r1, #MCOUNT_INSN_SIZE | ||
211 | mov r2, fp @ frame pointer | ||
212 | bl prepare_ftrace_return | ||
213 | mcount_exit | ||
214 | .endm | ||
169 | 215 | ||
170 | #ifdef CONFIG_OLD_MCOUNT | 216 | #ifdef CONFIG_OLD_MCOUNT |
217 | /* | ||
218 | * mcount | ||
219 | */ | ||
220 | |||
221 | .macro mcount_enter | ||
222 | stmdb sp!, {r0-r3, lr} | ||
223 | .endm | ||
224 | |||
225 | .macro mcount_get_lr reg | ||
226 | ldr \reg, [fp, #-4] | ||
227 | .endm | ||
228 | |||
229 | .macro mcount_exit | ||
230 | ldr lr, [fp, #-4] | ||
231 | ldmia sp!, {r0-r3, pc} | ||
232 | .endm | ||
233 | |||
171 | ENTRY(mcount) | 234 | ENTRY(mcount) |
235 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
172 | stmdb sp!, {lr} | 236 | stmdb sp!, {lr} |
173 | ldr lr, [fp, #-4] | 237 | ldr lr, [fp, #-4] |
174 | ldmia sp!, {pc} | 238 | ldmia sp!, {pc} |
239 | #else | ||
240 | __mcount _old | ||
241 | #endif | ||
175 | ENDPROC(mcount) | 242 | ENDPROC(mcount) |
176 | 243 | ||
244 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
177 | ENTRY(ftrace_caller_old) | 245 | ENTRY(ftrace_caller_old) |
178 | stmdb sp!, {r0-r3, lr} | 246 | __ftrace_caller _old |
179 | ldr r1, [fp, #-4] | ||
180 | mov r0, lr | ||
181 | sub r0, r0, #MCOUNT_INSN_SIZE | ||
182 | |||
183 | .globl ftrace_call_old | ||
184 | ftrace_call_old: | ||
185 | bl ftrace_stub | ||
186 | ldr lr, [fp, #-4] @ restore lr | ||
187 | ldmia sp!, {r0-r3, pc} | ||
188 | ENDPROC(ftrace_caller_old) | 247 | ENDPROC(ftrace_caller_old) |
189 | #endif | 248 | #endif |
190 | 249 | ||
191 | #else | 250 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
251 | ENTRY(ftrace_graph_caller_old) | ||
252 | __ftrace_graph_caller | ||
253 | ENDPROC(ftrace_graph_caller_old) | ||
254 | #endif | ||
192 | 255 | ||
193 | ENTRY(__gnu_mcount_nc) | 256 | .purgem mcount_enter |
257 | .purgem mcount_get_lr | ||
258 | .purgem mcount_exit | ||
259 | #endif | ||
260 | |||
261 | /* | ||
262 | * __gnu_mcount_nc | ||
263 | */ | ||
264 | |||
265 | .macro mcount_enter | ||
194 | stmdb sp!, {r0-r3, lr} | 266 | stmdb sp!, {r0-r3, lr} |
195 | ldr r0, =ftrace_trace_function | 267 | .endm |
196 | ldr r2, [r0] | 268 | |
197 | adr r0, .Lftrace_stub | 269 | .macro mcount_get_lr reg |
198 | cmp r0, r2 | 270 | ldr \reg, [sp, #20] |
199 | bne gnu_trace | 271 | .endm |
272 | |||
273 | .macro mcount_exit | ||
200 | ldmia sp!, {r0-r3, ip, lr} | 274 | ldmia sp!, {r0-r3, ip, lr} |
201 | mov pc, ip | 275 | mov pc, ip |
276 | .endm | ||
202 | 277 | ||
203 | gnu_trace: | 278 | ENTRY(__gnu_mcount_nc) |
204 | ldr r1, [sp, #20] @ lr of instrumented routine | 279 | #ifdef CONFIG_DYNAMIC_FTRACE |
205 | mov r0, lr | 280 | mov ip, lr |
206 | sub r0, r0, #MCOUNT_INSN_SIZE | 281 | ldmia sp!, {lr} |
207 | adr lr, BSYM(1f) | ||
208 | mov pc, r2 | ||
209 | 1: | ||
210 | ldmia sp!, {r0-r3, ip, lr} | ||
211 | mov pc, ip | 282 | mov pc, ip |
283 | #else | ||
284 | __mcount | ||
285 | #endif | ||
212 | ENDPROC(__gnu_mcount_nc) | 286 | ENDPROC(__gnu_mcount_nc) |
213 | 287 | ||
214 | #ifdef CONFIG_OLD_MCOUNT | 288 | #ifdef CONFIG_DYNAMIC_FTRACE |
215 | /* | 289 | ENTRY(ftrace_caller) |
216 | * This is under an ifdef in order to force link-time errors for people trying | 290 | __ftrace_caller |
217 | * to build with !FRAME_POINTER with a GCC which doesn't use the new-style | 291 | ENDPROC(ftrace_caller) |
218 | * mcount. | 292 | #endif |
219 | */ | ||
220 | ENTRY(mcount) | ||
221 | stmdb sp!, {r0-r3, lr} | ||
222 | ldr r0, =ftrace_trace_function | ||
223 | ldr r2, [r0] | ||
224 | adr r0, ftrace_stub | ||
225 | cmp r0, r2 | ||
226 | bne trace | ||
227 | ldr lr, [fp, #-4] @ restore lr | ||
228 | ldmia sp!, {r0-r3, pc} | ||
229 | 293 | ||
230 | trace: | 294 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
231 | ldr r1, [fp, #-4] @ lr of instrumented routine | 295 | ENTRY(ftrace_graph_caller) |
232 | mov r0, lr | 296 | __ftrace_graph_caller |
233 | sub r0, r0, #MCOUNT_INSN_SIZE | 297 | ENDPROC(ftrace_graph_caller) |
234 | mov lr, pc | ||
235 | mov pc, r2 | ||
236 | ldr lr, [fp, #-4] @ restore lr | ||
237 | ldmia sp!, {r0-r3, pc} | ||
238 | ENDPROC(mcount) | ||
239 | #endif | 298 | #endif |
240 | 299 | ||
241 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 300 | .purgem mcount_enter |
301 | .purgem mcount_get_lr | ||
302 | .purgem mcount_exit | ||
303 | |||
304 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
305 | .globl return_to_handler | ||
306 | return_to_handler: | ||
307 | stmdb sp!, {r0-r3} | ||
308 | mov r0, fp @ frame pointer | ||
309 | bl ftrace_return_to_handler | ||
310 | mov lr, r0 @ r0 has real ret addr | ||
311 | ldmia sp!, {r0-r3} | ||
312 | mov pc, lr | ||
313 | #endif | ||
242 | 314 | ||
243 | ENTRY(ftrace_stub) | 315 | ENTRY(ftrace_stub) |
244 | .Lftrace_stub: | 316 | .Lftrace_stub: |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index d93f976fb389..ae9464900168 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -165,6 +165,25 @@ | |||
165 | .endm | 165 | .endm |
166 | #endif /* !CONFIG_THUMB2_KERNEL */ | 166 | #endif /* !CONFIG_THUMB2_KERNEL */ |
167 | 167 | ||
168 | @ | ||
169 | @ Debug exceptions are taken as prefetch or data aborts. | ||
170 | @ We must disable preemption during the handler so that | ||
171 | @ we can access the debug registers safely. | ||
172 | @ | ||
173 | .macro debug_entry, fsr | ||
174 | #if defined(CONFIG_HAVE_HW_BREAKPOINT) && defined(CONFIG_PREEMPT) | ||
175 | ldr r4, =0x40f @ mask out fsr.fs | ||
176 | and r5, r4, \fsr | ||
177 | cmp r5, #2 @ debug exception | ||
178 | bne 1f | ||
179 | get_thread_info r10 | ||
180 | ldr r6, [r10, #TI_PREEMPT] @ get preempt count | ||
181 | add r11, r6, #1 @ increment it | ||
182 | str r11, [r10, #TI_PREEMPT] | ||
183 | 1: | ||
184 | #endif | ||
185 | .endm | ||
186 | |||
168 | /* | 187 | /* |
169 | * These are the registers used in the syscall handler, and allow us to | 188 | * These are the registers used in the syscall handler, and allow us to |
170 | * have in theory up to 7 arguments to a function - r0 to r6. | 189 | * have in theory up to 7 arguments to a function - r0 to r6. |
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 6ff7919613d7..e72dc34eea1c 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <asm/fiq.h> | 45 | #include <asm/fiq.h> |
46 | #include <asm/irq.h> | 46 | #include <asm/irq.h> |
47 | #include <asm/system.h> | 47 | #include <asm/system.h> |
48 | #include <asm/traps.h> | ||
48 | 49 | ||
49 | static unsigned long no_fiq_insn; | 50 | static unsigned long no_fiq_insn; |
50 | 51 | ||
@@ -67,17 +68,22 @@ static struct fiq_handler default_owner = { | |||
67 | 68 | ||
68 | static struct fiq_handler *current_fiq = &default_owner; | 69 | static struct fiq_handler *current_fiq = &default_owner; |
69 | 70 | ||
70 | int show_fiq_list(struct seq_file *p, void *v) | 71 | int show_fiq_list(struct seq_file *p, int prec) |
71 | { | 72 | { |
72 | if (current_fiq != &default_owner) | 73 | if (current_fiq != &default_owner) |
73 | seq_printf(p, "FIQ: %s\n", current_fiq->name); | 74 | seq_printf(p, "%*s: %s\n", prec, "FIQ", |
75 | current_fiq->name); | ||
74 | 76 | ||
75 | return 0; | 77 | return 0; |
76 | } | 78 | } |
77 | 79 | ||
78 | void set_fiq_handler(void *start, unsigned int length) | 80 | void set_fiq_handler(void *start, unsigned int length) |
79 | { | 81 | { |
82 | #if defined(CONFIG_CPU_USE_DOMAINS) | ||
80 | memcpy((void *)0xffff001c, start, length); | 83 | memcpy((void *)0xffff001c, start, length); |
84 | #else | ||
85 | memcpy(vectors_page + 0x1c, start, length); | ||
86 | #endif | ||
81 | flush_icache_range(0xffff001c, 0xffff001c + length); | 87 | flush_icache_range(0xffff001c, 0xffff001c + length); |
82 | if (!vectors_high()) | 88 | if (!vectors_high()) |
83 | flush_icache_range(0x1c, 0x1c + length); | 89 | flush_icache_range(0x1c, 0x1c + length); |
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index 971ac8c36ea7..c0062ad1e847 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #define NOP 0xe8bd4000 /* pop {lr} */ | 24 | #define NOP 0xe8bd4000 /* pop {lr} */ |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
27 | #ifdef CONFIG_OLD_MCOUNT | 28 | #ifdef CONFIG_OLD_MCOUNT |
28 | #define OLD_MCOUNT_ADDR ((unsigned long) mcount) | 29 | #define OLD_MCOUNT_ADDR ((unsigned long) mcount) |
29 | #define OLD_FTRACE_ADDR ((unsigned long) ftrace_caller_old) | 30 | #define OLD_FTRACE_ADDR ((unsigned long) ftrace_caller_old) |
@@ -59,9 +60,9 @@ static unsigned long adjust_address(struct dyn_ftrace *rec, unsigned long addr) | |||
59 | } | 60 | } |
60 | #endif | 61 | #endif |
61 | 62 | ||
62 | /* construct a branch (BL) instruction to addr */ | ||
63 | #ifdef CONFIG_THUMB2_KERNEL | 63 | #ifdef CONFIG_THUMB2_KERNEL |
64 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) | 64 | static unsigned long ftrace_gen_branch(unsigned long pc, unsigned long addr, |
65 | bool link) | ||
65 | { | 66 | { |
66 | unsigned long s, j1, j2, i1, i2, imm10, imm11; | 67 | unsigned long s, j1, j2, i1, i2, imm10, imm11; |
67 | unsigned long first, second; | 68 | unsigned long first, second; |
@@ -83,15 +84,22 @@ static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) | |||
83 | j2 = (!i2) ^ s; | 84 | j2 = (!i2) ^ s; |
84 | 85 | ||
85 | first = 0xf000 | (s << 10) | imm10; | 86 | first = 0xf000 | (s << 10) | imm10; |
86 | second = 0xd000 | (j1 << 13) | (j2 << 11) | imm11; | 87 | second = 0x9000 | (j1 << 13) | (j2 << 11) | imm11; |
88 | if (link) | ||
89 | second |= 1 << 14; | ||
87 | 90 | ||
88 | return (second << 16) | first; | 91 | return (second << 16) | first; |
89 | } | 92 | } |
90 | #else | 93 | #else |
91 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) | 94 | static unsigned long ftrace_gen_branch(unsigned long pc, unsigned long addr, |
95 | bool link) | ||
92 | { | 96 | { |
97 | unsigned long opcode = 0xea000000; | ||
93 | long offset; | 98 | long offset; |
94 | 99 | ||
100 | if (link) | ||
101 | opcode |= 1 << 24; | ||
102 | |||
95 | offset = (long)addr - (long)(pc + 8); | 103 | offset = (long)addr - (long)(pc + 8); |
96 | if (unlikely(offset < -33554432 || offset > 33554428)) { | 104 | if (unlikely(offset < -33554432 || offset > 33554428)) { |
97 | /* Can't generate branches that far (from ARM ARM). Ftrace | 105 | /* Can't generate branches that far (from ARM ARM). Ftrace |
@@ -103,10 +111,15 @@ static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) | |||
103 | 111 | ||
104 | offset = (offset >> 2) & 0x00ffffff; | 112 | offset = (offset >> 2) & 0x00ffffff; |
105 | 113 | ||
106 | return 0xeb000000 | offset; | 114 | return opcode | offset; |
107 | } | 115 | } |
108 | #endif | 116 | #endif |
109 | 117 | ||
118 | static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) | ||
119 | { | ||
120 | return ftrace_gen_branch(pc, addr, true); | ||
121 | } | ||
122 | |||
110 | static int ftrace_modify_code(unsigned long pc, unsigned long old, | 123 | static int ftrace_modify_code(unsigned long pc, unsigned long old, |
111 | unsigned long new) | 124 | unsigned long new) |
112 | { | 125 | { |
@@ -193,3 +206,83 @@ int __init ftrace_dyn_arch_init(void *data) | |||
193 | 206 | ||
194 | return 0; | 207 | return 0; |
195 | } | 208 | } |
209 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
210 | |||
211 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
212 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr, | ||
213 | unsigned long frame_pointer) | ||
214 | { | ||
215 | unsigned long return_hooker = (unsigned long) &return_to_handler; | ||
216 | struct ftrace_graph_ent trace; | ||
217 | unsigned long old; | ||
218 | int err; | ||
219 | |||
220 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) | ||
221 | return; | ||
222 | |||
223 | old = *parent; | ||
224 | *parent = return_hooker; | ||
225 | |||
226 | err = ftrace_push_return_trace(old, self_addr, &trace.depth, | ||
227 | frame_pointer); | ||
228 | if (err == -EBUSY) { | ||
229 | *parent = old; | ||
230 | return; | ||
231 | } | ||
232 | |||
233 | trace.func = self_addr; | ||
234 | |||
235 | /* Only trace if the calling function expects to */ | ||
236 | if (!ftrace_graph_entry(&trace)) { | ||
237 | current->curr_ret_stack--; | ||
238 | *parent = old; | ||
239 | } | ||
240 | } | ||
241 | |||
242 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
243 | extern unsigned long ftrace_graph_call; | ||
244 | extern unsigned long ftrace_graph_call_old; | ||
245 | extern void ftrace_graph_caller_old(void); | ||
246 | |||
247 | static int __ftrace_modify_caller(unsigned long *callsite, | ||
248 | void (*func) (void), bool enable) | ||
249 | { | ||
250 | unsigned long caller_fn = (unsigned long) func; | ||
251 | unsigned long pc = (unsigned long) callsite; | ||
252 | unsigned long branch = ftrace_gen_branch(pc, caller_fn, false); | ||
253 | unsigned long nop = 0xe1a00000; /* mov r0, r0 */ | ||
254 | unsigned long old = enable ? nop : branch; | ||
255 | unsigned long new = enable ? branch : nop; | ||
256 | |||
257 | return ftrace_modify_code(pc, old, new); | ||
258 | } | ||
259 | |||
260 | static int ftrace_modify_graph_caller(bool enable) | ||
261 | { | ||
262 | int ret; | ||
263 | |||
264 | ret = __ftrace_modify_caller(&ftrace_graph_call, | ||
265 | ftrace_graph_caller, | ||
266 | enable); | ||
267 | |||
268 | #ifdef CONFIG_OLD_MCOUNT | ||
269 | if (!ret) | ||
270 | ret = __ftrace_modify_caller(&ftrace_graph_call_old, | ||
271 | ftrace_graph_caller_old, | ||
272 | enable); | ||
273 | #endif | ||
274 | |||
275 | return ret; | ||
276 | } | ||
277 | |||
278 | int ftrace_enable_ftrace_graph_caller(void) | ||
279 | { | ||
280 | return ftrace_modify_graph_caller(true); | ||
281 | } | ||
282 | |||
283 | int ftrace_disable_ftrace_graph_caller(void) | ||
284 | { | ||
285 | return ftrace_modify_graph_caller(false); | ||
286 | } | ||
287 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
288 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | ||
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 6bd82d25683c..f17d9a09e8fb 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -91,6 +91,11 @@ ENTRY(stext) | |||
91 | movs r8, r5 @ invalid machine (r5=0)? | 91 | movs r8, r5 @ invalid machine (r5=0)? |
92 | THUMB( it eq ) @ force fixup-able long branch encoding | 92 | THUMB( it eq ) @ force fixup-able long branch encoding |
93 | beq __error_a @ yes, error 'a' | 93 | beq __error_a @ yes, error 'a' |
94 | |||
95 | /* | ||
96 | * r1 = machine no, r2 = atags, | ||
97 | * r8 = machinfo, r9 = cpuid, r10 = procinfo | ||
98 | */ | ||
94 | bl __vet_atags | 99 | bl __vet_atags |
95 | #ifdef CONFIG_SMP_ON_UP | 100 | #ifdef CONFIG_SMP_ON_UP |
96 | bl __fixup_smp | 101 | bl __fixup_smp |
@@ -387,19 +392,19 @@ ENDPROC(__turn_mmu_on) | |||
387 | 392 | ||
388 | #ifdef CONFIG_SMP_ON_UP | 393 | #ifdef CONFIG_SMP_ON_UP |
389 | __fixup_smp: | 394 | __fixup_smp: |
390 | mov r7, #0x00070000 | 395 | mov r4, #0x00070000 |
391 | orr r6, r7, #0xff000000 @ mask 0xff070000 | 396 | orr r3, r4, #0xff000000 @ mask 0xff070000 |
392 | orr r7, r7, #0x41000000 @ val 0x41070000 | 397 | orr r4, r4, #0x41000000 @ val 0x41070000 |
393 | and r0, r9, r6 | 398 | and r0, r9, r3 |
394 | teq r0, r7 @ ARM CPU and ARMv6/v7? | 399 | teq r0, r4 @ ARM CPU and ARMv6/v7? |
395 | bne __fixup_smp_on_up @ no, assume UP | 400 | bne __fixup_smp_on_up @ no, assume UP |
396 | 401 | ||
397 | orr r6, r6, #0x0000ff00 | 402 | orr r3, r3, #0x0000ff00 |
398 | orr r6, r6, #0x000000f0 @ mask 0xff07fff0 | 403 | orr r3, r3, #0x000000f0 @ mask 0xff07fff0 |
399 | orr r7, r7, #0x0000b000 | 404 | orr r4, r4, #0x0000b000 |
400 | orr r7, r7, #0x00000020 @ val 0x4107b020 | 405 | orr r4, r4, #0x00000020 @ val 0x4107b020 |
401 | and r0, r9, r6 | 406 | and r0, r9, r3 |
402 | teq r0, r7 @ ARM 11MPCore? | 407 | teq r0, r4 @ ARM 11MPCore? |
403 | moveq pc, lr @ yes, assume SMP | 408 | moveq pc, lr @ yes, assume SMP |
404 | 409 | ||
405 | mrc p15, 0, r0, c0, c0, 5 @ read MPIDR | 410 | mrc p15, 0, r0, c0, c0, 5 @ read MPIDR |
@@ -408,15 +413,22 @@ __fixup_smp: | |||
408 | 413 | ||
409 | __fixup_smp_on_up: | 414 | __fixup_smp_on_up: |
410 | adr r0, 1f | 415 | adr r0, 1f |
411 | ldmia r0, {r3, r6, r7} | 416 | ldmia r0, {r3 - r5} |
412 | sub r3, r0, r3 | 417 | sub r3, r0, r3 |
413 | add r6, r6, r3 | 418 | add r4, r4, r3 |
414 | add r7, r7, r3 | 419 | add r5, r5, r3 |
415 | 2: cmp r6, r7 | 420 | 2: cmp r4, r5 |
416 | ldmia r6!, {r0, r4} | 421 | movhs pc, lr |
417 | strlo r4, [r0, r3] | 422 | ldmia r4!, {r0, r6} |
418 | blo 2b | 423 | ARM( str r6, [r0, r3] ) |
419 | mov pc, lr | 424 | THUMB( add r0, r0, r3 ) |
425 | #ifdef __ARMEB__ | ||
426 | THUMB( mov r6, r6, ror #16 ) @ Convert word order for big-endian. | ||
427 | #endif | ||
428 | THUMB( strh r6, [r0], #2 ) @ For Thumb-2, store as two halfwords | ||
429 | THUMB( mov r6, r6, lsr #16 ) @ to be robust against misaligned r3. | ||
430 | THUMB( strh r6, [r0] ) | ||
431 | b 2b | ||
420 | ENDPROC(__fixup_smp) | 432 | ENDPROC(__fixup_smp) |
421 | 433 | ||
422 | .align | 434 | .align |
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index 21e3a4ab3b8c..c9f3f0467570 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #define pr_fmt(fmt) "hw-breakpoint: " fmt | 24 | #define pr_fmt(fmt) "hw-breakpoint: " fmt |
25 | 25 | ||
26 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
27 | #include <linux/hardirq.h> | ||
27 | #include <linux/perf_event.h> | 28 | #include <linux/perf_event.h> |
28 | #include <linux/hw_breakpoint.h> | 29 | #include <linux/hw_breakpoint.h> |
29 | #include <linux/smp.h> | 30 | #include <linux/smp.h> |
@@ -44,6 +45,7 @@ static DEFINE_PER_CPU(struct perf_event *, wp_on_reg[ARM_MAX_WRP]); | |||
44 | 45 | ||
45 | /* Number of BRP/WRP registers on this CPU. */ | 46 | /* Number of BRP/WRP registers on this CPU. */ |
46 | static int core_num_brps; | 47 | static int core_num_brps; |
48 | static int core_num_reserved_brps; | ||
47 | static int core_num_wrps; | 49 | static int core_num_wrps; |
48 | 50 | ||
49 | /* Debug architecture version. */ | 51 | /* Debug architecture version. */ |
@@ -52,87 +54,6 @@ static u8 debug_arch; | |||
52 | /* Maximum supported watchpoint length. */ | 54 | /* Maximum supported watchpoint length. */ |
53 | static u8 max_watchpoint_len; | 55 | static u8 max_watchpoint_len; |
54 | 56 | ||
55 | /* Determine number of BRP registers available. */ | ||
56 | static int get_num_brps(void) | ||
57 | { | ||
58 | u32 didr; | ||
59 | ARM_DBG_READ(c0, 0, didr); | ||
60 | return ((didr >> 24) & 0xf) + 1; | ||
61 | } | ||
62 | |||
63 | /* Determine number of WRP registers available. */ | ||
64 | static int get_num_wrps(void) | ||
65 | { | ||
66 | /* | ||
67 | * FIXME: When a watchpoint fires, the only way to work out which | ||
68 | * watchpoint it was is by disassembling the faulting instruction | ||
69 | * and working out the address of the memory access. | ||
70 | * | ||
71 | * Furthermore, we can only do this if the watchpoint was precise | ||
72 | * since imprecise watchpoints prevent us from calculating register | ||
73 | * based addresses. | ||
74 | * | ||
75 | * For the time being, we only report 1 watchpoint register so we | ||
76 | * always know which watchpoint fired. In the future we can either | ||
77 | * add a disassembler and address generation emulator, or we can | ||
78 | * insert a check to see if the DFAR is set on watchpoint exception | ||
79 | * entry [the ARM ARM states that the DFAR is UNKNOWN, but | ||
80 | * experience shows that it is set on some implementations]. | ||
81 | */ | ||
82 | |||
83 | #if 0 | ||
84 | u32 didr, wrps; | ||
85 | ARM_DBG_READ(c0, 0, didr); | ||
86 | return ((didr >> 28) & 0xf) + 1; | ||
87 | #endif | ||
88 | |||
89 | return 1; | ||
90 | } | ||
91 | |||
92 | int hw_breakpoint_slots(int type) | ||
93 | { | ||
94 | /* | ||
95 | * We can be called early, so don't rely on | ||
96 | * our static variables being initialised. | ||
97 | */ | ||
98 | switch (type) { | ||
99 | case TYPE_INST: | ||
100 | return get_num_brps(); | ||
101 | case TYPE_DATA: | ||
102 | return get_num_wrps(); | ||
103 | default: | ||
104 | pr_warning("unknown slot type: %d\n", type); | ||
105 | return 0; | ||
106 | } | ||
107 | } | ||
108 | |||
109 | /* Determine debug architecture. */ | ||
110 | static u8 get_debug_arch(void) | ||
111 | { | ||
112 | u32 didr; | ||
113 | |||
114 | /* Do we implement the extended CPUID interface? */ | ||
115 | if (((read_cpuid_id() >> 16) & 0xf) != 0xf) { | ||
116 | pr_warning("CPUID feature registers not supported. " | ||
117 | "Assuming v6 debug is present.\n"); | ||
118 | return ARM_DEBUG_ARCH_V6; | ||
119 | } | ||
120 | |||
121 | ARM_DBG_READ(c0, 0, didr); | ||
122 | return (didr >> 16) & 0xf; | ||
123 | } | ||
124 | |||
125 | /* Does this core support mismatch breakpoints? */ | ||
126 | static int core_has_mismatch_bps(void) | ||
127 | { | ||
128 | return debug_arch >= ARM_DEBUG_ARCH_V7_ECP14 && core_num_brps > 1; | ||
129 | } | ||
130 | |||
131 | u8 arch_get_debug_arch(void) | ||
132 | { | ||
133 | return debug_arch; | ||
134 | } | ||
135 | |||
136 | #define READ_WB_REG_CASE(OP2, M, VAL) \ | 57 | #define READ_WB_REG_CASE(OP2, M, VAL) \ |
137 | case ((OP2 << 4) + M): \ | 58 | case ((OP2 << 4) + M): \ |
138 | ARM_DBG_READ(c ## M, OP2, VAL); \ | 59 | ARM_DBG_READ(c ## M, OP2, VAL); \ |
@@ -210,6 +131,94 @@ static void write_wb_reg(int n, u32 val) | |||
210 | isb(); | 131 | isb(); |
211 | } | 132 | } |
212 | 133 | ||
134 | /* Determine debug architecture. */ | ||
135 | static u8 get_debug_arch(void) | ||
136 | { | ||
137 | u32 didr; | ||
138 | |||
139 | /* Do we implement the extended CPUID interface? */ | ||
140 | if (((read_cpuid_id() >> 16) & 0xf) != 0xf) { | ||
141 | pr_warning("CPUID feature registers not supported. " | ||
142 | "Assuming v6 debug is present.\n"); | ||
143 | return ARM_DEBUG_ARCH_V6; | ||
144 | } | ||
145 | |||
146 | ARM_DBG_READ(c0, 0, didr); | ||
147 | return (didr >> 16) & 0xf; | ||
148 | } | ||
149 | |||
150 | u8 arch_get_debug_arch(void) | ||
151 | { | ||
152 | return debug_arch; | ||
153 | } | ||
154 | |||
155 | /* Determine number of BRP register available. */ | ||
156 | static int get_num_brp_resources(void) | ||
157 | { | ||
158 | u32 didr; | ||
159 | ARM_DBG_READ(c0, 0, didr); | ||
160 | return ((didr >> 24) & 0xf) + 1; | ||
161 | } | ||
162 | |||
163 | /* Does this core support mismatch breakpoints? */ | ||
164 | static int core_has_mismatch_brps(void) | ||
165 | { | ||
166 | return (get_debug_arch() >= ARM_DEBUG_ARCH_V7_ECP14 && | ||
167 | get_num_brp_resources() > 1); | ||
168 | } | ||
169 | |||
170 | /* Determine number of usable WRPs available. */ | ||
171 | static int get_num_wrps(void) | ||
172 | { | ||
173 | /* | ||
174 | * FIXME: When a watchpoint fires, the only way to work out which | ||
175 | * watchpoint it was is by disassembling the faulting instruction | ||
176 | * and working out the address of the memory access. | ||
177 | * | ||
178 | * Furthermore, we can only do this if the watchpoint was precise | ||
179 | * since imprecise watchpoints prevent us from calculating register | ||
180 | * based addresses. | ||
181 | * | ||
182 | * Providing we have more than 1 breakpoint register, we only report | ||
183 | * a single watchpoint register for the time being. This way, we always | ||
184 | * know which watchpoint fired. In the future we can either add a | ||
185 | * disassembler and address generation emulator, or we can insert a | ||
186 | * check to see if the DFAR is set on watchpoint exception entry | ||
187 | * [the ARM ARM states that the DFAR is UNKNOWN, but experience shows | ||
188 | * that it is set on some implementations]. | ||
189 | */ | ||
190 | |||
191 | #if 0 | ||
192 | int wrps; | ||
193 | u32 didr; | ||
194 | ARM_DBG_READ(c0, 0, didr); | ||
195 | wrps = ((didr >> 28) & 0xf) + 1; | ||
196 | #endif | ||
197 | int wrps = 1; | ||
198 | |||
199 | if (core_has_mismatch_brps() && wrps >= get_num_brp_resources()) | ||
200 | wrps = get_num_brp_resources() - 1; | ||
201 | |||
202 | return wrps; | ||
203 | } | ||
204 | |||
205 | /* We reserve one breakpoint for each watchpoint. */ | ||
206 | static int get_num_reserved_brps(void) | ||
207 | { | ||
208 | if (core_has_mismatch_brps()) | ||
209 | return get_num_wrps(); | ||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | /* Determine number of usable BRPs available. */ | ||
214 | static int get_num_brps(void) | ||
215 | { | ||
216 | int brps = get_num_brp_resources(); | ||
217 | if (core_has_mismatch_brps()) | ||
218 | brps -= get_num_reserved_brps(); | ||
219 | return brps; | ||
220 | } | ||
221 | |||
213 | /* | 222 | /* |
214 | * In order to access the breakpoint/watchpoint control registers, | 223 | * In order to access the breakpoint/watchpoint control registers, |
215 | * we must be running in debug monitor mode. Unfortunately, we can | 224 | * we must be running in debug monitor mode. Unfortunately, we can |
@@ -230,8 +239,12 @@ static int enable_monitor_mode(void) | |||
230 | goto out; | 239 | goto out; |
231 | } | 240 | } |
232 | 241 | ||
242 | /* If monitor mode is already enabled, just return. */ | ||
243 | if (dscr & ARM_DSCR_MDBGEN) | ||
244 | goto out; | ||
245 | |||
233 | /* Write to the corresponding DSCR. */ | 246 | /* Write to the corresponding DSCR. */ |
234 | switch (debug_arch) { | 247 | switch (get_debug_arch()) { |
235 | case ARM_DEBUG_ARCH_V6: | 248 | case ARM_DEBUG_ARCH_V6: |
236 | case ARM_DEBUG_ARCH_V6_1: | 249 | case ARM_DEBUG_ARCH_V6_1: |
237 | ARM_DBG_WRITE(c1, 0, (dscr | ARM_DSCR_MDBGEN)); | 250 | ARM_DBG_WRITE(c1, 0, (dscr | ARM_DSCR_MDBGEN)); |
@@ -246,15 +259,30 @@ static int enable_monitor_mode(void) | |||
246 | 259 | ||
247 | /* Check that the write made it through. */ | 260 | /* Check that the write made it through. */ |
248 | ARM_DBG_READ(c1, 0, dscr); | 261 | ARM_DBG_READ(c1, 0, dscr); |
249 | if (WARN_ONCE(!(dscr & ARM_DSCR_MDBGEN), | 262 | if (!(dscr & ARM_DSCR_MDBGEN)) |
250 | "failed to enable monitor mode.")) { | ||
251 | ret = -EPERM; | 263 | ret = -EPERM; |
252 | } | ||
253 | 264 | ||
254 | out: | 265 | out: |
255 | return ret; | 266 | return ret; |
256 | } | 267 | } |
257 | 268 | ||
269 | int hw_breakpoint_slots(int type) | ||
270 | { | ||
271 | /* | ||
272 | * We can be called early, so don't rely on | ||
273 | * our static variables being initialised. | ||
274 | */ | ||
275 | switch (type) { | ||
276 | case TYPE_INST: | ||
277 | return get_num_brps(); | ||
278 | case TYPE_DATA: | ||
279 | return get_num_wrps(); | ||
280 | default: | ||
281 | pr_warning("unknown slot type: %d\n", type); | ||
282 | return 0; | ||
283 | } | ||
284 | } | ||
285 | |||
258 | /* | 286 | /* |
259 | * Check if 8-bit byte-address select is available. | 287 | * Check if 8-bit byte-address select is available. |
260 | * This clobbers WRP 0. | 288 | * This clobbers WRP 0. |
@@ -268,9 +296,6 @@ static u8 get_max_wp_len(void) | |||
268 | if (debug_arch < ARM_DEBUG_ARCH_V7_ECP14) | 296 | if (debug_arch < ARM_DEBUG_ARCH_V7_ECP14) |
269 | goto out; | 297 | goto out; |
270 | 298 | ||
271 | if (enable_monitor_mode()) | ||
272 | goto out; | ||
273 | |||
274 | memset(&ctrl, 0, sizeof(ctrl)); | 299 | memset(&ctrl, 0, sizeof(ctrl)); |
275 | ctrl.len = ARM_BREAKPOINT_LEN_8; | 300 | ctrl.len = ARM_BREAKPOINT_LEN_8; |
276 | ctrl_reg = encode_ctrl_reg(ctrl); | 301 | ctrl_reg = encode_ctrl_reg(ctrl); |
@@ -290,23 +315,6 @@ u8 arch_get_max_wp_len(void) | |||
290 | } | 315 | } |
291 | 316 | ||
292 | /* | 317 | /* |
293 | * Handler for reactivating a suspended watchpoint when the single | ||
294 | * step `mismatch' breakpoint is triggered. | ||
295 | */ | ||
296 | static void wp_single_step_handler(struct perf_event *bp, int unused, | ||
297 | struct perf_sample_data *data, | ||
298 | struct pt_regs *regs) | ||
299 | { | ||
300 | perf_event_enable(counter_arch_bp(bp)->suspended_wp); | ||
301 | unregister_hw_breakpoint(bp); | ||
302 | } | ||
303 | |||
304 | static int bp_is_single_step(struct perf_event *bp) | ||
305 | { | ||
306 | return bp->overflow_handler == wp_single_step_handler; | ||
307 | } | ||
308 | |||
309 | /* | ||
310 | * Install a perf counter breakpoint. | 318 | * Install a perf counter breakpoint. |
311 | */ | 319 | */ |
312 | int arch_install_hw_breakpoint(struct perf_event *bp) | 320 | int arch_install_hw_breakpoint(struct perf_event *bp) |
@@ -314,30 +322,41 @@ int arch_install_hw_breakpoint(struct perf_event *bp) | |||
314 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); | 322 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); |
315 | struct perf_event **slot, **slots; | 323 | struct perf_event **slot, **slots; |
316 | int i, max_slots, ctrl_base, val_base, ret = 0; | 324 | int i, max_slots, ctrl_base, val_base, ret = 0; |
325 | u32 addr, ctrl; | ||
317 | 326 | ||
318 | /* Ensure that we are in monitor mode and halting mode is disabled. */ | 327 | /* Ensure that we are in monitor mode and halting mode is disabled. */ |
319 | ret = enable_monitor_mode(); | 328 | ret = enable_monitor_mode(); |
320 | if (ret) | 329 | if (ret) |
321 | goto out; | 330 | goto out; |
322 | 331 | ||
332 | addr = info->address; | ||
333 | ctrl = encode_ctrl_reg(info->ctrl) | 0x1; | ||
334 | |||
323 | if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { | 335 | if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { |
324 | /* Breakpoint */ | 336 | /* Breakpoint */ |
325 | ctrl_base = ARM_BASE_BCR; | 337 | ctrl_base = ARM_BASE_BCR; |
326 | val_base = ARM_BASE_BVR; | 338 | val_base = ARM_BASE_BVR; |
327 | slots = __get_cpu_var(bp_on_reg); | 339 | slots = (struct perf_event **)__get_cpu_var(bp_on_reg); |
328 | max_slots = core_num_brps - 1; | 340 | max_slots = core_num_brps; |
329 | 341 | if (info->step_ctrl.enabled) { | |
330 | if (bp_is_single_step(bp)) { | 342 | /* Override the breakpoint data with the step data. */ |
331 | info->ctrl.mismatch = 1; | 343 | addr = info->trigger & ~0x3; |
332 | i = max_slots; | 344 | ctrl = encode_ctrl_reg(info->step_ctrl); |
333 | slots[i] = bp; | ||
334 | goto setup; | ||
335 | } | 345 | } |
336 | } else { | 346 | } else { |
337 | /* Watchpoint */ | 347 | /* Watchpoint */ |
338 | ctrl_base = ARM_BASE_WCR; | 348 | if (info->step_ctrl.enabled) { |
339 | val_base = ARM_BASE_WVR; | 349 | /* Install into the reserved breakpoint region. */ |
340 | slots = __get_cpu_var(wp_on_reg); | 350 | ctrl_base = ARM_BASE_BCR + core_num_brps; |
351 | val_base = ARM_BASE_BVR + core_num_brps; | ||
352 | /* Override the watchpoint data with the step data. */ | ||
353 | addr = info->trigger & ~0x3; | ||
354 | ctrl = encode_ctrl_reg(info->step_ctrl); | ||
355 | } else { | ||
356 | ctrl_base = ARM_BASE_WCR; | ||
357 | val_base = ARM_BASE_WVR; | ||
358 | } | ||
359 | slots = (struct perf_event **)__get_cpu_var(wp_on_reg); | ||
341 | max_slots = core_num_wrps; | 360 | max_slots = core_num_wrps; |
342 | } | 361 | } |
343 | 362 | ||
@@ -355,12 +374,11 @@ int arch_install_hw_breakpoint(struct perf_event *bp) | |||
355 | goto out; | 374 | goto out; |
356 | } | 375 | } |
357 | 376 | ||
358 | setup: | ||
359 | /* Setup the address register. */ | 377 | /* Setup the address register. */ |
360 | write_wb_reg(val_base + i, info->address); | 378 | write_wb_reg(val_base + i, addr); |
361 | 379 | ||
362 | /* Setup the control register. */ | 380 | /* Setup the control register. */ |
363 | write_wb_reg(ctrl_base + i, encode_ctrl_reg(info->ctrl) | 0x1); | 381 | write_wb_reg(ctrl_base + i, ctrl); |
364 | 382 | ||
365 | out: | 383 | out: |
366 | return ret; | 384 | return ret; |
@@ -375,18 +393,15 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) | |||
375 | if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { | 393 | if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { |
376 | /* Breakpoint */ | 394 | /* Breakpoint */ |
377 | base = ARM_BASE_BCR; | 395 | base = ARM_BASE_BCR; |
378 | slots = __get_cpu_var(bp_on_reg); | 396 | slots = (struct perf_event **)__get_cpu_var(bp_on_reg); |
379 | max_slots = core_num_brps - 1; | 397 | max_slots = core_num_brps; |
380 | |||
381 | if (bp_is_single_step(bp)) { | ||
382 | i = max_slots; | ||
383 | slots[i] = NULL; | ||
384 | goto reset; | ||
385 | } | ||
386 | } else { | 398 | } else { |
387 | /* Watchpoint */ | 399 | /* Watchpoint */ |
388 | base = ARM_BASE_WCR; | 400 | if (info->step_ctrl.enabled) |
389 | slots = __get_cpu_var(wp_on_reg); | 401 | base = ARM_BASE_BCR + core_num_brps; |
402 | else | ||
403 | base = ARM_BASE_WCR; | ||
404 | slots = (struct perf_event **)__get_cpu_var(wp_on_reg); | ||
390 | max_slots = core_num_wrps; | 405 | max_slots = core_num_wrps; |
391 | } | 406 | } |
392 | 407 | ||
@@ -403,7 +418,6 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) | |||
403 | if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot")) | 418 | if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot")) |
404 | return; | 419 | return; |
405 | 420 | ||
406 | reset: | ||
407 | /* Reset the control register. */ | 421 | /* Reset the control register. */ |
408 | write_wb_reg(base + i, 0); | 422 | write_wb_reg(base + i, 0); |
409 | } | 423 | } |
@@ -537,12 +551,23 @@ static int arch_build_bp_info(struct perf_event *bp) | |||
537 | return -EINVAL; | 551 | return -EINVAL; |
538 | } | 552 | } |
539 | 553 | ||
554 | /* | ||
555 | * Breakpoints must be of length 2 (thumb) or 4 (ARM) bytes. | ||
556 | * Watchpoints can be of length 1, 2, 4 or 8 bytes if supported | ||
557 | * by the hardware and must be aligned to the appropriate number of | ||
558 | * bytes. | ||
559 | */ | ||
560 | if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE && | ||
561 | info->ctrl.len != ARM_BREAKPOINT_LEN_2 && | ||
562 | info->ctrl.len != ARM_BREAKPOINT_LEN_4) | ||
563 | return -EINVAL; | ||
564 | |||
540 | /* Address */ | 565 | /* Address */ |
541 | info->address = bp->attr.bp_addr; | 566 | info->address = bp->attr.bp_addr; |
542 | 567 | ||
543 | /* Privilege */ | 568 | /* Privilege */ |
544 | info->ctrl.privilege = ARM_BREAKPOINT_USER; | 569 | info->ctrl.privilege = ARM_BREAKPOINT_USER; |
545 | if (arch_check_bp_in_kernelspace(bp) && !bp_is_single_step(bp)) | 570 | if (arch_check_bp_in_kernelspace(bp)) |
546 | info->ctrl.privilege |= ARM_BREAKPOINT_PRIV; | 571 | info->ctrl.privilege |= ARM_BREAKPOINT_PRIV; |
547 | 572 | ||
548 | /* Enabled? */ | 573 | /* Enabled? */ |
@@ -561,7 +586,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) | |||
561 | { | 586 | { |
562 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); | 587 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); |
563 | int ret = 0; | 588 | int ret = 0; |
564 | u32 bytelen, max_len, offset, alignment_mask = 0x3; | 589 | u32 offset, alignment_mask = 0x3; |
565 | 590 | ||
566 | /* Build the arch_hw_breakpoint. */ | 591 | /* Build the arch_hw_breakpoint. */ |
567 | ret = arch_build_bp_info(bp); | 592 | ret = arch_build_bp_info(bp); |
@@ -571,84 +596,85 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) | |||
571 | /* Check address alignment. */ | 596 | /* Check address alignment. */ |
572 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_8) | 597 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_8) |
573 | alignment_mask = 0x7; | 598 | alignment_mask = 0x7; |
574 | if (info->address & alignment_mask) { | 599 | offset = info->address & alignment_mask; |
575 | /* | 600 | switch (offset) { |
576 | * Try to fix the alignment. This may result in a length | 601 | case 0: |
577 | * that is too large, so we must check for that. | 602 | /* Aligned */ |
578 | */ | 603 | break; |
579 | bytelen = get_hbp_len(info->ctrl.len); | 604 | case 1: |
580 | max_len = info->ctrl.type == ARM_BREAKPOINT_EXECUTE ? 4 : | 605 | /* Allow single byte watchpoint. */ |
581 | max_watchpoint_len; | 606 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_1) |
582 | 607 | break; | |
583 | if (max_len >= 8) | 608 | case 2: |
584 | offset = info->address & 0x7; | 609 | /* Allow halfword watchpoints and breakpoints. */ |
585 | else | 610 | if (info->ctrl.len == ARM_BREAKPOINT_LEN_2) |
586 | offset = info->address & 0x3; | 611 | break; |
587 | 612 | default: | |
588 | if (bytelen > (1 << ((max_len - (offset + 1)) >> 1))) { | 613 | ret = -EINVAL; |
589 | ret = -EFBIG; | 614 | goto out; |
590 | goto out; | ||
591 | } | ||
592 | |||
593 | info->ctrl.len <<= offset; | ||
594 | info->address &= ~offset; | ||
595 | |||
596 | pr_debug("breakpoint alignment fixup: length = 0x%x, " | ||
597 | "address = 0x%x\n", info->ctrl.len, info->address); | ||
598 | } | 615 | } |
599 | 616 | ||
617 | info->address &= ~alignment_mask; | ||
618 | info->ctrl.len <<= offset; | ||
619 | |||
600 | /* | 620 | /* |
601 | * Currently we rely on an overflow handler to take | 621 | * Currently we rely on an overflow handler to take |
602 | * care of single-stepping the breakpoint when it fires. | 622 | * care of single-stepping the breakpoint when it fires. |
603 | * In the case of userspace breakpoints on a core with V7 debug, | 623 | * In the case of userspace breakpoints on a core with V7 debug, |
604 | * we can use the mismatch feature as a poor-man's hardware single-step. | 624 | * we can use the mismatch feature as a poor-man's hardware |
625 | * single-step, but this only works for per-task breakpoints. | ||
605 | */ | 626 | */ |
606 | if (WARN_ONCE(!bp->overflow_handler && | 627 | if (WARN_ONCE(!bp->overflow_handler && |
607 | (arch_check_bp_in_kernelspace(bp) || !core_has_mismatch_bps()), | 628 | (arch_check_bp_in_kernelspace(bp) || !core_has_mismatch_brps() |
629 | || !bp->hw.bp_target), | ||
608 | "overflow handler required but none found")) { | 630 | "overflow handler required but none found")) { |
609 | ret = -EINVAL; | 631 | ret = -EINVAL; |
610 | goto out; | ||
611 | } | 632 | } |
612 | out: | 633 | out: |
613 | return ret; | 634 | return ret; |
614 | } | 635 | } |
615 | 636 | ||
616 | static void update_mismatch_flag(int idx, int flag) | 637 | /* |
638 | * Enable/disable single-stepping over the breakpoint bp at address addr. | ||
639 | */ | ||
640 | static void enable_single_step(struct perf_event *bp, u32 addr) | ||
617 | { | 641 | { |
618 | struct perf_event *bp = __get_cpu_var(bp_on_reg[idx]); | 642 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); |
619 | struct arch_hw_breakpoint *info; | ||
620 | |||
621 | if (bp == NULL) | ||
622 | return; | ||
623 | 643 | ||
624 | info = counter_arch_bp(bp); | 644 | arch_uninstall_hw_breakpoint(bp); |
645 | info->step_ctrl.mismatch = 1; | ||
646 | info->step_ctrl.len = ARM_BREAKPOINT_LEN_4; | ||
647 | info->step_ctrl.type = ARM_BREAKPOINT_EXECUTE; | ||
648 | info->step_ctrl.privilege = info->ctrl.privilege; | ||
649 | info->step_ctrl.enabled = 1; | ||
650 | info->trigger = addr; | ||
651 | arch_install_hw_breakpoint(bp); | ||
652 | } | ||
625 | 653 | ||
626 | /* Update the mismatch field to enter/exit `single-step' mode */ | 654 | static void disable_single_step(struct perf_event *bp) |
627 | if (!bp->overflow_handler && info->ctrl.mismatch != flag) { | 655 | { |
628 | info->ctrl.mismatch = flag; | 656 | arch_uninstall_hw_breakpoint(bp); |
629 | write_wb_reg(ARM_BASE_BCR + idx, encode_ctrl_reg(info->ctrl) | 0x1); | 657 | counter_arch_bp(bp)->step_ctrl.enabled = 0; |
630 | } | 658 | arch_install_hw_breakpoint(bp); |
631 | } | 659 | } |
632 | 660 | ||
633 | static void watchpoint_handler(unsigned long unknown, struct pt_regs *regs) | 661 | static void watchpoint_handler(unsigned long unknown, struct pt_regs *regs) |
634 | { | 662 | { |
635 | int i; | 663 | int i; |
636 | struct perf_event *bp, **slots = __get_cpu_var(wp_on_reg); | 664 | struct perf_event *wp, **slots; |
637 | struct arch_hw_breakpoint *info; | 665 | struct arch_hw_breakpoint *info; |
638 | struct perf_event_attr attr; | 666 | |
667 | slots = (struct perf_event **)__get_cpu_var(wp_on_reg); | ||
639 | 668 | ||
640 | /* Without a disassembler, we can only handle 1 watchpoint. */ | 669 | /* Without a disassembler, we can only handle 1 watchpoint. */ |
641 | BUG_ON(core_num_wrps > 1); | 670 | BUG_ON(core_num_wrps > 1); |
642 | 671 | ||
643 | hw_breakpoint_init(&attr); | ||
644 | attr.bp_addr = regs->ARM_pc & ~0x3; | ||
645 | attr.bp_len = HW_BREAKPOINT_LEN_4; | ||
646 | attr.bp_type = HW_BREAKPOINT_X; | ||
647 | |||
648 | for (i = 0; i < core_num_wrps; ++i) { | 672 | for (i = 0; i < core_num_wrps; ++i) { |
649 | rcu_read_lock(); | 673 | rcu_read_lock(); |
650 | 674 | ||
651 | if (slots[i] == NULL) { | 675 | wp = slots[i]; |
676 | |||
677 | if (wp == NULL) { | ||
652 | rcu_read_unlock(); | 678 | rcu_read_unlock(); |
653 | continue; | 679 | continue; |
654 | } | 680 | } |
@@ -658,24 +684,51 @@ static void watchpoint_handler(unsigned long unknown, struct pt_regs *regs) | |||
658 | * single watchpoint, we can set the trigger to the lowest | 684 | * single watchpoint, we can set the trigger to the lowest |
659 | * possible faulting address. | 685 | * possible faulting address. |
660 | */ | 686 | */ |
661 | info = counter_arch_bp(slots[i]); | 687 | info = counter_arch_bp(wp); |
662 | info->trigger = slots[i]->attr.bp_addr; | 688 | info->trigger = wp->attr.bp_addr; |
663 | pr_debug("watchpoint fired: address = 0x%x\n", info->trigger); | 689 | pr_debug("watchpoint fired: address = 0x%x\n", info->trigger); |
664 | perf_bp_event(slots[i], regs); | 690 | perf_bp_event(wp, regs); |
665 | 691 | ||
666 | /* | 692 | /* |
667 | * If no overflow handler is present, insert a temporary | 693 | * If no overflow handler is present, insert a temporary |
668 | * mismatch breakpoint so we can single-step over the | 694 | * mismatch breakpoint so we can single-step over the |
669 | * watchpoint trigger. | 695 | * watchpoint trigger. |
670 | */ | 696 | */ |
671 | if (!slots[i]->overflow_handler) { | 697 | if (!wp->overflow_handler) |
672 | bp = register_user_hw_breakpoint(&attr, | 698 | enable_single_step(wp, instruction_pointer(regs)); |
673 | wp_single_step_handler, | 699 | |
674 | current); | 700 | rcu_read_unlock(); |
675 | counter_arch_bp(bp)->suspended_wp = slots[i]; | 701 | } |
676 | perf_event_disable(slots[i]); | 702 | } |
677 | } | ||
678 | 703 | ||
704 | static void watchpoint_single_step_handler(unsigned long pc) | ||
705 | { | ||
706 | int i; | ||
707 | struct perf_event *wp, **slots; | ||
708 | struct arch_hw_breakpoint *info; | ||
709 | |||
710 | slots = (struct perf_event **)__get_cpu_var(wp_on_reg); | ||
711 | |||
712 | for (i = 0; i < core_num_reserved_brps; ++i) { | ||
713 | rcu_read_lock(); | ||
714 | |||
715 | wp = slots[i]; | ||
716 | |||
717 | if (wp == NULL) | ||
718 | goto unlock; | ||
719 | |||
720 | info = counter_arch_bp(wp); | ||
721 | if (!info->step_ctrl.enabled) | ||
722 | goto unlock; | ||
723 | |||
724 | /* | ||
725 | * Restore the original watchpoint if we've completed the | ||
726 | * single-step. | ||
727 | */ | ||
728 | if (info->trigger != pc) | ||
729 | disable_single_step(wp); | ||
730 | |||
731 | unlock: | ||
679 | rcu_read_unlock(); | 732 | rcu_read_unlock(); |
680 | } | 733 | } |
681 | } | 734 | } |
@@ -683,62 +736,69 @@ static void watchpoint_handler(unsigned long unknown, struct pt_regs *regs) | |||
683 | static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) | 736 | static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) |
684 | { | 737 | { |
685 | int i; | 738 | int i; |
686 | int mismatch; | ||
687 | u32 ctrl_reg, val, addr; | 739 | u32 ctrl_reg, val, addr; |
688 | struct perf_event *bp, **slots = __get_cpu_var(bp_on_reg); | 740 | struct perf_event *bp, **slots; |
689 | struct arch_hw_breakpoint *info; | 741 | struct arch_hw_breakpoint *info; |
690 | struct arch_hw_breakpoint_ctrl ctrl; | 742 | struct arch_hw_breakpoint_ctrl ctrl; |
691 | 743 | ||
744 | slots = (struct perf_event **)__get_cpu_var(bp_on_reg); | ||
745 | |||
692 | /* The exception entry code places the amended lr in the PC. */ | 746 | /* The exception entry code places the amended lr in the PC. */ |
693 | addr = regs->ARM_pc; | 747 | addr = regs->ARM_pc; |
694 | 748 | ||
749 | /* Check the currently installed breakpoints first. */ | ||
695 | for (i = 0; i < core_num_brps; ++i) { | 750 | for (i = 0; i < core_num_brps; ++i) { |
696 | rcu_read_lock(); | 751 | rcu_read_lock(); |
697 | 752 | ||
698 | bp = slots[i]; | 753 | bp = slots[i]; |
699 | 754 | ||
700 | if (bp == NULL) { | 755 | if (bp == NULL) |
701 | rcu_read_unlock(); | 756 | goto unlock; |
702 | continue; | ||
703 | } | ||
704 | 757 | ||
705 | mismatch = 0; | 758 | info = counter_arch_bp(bp); |
706 | 759 | ||
707 | /* Check if the breakpoint value matches. */ | 760 | /* Check if the breakpoint value matches. */ |
708 | val = read_wb_reg(ARM_BASE_BVR + i); | 761 | val = read_wb_reg(ARM_BASE_BVR + i); |
709 | if (val != (addr & ~0x3)) | 762 | if (val != (addr & ~0x3)) |
710 | goto unlock; | 763 | goto mismatch; |
711 | 764 | ||
712 | /* Possible match, check the byte address select to confirm. */ | 765 | /* Possible match, check the byte address select to confirm. */ |
713 | ctrl_reg = read_wb_reg(ARM_BASE_BCR + i); | 766 | ctrl_reg = read_wb_reg(ARM_BASE_BCR + i); |
714 | decode_ctrl_reg(ctrl_reg, &ctrl); | 767 | decode_ctrl_reg(ctrl_reg, &ctrl); |
715 | if ((1 << (addr & 0x3)) & ctrl.len) { | 768 | if ((1 << (addr & 0x3)) & ctrl.len) { |
716 | mismatch = 1; | ||
717 | info = counter_arch_bp(bp); | ||
718 | info->trigger = addr; | 769 | info->trigger = addr; |
719 | } | ||
720 | |||
721 | unlock: | ||
722 | if ((mismatch && !info->ctrl.mismatch) || bp_is_single_step(bp)) { | ||
723 | pr_debug("breakpoint fired: address = 0x%x\n", addr); | 770 | pr_debug("breakpoint fired: address = 0x%x\n", addr); |
724 | perf_bp_event(bp, regs); | 771 | perf_bp_event(bp, regs); |
772 | if (!bp->overflow_handler) | ||
773 | enable_single_step(bp, addr); | ||
774 | goto unlock; | ||
725 | } | 775 | } |
726 | 776 | ||
727 | update_mismatch_flag(i, mismatch); | 777 | mismatch: |
778 | /* If we're stepping a breakpoint, it can now be restored. */ | ||
779 | if (info->step_ctrl.enabled) | ||
780 | disable_single_step(bp); | ||
781 | unlock: | ||
728 | rcu_read_unlock(); | 782 | rcu_read_unlock(); |
729 | } | 783 | } |
784 | |||
785 | /* Handle any pending watchpoint single-step breakpoints. */ | ||
786 | watchpoint_single_step_handler(addr); | ||
730 | } | 787 | } |
731 | 788 | ||
732 | /* | 789 | /* |
733 | * Called from either the Data Abort Handler [watchpoint] or the | 790 | * Called from either the Data Abort Handler [watchpoint] or the |
734 | * Prefetch Abort Handler [breakpoint]. | 791 | * Prefetch Abort Handler [breakpoint] with preemption disabled. |
735 | */ | 792 | */ |
736 | static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, | 793 | static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, |
737 | struct pt_regs *regs) | 794 | struct pt_regs *regs) |
738 | { | 795 | { |
739 | int ret = 1; /* Unhandled fault. */ | 796 | int ret = 0; |
740 | u32 dscr; | 797 | u32 dscr; |
741 | 798 | ||
799 | /* We must be called with preemption disabled. */ | ||
800 | WARN_ON(preemptible()); | ||
801 | |||
742 | /* We only handle watchpoints and hardware breakpoints. */ | 802 | /* We only handle watchpoints and hardware breakpoints. */ |
743 | ARM_DBG_READ(c1, 0, dscr); | 803 | ARM_DBG_READ(c1, 0, dscr); |
744 | 804 | ||
@@ -753,25 +813,47 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, | |||
753 | watchpoint_handler(addr, regs); | 813 | watchpoint_handler(addr, regs); |
754 | break; | 814 | break; |
755 | default: | 815 | default: |
756 | goto out; | 816 | ret = 1; /* Unhandled fault. */ |
757 | } | 817 | } |
758 | 818 | ||
759 | ret = 0; | 819 | /* |
760 | out: | 820 | * Re-enable preemption after it was disabled in the |
821 | * low-level exception handling code. | ||
822 | */ | ||
823 | preempt_enable(); | ||
824 | |||
761 | return ret; | 825 | return ret; |
762 | } | 826 | } |
763 | 827 | ||
764 | /* | 828 | /* |
765 | * One-time initialisation. | 829 | * One-time initialisation. |
766 | */ | 830 | */ |
767 | static void __init reset_ctrl_regs(void *unused) | 831 | static void reset_ctrl_regs(void *unused) |
768 | { | 832 | { |
769 | int i; | 833 | int i; |
770 | 834 | ||
835 | /* | ||
836 | * v7 debug contains save and restore registers so that debug state | ||
837 | * can be maintained across low-power modes without leaving | ||
838 | * the debug logic powered up. It is IMPLEMENTATION DEFINED whether | ||
839 | * we can write to the debug registers out of reset, so we must | ||
840 | * unlock the OS Lock Access Register to avoid taking undefined | ||
841 | * instruction exceptions later on. | ||
842 | */ | ||
843 | if (debug_arch >= ARM_DEBUG_ARCH_V7_ECP14) { | ||
844 | /* | ||
845 | * Unconditionally clear the lock by writing a value | ||
846 | * other than 0xC5ACCE55 to the access register. | ||
847 | */ | ||
848 | asm volatile("mcr p14, 0, %0, c1, c0, 4" : : "r" (0)); | ||
849 | isb(); | ||
850 | } | ||
851 | |||
771 | if (enable_monitor_mode()) | 852 | if (enable_monitor_mode()) |
772 | return; | 853 | return; |
773 | 854 | ||
774 | for (i = 0; i < core_num_brps; ++i) { | 855 | /* We must also reset any reserved registers. */ |
856 | for (i = 0; i < core_num_brps + core_num_reserved_brps; ++i) { | ||
775 | write_wb_reg(ARM_BASE_BCR + i, 0UL); | 857 | write_wb_reg(ARM_BASE_BCR + i, 0UL); |
776 | write_wb_reg(ARM_BASE_BVR + i, 0UL); | 858 | write_wb_reg(ARM_BASE_BVR + i, 0UL); |
777 | } | 859 | } |
@@ -782,45 +864,57 @@ static void __init reset_ctrl_regs(void *unused) | |||
782 | } | 864 | } |
783 | } | 865 | } |
784 | 866 | ||
867 | static int __cpuinit dbg_reset_notify(struct notifier_block *self, | ||
868 | unsigned long action, void *cpu) | ||
869 | { | ||
870 | if (action == CPU_ONLINE) | ||
871 | smp_call_function_single((int)cpu, reset_ctrl_regs, NULL, 1); | ||
872 | return NOTIFY_OK; | ||
873 | } | ||
874 | |||
875 | static struct notifier_block __cpuinitdata dbg_reset_nb = { | ||
876 | .notifier_call = dbg_reset_notify, | ||
877 | }; | ||
878 | |||
785 | static int __init arch_hw_breakpoint_init(void) | 879 | static int __init arch_hw_breakpoint_init(void) |
786 | { | 880 | { |
787 | int ret = 0; | ||
788 | u32 dscr; | 881 | u32 dscr; |
789 | 882 | ||
790 | debug_arch = get_debug_arch(); | 883 | debug_arch = get_debug_arch(); |
791 | 884 | ||
792 | if (debug_arch > ARM_DEBUG_ARCH_V7_ECP14) { | 885 | if (debug_arch > ARM_DEBUG_ARCH_V7_ECP14) { |
793 | pr_info("debug architecture 0x%x unsupported.\n", debug_arch); | 886 | pr_info("debug architecture 0x%x unsupported.\n", debug_arch); |
794 | ret = -ENODEV; | 887 | return 0; |
795 | goto out; | ||
796 | } | 888 | } |
797 | 889 | ||
798 | /* Determine how many BRPs/WRPs are available. */ | 890 | /* Determine how many BRPs/WRPs are available. */ |
799 | core_num_brps = get_num_brps(); | 891 | core_num_brps = get_num_brps(); |
892 | core_num_reserved_brps = get_num_reserved_brps(); | ||
800 | core_num_wrps = get_num_wrps(); | 893 | core_num_wrps = get_num_wrps(); |
801 | 894 | ||
802 | pr_info("found %d breakpoint and %d watchpoint registers.\n", | 895 | pr_info("found %d breakpoint and %d watchpoint registers.\n", |
803 | core_num_brps, core_num_wrps); | 896 | core_num_brps + core_num_reserved_brps, core_num_wrps); |
804 | 897 | ||
805 | if (core_has_mismatch_bps()) | 898 | if (core_num_reserved_brps) |
806 | pr_info("1 breakpoint reserved for watchpoint single-step.\n"); | 899 | pr_info("%d breakpoint(s) reserved for watchpoint " |
900 | "single-step.\n", core_num_reserved_brps); | ||
807 | 901 | ||
808 | ARM_DBG_READ(c1, 0, dscr); | 902 | ARM_DBG_READ(c1, 0, dscr); |
809 | if (dscr & ARM_DSCR_HDBGEN) { | 903 | if (dscr & ARM_DSCR_HDBGEN) { |
810 | pr_warning("halting debug mode enabled. Assuming maximum " | 904 | pr_warning("halting debug mode enabled. Assuming maximum " |
811 | "watchpoint size of 4 bytes."); | 905 | "watchpoint size of 4 bytes."); |
812 | } else { | 906 | } else { |
813 | /* Work out the maximum supported watchpoint length. */ | ||
814 | max_watchpoint_len = get_max_wp_len(); | ||
815 | pr_info("maximum watchpoint size is %u bytes.\n", | ||
816 | max_watchpoint_len); | ||
817 | |||
818 | /* | 907 | /* |
819 | * Reset the breakpoint resources. We assume that a halting | 908 | * Reset the breakpoint resources. We assume that a halting |
820 | * debugger will leave the world in a nice state for us. | 909 | * debugger will leave the world in a nice state for us. |
821 | */ | 910 | */ |
822 | smp_call_function(reset_ctrl_regs, NULL, 1); | 911 | smp_call_function(reset_ctrl_regs, NULL, 1); |
823 | reset_ctrl_regs(NULL); | 912 | reset_ctrl_regs(NULL); |
913 | |||
914 | /* Work out the maximum supported watchpoint length. */ | ||
915 | max_watchpoint_len = get_max_wp_len(); | ||
916 | pr_info("maximum watchpoint size is %u bytes.\n", | ||
917 | max_watchpoint_len); | ||
824 | } | 918 | } |
825 | 919 | ||
826 | /* Register debug fault handler. */ | 920 | /* Register debug fault handler. */ |
@@ -829,8 +923,9 @@ static int __init arch_hw_breakpoint_init(void) | |||
829 | hook_ifault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT, | 923 | hook_ifault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT, |
830 | "breakpoint debug exception"); | 924 | "breakpoint debug exception"); |
831 | 925 | ||
832 | out: | 926 | /* Register hotplug notifier. */ |
833 | return ret; | 927 | register_cpu_notifier(&dbg_reset_nb); |
928 | return 0; | ||
834 | } | 929 | } |
835 | arch_initcall(arch_hw_breakpoint_init); | 930 | arch_initcall(arch_hw_breakpoint_init); |
836 | 931 | ||
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 36ad3be4692a..8135438b8818 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c | |||
@@ -35,8 +35,10 @@ | |||
35 | #include <linux/list.h> | 35 | #include <linux/list.h> |
36 | #include <linux/kallsyms.h> | 36 | #include <linux/kallsyms.h> |
37 | #include <linux/proc_fs.h> | 37 | #include <linux/proc_fs.h> |
38 | #include <linux/ftrace.h> | ||
38 | 39 | ||
39 | #include <asm/system.h> | 40 | #include <asm/system.h> |
41 | #include <asm/mach/arch.h> | ||
40 | #include <asm/mach/irq.h> | 42 | #include <asm/mach/irq.h> |
41 | #include <asm/mach/time.h> | 43 | #include <asm/mach/time.h> |
42 | 44 | ||
@@ -47,8 +49,6 @@ | |||
47 | #define irq_finish(irq) do { } while (0) | 49 | #define irq_finish(irq) do { } while (0) |
48 | #endif | 50 | #endif |
49 | 51 | ||
50 | unsigned int arch_nr_irqs; | ||
51 | void (*init_arch_irq)(void) __initdata = NULL; | ||
52 | unsigned long irq_err_count; | 52 | unsigned long irq_err_count; |
53 | 53 | ||
54 | int show_interrupts(struct seq_file *p, void *v) | 54 | int show_interrupts(struct seq_file *p, void *v) |
@@ -57,11 +57,20 @@ int show_interrupts(struct seq_file *p, void *v) | |||
57 | struct irq_desc *desc; | 57 | struct irq_desc *desc; |
58 | struct irqaction * action; | 58 | struct irqaction * action; |
59 | unsigned long flags; | 59 | unsigned long flags; |
60 | int prec, n; | ||
61 | |||
62 | for (prec = 3, n = 1000; prec < 10 && n <= nr_irqs; prec++) | ||
63 | n *= 10; | ||
64 | |||
65 | #ifdef CONFIG_SMP | ||
66 | if (prec < 4) | ||
67 | prec = 4; | ||
68 | #endif | ||
60 | 69 | ||
61 | if (i == 0) { | 70 | if (i == 0) { |
62 | char cpuname[12]; | 71 | char cpuname[12]; |
63 | 72 | ||
64 | seq_printf(p, " "); | 73 | seq_printf(p, "%*s ", prec, ""); |
65 | for_each_present_cpu(cpu) { | 74 | for_each_present_cpu(cpu) { |
66 | sprintf(cpuname, "CPU%d", cpu); | 75 | sprintf(cpuname, "CPU%d", cpu); |
67 | seq_printf(p, " %10s", cpuname); | 76 | seq_printf(p, " %10s", cpuname); |
@@ -76,7 +85,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
76 | if (!action) | 85 | if (!action) |
77 | goto unlock; | 86 | goto unlock; |
78 | 87 | ||
79 | seq_printf(p, "%3d: ", i); | 88 | seq_printf(p, "%*d: ", prec, i); |
80 | for_each_present_cpu(cpu) | 89 | for_each_present_cpu(cpu) |
81 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); | 90 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); |
82 | seq_printf(p, " %10s", desc->chip->name ? : "-"); | 91 | seq_printf(p, " %10s", desc->chip->name ? : "-"); |
@@ -89,13 +98,15 @@ unlock: | |||
89 | raw_spin_unlock_irqrestore(&desc->lock, flags); | 98 | raw_spin_unlock_irqrestore(&desc->lock, flags); |
90 | } else if (i == nr_irqs) { | 99 | } else if (i == nr_irqs) { |
91 | #ifdef CONFIG_FIQ | 100 | #ifdef CONFIG_FIQ |
92 | show_fiq_list(p, v); | 101 | show_fiq_list(p, prec); |
93 | #endif | 102 | #endif |
94 | #ifdef CONFIG_SMP | 103 | #ifdef CONFIG_SMP |
95 | show_ipi_list(p); | 104 | show_ipi_list(p, prec); |
96 | show_local_irqs(p); | 105 | #endif |
106 | #ifdef CONFIG_LOCAL_TIMERS | ||
107 | show_local_irqs(p, prec); | ||
97 | #endif | 108 | #endif |
98 | seq_printf(p, "Err: %10lu\n", irq_err_count); | 109 | seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count); |
99 | } | 110 | } |
100 | return 0; | 111 | return 0; |
101 | } | 112 | } |
@@ -105,7 +116,8 @@ unlock: | |||
105 | * come via this function. Instead, they should provide their | 116 | * come via this function. Instead, they should provide their |
106 | * own 'handler' | 117 | * own 'handler' |
107 | */ | 118 | */ |
108 | asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | 119 | asmlinkage void __exception_irq_entry |
120 | asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | ||
109 | { | 121 | { |
110 | struct pt_regs *old_regs = set_irq_regs(regs); | 122 | struct pt_regs *old_regs = set_irq_regs(regs); |
111 | 123 | ||
@@ -154,13 +166,13 @@ void set_irq_flags(unsigned int irq, unsigned int iflags) | |||
154 | 166 | ||
155 | void __init init_IRQ(void) | 167 | void __init init_IRQ(void) |
156 | { | 168 | { |
157 | init_arch_irq(); | 169 | machine_desc->init_irq(); |
158 | } | 170 | } |
159 | 171 | ||
160 | #ifdef CONFIG_SPARSE_IRQ | 172 | #ifdef CONFIG_SPARSE_IRQ |
161 | int __init arch_probe_nr_irqs(void) | 173 | int __init arch_probe_nr_irqs(void) |
162 | { | 174 | { |
163 | nr_irqs = arch_nr_irqs ? arch_nr_irqs : NR_IRQS; | 175 | nr_irqs = machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS; |
164 | return nr_irqs; | 176 | return nr_irqs; |
165 | } | 177 | } |
166 | #endif | 178 | #endif |
diff --git a/arch/arm/kernel/iwmmxt.S b/arch/arm/kernel/iwmmxt.S index b63b528f22a6..7fa3bb0d2397 100644 --- a/arch/arm/kernel/iwmmxt.S +++ b/arch/arm/kernel/iwmmxt.S | |||
@@ -19,6 +19,14 @@ | |||
19 | #include <asm/thread_info.h> | 19 | #include <asm/thread_info.h> |
20 | #include <asm/asm-offsets.h> | 20 | #include <asm/asm-offsets.h> |
21 | 21 | ||
22 | #if defined(CONFIG_CPU_PJ4) | ||
23 | #define PJ4(code...) code | ||
24 | #define XSC(code...) | ||
25 | #else | ||
26 | #define PJ4(code...) | ||
27 | #define XSC(code...) code | ||
28 | #endif | ||
29 | |||
22 | #define MMX_WR0 (0x00) | 30 | #define MMX_WR0 (0x00) |
23 | #define MMX_WR1 (0x08) | 31 | #define MMX_WR1 (0x08) |
24 | #define MMX_WR2 (0x10) | 32 | #define MMX_WR2 (0x10) |
@@ -58,11 +66,17 @@ | |||
58 | 66 | ||
59 | ENTRY(iwmmxt_task_enable) | 67 | ENTRY(iwmmxt_task_enable) |
60 | 68 | ||
61 | mrc p15, 0, r2, c15, c1, 0 | 69 | XSC(mrc p15, 0, r2, c15, c1, 0) |
62 | tst r2, #0x3 @ CP0 and CP1 accessible? | 70 | PJ4(mrc p15, 0, r2, c1, c0, 2) |
71 | @ CP0 and CP1 accessible? | ||
72 | XSC(tst r2, #0x3) | ||
73 | PJ4(tst r2, #0xf) | ||
63 | movne pc, lr @ if so no business here | 74 | movne pc, lr @ if so no business here |
64 | orr r2, r2, #0x3 @ enable access to CP0 and CP1 | 75 | @ enable access to CP0 and CP1 |
65 | mcr p15, 0, r2, c15, c1, 0 | 76 | XSC(orr r2, r2, #0x3) |
77 | XSC(mcr p15, 0, r2, c15, c1, 0) | ||
78 | PJ4(orr r2, r2, #0xf) | ||
79 | PJ4(mcr p15, 0, r2, c1, c0, 2) | ||
66 | 80 | ||
67 | ldr r3, =concan_owner | 81 | ldr r3, =concan_owner |
68 | add r0, r10, #TI_IWMMXT_STATE @ get task Concan save area | 82 | add r0, r10, #TI_IWMMXT_STATE @ get task Concan save area |
@@ -179,17 +193,26 @@ ENTRY(iwmmxt_task_disable) | |||
179 | teqne r1, r2 @ or specified one? | 193 | teqne r1, r2 @ or specified one? |
180 | bne 1f @ no: quit | 194 | bne 1f @ no: quit |
181 | 195 | ||
182 | mrc p15, 0, r4, c15, c1, 0 | 196 | @ enable access to CP0 and CP1 |
183 | orr r4, r4, #0x3 @ enable access to CP0 and CP1 | 197 | XSC(mrc p15, 0, r4, c15, c1, 0) |
184 | mcr p15, 0, r4, c15, c1, 0 | 198 | XSC(orr r4, r4, #0xf) |
199 | XSC(mcr p15, 0, r4, c15, c1, 0) | ||
200 | PJ4(mrc p15, 0, r4, c1, c0, 2) | ||
201 | PJ4(orr r4, r4, #0x3) | ||
202 | PJ4(mcr p15, 0, r4, c1, c0, 2) | ||
203 | |||
185 | mov r0, #0 @ nothing to load | 204 | mov r0, #0 @ nothing to load |
186 | str r0, [r3] @ no more current owner | 205 | str r0, [r3] @ no more current owner |
187 | mrc p15, 0, r2, c2, c0, 0 | 206 | mrc p15, 0, r2, c2, c0, 0 |
188 | mov r2, r2 @ cpwait | 207 | mov r2, r2 @ cpwait |
189 | bl concan_save | 208 | bl concan_save |
190 | 209 | ||
191 | bic r4, r4, #0x3 @ disable access to CP0 and CP1 | 210 | @ disable access to CP0 and CP1 |
192 | mcr p15, 0, r4, c15, c1, 0 | 211 | XSC(bic r4, r4, #0x3) |
212 | XSC(mcr p15, 0, r4, c15, c1, 0) | ||
213 | PJ4(bic r4, r4, #0xf) | ||
214 | PJ4(mcr p15, 0, r4, c1, c0, 2) | ||
215 | |||
193 | mrc p15, 0, r2, c2, c0, 0 | 216 | mrc p15, 0, r2, c2, c0, 0 |
194 | mov r2, r2 @ cpwait | 217 | mov r2, r2 @ cpwait |
195 | 218 | ||
@@ -277,8 +300,11 @@ ENTRY(iwmmxt_task_restore) | |||
277 | */ | 300 | */ |
278 | ENTRY(iwmmxt_task_switch) | 301 | ENTRY(iwmmxt_task_switch) |
279 | 302 | ||
280 | mrc p15, 0, r1, c15, c1, 0 | 303 | XSC(mrc p15, 0, r1, c15, c1, 0) |
281 | tst r1, #0x3 @ CP0 and CP1 accessible? | 304 | PJ4(mrc p15, 0, r1, c1, c0, 2) |
305 | @ CP0 and CP1 accessible? | ||
306 | XSC(tst r1, #0x3) | ||
307 | PJ4(tst r1, #0xf) | ||
282 | bne 1f @ yes: block them for next task | 308 | bne 1f @ yes: block them for next task |
283 | 309 | ||
284 | ldr r2, =concan_owner | 310 | ldr r2, =concan_owner |
@@ -287,8 +313,11 @@ ENTRY(iwmmxt_task_switch) | |||
287 | teq r2, r3 @ next task owns it? | 313 | teq r2, r3 @ next task owns it? |
288 | movne pc, lr @ no: leave Concan disabled | 314 | movne pc, lr @ no: leave Concan disabled |
289 | 315 | ||
290 | 1: eor r1, r1, #3 @ flip Concan access | 316 | 1: @ flip Conan access |
291 | mcr p15, 0, r1, c15, c1, 0 | 317 | XSC(eor r1, r1, #0x3) |
318 | XSC(mcr p15, 0, r1, c15, c1, 0) | ||
319 | PJ4(eor r1, r1, #0xf) | ||
320 | PJ4(mcr p15, 0, r1, c1, c0, 2) | ||
292 | 321 | ||
293 | mrc p15, 0, r1, c2, c0, 0 | 322 | mrc p15, 0, r1, c2, c0, 0 |
294 | sub pc, lr, r1, lsr #32 @ cpwait and return | 323 | sub pc, lr, r1, lsr #32 @ cpwait and return |
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index 3a8fd5140d7a..30ead135ff5f 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c | |||
@@ -23,6 +23,8 @@ extern unsigned long kexec_indirection_page; | |||
23 | extern unsigned long kexec_mach_type; | 23 | extern unsigned long kexec_mach_type; |
24 | extern unsigned long kexec_boot_atags; | 24 | extern unsigned long kexec_boot_atags; |
25 | 25 | ||
26 | static atomic_t waiting_for_crash_ipi; | ||
27 | |||
26 | /* | 28 | /* |
27 | * Provide a dummy crash_notes definition while crash dump arrives to arm. | 29 | * Provide a dummy crash_notes definition while crash dump arrives to arm. |
28 | * This prevents breakage of crash_notes attribute in kernel/ksysfs.c. | 30 | * This prevents breakage of crash_notes attribute in kernel/ksysfs.c. |
@@ -37,9 +39,37 @@ void machine_kexec_cleanup(struct kimage *image) | |||
37 | { | 39 | { |
38 | } | 40 | } |
39 | 41 | ||
42 | void machine_crash_nonpanic_core(void *unused) | ||
43 | { | ||
44 | struct pt_regs regs; | ||
45 | |||
46 | crash_setup_regs(®s, NULL); | ||
47 | printk(KERN_DEBUG "CPU %u will stop doing anything useful since another CPU has crashed\n", | ||
48 | smp_processor_id()); | ||
49 | crash_save_cpu(®s, smp_processor_id()); | ||
50 | flush_cache_all(); | ||
51 | |||
52 | atomic_dec(&waiting_for_crash_ipi); | ||
53 | while (1) | ||
54 | cpu_relax(); | ||
55 | } | ||
56 | |||
40 | void machine_crash_shutdown(struct pt_regs *regs) | 57 | void machine_crash_shutdown(struct pt_regs *regs) |
41 | { | 58 | { |
59 | unsigned long msecs; | ||
60 | |||
42 | local_irq_disable(); | 61 | local_irq_disable(); |
62 | |||
63 | atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1); | ||
64 | smp_call_function(machine_crash_nonpanic_core, NULL, false); | ||
65 | msecs = 1000; /* Wait at most a second for the other cpus to stop */ | ||
66 | while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) { | ||
67 | mdelay(1); | ||
68 | msecs--; | ||
69 | } | ||
70 | if (atomic_read(&waiting_for_crash_ipi) > 0) | ||
71 | printk(KERN_WARNING "Non-crashing CPUs did not react to IPI\n"); | ||
72 | |||
43 | crash_save_cpu(regs, smp_processor_id()); | 73 | crash_save_cpu(regs, smp_processor_id()); |
44 | 74 | ||
45 | printk(KERN_INFO "Loading crashdump kernel...\n"); | 75 | printk(KERN_INFO "Loading crashdump kernel...\n"); |
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index d9bd786ce23d..0c1bb68ff4a8 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c | |||
@@ -67,35 +67,6 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, | |||
67 | char *secstrings, | 67 | char *secstrings, |
68 | struct module *mod) | 68 | struct module *mod) |
69 | { | 69 | { |
70 | #ifdef CONFIG_ARM_UNWIND | ||
71 | Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum; | ||
72 | struct arm_unwind_mapping *maps = mod->arch.map; | ||
73 | |||
74 | for (s = sechdrs; s < sechdrs_end; s++) { | ||
75 | char const *secname = secstrings + s->sh_name; | ||
76 | |||
77 | if (strcmp(".ARM.exidx.init.text", secname) == 0) | ||
78 | maps[ARM_SEC_INIT].unw_sec = s; | ||
79 | else if (strcmp(".ARM.exidx.devinit.text", secname) == 0) | ||
80 | maps[ARM_SEC_DEVINIT].unw_sec = s; | ||
81 | else if (strcmp(".ARM.exidx", secname) == 0) | ||
82 | maps[ARM_SEC_CORE].unw_sec = s; | ||
83 | else if (strcmp(".ARM.exidx.exit.text", secname) == 0) | ||
84 | maps[ARM_SEC_EXIT].unw_sec = s; | ||
85 | else if (strcmp(".ARM.exidx.devexit.text", secname) == 0) | ||
86 | maps[ARM_SEC_DEVEXIT].unw_sec = s; | ||
87 | else if (strcmp(".init.text", secname) == 0) | ||
88 | maps[ARM_SEC_INIT].sec_text = s; | ||
89 | else if (strcmp(".devinit.text", secname) == 0) | ||
90 | maps[ARM_SEC_DEVINIT].sec_text = s; | ||
91 | else if (strcmp(".text", secname) == 0) | ||
92 | maps[ARM_SEC_CORE].sec_text = s; | ||
93 | else if (strcmp(".exit.text", secname) == 0) | ||
94 | maps[ARM_SEC_EXIT].sec_text = s; | ||
95 | else if (strcmp(".devexit.text", secname) == 0) | ||
96 | maps[ARM_SEC_DEVEXIT].sec_text = s; | ||
97 | } | ||
98 | #endif | ||
99 | return 0; | 70 | return 0; |
100 | } | 71 | } |
101 | 72 | ||
@@ -300,41 +271,69 @@ apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, | |||
300 | return -ENOEXEC; | 271 | return -ENOEXEC; |
301 | } | 272 | } |
302 | 273 | ||
303 | #ifdef CONFIG_ARM_UNWIND | 274 | struct mod_unwind_map { |
304 | static void register_unwind_tables(struct module *mod) | 275 | const Elf_Shdr *unw_sec; |
276 | const Elf_Shdr *txt_sec; | ||
277 | }; | ||
278 | |||
279 | int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, | ||
280 | struct module *mod) | ||
305 | { | 281 | { |
282 | #ifdef CONFIG_ARM_UNWIND | ||
283 | const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; | ||
284 | const Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum; | ||
285 | struct mod_unwind_map maps[ARM_SEC_MAX]; | ||
306 | int i; | 286 | int i; |
307 | for (i = 0; i < ARM_SEC_MAX; ++i) { | 287 | |
308 | struct arm_unwind_mapping *map = &mod->arch.map[i]; | 288 | memset(maps, 0, sizeof(maps)); |
309 | if (map->unw_sec && map->sec_text) | 289 | |
310 | map->unwind = unwind_table_add(map->unw_sec->sh_addr, | 290 | for (s = sechdrs; s < sechdrs_end; s++) { |
311 | map->unw_sec->sh_size, | 291 | const char *secname = secstrs + s->sh_name; |
312 | map->sec_text->sh_addr, | 292 | |
313 | map->sec_text->sh_size); | 293 | if (!(s->sh_flags & SHF_ALLOC)) |
294 | continue; | ||
295 | |||
296 | if (strcmp(".ARM.exidx.init.text", secname) == 0) | ||
297 | maps[ARM_SEC_INIT].unw_sec = s; | ||
298 | else if (strcmp(".ARM.exidx.devinit.text", secname) == 0) | ||
299 | maps[ARM_SEC_DEVINIT].unw_sec = s; | ||
300 | else if (strcmp(".ARM.exidx", secname) == 0) | ||
301 | maps[ARM_SEC_CORE].unw_sec = s; | ||
302 | else if (strcmp(".ARM.exidx.exit.text", secname) == 0) | ||
303 | maps[ARM_SEC_EXIT].unw_sec = s; | ||
304 | else if (strcmp(".ARM.exidx.devexit.text", secname) == 0) | ||
305 | maps[ARM_SEC_DEVEXIT].unw_sec = s; | ||
306 | else if (strcmp(".init.text", secname) == 0) | ||
307 | maps[ARM_SEC_INIT].txt_sec = s; | ||
308 | else if (strcmp(".devinit.text", secname) == 0) | ||
309 | maps[ARM_SEC_DEVINIT].txt_sec = s; | ||
310 | else if (strcmp(".text", secname) == 0) | ||
311 | maps[ARM_SEC_CORE].txt_sec = s; | ||
312 | else if (strcmp(".exit.text", secname) == 0) | ||
313 | maps[ARM_SEC_EXIT].txt_sec = s; | ||
314 | else if (strcmp(".devexit.text", secname) == 0) | ||
315 | maps[ARM_SEC_DEVEXIT].txt_sec = s; | ||
314 | } | 316 | } |
315 | } | ||
316 | 317 | ||
317 | static void unregister_unwind_tables(struct module *mod) | 318 | for (i = 0; i < ARM_SEC_MAX; i++) |
318 | { | 319 | if (maps[i].unw_sec && maps[i].txt_sec) |
319 | int i = ARM_SEC_MAX; | 320 | mod->arch.unwind[i] = |
320 | while (--i >= 0) | 321 | unwind_table_add(maps[i].unw_sec->sh_addr, |
321 | unwind_table_del(mod->arch.map[i].unwind); | 322 | maps[i].unw_sec->sh_size, |
322 | } | 323 | maps[i].txt_sec->sh_addr, |
323 | #else | 324 | maps[i].txt_sec->sh_size); |
324 | static inline void register_unwind_tables(struct module *mod) { } | ||
325 | static inline void unregister_unwind_tables(struct module *mod) { } | ||
326 | #endif | 325 | #endif |
327 | |||
328 | int | ||
329 | module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, | ||
330 | struct module *module) | ||
331 | { | ||
332 | register_unwind_tables(module); | ||
333 | return 0; | 326 | return 0; |
334 | } | 327 | } |
335 | 328 | ||
336 | void | 329 | void |
337 | module_arch_cleanup(struct module *mod) | 330 | module_arch_cleanup(struct module *mod) |
338 | { | 331 | { |
339 | unregister_unwind_tables(mod); | 332 | #ifdef CONFIG_ARM_UNWIND |
333 | int i; | ||
334 | |||
335 | for (i = 0; i < ARM_SEC_MAX; i++) | ||
336 | if (mod->arch.unwind[i]) | ||
337 | unwind_table_del(mod->arch.unwind[i]); | ||
338 | #endif | ||
340 | } | 339 | } |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index fdfa4976b0bf..5efa2647a2fb 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -4,9 +4,7 @@ | |||
4 | * ARM performance counter support. | 4 | * ARM performance counter support. |
5 | * | 5 | * |
6 | * Copyright (C) 2009 picoChip Designs, Ltd., Jamie Iles | 6 | * Copyright (C) 2009 picoChip Designs, Ltd., Jamie Iles |
7 | * | 7 | * Copyright (C) 2010 ARM Ltd., Will Deacon <will.deacon@arm.com> |
8 | * ARMv7 support: Jean Pihet <jpihet@mvista.com> | ||
9 | * 2010 (c) MontaVista Software, LLC. | ||
10 | * | 8 | * |
11 | * This code is based on the sparc64 perf event code, which is in turn based | 9 | * This code is based on the sparc64 perf event code, which is in turn based |
12 | * on the x86 code. Callchain code is based on the ARM OProfile backtrace | 10 | * on the x86 code. Callchain code is based on the ARM OProfile backtrace |
@@ -34,7 +32,7 @@ static struct platform_device *pmu_device; | |||
34 | * Hardware lock to serialize accesses to PMU registers. Needed for the | 32 | * Hardware lock to serialize accesses to PMU registers. Needed for the |
35 | * read/modify/write sequences. | 33 | * read/modify/write sequences. |
36 | */ | 34 | */ |
37 | DEFINE_SPINLOCK(pmu_lock); | 35 | static DEFINE_RAW_SPINLOCK(pmu_lock); |
38 | 36 | ||
39 | /* | 37 | /* |
40 | * ARMv6 supports a maximum of 3 events, starting from index 1. If we add | 38 | * ARMv6 supports a maximum of 3 events, starting from index 1. If we add |
@@ -67,31 +65,25 @@ struct cpu_hw_events { | |||
67 | */ | 65 | */ |
68 | unsigned long active_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)]; | 66 | unsigned long active_mask[BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)]; |
69 | }; | 67 | }; |
70 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); | 68 | static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); |
71 | |||
72 | /* PMU names. */ | ||
73 | static const char *arm_pmu_names[] = { | ||
74 | [ARM_PERF_PMU_ID_XSCALE1] = "xscale1", | ||
75 | [ARM_PERF_PMU_ID_XSCALE2] = "xscale2", | ||
76 | [ARM_PERF_PMU_ID_V6] = "v6", | ||
77 | [ARM_PERF_PMU_ID_V6MP] = "v6mpcore", | ||
78 | [ARM_PERF_PMU_ID_CA8] = "ARMv7 Cortex-A8", | ||
79 | [ARM_PERF_PMU_ID_CA9] = "ARMv7 Cortex-A9", | ||
80 | }; | ||
81 | 69 | ||
82 | struct arm_pmu { | 70 | struct arm_pmu { |
83 | enum arm_perf_pmu_ids id; | 71 | enum arm_perf_pmu_ids id; |
72 | const char *name; | ||
84 | irqreturn_t (*handle_irq)(int irq_num, void *dev); | 73 | irqreturn_t (*handle_irq)(int irq_num, void *dev); |
85 | void (*enable)(struct hw_perf_event *evt, int idx); | 74 | void (*enable)(struct hw_perf_event *evt, int idx); |
86 | void (*disable)(struct hw_perf_event *evt, int idx); | 75 | void (*disable)(struct hw_perf_event *evt, int idx); |
87 | int (*event_map)(int evt); | ||
88 | u64 (*raw_event)(u64); | ||
89 | int (*get_event_idx)(struct cpu_hw_events *cpuc, | 76 | int (*get_event_idx)(struct cpu_hw_events *cpuc, |
90 | struct hw_perf_event *hwc); | 77 | struct hw_perf_event *hwc); |
91 | u32 (*read_counter)(int idx); | 78 | u32 (*read_counter)(int idx); |
92 | void (*write_counter)(int idx, u32 val); | 79 | void (*write_counter)(int idx, u32 val); |
93 | void (*start)(void); | 80 | void (*start)(void); |
94 | void (*stop)(void); | 81 | void (*stop)(void); |
82 | const unsigned (*cache_map)[PERF_COUNT_HW_CACHE_MAX] | ||
83 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
84 | [PERF_COUNT_HW_CACHE_RESULT_MAX]; | ||
85 | const unsigned (*event_map)[PERF_COUNT_HW_MAX]; | ||
86 | u32 raw_event_mask; | ||
95 | int num_events; | 87 | int num_events; |
96 | u64 max_period; | 88 | u64 max_period; |
97 | }; | 89 | }; |
@@ -136,10 +128,6 @@ EXPORT_SYMBOL_GPL(perf_num_counters); | |||
136 | 128 | ||
137 | #define CACHE_OP_UNSUPPORTED 0xFFFF | 129 | #define CACHE_OP_UNSUPPORTED 0xFFFF |
138 | 130 | ||
139 | static unsigned armpmu_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
140 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
141 | [PERF_COUNT_HW_CACHE_RESULT_MAX]; | ||
142 | |||
143 | static int | 131 | static int |
144 | armpmu_map_cache_event(u64 config) | 132 | armpmu_map_cache_event(u64 config) |
145 | { | 133 | { |
@@ -157,7 +145,7 @@ armpmu_map_cache_event(u64 config) | |||
157 | if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX) | 145 | if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX) |
158 | return -EINVAL; | 146 | return -EINVAL; |
159 | 147 | ||
160 | ret = (int)armpmu_perf_cache_map[cache_type][cache_op][cache_result]; | 148 | ret = (int)(*armpmu->cache_map)[cache_type][cache_op][cache_result]; |
161 | 149 | ||
162 | if (ret == CACHE_OP_UNSUPPORTED) | 150 | if (ret == CACHE_OP_UNSUPPORTED) |
163 | return -ENOENT; | 151 | return -ENOENT; |
@@ -166,6 +154,19 @@ armpmu_map_cache_event(u64 config) | |||
166 | } | 154 | } |
167 | 155 | ||
168 | static int | 156 | static int |
157 | armpmu_map_event(u64 config) | ||
158 | { | ||
159 | int mapping = (*armpmu->event_map)[config]; | ||
160 | return mapping == HW_OP_UNSUPPORTED ? -EOPNOTSUPP : mapping; | ||
161 | } | ||
162 | |||
163 | static int | ||
164 | armpmu_map_raw_event(u64 config) | ||
165 | { | ||
166 | return (int)(config & armpmu->raw_event_mask); | ||
167 | } | ||
168 | |||
169 | static int | ||
169 | armpmu_event_set_period(struct perf_event *event, | 170 | armpmu_event_set_period(struct perf_event *event, |
170 | struct hw_perf_event *hwc, | 171 | struct hw_perf_event *hwc, |
171 | int idx) | 172 | int idx) |
@@ -458,11 +459,11 @@ __hw_perf_event_init(struct perf_event *event) | |||
458 | 459 | ||
459 | /* Decode the generic type into an ARM event identifier. */ | 460 | /* Decode the generic type into an ARM event identifier. */ |
460 | if (PERF_TYPE_HARDWARE == event->attr.type) { | 461 | if (PERF_TYPE_HARDWARE == event->attr.type) { |
461 | mapping = armpmu->event_map(event->attr.config); | 462 | mapping = armpmu_map_event(event->attr.config); |
462 | } else if (PERF_TYPE_HW_CACHE == event->attr.type) { | 463 | } else if (PERF_TYPE_HW_CACHE == event->attr.type) { |
463 | mapping = armpmu_map_cache_event(event->attr.config); | 464 | mapping = armpmu_map_cache_event(event->attr.config); |
464 | } else if (PERF_TYPE_RAW == event->attr.type) { | 465 | } else if (PERF_TYPE_RAW == event->attr.type) { |
465 | mapping = armpmu->raw_event(event->attr.config); | 466 | mapping = armpmu_map_raw_event(event->attr.config); |
466 | } else { | 467 | } else { |
467 | pr_debug("event type %x not supported\n", event->attr.type); | 468 | pr_debug("event type %x not supported\n", event->attr.type); |
468 | return -EOPNOTSUPP; | 469 | return -EOPNOTSUPP; |
@@ -603,2366 +604,10 @@ static struct pmu pmu = { | |||
603 | .read = armpmu_read, | 604 | .read = armpmu_read, |
604 | }; | 605 | }; |
605 | 606 | ||
606 | /* | 607 | /* Include the PMU-specific implementations. */ |
607 | * ARMv6 Performance counter handling code. | 608 | #include "perf_event_xscale.c" |
608 | * | 609 | #include "perf_event_v6.c" |
609 | * ARMv6 has 2 configurable performance counters and a single cycle counter. | 610 | #include "perf_event_v7.c" |
610 | * They all share a single reset bit but can be written to zero so we can use | ||
611 | * that for a reset. | ||
612 | * | ||
613 | * The counters can't be individually enabled or disabled so when we remove | ||
614 | * one event and replace it with another we could get spurious counts from the | ||
615 | * wrong event. However, we can take advantage of the fact that the | ||
616 | * performance counters can export events to the event bus, and the event bus | ||
617 | * itself can be monitored. This requires that we *don't* export the events to | ||
618 | * the event bus. The procedure for disabling a configurable counter is: | ||
619 | * - change the counter to count the ETMEXTOUT[0] signal (0x20). This | ||
620 | * effectively stops the counter from counting. | ||
621 | * - disable the counter's interrupt generation (each counter has it's | ||
622 | * own interrupt enable bit). | ||
623 | * Once stopped, the counter value can be written as 0 to reset. | ||
624 | * | ||
625 | * To enable a counter: | ||
626 | * - enable the counter's interrupt generation. | ||
627 | * - set the new event type. | ||
628 | * | ||
629 | * Note: the dedicated cycle counter only counts cycles and can't be | ||
630 | * enabled/disabled independently of the others. When we want to disable the | ||
631 | * cycle counter, we have to just disable the interrupt reporting and start | ||
632 | * ignoring that counter. When re-enabling, we have to reset the value and | ||
633 | * enable the interrupt. | ||
634 | */ | ||
635 | |||
636 | enum armv6_perf_types { | ||
637 | ARMV6_PERFCTR_ICACHE_MISS = 0x0, | ||
638 | ARMV6_PERFCTR_IBUF_STALL = 0x1, | ||
639 | ARMV6_PERFCTR_DDEP_STALL = 0x2, | ||
640 | ARMV6_PERFCTR_ITLB_MISS = 0x3, | ||
641 | ARMV6_PERFCTR_DTLB_MISS = 0x4, | ||
642 | ARMV6_PERFCTR_BR_EXEC = 0x5, | ||
643 | ARMV6_PERFCTR_BR_MISPREDICT = 0x6, | ||
644 | ARMV6_PERFCTR_INSTR_EXEC = 0x7, | ||
645 | ARMV6_PERFCTR_DCACHE_HIT = 0x9, | ||
646 | ARMV6_PERFCTR_DCACHE_ACCESS = 0xA, | ||
647 | ARMV6_PERFCTR_DCACHE_MISS = 0xB, | ||
648 | ARMV6_PERFCTR_DCACHE_WBACK = 0xC, | ||
649 | ARMV6_PERFCTR_SW_PC_CHANGE = 0xD, | ||
650 | ARMV6_PERFCTR_MAIN_TLB_MISS = 0xF, | ||
651 | ARMV6_PERFCTR_EXPL_D_ACCESS = 0x10, | ||
652 | ARMV6_PERFCTR_LSU_FULL_STALL = 0x11, | ||
653 | ARMV6_PERFCTR_WBUF_DRAINED = 0x12, | ||
654 | ARMV6_PERFCTR_CPU_CYCLES = 0xFF, | ||
655 | ARMV6_PERFCTR_NOP = 0x20, | ||
656 | }; | ||
657 | |||
658 | enum armv6_counters { | ||
659 | ARMV6_CYCLE_COUNTER = 1, | ||
660 | ARMV6_COUNTER0, | ||
661 | ARMV6_COUNTER1, | ||
662 | }; | ||
663 | |||
664 | /* | ||
665 | * The hardware events that we support. We do support cache operations but | ||
666 | * we have harvard caches and no way to combine instruction and data | ||
667 | * accesses/misses in hardware. | ||
668 | */ | ||
669 | static const unsigned armv6_perf_map[PERF_COUNT_HW_MAX] = { | ||
670 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV6_PERFCTR_CPU_CYCLES, | ||
671 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6_PERFCTR_INSTR_EXEC, | ||
672 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
673 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
674 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6_PERFCTR_BR_EXEC, | ||
675 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6_PERFCTR_BR_MISPREDICT, | ||
676 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
677 | }; | ||
678 | |||
679 | static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
680 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
681 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
682 | [C(L1D)] = { | ||
683 | /* | ||
684 | * The performance counters don't differentiate between read | ||
685 | * and write accesses/misses so this isn't strictly correct, | ||
686 | * but it's the best we can do. Writes and reads get | ||
687 | * combined. | ||
688 | */ | ||
689 | [C(OP_READ)] = { | ||
690 | [C(RESULT_ACCESS)] = ARMV6_PERFCTR_DCACHE_ACCESS, | ||
691 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DCACHE_MISS, | ||
692 | }, | ||
693 | [C(OP_WRITE)] = { | ||
694 | [C(RESULT_ACCESS)] = ARMV6_PERFCTR_DCACHE_ACCESS, | ||
695 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DCACHE_MISS, | ||
696 | }, | ||
697 | [C(OP_PREFETCH)] = { | ||
698 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
699 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
700 | }, | ||
701 | }, | ||
702 | [C(L1I)] = { | ||
703 | [C(OP_READ)] = { | ||
704 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
705 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS, | ||
706 | }, | ||
707 | [C(OP_WRITE)] = { | ||
708 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
709 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS, | ||
710 | }, | ||
711 | [C(OP_PREFETCH)] = { | ||
712 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
713 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
714 | }, | ||
715 | }, | ||
716 | [C(LL)] = { | ||
717 | [C(OP_READ)] = { | ||
718 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
719 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
720 | }, | ||
721 | [C(OP_WRITE)] = { | ||
722 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
723 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
724 | }, | ||
725 | [C(OP_PREFETCH)] = { | ||
726 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
727 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
728 | }, | ||
729 | }, | ||
730 | [C(DTLB)] = { | ||
731 | /* | ||
732 | * The ARM performance counters can count micro DTLB misses, | ||
733 | * micro ITLB misses and main TLB misses. There isn't an event | ||
734 | * for TLB misses, so use the micro misses here and if users | ||
735 | * want the main TLB misses they can use a raw counter. | ||
736 | */ | ||
737 | [C(OP_READ)] = { | ||
738 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
739 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DTLB_MISS, | ||
740 | }, | ||
741 | [C(OP_WRITE)] = { | ||
742 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
743 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DTLB_MISS, | ||
744 | }, | ||
745 | [C(OP_PREFETCH)] = { | ||
746 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
747 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
748 | }, | ||
749 | }, | ||
750 | [C(ITLB)] = { | ||
751 | [C(OP_READ)] = { | ||
752 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
753 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ITLB_MISS, | ||
754 | }, | ||
755 | [C(OP_WRITE)] = { | ||
756 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
757 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ITLB_MISS, | ||
758 | }, | ||
759 | [C(OP_PREFETCH)] = { | ||
760 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
761 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
762 | }, | ||
763 | }, | ||
764 | [C(BPU)] = { | ||
765 | [C(OP_READ)] = { | ||
766 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
767 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
768 | }, | ||
769 | [C(OP_WRITE)] = { | ||
770 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
771 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
772 | }, | ||
773 | [C(OP_PREFETCH)] = { | ||
774 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
775 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
776 | }, | ||
777 | }, | ||
778 | }; | ||
779 | |||
780 | enum armv6mpcore_perf_types { | ||
781 | ARMV6MPCORE_PERFCTR_ICACHE_MISS = 0x0, | ||
782 | ARMV6MPCORE_PERFCTR_IBUF_STALL = 0x1, | ||
783 | ARMV6MPCORE_PERFCTR_DDEP_STALL = 0x2, | ||
784 | ARMV6MPCORE_PERFCTR_ITLB_MISS = 0x3, | ||
785 | ARMV6MPCORE_PERFCTR_DTLB_MISS = 0x4, | ||
786 | ARMV6MPCORE_PERFCTR_BR_EXEC = 0x5, | ||
787 | ARMV6MPCORE_PERFCTR_BR_NOTPREDICT = 0x6, | ||
788 | ARMV6MPCORE_PERFCTR_BR_MISPREDICT = 0x7, | ||
789 | ARMV6MPCORE_PERFCTR_INSTR_EXEC = 0x8, | ||
790 | ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS = 0xA, | ||
791 | ARMV6MPCORE_PERFCTR_DCACHE_RDMISS = 0xB, | ||
792 | ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS = 0xC, | ||
793 | ARMV6MPCORE_PERFCTR_DCACHE_WRMISS = 0xD, | ||
794 | ARMV6MPCORE_PERFCTR_DCACHE_EVICTION = 0xE, | ||
795 | ARMV6MPCORE_PERFCTR_SW_PC_CHANGE = 0xF, | ||
796 | ARMV6MPCORE_PERFCTR_MAIN_TLB_MISS = 0x10, | ||
797 | ARMV6MPCORE_PERFCTR_EXPL_MEM_ACCESS = 0x11, | ||
798 | ARMV6MPCORE_PERFCTR_LSU_FULL_STALL = 0x12, | ||
799 | ARMV6MPCORE_PERFCTR_WBUF_DRAINED = 0x13, | ||
800 | ARMV6MPCORE_PERFCTR_CPU_CYCLES = 0xFF, | ||
801 | }; | ||
802 | |||
803 | /* | ||
804 | * The hardware events that we support. We do support cache operations but | ||
805 | * we have harvard caches and no way to combine instruction and data | ||
806 | * accesses/misses in hardware. | ||
807 | */ | ||
808 | static const unsigned armv6mpcore_perf_map[PERF_COUNT_HW_MAX] = { | ||
809 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV6MPCORE_PERFCTR_CPU_CYCLES, | ||
810 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_INSTR_EXEC, | ||
811 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
812 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
813 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_BR_EXEC, | ||
814 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6MPCORE_PERFCTR_BR_MISPREDICT, | ||
815 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
816 | }; | ||
817 | |||
818 | static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
819 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
820 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
821 | [C(L1D)] = { | ||
822 | [C(OP_READ)] = { | ||
823 | [C(RESULT_ACCESS)] = | ||
824 | ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS, | ||
825 | [C(RESULT_MISS)] = | ||
826 | ARMV6MPCORE_PERFCTR_DCACHE_RDMISS, | ||
827 | }, | ||
828 | [C(OP_WRITE)] = { | ||
829 | [C(RESULT_ACCESS)] = | ||
830 | ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS, | ||
831 | [C(RESULT_MISS)] = | ||
832 | ARMV6MPCORE_PERFCTR_DCACHE_WRMISS, | ||
833 | }, | ||
834 | [C(OP_PREFETCH)] = { | ||
835 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
836 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
837 | }, | ||
838 | }, | ||
839 | [C(L1I)] = { | ||
840 | [C(OP_READ)] = { | ||
841 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
842 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS, | ||
843 | }, | ||
844 | [C(OP_WRITE)] = { | ||
845 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
846 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS, | ||
847 | }, | ||
848 | [C(OP_PREFETCH)] = { | ||
849 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
850 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
851 | }, | ||
852 | }, | ||
853 | [C(LL)] = { | ||
854 | [C(OP_READ)] = { | ||
855 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
856 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
857 | }, | ||
858 | [C(OP_WRITE)] = { | ||
859 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
860 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
861 | }, | ||
862 | [C(OP_PREFETCH)] = { | ||
863 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
864 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
865 | }, | ||
866 | }, | ||
867 | [C(DTLB)] = { | ||
868 | /* | ||
869 | * The ARM performance counters can count micro DTLB misses, | ||
870 | * micro ITLB misses and main TLB misses. There isn't an event | ||
871 | * for TLB misses, so use the micro misses here and if users | ||
872 | * want the main TLB misses they can use a raw counter. | ||
873 | */ | ||
874 | [C(OP_READ)] = { | ||
875 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
876 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_DTLB_MISS, | ||
877 | }, | ||
878 | [C(OP_WRITE)] = { | ||
879 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
880 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_DTLB_MISS, | ||
881 | }, | ||
882 | [C(OP_PREFETCH)] = { | ||
883 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
884 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
885 | }, | ||
886 | }, | ||
887 | [C(ITLB)] = { | ||
888 | [C(OP_READ)] = { | ||
889 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
890 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ITLB_MISS, | ||
891 | }, | ||
892 | [C(OP_WRITE)] = { | ||
893 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
894 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ITLB_MISS, | ||
895 | }, | ||
896 | [C(OP_PREFETCH)] = { | ||
897 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
898 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
899 | }, | ||
900 | }, | ||
901 | [C(BPU)] = { | ||
902 | [C(OP_READ)] = { | ||
903 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
904 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
905 | }, | ||
906 | [C(OP_WRITE)] = { | ||
907 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
908 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
909 | }, | ||
910 | [C(OP_PREFETCH)] = { | ||
911 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
912 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
913 | }, | ||
914 | }, | ||
915 | }; | ||
916 | |||
917 | static inline unsigned long | ||
918 | armv6_pmcr_read(void) | ||
919 | { | ||
920 | u32 val; | ||
921 | asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r"(val)); | ||
922 | return val; | ||
923 | } | ||
924 | |||
925 | static inline void | ||
926 | armv6_pmcr_write(unsigned long val) | ||
927 | { | ||
928 | asm volatile("mcr p15, 0, %0, c15, c12, 0" : : "r"(val)); | ||
929 | } | ||
930 | |||
931 | #define ARMV6_PMCR_ENABLE (1 << 0) | ||
932 | #define ARMV6_PMCR_CTR01_RESET (1 << 1) | ||
933 | #define ARMV6_PMCR_CCOUNT_RESET (1 << 2) | ||
934 | #define ARMV6_PMCR_CCOUNT_DIV (1 << 3) | ||
935 | #define ARMV6_PMCR_COUNT0_IEN (1 << 4) | ||
936 | #define ARMV6_PMCR_COUNT1_IEN (1 << 5) | ||
937 | #define ARMV6_PMCR_CCOUNT_IEN (1 << 6) | ||
938 | #define ARMV6_PMCR_COUNT0_OVERFLOW (1 << 8) | ||
939 | #define ARMV6_PMCR_COUNT1_OVERFLOW (1 << 9) | ||
940 | #define ARMV6_PMCR_CCOUNT_OVERFLOW (1 << 10) | ||
941 | #define ARMV6_PMCR_EVT_COUNT0_SHIFT 20 | ||
942 | #define ARMV6_PMCR_EVT_COUNT0_MASK (0xFF << ARMV6_PMCR_EVT_COUNT0_SHIFT) | ||
943 | #define ARMV6_PMCR_EVT_COUNT1_SHIFT 12 | ||
944 | #define ARMV6_PMCR_EVT_COUNT1_MASK (0xFF << ARMV6_PMCR_EVT_COUNT1_SHIFT) | ||
945 | |||
946 | #define ARMV6_PMCR_OVERFLOWED_MASK \ | ||
947 | (ARMV6_PMCR_COUNT0_OVERFLOW | ARMV6_PMCR_COUNT1_OVERFLOW | \ | ||
948 | ARMV6_PMCR_CCOUNT_OVERFLOW) | ||
949 | |||
950 | static inline int | ||
951 | armv6_pmcr_has_overflowed(unsigned long pmcr) | ||
952 | { | ||
953 | return (pmcr & ARMV6_PMCR_OVERFLOWED_MASK); | ||
954 | } | ||
955 | |||
956 | static inline int | ||
957 | armv6_pmcr_counter_has_overflowed(unsigned long pmcr, | ||
958 | enum armv6_counters counter) | ||
959 | { | ||
960 | int ret = 0; | ||
961 | |||
962 | if (ARMV6_CYCLE_COUNTER == counter) | ||
963 | ret = pmcr & ARMV6_PMCR_CCOUNT_OVERFLOW; | ||
964 | else if (ARMV6_COUNTER0 == counter) | ||
965 | ret = pmcr & ARMV6_PMCR_COUNT0_OVERFLOW; | ||
966 | else if (ARMV6_COUNTER1 == counter) | ||
967 | ret = pmcr & ARMV6_PMCR_COUNT1_OVERFLOW; | ||
968 | else | ||
969 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
970 | |||
971 | return ret; | ||
972 | } | ||
973 | |||
974 | static inline u32 | ||
975 | armv6pmu_read_counter(int counter) | ||
976 | { | ||
977 | unsigned long value = 0; | ||
978 | |||
979 | if (ARMV6_CYCLE_COUNTER == counter) | ||
980 | asm volatile("mrc p15, 0, %0, c15, c12, 1" : "=r"(value)); | ||
981 | else if (ARMV6_COUNTER0 == counter) | ||
982 | asm volatile("mrc p15, 0, %0, c15, c12, 2" : "=r"(value)); | ||
983 | else if (ARMV6_COUNTER1 == counter) | ||
984 | asm volatile("mrc p15, 0, %0, c15, c12, 3" : "=r"(value)); | ||
985 | else | ||
986 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
987 | |||
988 | return value; | ||
989 | } | ||
990 | |||
991 | static inline void | ||
992 | armv6pmu_write_counter(int counter, | ||
993 | u32 value) | ||
994 | { | ||
995 | if (ARMV6_CYCLE_COUNTER == counter) | ||
996 | asm volatile("mcr p15, 0, %0, c15, c12, 1" : : "r"(value)); | ||
997 | else if (ARMV6_COUNTER0 == counter) | ||
998 | asm volatile("mcr p15, 0, %0, c15, c12, 2" : : "r"(value)); | ||
999 | else if (ARMV6_COUNTER1 == counter) | ||
1000 | asm volatile("mcr p15, 0, %0, c15, c12, 3" : : "r"(value)); | ||
1001 | else | ||
1002 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
1003 | } | ||
1004 | |||
1005 | void | ||
1006 | armv6pmu_enable_event(struct hw_perf_event *hwc, | ||
1007 | int idx) | ||
1008 | { | ||
1009 | unsigned long val, mask, evt, flags; | ||
1010 | |||
1011 | if (ARMV6_CYCLE_COUNTER == idx) { | ||
1012 | mask = 0; | ||
1013 | evt = ARMV6_PMCR_CCOUNT_IEN; | ||
1014 | } else if (ARMV6_COUNTER0 == idx) { | ||
1015 | mask = ARMV6_PMCR_EVT_COUNT0_MASK; | ||
1016 | evt = (hwc->config_base << ARMV6_PMCR_EVT_COUNT0_SHIFT) | | ||
1017 | ARMV6_PMCR_COUNT0_IEN; | ||
1018 | } else if (ARMV6_COUNTER1 == idx) { | ||
1019 | mask = ARMV6_PMCR_EVT_COUNT1_MASK; | ||
1020 | evt = (hwc->config_base << ARMV6_PMCR_EVT_COUNT1_SHIFT) | | ||
1021 | ARMV6_PMCR_COUNT1_IEN; | ||
1022 | } else { | ||
1023 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
1024 | return; | ||
1025 | } | ||
1026 | |||
1027 | /* | ||
1028 | * Mask out the current event and set the counter to count the event | ||
1029 | * that we're interested in. | ||
1030 | */ | ||
1031 | spin_lock_irqsave(&pmu_lock, flags); | ||
1032 | val = armv6_pmcr_read(); | ||
1033 | val &= ~mask; | ||
1034 | val |= evt; | ||
1035 | armv6_pmcr_write(val); | ||
1036 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1037 | } | ||
1038 | |||
1039 | static irqreturn_t | ||
1040 | armv6pmu_handle_irq(int irq_num, | ||
1041 | void *dev) | ||
1042 | { | ||
1043 | unsigned long pmcr = armv6_pmcr_read(); | ||
1044 | struct perf_sample_data data; | ||
1045 | struct cpu_hw_events *cpuc; | ||
1046 | struct pt_regs *regs; | ||
1047 | int idx; | ||
1048 | |||
1049 | if (!armv6_pmcr_has_overflowed(pmcr)) | ||
1050 | return IRQ_NONE; | ||
1051 | |||
1052 | regs = get_irq_regs(); | ||
1053 | |||
1054 | /* | ||
1055 | * The interrupts are cleared by writing the overflow flags back to | ||
1056 | * the control register. All of the other bits don't have any effect | ||
1057 | * if they are rewritten, so write the whole value back. | ||
1058 | */ | ||
1059 | armv6_pmcr_write(pmcr); | ||
1060 | |||
1061 | perf_sample_data_init(&data, 0); | ||
1062 | |||
1063 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
1064 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
1065 | struct perf_event *event = cpuc->events[idx]; | ||
1066 | struct hw_perf_event *hwc; | ||
1067 | |||
1068 | if (!test_bit(idx, cpuc->active_mask)) | ||
1069 | continue; | ||
1070 | |||
1071 | /* | ||
1072 | * We have a single interrupt for all counters. Check that | ||
1073 | * each counter has overflowed before we process it. | ||
1074 | */ | ||
1075 | if (!armv6_pmcr_counter_has_overflowed(pmcr, idx)) | ||
1076 | continue; | ||
1077 | |||
1078 | hwc = &event->hw; | ||
1079 | armpmu_event_update(event, hwc, idx); | ||
1080 | data.period = event->hw.last_period; | ||
1081 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
1082 | continue; | ||
1083 | |||
1084 | if (perf_event_overflow(event, 0, &data, regs)) | ||
1085 | armpmu->disable(hwc, idx); | ||
1086 | } | ||
1087 | |||
1088 | /* | ||
1089 | * Handle the pending perf events. | ||
1090 | * | ||
1091 | * Note: this call *must* be run with interrupts disabled. For | ||
1092 | * platforms that can have the PMU interrupts raised as an NMI, this | ||
1093 | * will not work. | ||
1094 | */ | ||
1095 | irq_work_run(); | ||
1096 | |||
1097 | return IRQ_HANDLED; | ||
1098 | } | ||
1099 | |||
1100 | static void | ||
1101 | armv6pmu_start(void) | ||
1102 | { | ||
1103 | unsigned long flags, val; | ||
1104 | |||
1105 | spin_lock_irqsave(&pmu_lock, flags); | ||
1106 | val = armv6_pmcr_read(); | ||
1107 | val |= ARMV6_PMCR_ENABLE; | ||
1108 | armv6_pmcr_write(val); | ||
1109 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1110 | } | ||
1111 | |||
1112 | void | ||
1113 | armv6pmu_stop(void) | ||
1114 | { | ||
1115 | unsigned long flags, val; | ||
1116 | |||
1117 | spin_lock_irqsave(&pmu_lock, flags); | ||
1118 | val = armv6_pmcr_read(); | ||
1119 | val &= ~ARMV6_PMCR_ENABLE; | ||
1120 | armv6_pmcr_write(val); | ||
1121 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1122 | } | ||
1123 | |||
1124 | static inline int | ||
1125 | armv6pmu_event_map(int config) | ||
1126 | { | ||
1127 | int mapping = armv6_perf_map[config]; | ||
1128 | if (HW_OP_UNSUPPORTED == mapping) | ||
1129 | mapping = -EOPNOTSUPP; | ||
1130 | return mapping; | ||
1131 | } | ||
1132 | |||
1133 | static inline int | ||
1134 | armv6mpcore_pmu_event_map(int config) | ||
1135 | { | ||
1136 | int mapping = armv6mpcore_perf_map[config]; | ||
1137 | if (HW_OP_UNSUPPORTED == mapping) | ||
1138 | mapping = -EOPNOTSUPP; | ||
1139 | return mapping; | ||
1140 | } | ||
1141 | |||
1142 | static u64 | ||
1143 | armv6pmu_raw_event(u64 config) | ||
1144 | { | ||
1145 | return config & 0xff; | ||
1146 | } | ||
1147 | |||
1148 | static int | ||
1149 | armv6pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
1150 | struct hw_perf_event *event) | ||
1151 | { | ||
1152 | /* Always place a cycle counter into the cycle counter. */ | ||
1153 | if (ARMV6_PERFCTR_CPU_CYCLES == event->config_base) { | ||
1154 | if (test_and_set_bit(ARMV6_CYCLE_COUNTER, cpuc->used_mask)) | ||
1155 | return -EAGAIN; | ||
1156 | |||
1157 | return ARMV6_CYCLE_COUNTER; | ||
1158 | } else { | ||
1159 | /* | ||
1160 | * For anything other than a cycle counter, try and use | ||
1161 | * counter0 and counter1. | ||
1162 | */ | ||
1163 | if (!test_and_set_bit(ARMV6_COUNTER1, cpuc->used_mask)) { | ||
1164 | return ARMV6_COUNTER1; | ||
1165 | } | ||
1166 | |||
1167 | if (!test_and_set_bit(ARMV6_COUNTER0, cpuc->used_mask)) { | ||
1168 | return ARMV6_COUNTER0; | ||
1169 | } | ||
1170 | |||
1171 | /* The counters are all in use. */ | ||
1172 | return -EAGAIN; | ||
1173 | } | ||
1174 | } | ||
1175 | |||
1176 | static void | ||
1177 | armv6pmu_disable_event(struct hw_perf_event *hwc, | ||
1178 | int idx) | ||
1179 | { | ||
1180 | unsigned long val, mask, evt, flags; | ||
1181 | |||
1182 | if (ARMV6_CYCLE_COUNTER == idx) { | ||
1183 | mask = ARMV6_PMCR_CCOUNT_IEN; | ||
1184 | evt = 0; | ||
1185 | } else if (ARMV6_COUNTER0 == idx) { | ||
1186 | mask = ARMV6_PMCR_COUNT0_IEN | ARMV6_PMCR_EVT_COUNT0_MASK; | ||
1187 | evt = ARMV6_PERFCTR_NOP << ARMV6_PMCR_EVT_COUNT0_SHIFT; | ||
1188 | } else if (ARMV6_COUNTER1 == idx) { | ||
1189 | mask = ARMV6_PMCR_COUNT1_IEN | ARMV6_PMCR_EVT_COUNT1_MASK; | ||
1190 | evt = ARMV6_PERFCTR_NOP << ARMV6_PMCR_EVT_COUNT1_SHIFT; | ||
1191 | } else { | ||
1192 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
1193 | return; | ||
1194 | } | ||
1195 | |||
1196 | /* | ||
1197 | * Mask out the current event and set the counter to count the number | ||
1198 | * of ETM bus signal assertion cycles. The external reporting should | ||
1199 | * be disabled and so this should never increment. | ||
1200 | */ | ||
1201 | spin_lock_irqsave(&pmu_lock, flags); | ||
1202 | val = armv6_pmcr_read(); | ||
1203 | val &= ~mask; | ||
1204 | val |= evt; | ||
1205 | armv6_pmcr_write(val); | ||
1206 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1207 | } | ||
1208 | |||
1209 | static void | ||
1210 | armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc, | ||
1211 | int idx) | ||
1212 | { | ||
1213 | unsigned long val, mask, flags, evt = 0; | ||
1214 | |||
1215 | if (ARMV6_CYCLE_COUNTER == idx) { | ||
1216 | mask = ARMV6_PMCR_CCOUNT_IEN; | ||
1217 | } else if (ARMV6_COUNTER0 == idx) { | ||
1218 | mask = ARMV6_PMCR_COUNT0_IEN; | ||
1219 | } else if (ARMV6_COUNTER1 == idx) { | ||
1220 | mask = ARMV6_PMCR_COUNT1_IEN; | ||
1221 | } else { | ||
1222 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
1223 | return; | ||
1224 | } | ||
1225 | |||
1226 | /* | ||
1227 | * Unlike UP ARMv6, we don't have a way of stopping the counters. We | ||
1228 | * simply disable the interrupt reporting. | ||
1229 | */ | ||
1230 | spin_lock_irqsave(&pmu_lock, flags); | ||
1231 | val = armv6_pmcr_read(); | ||
1232 | val &= ~mask; | ||
1233 | val |= evt; | ||
1234 | armv6_pmcr_write(val); | ||
1235 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1236 | } | ||
1237 | |||
1238 | static const struct arm_pmu armv6pmu = { | ||
1239 | .id = ARM_PERF_PMU_ID_V6, | ||
1240 | .handle_irq = armv6pmu_handle_irq, | ||
1241 | .enable = armv6pmu_enable_event, | ||
1242 | .disable = armv6pmu_disable_event, | ||
1243 | .event_map = armv6pmu_event_map, | ||
1244 | .raw_event = armv6pmu_raw_event, | ||
1245 | .read_counter = armv6pmu_read_counter, | ||
1246 | .write_counter = armv6pmu_write_counter, | ||
1247 | .get_event_idx = armv6pmu_get_event_idx, | ||
1248 | .start = armv6pmu_start, | ||
1249 | .stop = armv6pmu_stop, | ||
1250 | .num_events = 3, | ||
1251 | .max_period = (1LLU << 32) - 1, | ||
1252 | }; | ||
1253 | |||
1254 | /* | ||
1255 | * ARMv6mpcore is almost identical to single core ARMv6 with the exception | ||
1256 | * that some of the events have different enumerations and that there is no | ||
1257 | * *hack* to stop the programmable counters. To stop the counters we simply | ||
1258 | * disable the interrupt reporting and update the event. When unthrottling we | ||
1259 | * reset the period and enable the interrupt reporting. | ||
1260 | */ | ||
1261 | static const struct arm_pmu armv6mpcore_pmu = { | ||
1262 | .id = ARM_PERF_PMU_ID_V6MP, | ||
1263 | .handle_irq = armv6pmu_handle_irq, | ||
1264 | .enable = armv6pmu_enable_event, | ||
1265 | .disable = armv6mpcore_pmu_disable_event, | ||
1266 | .event_map = armv6mpcore_pmu_event_map, | ||
1267 | .raw_event = armv6pmu_raw_event, | ||
1268 | .read_counter = armv6pmu_read_counter, | ||
1269 | .write_counter = armv6pmu_write_counter, | ||
1270 | .get_event_idx = armv6pmu_get_event_idx, | ||
1271 | .start = armv6pmu_start, | ||
1272 | .stop = armv6pmu_stop, | ||
1273 | .num_events = 3, | ||
1274 | .max_period = (1LLU << 32) - 1, | ||
1275 | }; | ||
1276 | |||
1277 | /* | ||
1278 | * ARMv7 Cortex-A8 and Cortex-A9 Performance Events handling code. | ||
1279 | * | ||
1280 | * Copied from ARMv6 code, with the low level code inspired | ||
1281 | * by the ARMv7 Oprofile code. | ||
1282 | * | ||
1283 | * Cortex-A8 has up to 4 configurable performance counters and | ||
1284 | * a single cycle counter. | ||
1285 | * Cortex-A9 has up to 31 configurable performance counters and | ||
1286 | * a single cycle counter. | ||
1287 | * | ||
1288 | * All counters can be enabled/disabled and IRQ masked separately. The cycle | ||
1289 | * counter and all 4 performance counters together can be reset separately. | ||
1290 | */ | ||
1291 | |||
1292 | /* Common ARMv7 event types */ | ||
1293 | enum armv7_perf_types { | ||
1294 | ARMV7_PERFCTR_PMNC_SW_INCR = 0x00, | ||
1295 | ARMV7_PERFCTR_IFETCH_MISS = 0x01, | ||
1296 | ARMV7_PERFCTR_ITLB_MISS = 0x02, | ||
1297 | ARMV7_PERFCTR_DCACHE_REFILL = 0x03, | ||
1298 | ARMV7_PERFCTR_DCACHE_ACCESS = 0x04, | ||
1299 | ARMV7_PERFCTR_DTLB_REFILL = 0x05, | ||
1300 | ARMV7_PERFCTR_DREAD = 0x06, | ||
1301 | ARMV7_PERFCTR_DWRITE = 0x07, | ||
1302 | |||
1303 | ARMV7_PERFCTR_EXC_TAKEN = 0x09, | ||
1304 | ARMV7_PERFCTR_EXC_EXECUTED = 0x0A, | ||
1305 | ARMV7_PERFCTR_CID_WRITE = 0x0B, | ||
1306 | /* ARMV7_PERFCTR_PC_WRITE is equivalent to HW_BRANCH_INSTRUCTIONS. | ||
1307 | * It counts: | ||
1308 | * - all branch instructions, | ||
1309 | * - instructions that explicitly write the PC, | ||
1310 | * - exception generating instructions. | ||
1311 | */ | ||
1312 | ARMV7_PERFCTR_PC_WRITE = 0x0C, | ||
1313 | ARMV7_PERFCTR_PC_IMM_BRANCH = 0x0D, | ||
1314 | ARMV7_PERFCTR_UNALIGNED_ACCESS = 0x0F, | ||
1315 | ARMV7_PERFCTR_PC_BRANCH_MIS_PRED = 0x10, | ||
1316 | ARMV7_PERFCTR_CLOCK_CYCLES = 0x11, | ||
1317 | |||
1318 | ARMV7_PERFCTR_PC_BRANCH_MIS_USED = 0x12, | ||
1319 | |||
1320 | ARMV7_PERFCTR_CPU_CYCLES = 0xFF | ||
1321 | }; | ||
1322 | |||
1323 | /* ARMv7 Cortex-A8 specific event types */ | ||
1324 | enum armv7_a8_perf_types { | ||
1325 | ARMV7_PERFCTR_INSTR_EXECUTED = 0x08, | ||
1326 | |||
1327 | ARMV7_PERFCTR_PC_PROC_RETURN = 0x0E, | ||
1328 | |||
1329 | ARMV7_PERFCTR_WRITE_BUFFER_FULL = 0x40, | ||
1330 | ARMV7_PERFCTR_L2_STORE_MERGED = 0x41, | ||
1331 | ARMV7_PERFCTR_L2_STORE_BUFF = 0x42, | ||
1332 | ARMV7_PERFCTR_L2_ACCESS = 0x43, | ||
1333 | ARMV7_PERFCTR_L2_CACH_MISS = 0x44, | ||
1334 | ARMV7_PERFCTR_AXI_READ_CYCLES = 0x45, | ||
1335 | ARMV7_PERFCTR_AXI_WRITE_CYCLES = 0x46, | ||
1336 | ARMV7_PERFCTR_MEMORY_REPLAY = 0x47, | ||
1337 | ARMV7_PERFCTR_UNALIGNED_ACCESS_REPLAY = 0x48, | ||
1338 | ARMV7_PERFCTR_L1_DATA_MISS = 0x49, | ||
1339 | ARMV7_PERFCTR_L1_INST_MISS = 0x4A, | ||
1340 | ARMV7_PERFCTR_L1_DATA_COLORING = 0x4B, | ||
1341 | ARMV7_PERFCTR_L1_NEON_DATA = 0x4C, | ||
1342 | ARMV7_PERFCTR_L1_NEON_CACH_DATA = 0x4D, | ||
1343 | ARMV7_PERFCTR_L2_NEON = 0x4E, | ||
1344 | ARMV7_PERFCTR_L2_NEON_HIT = 0x4F, | ||
1345 | ARMV7_PERFCTR_L1_INST = 0x50, | ||
1346 | ARMV7_PERFCTR_PC_RETURN_MIS_PRED = 0x51, | ||
1347 | ARMV7_PERFCTR_PC_BRANCH_FAILED = 0x52, | ||
1348 | ARMV7_PERFCTR_PC_BRANCH_TAKEN = 0x53, | ||
1349 | ARMV7_PERFCTR_PC_BRANCH_EXECUTED = 0x54, | ||
1350 | ARMV7_PERFCTR_OP_EXECUTED = 0x55, | ||
1351 | ARMV7_PERFCTR_CYCLES_INST_STALL = 0x56, | ||
1352 | ARMV7_PERFCTR_CYCLES_INST = 0x57, | ||
1353 | ARMV7_PERFCTR_CYCLES_NEON_DATA_STALL = 0x58, | ||
1354 | ARMV7_PERFCTR_CYCLES_NEON_INST_STALL = 0x59, | ||
1355 | ARMV7_PERFCTR_NEON_CYCLES = 0x5A, | ||
1356 | |||
1357 | ARMV7_PERFCTR_PMU0_EVENTS = 0x70, | ||
1358 | ARMV7_PERFCTR_PMU1_EVENTS = 0x71, | ||
1359 | ARMV7_PERFCTR_PMU_EVENTS = 0x72, | ||
1360 | }; | ||
1361 | |||
1362 | /* ARMv7 Cortex-A9 specific event types */ | ||
1363 | enum armv7_a9_perf_types { | ||
1364 | ARMV7_PERFCTR_JAVA_HW_BYTECODE_EXEC = 0x40, | ||
1365 | ARMV7_PERFCTR_JAVA_SW_BYTECODE_EXEC = 0x41, | ||
1366 | ARMV7_PERFCTR_JAZELLE_BRANCH_EXEC = 0x42, | ||
1367 | |||
1368 | ARMV7_PERFCTR_COHERENT_LINE_MISS = 0x50, | ||
1369 | ARMV7_PERFCTR_COHERENT_LINE_HIT = 0x51, | ||
1370 | |||
1371 | ARMV7_PERFCTR_ICACHE_DEP_STALL_CYCLES = 0x60, | ||
1372 | ARMV7_PERFCTR_DCACHE_DEP_STALL_CYCLES = 0x61, | ||
1373 | ARMV7_PERFCTR_TLB_MISS_DEP_STALL_CYCLES = 0x62, | ||
1374 | ARMV7_PERFCTR_STREX_EXECUTED_PASSED = 0x63, | ||
1375 | ARMV7_PERFCTR_STREX_EXECUTED_FAILED = 0x64, | ||
1376 | ARMV7_PERFCTR_DATA_EVICTION = 0x65, | ||
1377 | ARMV7_PERFCTR_ISSUE_STAGE_NO_INST = 0x66, | ||
1378 | ARMV7_PERFCTR_ISSUE_STAGE_EMPTY = 0x67, | ||
1379 | ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE = 0x68, | ||
1380 | |||
1381 | ARMV7_PERFCTR_PREDICTABLE_FUNCT_RETURNS = 0x6E, | ||
1382 | |||
1383 | ARMV7_PERFCTR_MAIN_UNIT_EXECUTED_INST = 0x70, | ||
1384 | ARMV7_PERFCTR_SECOND_UNIT_EXECUTED_INST = 0x71, | ||
1385 | ARMV7_PERFCTR_LD_ST_UNIT_EXECUTED_INST = 0x72, | ||
1386 | ARMV7_PERFCTR_FP_EXECUTED_INST = 0x73, | ||
1387 | ARMV7_PERFCTR_NEON_EXECUTED_INST = 0x74, | ||
1388 | |||
1389 | ARMV7_PERFCTR_PLD_FULL_DEP_STALL_CYCLES = 0x80, | ||
1390 | ARMV7_PERFCTR_DATA_WR_DEP_STALL_CYCLES = 0x81, | ||
1391 | ARMV7_PERFCTR_ITLB_MISS_DEP_STALL_CYCLES = 0x82, | ||
1392 | ARMV7_PERFCTR_DTLB_MISS_DEP_STALL_CYCLES = 0x83, | ||
1393 | ARMV7_PERFCTR_MICRO_ITLB_MISS_DEP_STALL_CYCLES = 0x84, | ||
1394 | ARMV7_PERFCTR_MICRO_DTLB_MISS_DEP_STALL_CYCLES = 0x85, | ||
1395 | ARMV7_PERFCTR_DMB_DEP_STALL_CYCLES = 0x86, | ||
1396 | |||
1397 | ARMV7_PERFCTR_INTGR_CLK_ENABLED_CYCLES = 0x8A, | ||
1398 | ARMV7_PERFCTR_DATA_ENGINE_CLK_EN_CYCLES = 0x8B, | ||
1399 | |||
1400 | ARMV7_PERFCTR_ISB_INST = 0x90, | ||
1401 | ARMV7_PERFCTR_DSB_INST = 0x91, | ||
1402 | ARMV7_PERFCTR_DMB_INST = 0x92, | ||
1403 | ARMV7_PERFCTR_EXT_INTERRUPTS = 0x93, | ||
1404 | |||
1405 | ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_COMPLETED = 0xA0, | ||
1406 | ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_SKIPPED = 0xA1, | ||
1407 | ARMV7_PERFCTR_PLE_FIFO_FLUSH = 0xA2, | ||
1408 | ARMV7_PERFCTR_PLE_RQST_COMPLETED = 0xA3, | ||
1409 | ARMV7_PERFCTR_PLE_FIFO_OVERFLOW = 0xA4, | ||
1410 | ARMV7_PERFCTR_PLE_RQST_PROG = 0xA5 | ||
1411 | }; | ||
1412 | |||
1413 | /* | ||
1414 | * Cortex-A8 HW events mapping | ||
1415 | * | ||
1416 | * The hardware events that we support. We do support cache operations but | ||
1417 | * we have harvard caches and no way to combine instruction and data | ||
1418 | * accesses/misses in hardware. | ||
1419 | */ | ||
1420 | static const unsigned armv7_a8_perf_map[PERF_COUNT_HW_MAX] = { | ||
1421 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, | ||
1422 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED, | ||
1423 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
1424 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
1425 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, | ||
1426 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
1427 | [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES, | ||
1428 | }; | ||
1429 | |||
1430 | static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
1431 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
1432 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
1433 | [C(L1D)] = { | ||
1434 | /* | ||
1435 | * The performance counters don't differentiate between read | ||
1436 | * and write accesses/misses so this isn't strictly correct, | ||
1437 | * but it's the best we can do. Writes and reads get | ||
1438 | * combined. | ||
1439 | */ | ||
1440 | [C(OP_READ)] = { | ||
1441 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
1442 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
1443 | }, | ||
1444 | [C(OP_WRITE)] = { | ||
1445 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
1446 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
1447 | }, | ||
1448 | [C(OP_PREFETCH)] = { | ||
1449 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1450 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1451 | }, | ||
1452 | }, | ||
1453 | [C(L1I)] = { | ||
1454 | [C(OP_READ)] = { | ||
1455 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST, | ||
1456 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS, | ||
1457 | }, | ||
1458 | [C(OP_WRITE)] = { | ||
1459 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST, | ||
1460 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS, | ||
1461 | }, | ||
1462 | [C(OP_PREFETCH)] = { | ||
1463 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1464 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1465 | }, | ||
1466 | }, | ||
1467 | [C(LL)] = { | ||
1468 | [C(OP_READ)] = { | ||
1469 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS, | ||
1470 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS, | ||
1471 | }, | ||
1472 | [C(OP_WRITE)] = { | ||
1473 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS, | ||
1474 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS, | ||
1475 | }, | ||
1476 | [C(OP_PREFETCH)] = { | ||
1477 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1478 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1479 | }, | ||
1480 | }, | ||
1481 | [C(DTLB)] = { | ||
1482 | /* | ||
1483 | * Only ITLB misses and DTLB refills are supported. | ||
1484 | * If users want the DTLB refills misses a raw counter | ||
1485 | * must be used. | ||
1486 | */ | ||
1487 | [C(OP_READ)] = { | ||
1488 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1489 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
1490 | }, | ||
1491 | [C(OP_WRITE)] = { | ||
1492 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1493 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
1494 | }, | ||
1495 | [C(OP_PREFETCH)] = { | ||
1496 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1497 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1498 | }, | ||
1499 | }, | ||
1500 | [C(ITLB)] = { | ||
1501 | [C(OP_READ)] = { | ||
1502 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1503 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
1504 | }, | ||
1505 | [C(OP_WRITE)] = { | ||
1506 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1507 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
1508 | }, | ||
1509 | [C(OP_PREFETCH)] = { | ||
1510 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1511 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1512 | }, | ||
1513 | }, | ||
1514 | [C(BPU)] = { | ||
1515 | [C(OP_READ)] = { | ||
1516 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
1517 | [C(RESULT_MISS)] | ||
1518 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
1519 | }, | ||
1520 | [C(OP_WRITE)] = { | ||
1521 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
1522 | [C(RESULT_MISS)] | ||
1523 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
1524 | }, | ||
1525 | [C(OP_PREFETCH)] = { | ||
1526 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1527 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1528 | }, | ||
1529 | }, | ||
1530 | }; | ||
1531 | |||
1532 | /* | ||
1533 | * Cortex-A9 HW events mapping | ||
1534 | */ | ||
1535 | static const unsigned armv7_a9_perf_map[PERF_COUNT_HW_MAX] = { | ||
1536 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, | ||
1537 | [PERF_COUNT_HW_INSTRUCTIONS] = | ||
1538 | ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE, | ||
1539 | [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_COHERENT_LINE_HIT, | ||
1540 | [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_COHERENT_LINE_MISS, | ||
1541 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, | ||
1542 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
1543 | [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES, | ||
1544 | }; | ||
1545 | |||
1546 | static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
1547 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
1548 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
1549 | [C(L1D)] = { | ||
1550 | /* | ||
1551 | * The performance counters don't differentiate between read | ||
1552 | * and write accesses/misses so this isn't strictly correct, | ||
1553 | * but it's the best we can do. Writes and reads get | ||
1554 | * combined. | ||
1555 | */ | ||
1556 | [C(OP_READ)] = { | ||
1557 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
1558 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
1559 | }, | ||
1560 | [C(OP_WRITE)] = { | ||
1561 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
1562 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
1563 | }, | ||
1564 | [C(OP_PREFETCH)] = { | ||
1565 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1566 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1567 | }, | ||
1568 | }, | ||
1569 | [C(L1I)] = { | ||
1570 | [C(OP_READ)] = { | ||
1571 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1572 | [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, | ||
1573 | }, | ||
1574 | [C(OP_WRITE)] = { | ||
1575 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1576 | [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, | ||
1577 | }, | ||
1578 | [C(OP_PREFETCH)] = { | ||
1579 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1580 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1581 | }, | ||
1582 | }, | ||
1583 | [C(LL)] = { | ||
1584 | [C(OP_READ)] = { | ||
1585 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1586 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1587 | }, | ||
1588 | [C(OP_WRITE)] = { | ||
1589 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1590 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1591 | }, | ||
1592 | [C(OP_PREFETCH)] = { | ||
1593 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1594 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1595 | }, | ||
1596 | }, | ||
1597 | [C(DTLB)] = { | ||
1598 | /* | ||
1599 | * Only ITLB misses and DTLB refills are supported. | ||
1600 | * If users want the DTLB refills misses a raw counter | ||
1601 | * must be used. | ||
1602 | */ | ||
1603 | [C(OP_READ)] = { | ||
1604 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1605 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
1606 | }, | ||
1607 | [C(OP_WRITE)] = { | ||
1608 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1609 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
1610 | }, | ||
1611 | [C(OP_PREFETCH)] = { | ||
1612 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1613 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1614 | }, | ||
1615 | }, | ||
1616 | [C(ITLB)] = { | ||
1617 | [C(OP_READ)] = { | ||
1618 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1619 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
1620 | }, | ||
1621 | [C(OP_WRITE)] = { | ||
1622 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1623 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
1624 | }, | ||
1625 | [C(OP_PREFETCH)] = { | ||
1626 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1627 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1628 | }, | ||
1629 | }, | ||
1630 | [C(BPU)] = { | ||
1631 | [C(OP_READ)] = { | ||
1632 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
1633 | [C(RESULT_MISS)] | ||
1634 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
1635 | }, | ||
1636 | [C(OP_WRITE)] = { | ||
1637 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
1638 | [C(RESULT_MISS)] | ||
1639 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
1640 | }, | ||
1641 | [C(OP_PREFETCH)] = { | ||
1642 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
1643 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
1644 | }, | ||
1645 | }, | ||
1646 | }; | ||
1647 | |||
1648 | /* | ||
1649 | * Perf Events counters | ||
1650 | */ | ||
1651 | enum armv7_counters { | ||
1652 | ARMV7_CYCLE_COUNTER = 1, /* Cycle counter */ | ||
1653 | ARMV7_COUNTER0 = 2, /* First event counter */ | ||
1654 | }; | ||
1655 | |||
1656 | /* | ||
1657 | * The cycle counter is ARMV7_CYCLE_COUNTER. | ||
1658 | * The first event counter is ARMV7_COUNTER0. | ||
1659 | * The last event counter is (ARMV7_COUNTER0 + armpmu->num_events - 1). | ||
1660 | */ | ||
1661 | #define ARMV7_COUNTER_LAST (ARMV7_COUNTER0 + armpmu->num_events - 1) | ||
1662 | |||
1663 | /* | ||
1664 | * ARMv7 low level PMNC access | ||
1665 | */ | ||
1666 | |||
1667 | /* | ||
1668 | * Per-CPU PMNC: config reg | ||
1669 | */ | ||
1670 | #define ARMV7_PMNC_E (1 << 0) /* Enable all counters */ | ||
1671 | #define ARMV7_PMNC_P (1 << 1) /* Reset all counters */ | ||
1672 | #define ARMV7_PMNC_C (1 << 2) /* Cycle counter reset */ | ||
1673 | #define ARMV7_PMNC_D (1 << 3) /* CCNT counts every 64th cpu cycle */ | ||
1674 | #define ARMV7_PMNC_X (1 << 4) /* Export to ETM */ | ||
1675 | #define ARMV7_PMNC_DP (1 << 5) /* Disable CCNT if non-invasive debug*/ | ||
1676 | #define ARMV7_PMNC_N_SHIFT 11 /* Number of counters supported */ | ||
1677 | #define ARMV7_PMNC_N_MASK 0x1f | ||
1678 | #define ARMV7_PMNC_MASK 0x3f /* Mask for writable bits */ | ||
1679 | |||
1680 | /* | ||
1681 | * Available counters | ||
1682 | */ | ||
1683 | #define ARMV7_CNT0 0 /* First event counter */ | ||
1684 | #define ARMV7_CCNT 31 /* Cycle counter */ | ||
1685 | |||
1686 | /* Perf Event to low level counters mapping */ | ||
1687 | #define ARMV7_EVENT_CNT_TO_CNTx (ARMV7_COUNTER0 - ARMV7_CNT0) | ||
1688 | |||
1689 | /* | ||
1690 | * CNTENS: counters enable reg | ||
1691 | */ | ||
1692 | #define ARMV7_CNTENS_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
1693 | #define ARMV7_CNTENS_C (1 << ARMV7_CCNT) | ||
1694 | |||
1695 | /* | ||
1696 | * CNTENC: counters disable reg | ||
1697 | */ | ||
1698 | #define ARMV7_CNTENC_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
1699 | #define ARMV7_CNTENC_C (1 << ARMV7_CCNT) | ||
1700 | |||
1701 | /* | ||
1702 | * INTENS: counters overflow interrupt enable reg | ||
1703 | */ | ||
1704 | #define ARMV7_INTENS_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
1705 | #define ARMV7_INTENS_C (1 << ARMV7_CCNT) | ||
1706 | |||
1707 | /* | ||
1708 | * INTENC: counters overflow interrupt disable reg | ||
1709 | */ | ||
1710 | #define ARMV7_INTENC_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
1711 | #define ARMV7_INTENC_C (1 << ARMV7_CCNT) | ||
1712 | |||
1713 | /* | ||
1714 | * EVTSEL: Event selection reg | ||
1715 | */ | ||
1716 | #define ARMV7_EVTSEL_MASK 0xff /* Mask for writable bits */ | ||
1717 | |||
1718 | /* | ||
1719 | * SELECT: Counter selection reg | ||
1720 | */ | ||
1721 | #define ARMV7_SELECT_MASK 0x1f /* Mask for writable bits */ | ||
1722 | |||
1723 | /* | ||
1724 | * FLAG: counters overflow flag status reg | ||
1725 | */ | ||
1726 | #define ARMV7_FLAG_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
1727 | #define ARMV7_FLAG_C (1 << ARMV7_CCNT) | ||
1728 | #define ARMV7_FLAG_MASK 0xffffffff /* Mask for writable bits */ | ||
1729 | #define ARMV7_OVERFLOWED_MASK ARMV7_FLAG_MASK | ||
1730 | |||
1731 | static inline unsigned long armv7_pmnc_read(void) | ||
1732 | { | ||
1733 | u32 val; | ||
1734 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(val)); | ||
1735 | return val; | ||
1736 | } | ||
1737 | |||
1738 | static inline void armv7_pmnc_write(unsigned long val) | ||
1739 | { | ||
1740 | val &= ARMV7_PMNC_MASK; | ||
1741 | asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val)); | ||
1742 | } | ||
1743 | |||
1744 | static inline int armv7_pmnc_has_overflowed(unsigned long pmnc) | ||
1745 | { | ||
1746 | return pmnc & ARMV7_OVERFLOWED_MASK; | ||
1747 | } | ||
1748 | |||
1749 | static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc, | ||
1750 | enum armv7_counters counter) | ||
1751 | { | ||
1752 | int ret = 0; | ||
1753 | |||
1754 | if (counter == ARMV7_CYCLE_COUNTER) | ||
1755 | ret = pmnc & ARMV7_FLAG_C; | ||
1756 | else if ((counter >= ARMV7_COUNTER0) && (counter <= ARMV7_COUNTER_LAST)) | ||
1757 | ret = pmnc & ARMV7_FLAG_P(counter); | ||
1758 | else | ||
1759 | pr_err("CPU%u checking wrong counter %d overflow status\n", | ||
1760 | smp_processor_id(), counter); | ||
1761 | |||
1762 | return ret; | ||
1763 | } | ||
1764 | |||
1765 | static inline int armv7_pmnc_select_counter(unsigned int idx) | ||
1766 | { | ||
1767 | u32 val; | ||
1768 | |||
1769 | if ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST)) { | ||
1770 | pr_err("CPU%u selecting wrong PMNC counter" | ||
1771 | " %d\n", smp_processor_id(), idx); | ||
1772 | return -1; | ||
1773 | } | ||
1774 | |||
1775 | val = (idx - ARMV7_EVENT_CNT_TO_CNTx) & ARMV7_SELECT_MASK; | ||
1776 | asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (val)); | ||
1777 | |||
1778 | return idx; | ||
1779 | } | ||
1780 | |||
1781 | static inline u32 armv7pmu_read_counter(int idx) | ||
1782 | { | ||
1783 | unsigned long value = 0; | ||
1784 | |||
1785 | if (idx == ARMV7_CYCLE_COUNTER) | ||
1786 | asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (value)); | ||
1787 | else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) { | ||
1788 | if (armv7_pmnc_select_counter(idx) == idx) | ||
1789 | asm volatile("mrc p15, 0, %0, c9, c13, 2" | ||
1790 | : "=r" (value)); | ||
1791 | } else | ||
1792 | pr_err("CPU%u reading wrong counter %d\n", | ||
1793 | smp_processor_id(), idx); | ||
1794 | |||
1795 | return value; | ||
1796 | } | ||
1797 | |||
1798 | static inline void armv7pmu_write_counter(int idx, u32 value) | ||
1799 | { | ||
1800 | if (idx == ARMV7_CYCLE_COUNTER) | ||
1801 | asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (value)); | ||
1802 | else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) { | ||
1803 | if (armv7_pmnc_select_counter(idx) == idx) | ||
1804 | asm volatile("mcr p15, 0, %0, c9, c13, 2" | ||
1805 | : : "r" (value)); | ||
1806 | } else | ||
1807 | pr_err("CPU%u writing wrong counter %d\n", | ||
1808 | smp_processor_id(), idx); | ||
1809 | } | ||
1810 | |||
1811 | static inline void armv7_pmnc_write_evtsel(unsigned int idx, u32 val) | ||
1812 | { | ||
1813 | if (armv7_pmnc_select_counter(idx) == idx) { | ||
1814 | val &= ARMV7_EVTSEL_MASK; | ||
1815 | asm volatile("mcr p15, 0, %0, c9, c13, 1" : : "r" (val)); | ||
1816 | } | ||
1817 | } | ||
1818 | |||
1819 | static inline u32 armv7_pmnc_enable_counter(unsigned int idx) | ||
1820 | { | ||
1821 | u32 val; | ||
1822 | |||
1823 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
1824 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
1825 | pr_err("CPU%u enabling wrong PMNC counter" | ||
1826 | " %d\n", smp_processor_id(), idx); | ||
1827 | return -1; | ||
1828 | } | ||
1829 | |||
1830 | if (idx == ARMV7_CYCLE_COUNTER) | ||
1831 | val = ARMV7_CNTENS_C; | ||
1832 | else | ||
1833 | val = ARMV7_CNTENS_P(idx); | ||
1834 | |||
1835 | asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (val)); | ||
1836 | |||
1837 | return idx; | ||
1838 | } | ||
1839 | |||
1840 | static inline u32 armv7_pmnc_disable_counter(unsigned int idx) | ||
1841 | { | ||
1842 | u32 val; | ||
1843 | |||
1844 | |||
1845 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
1846 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
1847 | pr_err("CPU%u disabling wrong PMNC counter" | ||
1848 | " %d\n", smp_processor_id(), idx); | ||
1849 | return -1; | ||
1850 | } | ||
1851 | |||
1852 | if (idx == ARMV7_CYCLE_COUNTER) | ||
1853 | val = ARMV7_CNTENC_C; | ||
1854 | else | ||
1855 | val = ARMV7_CNTENC_P(idx); | ||
1856 | |||
1857 | asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (val)); | ||
1858 | |||
1859 | return idx; | ||
1860 | } | ||
1861 | |||
1862 | static inline u32 armv7_pmnc_enable_intens(unsigned int idx) | ||
1863 | { | ||
1864 | u32 val; | ||
1865 | |||
1866 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
1867 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
1868 | pr_err("CPU%u enabling wrong PMNC counter" | ||
1869 | " interrupt enable %d\n", smp_processor_id(), idx); | ||
1870 | return -1; | ||
1871 | } | ||
1872 | |||
1873 | if (idx == ARMV7_CYCLE_COUNTER) | ||
1874 | val = ARMV7_INTENS_C; | ||
1875 | else | ||
1876 | val = ARMV7_INTENS_P(idx); | ||
1877 | |||
1878 | asm volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (val)); | ||
1879 | |||
1880 | return idx; | ||
1881 | } | ||
1882 | |||
1883 | static inline u32 armv7_pmnc_disable_intens(unsigned int idx) | ||
1884 | { | ||
1885 | u32 val; | ||
1886 | |||
1887 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
1888 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
1889 | pr_err("CPU%u disabling wrong PMNC counter" | ||
1890 | " interrupt enable %d\n", smp_processor_id(), idx); | ||
1891 | return -1; | ||
1892 | } | ||
1893 | |||
1894 | if (idx == ARMV7_CYCLE_COUNTER) | ||
1895 | val = ARMV7_INTENC_C; | ||
1896 | else | ||
1897 | val = ARMV7_INTENC_P(idx); | ||
1898 | |||
1899 | asm volatile("mcr p15, 0, %0, c9, c14, 2" : : "r" (val)); | ||
1900 | |||
1901 | return idx; | ||
1902 | } | ||
1903 | |||
1904 | static inline u32 armv7_pmnc_getreset_flags(void) | ||
1905 | { | ||
1906 | u32 val; | ||
1907 | |||
1908 | /* Read */ | ||
1909 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
1910 | |||
1911 | /* Write to clear flags */ | ||
1912 | val &= ARMV7_FLAG_MASK; | ||
1913 | asm volatile("mcr p15, 0, %0, c9, c12, 3" : : "r" (val)); | ||
1914 | |||
1915 | return val; | ||
1916 | } | ||
1917 | |||
1918 | #ifdef DEBUG | ||
1919 | static void armv7_pmnc_dump_regs(void) | ||
1920 | { | ||
1921 | u32 val; | ||
1922 | unsigned int cnt; | ||
1923 | |||
1924 | printk(KERN_INFO "PMNC registers dump:\n"); | ||
1925 | |||
1926 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (val)); | ||
1927 | printk(KERN_INFO "PMNC =0x%08x\n", val); | ||
1928 | |||
1929 | asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r" (val)); | ||
1930 | printk(KERN_INFO "CNTENS=0x%08x\n", val); | ||
1931 | |||
1932 | asm volatile("mrc p15, 0, %0, c9, c14, 1" : "=r" (val)); | ||
1933 | printk(KERN_INFO "INTENS=0x%08x\n", val); | ||
1934 | |||
1935 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
1936 | printk(KERN_INFO "FLAGS =0x%08x\n", val); | ||
1937 | |||
1938 | asm volatile("mrc p15, 0, %0, c9, c12, 5" : "=r" (val)); | ||
1939 | printk(KERN_INFO "SELECT=0x%08x\n", val); | ||
1940 | |||
1941 | asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (val)); | ||
1942 | printk(KERN_INFO "CCNT =0x%08x\n", val); | ||
1943 | |||
1944 | for (cnt = ARMV7_COUNTER0; cnt < ARMV7_COUNTER_LAST; cnt++) { | ||
1945 | armv7_pmnc_select_counter(cnt); | ||
1946 | asm volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (val)); | ||
1947 | printk(KERN_INFO "CNT[%d] count =0x%08x\n", | ||
1948 | cnt-ARMV7_EVENT_CNT_TO_CNTx, val); | ||
1949 | asm volatile("mrc p15, 0, %0, c9, c13, 1" : "=r" (val)); | ||
1950 | printk(KERN_INFO "CNT[%d] evtsel=0x%08x\n", | ||
1951 | cnt-ARMV7_EVENT_CNT_TO_CNTx, val); | ||
1952 | } | ||
1953 | } | ||
1954 | #endif | ||
1955 | |||
1956 | void armv7pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
1957 | { | ||
1958 | unsigned long flags; | ||
1959 | |||
1960 | /* | ||
1961 | * Enable counter and interrupt, and set the counter to count | ||
1962 | * the event that we're interested in. | ||
1963 | */ | ||
1964 | spin_lock_irqsave(&pmu_lock, flags); | ||
1965 | |||
1966 | /* | ||
1967 | * Disable counter | ||
1968 | */ | ||
1969 | armv7_pmnc_disable_counter(idx); | ||
1970 | |||
1971 | /* | ||
1972 | * Set event (if destined for PMNx counters) | ||
1973 | * We don't need to set the event if it's a cycle count | ||
1974 | */ | ||
1975 | if (idx != ARMV7_CYCLE_COUNTER) | ||
1976 | armv7_pmnc_write_evtsel(idx, hwc->config_base); | ||
1977 | |||
1978 | /* | ||
1979 | * Enable interrupt for this counter | ||
1980 | */ | ||
1981 | armv7_pmnc_enable_intens(idx); | ||
1982 | |||
1983 | /* | ||
1984 | * Enable counter | ||
1985 | */ | ||
1986 | armv7_pmnc_enable_counter(idx); | ||
1987 | |||
1988 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
1989 | } | ||
1990 | |||
1991 | static void armv7pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
1992 | { | ||
1993 | unsigned long flags; | ||
1994 | |||
1995 | /* | ||
1996 | * Disable counter and interrupt | ||
1997 | */ | ||
1998 | spin_lock_irqsave(&pmu_lock, flags); | ||
1999 | |||
2000 | /* | ||
2001 | * Disable counter | ||
2002 | */ | ||
2003 | armv7_pmnc_disable_counter(idx); | ||
2004 | |||
2005 | /* | ||
2006 | * Disable interrupt for this counter | ||
2007 | */ | ||
2008 | armv7_pmnc_disable_intens(idx); | ||
2009 | |||
2010 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2011 | } | ||
2012 | |||
2013 | static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev) | ||
2014 | { | ||
2015 | unsigned long pmnc; | ||
2016 | struct perf_sample_data data; | ||
2017 | struct cpu_hw_events *cpuc; | ||
2018 | struct pt_regs *regs; | ||
2019 | int idx; | ||
2020 | |||
2021 | /* | ||
2022 | * Get and reset the IRQ flags | ||
2023 | */ | ||
2024 | pmnc = armv7_pmnc_getreset_flags(); | ||
2025 | |||
2026 | /* | ||
2027 | * Did an overflow occur? | ||
2028 | */ | ||
2029 | if (!armv7_pmnc_has_overflowed(pmnc)) | ||
2030 | return IRQ_NONE; | ||
2031 | |||
2032 | /* | ||
2033 | * Handle the counter(s) overflow(s) | ||
2034 | */ | ||
2035 | regs = get_irq_regs(); | ||
2036 | |||
2037 | perf_sample_data_init(&data, 0); | ||
2038 | |||
2039 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
2040 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
2041 | struct perf_event *event = cpuc->events[idx]; | ||
2042 | struct hw_perf_event *hwc; | ||
2043 | |||
2044 | if (!test_bit(idx, cpuc->active_mask)) | ||
2045 | continue; | ||
2046 | |||
2047 | /* | ||
2048 | * We have a single interrupt for all counters. Check that | ||
2049 | * each counter has overflowed before we process it. | ||
2050 | */ | ||
2051 | if (!armv7_pmnc_counter_has_overflowed(pmnc, idx)) | ||
2052 | continue; | ||
2053 | |||
2054 | hwc = &event->hw; | ||
2055 | armpmu_event_update(event, hwc, idx); | ||
2056 | data.period = event->hw.last_period; | ||
2057 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
2058 | continue; | ||
2059 | |||
2060 | if (perf_event_overflow(event, 0, &data, regs)) | ||
2061 | armpmu->disable(hwc, idx); | ||
2062 | } | ||
2063 | |||
2064 | /* | ||
2065 | * Handle the pending perf events. | ||
2066 | * | ||
2067 | * Note: this call *must* be run with interrupts disabled. For | ||
2068 | * platforms that can have the PMU interrupts raised as an NMI, this | ||
2069 | * will not work. | ||
2070 | */ | ||
2071 | irq_work_run(); | ||
2072 | |||
2073 | return IRQ_HANDLED; | ||
2074 | } | ||
2075 | |||
2076 | static void armv7pmu_start(void) | ||
2077 | { | ||
2078 | unsigned long flags; | ||
2079 | |||
2080 | spin_lock_irqsave(&pmu_lock, flags); | ||
2081 | /* Enable all counters */ | ||
2082 | armv7_pmnc_write(armv7_pmnc_read() | ARMV7_PMNC_E); | ||
2083 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2084 | } | ||
2085 | |||
2086 | static void armv7pmu_stop(void) | ||
2087 | { | ||
2088 | unsigned long flags; | ||
2089 | |||
2090 | spin_lock_irqsave(&pmu_lock, flags); | ||
2091 | /* Disable all counters */ | ||
2092 | armv7_pmnc_write(armv7_pmnc_read() & ~ARMV7_PMNC_E); | ||
2093 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2094 | } | ||
2095 | |||
2096 | static inline int armv7_a8_pmu_event_map(int config) | ||
2097 | { | ||
2098 | int mapping = armv7_a8_perf_map[config]; | ||
2099 | if (HW_OP_UNSUPPORTED == mapping) | ||
2100 | mapping = -EOPNOTSUPP; | ||
2101 | return mapping; | ||
2102 | } | ||
2103 | |||
2104 | static inline int armv7_a9_pmu_event_map(int config) | ||
2105 | { | ||
2106 | int mapping = armv7_a9_perf_map[config]; | ||
2107 | if (HW_OP_UNSUPPORTED == mapping) | ||
2108 | mapping = -EOPNOTSUPP; | ||
2109 | return mapping; | ||
2110 | } | ||
2111 | |||
2112 | static u64 armv7pmu_raw_event(u64 config) | ||
2113 | { | ||
2114 | return config & 0xff; | ||
2115 | } | ||
2116 | |||
2117 | static int armv7pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
2118 | struct hw_perf_event *event) | ||
2119 | { | ||
2120 | int idx; | ||
2121 | |||
2122 | /* Always place a cycle counter into the cycle counter. */ | ||
2123 | if (event->config_base == ARMV7_PERFCTR_CPU_CYCLES) { | ||
2124 | if (test_and_set_bit(ARMV7_CYCLE_COUNTER, cpuc->used_mask)) | ||
2125 | return -EAGAIN; | ||
2126 | |||
2127 | return ARMV7_CYCLE_COUNTER; | ||
2128 | } else { | ||
2129 | /* | ||
2130 | * For anything other than a cycle counter, try and use | ||
2131 | * the events counters | ||
2132 | */ | ||
2133 | for (idx = ARMV7_COUNTER0; idx <= armpmu->num_events; ++idx) { | ||
2134 | if (!test_and_set_bit(idx, cpuc->used_mask)) | ||
2135 | return idx; | ||
2136 | } | ||
2137 | |||
2138 | /* The counters are all in use. */ | ||
2139 | return -EAGAIN; | ||
2140 | } | ||
2141 | } | ||
2142 | |||
2143 | static struct arm_pmu armv7pmu = { | ||
2144 | .handle_irq = armv7pmu_handle_irq, | ||
2145 | .enable = armv7pmu_enable_event, | ||
2146 | .disable = armv7pmu_disable_event, | ||
2147 | .raw_event = armv7pmu_raw_event, | ||
2148 | .read_counter = armv7pmu_read_counter, | ||
2149 | .write_counter = armv7pmu_write_counter, | ||
2150 | .get_event_idx = armv7pmu_get_event_idx, | ||
2151 | .start = armv7pmu_start, | ||
2152 | .stop = armv7pmu_stop, | ||
2153 | .max_period = (1LLU << 32) - 1, | ||
2154 | }; | ||
2155 | |||
2156 | static u32 __init armv7_reset_read_pmnc(void) | ||
2157 | { | ||
2158 | u32 nb_cnt; | ||
2159 | |||
2160 | /* Initialize & Reset PMNC: C and P bits */ | ||
2161 | armv7_pmnc_write(ARMV7_PMNC_P | ARMV7_PMNC_C); | ||
2162 | |||
2163 | /* Read the nb of CNTx counters supported from PMNC */ | ||
2164 | nb_cnt = (armv7_pmnc_read() >> ARMV7_PMNC_N_SHIFT) & ARMV7_PMNC_N_MASK; | ||
2165 | |||
2166 | /* Add the CPU cycles counter and return */ | ||
2167 | return nb_cnt + 1; | ||
2168 | } | ||
2169 | |||
2170 | /* | ||
2171 | * ARMv5 [xscale] Performance counter handling code. | ||
2172 | * | ||
2173 | * Based on xscale OProfile code. | ||
2174 | * | ||
2175 | * There are two variants of the xscale PMU that we support: | ||
2176 | * - xscale1pmu: 2 event counters and a cycle counter | ||
2177 | * - xscale2pmu: 4 event counters and a cycle counter | ||
2178 | * The two variants share event definitions, but have different | ||
2179 | * PMU structures. | ||
2180 | */ | ||
2181 | |||
2182 | enum xscale_perf_types { | ||
2183 | XSCALE_PERFCTR_ICACHE_MISS = 0x00, | ||
2184 | XSCALE_PERFCTR_ICACHE_NO_DELIVER = 0x01, | ||
2185 | XSCALE_PERFCTR_DATA_STALL = 0x02, | ||
2186 | XSCALE_PERFCTR_ITLB_MISS = 0x03, | ||
2187 | XSCALE_PERFCTR_DTLB_MISS = 0x04, | ||
2188 | XSCALE_PERFCTR_BRANCH = 0x05, | ||
2189 | XSCALE_PERFCTR_BRANCH_MISS = 0x06, | ||
2190 | XSCALE_PERFCTR_INSTRUCTION = 0x07, | ||
2191 | XSCALE_PERFCTR_DCACHE_FULL_STALL = 0x08, | ||
2192 | XSCALE_PERFCTR_DCACHE_FULL_STALL_CONTIG = 0x09, | ||
2193 | XSCALE_PERFCTR_DCACHE_ACCESS = 0x0A, | ||
2194 | XSCALE_PERFCTR_DCACHE_MISS = 0x0B, | ||
2195 | XSCALE_PERFCTR_DCACHE_WRITE_BACK = 0x0C, | ||
2196 | XSCALE_PERFCTR_PC_CHANGED = 0x0D, | ||
2197 | XSCALE_PERFCTR_BCU_REQUEST = 0x10, | ||
2198 | XSCALE_PERFCTR_BCU_FULL = 0x11, | ||
2199 | XSCALE_PERFCTR_BCU_DRAIN = 0x12, | ||
2200 | XSCALE_PERFCTR_BCU_ECC_NO_ELOG = 0x14, | ||
2201 | XSCALE_PERFCTR_BCU_1_BIT_ERR = 0x15, | ||
2202 | XSCALE_PERFCTR_RMW = 0x16, | ||
2203 | /* XSCALE_PERFCTR_CCNT is not hardware defined */ | ||
2204 | XSCALE_PERFCTR_CCNT = 0xFE, | ||
2205 | XSCALE_PERFCTR_UNUSED = 0xFF, | ||
2206 | }; | ||
2207 | |||
2208 | enum xscale_counters { | ||
2209 | XSCALE_CYCLE_COUNTER = 1, | ||
2210 | XSCALE_COUNTER0, | ||
2211 | XSCALE_COUNTER1, | ||
2212 | XSCALE_COUNTER2, | ||
2213 | XSCALE_COUNTER3, | ||
2214 | }; | ||
2215 | |||
2216 | static const unsigned xscale_perf_map[PERF_COUNT_HW_MAX] = { | ||
2217 | [PERF_COUNT_HW_CPU_CYCLES] = XSCALE_PERFCTR_CCNT, | ||
2218 | [PERF_COUNT_HW_INSTRUCTIONS] = XSCALE_PERFCTR_INSTRUCTION, | ||
2219 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
2220 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
2221 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = XSCALE_PERFCTR_BRANCH, | ||
2222 | [PERF_COUNT_HW_BRANCH_MISSES] = XSCALE_PERFCTR_BRANCH_MISS, | ||
2223 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
2224 | }; | ||
2225 | |||
2226 | static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
2227 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
2228 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
2229 | [C(L1D)] = { | ||
2230 | [C(OP_READ)] = { | ||
2231 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
2232 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
2233 | }, | ||
2234 | [C(OP_WRITE)] = { | ||
2235 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
2236 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
2237 | }, | ||
2238 | [C(OP_PREFETCH)] = { | ||
2239 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2240 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2241 | }, | ||
2242 | }, | ||
2243 | [C(L1I)] = { | ||
2244 | [C(OP_READ)] = { | ||
2245 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2246 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
2247 | }, | ||
2248 | [C(OP_WRITE)] = { | ||
2249 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2250 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
2251 | }, | ||
2252 | [C(OP_PREFETCH)] = { | ||
2253 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2254 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2255 | }, | ||
2256 | }, | ||
2257 | [C(LL)] = { | ||
2258 | [C(OP_READ)] = { | ||
2259 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2260 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2261 | }, | ||
2262 | [C(OP_WRITE)] = { | ||
2263 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2264 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2265 | }, | ||
2266 | [C(OP_PREFETCH)] = { | ||
2267 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2268 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2269 | }, | ||
2270 | }, | ||
2271 | [C(DTLB)] = { | ||
2272 | [C(OP_READ)] = { | ||
2273 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2274 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
2275 | }, | ||
2276 | [C(OP_WRITE)] = { | ||
2277 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2278 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
2279 | }, | ||
2280 | [C(OP_PREFETCH)] = { | ||
2281 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2282 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2283 | }, | ||
2284 | }, | ||
2285 | [C(ITLB)] = { | ||
2286 | [C(OP_READ)] = { | ||
2287 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2288 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
2289 | }, | ||
2290 | [C(OP_WRITE)] = { | ||
2291 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2292 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
2293 | }, | ||
2294 | [C(OP_PREFETCH)] = { | ||
2295 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2296 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2297 | }, | ||
2298 | }, | ||
2299 | [C(BPU)] = { | ||
2300 | [C(OP_READ)] = { | ||
2301 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2302 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2303 | }, | ||
2304 | [C(OP_WRITE)] = { | ||
2305 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2306 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2307 | }, | ||
2308 | [C(OP_PREFETCH)] = { | ||
2309 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2310 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2311 | }, | ||
2312 | }, | ||
2313 | }; | ||
2314 | |||
2315 | #define XSCALE_PMU_ENABLE 0x001 | ||
2316 | #define XSCALE_PMN_RESET 0x002 | ||
2317 | #define XSCALE_CCNT_RESET 0x004 | ||
2318 | #define XSCALE_PMU_RESET (CCNT_RESET | PMN_RESET) | ||
2319 | #define XSCALE_PMU_CNT64 0x008 | ||
2320 | |||
2321 | static inline int | ||
2322 | xscalepmu_event_map(int config) | ||
2323 | { | ||
2324 | int mapping = xscale_perf_map[config]; | ||
2325 | if (HW_OP_UNSUPPORTED == mapping) | ||
2326 | mapping = -EOPNOTSUPP; | ||
2327 | return mapping; | ||
2328 | } | ||
2329 | |||
2330 | static u64 | ||
2331 | xscalepmu_raw_event(u64 config) | ||
2332 | { | ||
2333 | return config & 0xff; | ||
2334 | } | ||
2335 | |||
2336 | #define XSCALE1_OVERFLOWED_MASK 0x700 | ||
2337 | #define XSCALE1_CCOUNT_OVERFLOW 0x400 | ||
2338 | #define XSCALE1_COUNT0_OVERFLOW 0x100 | ||
2339 | #define XSCALE1_COUNT1_OVERFLOW 0x200 | ||
2340 | #define XSCALE1_CCOUNT_INT_EN 0x040 | ||
2341 | #define XSCALE1_COUNT0_INT_EN 0x010 | ||
2342 | #define XSCALE1_COUNT1_INT_EN 0x020 | ||
2343 | #define XSCALE1_COUNT0_EVT_SHFT 12 | ||
2344 | #define XSCALE1_COUNT0_EVT_MASK (0xff << XSCALE1_COUNT0_EVT_SHFT) | ||
2345 | #define XSCALE1_COUNT1_EVT_SHFT 20 | ||
2346 | #define XSCALE1_COUNT1_EVT_MASK (0xff << XSCALE1_COUNT1_EVT_SHFT) | ||
2347 | |||
2348 | static inline u32 | ||
2349 | xscale1pmu_read_pmnc(void) | ||
2350 | { | ||
2351 | u32 val; | ||
2352 | asm volatile("mrc p14, 0, %0, c0, c0, 0" : "=r" (val)); | ||
2353 | return val; | ||
2354 | } | ||
2355 | |||
2356 | static inline void | ||
2357 | xscale1pmu_write_pmnc(u32 val) | ||
2358 | { | ||
2359 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
2360 | val &= 0xffff77f; | ||
2361 | asm volatile("mcr p14, 0, %0, c0, c0, 0" : : "r" (val)); | ||
2362 | } | ||
2363 | |||
2364 | static inline int | ||
2365 | xscale1_pmnc_counter_has_overflowed(unsigned long pmnc, | ||
2366 | enum xscale_counters counter) | ||
2367 | { | ||
2368 | int ret = 0; | ||
2369 | |||
2370 | switch (counter) { | ||
2371 | case XSCALE_CYCLE_COUNTER: | ||
2372 | ret = pmnc & XSCALE1_CCOUNT_OVERFLOW; | ||
2373 | break; | ||
2374 | case XSCALE_COUNTER0: | ||
2375 | ret = pmnc & XSCALE1_COUNT0_OVERFLOW; | ||
2376 | break; | ||
2377 | case XSCALE_COUNTER1: | ||
2378 | ret = pmnc & XSCALE1_COUNT1_OVERFLOW; | ||
2379 | break; | ||
2380 | default: | ||
2381 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
2382 | } | ||
2383 | |||
2384 | return ret; | ||
2385 | } | ||
2386 | |||
2387 | static irqreturn_t | ||
2388 | xscale1pmu_handle_irq(int irq_num, void *dev) | ||
2389 | { | ||
2390 | unsigned long pmnc; | ||
2391 | struct perf_sample_data data; | ||
2392 | struct cpu_hw_events *cpuc; | ||
2393 | struct pt_regs *regs; | ||
2394 | int idx; | ||
2395 | |||
2396 | /* | ||
2397 | * NOTE: there's an A stepping erratum that states if an overflow | ||
2398 | * bit already exists and another occurs, the previous | ||
2399 | * Overflow bit gets cleared. There's no workaround. | ||
2400 | * Fixed in B stepping or later. | ||
2401 | */ | ||
2402 | pmnc = xscale1pmu_read_pmnc(); | ||
2403 | |||
2404 | /* | ||
2405 | * Write the value back to clear the overflow flags. Overflow | ||
2406 | * flags remain in pmnc for use below. We also disable the PMU | ||
2407 | * while we process the interrupt. | ||
2408 | */ | ||
2409 | xscale1pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
2410 | |||
2411 | if (!(pmnc & XSCALE1_OVERFLOWED_MASK)) | ||
2412 | return IRQ_NONE; | ||
2413 | |||
2414 | regs = get_irq_regs(); | ||
2415 | |||
2416 | perf_sample_data_init(&data, 0); | ||
2417 | |||
2418 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
2419 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
2420 | struct perf_event *event = cpuc->events[idx]; | ||
2421 | struct hw_perf_event *hwc; | ||
2422 | |||
2423 | if (!test_bit(idx, cpuc->active_mask)) | ||
2424 | continue; | ||
2425 | |||
2426 | if (!xscale1_pmnc_counter_has_overflowed(pmnc, idx)) | ||
2427 | continue; | ||
2428 | |||
2429 | hwc = &event->hw; | ||
2430 | armpmu_event_update(event, hwc, idx); | ||
2431 | data.period = event->hw.last_period; | ||
2432 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
2433 | continue; | ||
2434 | |||
2435 | if (perf_event_overflow(event, 0, &data, regs)) | ||
2436 | armpmu->disable(hwc, idx); | ||
2437 | } | ||
2438 | |||
2439 | irq_work_run(); | ||
2440 | |||
2441 | /* | ||
2442 | * Re-enable the PMU. | ||
2443 | */ | ||
2444 | pmnc = xscale1pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
2445 | xscale1pmu_write_pmnc(pmnc); | ||
2446 | |||
2447 | return IRQ_HANDLED; | ||
2448 | } | ||
2449 | |||
2450 | static void | ||
2451 | xscale1pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
2452 | { | ||
2453 | unsigned long val, mask, evt, flags; | ||
2454 | |||
2455 | switch (idx) { | ||
2456 | case XSCALE_CYCLE_COUNTER: | ||
2457 | mask = 0; | ||
2458 | evt = XSCALE1_CCOUNT_INT_EN; | ||
2459 | break; | ||
2460 | case XSCALE_COUNTER0: | ||
2461 | mask = XSCALE1_COUNT0_EVT_MASK; | ||
2462 | evt = (hwc->config_base << XSCALE1_COUNT0_EVT_SHFT) | | ||
2463 | XSCALE1_COUNT0_INT_EN; | ||
2464 | break; | ||
2465 | case XSCALE_COUNTER1: | ||
2466 | mask = XSCALE1_COUNT1_EVT_MASK; | ||
2467 | evt = (hwc->config_base << XSCALE1_COUNT1_EVT_SHFT) | | ||
2468 | XSCALE1_COUNT1_INT_EN; | ||
2469 | break; | ||
2470 | default: | ||
2471 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2472 | return; | ||
2473 | } | ||
2474 | |||
2475 | spin_lock_irqsave(&pmu_lock, flags); | ||
2476 | val = xscale1pmu_read_pmnc(); | ||
2477 | val &= ~mask; | ||
2478 | val |= evt; | ||
2479 | xscale1pmu_write_pmnc(val); | ||
2480 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2481 | } | ||
2482 | |||
2483 | static void | ||
2484 | xscale1pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
2485 | { | ||
2486 | unsigned long val, mask, evt, flags; | ||
2487 | |||
2488 | switch (idx) { | ||
2489 | case XSCALE_CYCLE_COUNTER: | ||
2490 | mask = XSCALE1_CCOUNT_INT_EN; | ||
2491 | evt = 0; | ||
2492 | break; | ||
2493 | case XSCALE_COUNTER0: | ||
2494 | mask = XSCALE1_COUNT0_INT_EN | XSCALE1_COUNT0_EVT_MASK; | ||
2495 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT0_EVT_SHFT; | ||
2496 | break; | ||
2497 | case XSCALE_COUNTER1: | ||
2498 | mask = XSCALE1_COUNT1_INT_EN | XSCALE1_COUNT1_EVT_MASK; | ||
2499 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT1_EVT_SHFT; | ||
2500 | break; | ||
2501 | default: | ||
2502 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2503 | return; | ||
2504 | } | ||
2505 | |||
2506 | spin_lock_irqsave(&pmu_lock, flags); | ||
2507 | val = xscale1pmu_read_pmnc(); | ||
2508 | val &= ~mask; | ||
2509 | val |= evt; | ||
2510 | xscale1pmu_write_pmnc(val); | ||
2511 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2512 | } | ||
2513 | |||
2514 | static int | ||
2515 | xscale1pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
2516 | struct hw_perf_event *event) | ||
2517 | { | ||
2518 | if (XSCALE_PERFCTR_CCNT == event->config_base) { | ||
2519 | if (test_and_set_bit(XSCALE_CYCLE_COUNTER, cpuc->used_mask)) | ||
2520 | return -EAGAIN; | ||
2521 | |||
2522 | return XSCALE_CYCLE_COUNTER; | ||
2523 | } else { | ||
2524 | if (!test_and_set_bit(XSCALE_COUNTER1, cpuc->used_mask)) { | ||
2525 | return XSCALE_COUNTER1; | ||
2526 | } | ||
2527 | |||
2528 | if (!test_and_set_bit(XSCALE_COUNTER0, cpuc->used_mask)) { | ||
2529 | return XSCALE_COUNTER0; | ||
2530 | } | ||
2531 | |||
2532 | return -EAGAIN; | ||
2533 | } | ||
2534 | } | ||
2535 | |||
2536 | static void | ||
2537 | xscale1pmu_start(void) | ||
2538 | { | ||
2539 | unsigned long flags, val; | ||
2540 | |||
2541 | spin_lock_irqsave(&pmu_lock, flags); | ||
2542 | val = xscale1pmu_read_pmnc(); | ||
2543 | val |= XSCALE_PMU_ENABLE; | ||
2544 | xscale1pmu_write_pmnc(val); | ||
2545 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2546 | } | ||
2547 | |||
2548 | static void | ||
2549 | xscale1pmu_stop(void) | ||
2550 | { | ||
2551 | unsigned long flags, val; | ||
2552 | |||
2553 | spin_lock_irqsave(&pmu_lock, flags); | ||
2554 | val = xscale1pmu_read_pmnc(); | ||
2555 | val &= ~XSCALE_PMU_ENABLE; | ||
2556 | xscale1pmu_write_pmnc(val); | ||
2557 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2558 | } | ||
2559 | |||
2560 | static inline u32 | ||
2561 | xscale1pmu_read_counter(int counter) | ||
2562 | { | ||
2563 | u32 val = 0; | ||
2564 | |||
2565 | switch (counter) { | ||
2566 | case XSCALE_CYCLE_COUNTER: | ||
2567 | asm volatile("mrc p14, 0, %0, c1, c0, 0" : "=r" (val)); | ||
2568 | break; | ||
2569 | case XSCALE_COUNTER0: | ||
2570 | asm volatile("mrc p14, 0, %0, c2, c0, 0" : "=r" (val)); | ||
2571 | break; | ||
2572 | case XSCALE_COUNTER1: | ||
2573 | asm volatile("mrc p14, 0, %0, c3, c0, 0" : "=r" (val)); | ||
2574 | break; | ||
2575 | } | ||
2576 | |||
2577 | return val; | ||
2578 | } | ||
2579 | |||
2580 | static inline void | ||
2581 | xscale1pmu_write_counter(int counter, u32 val) | ||
2582 | { | ||
2583 | switch (counter) { | ||
2584 | case XSCALE_CYCLE_COUNTER: | ||
2585 | asm volatile("mcr p14, 0, %0, c1, c0, 0" : : "r" (val)); | ||
2586 | break; | ||
2587 | case XSCALE_COUNTER0: | ||
2588 | asm volatile("mcr p14, 0, %0, c2, c0, 0" : : "r" (val)); | ||
2589 | break; | ||
2590 | case XSCALE_COUNTER1: | ||
2591 | asm volatile("mcr p14, 0, %0, c3, c0, 0" : : "r" (val)); | ||
2592 | break; | ||
2593 | } | ||
2594 | } | ||
2595 | |||
2596 | static const struct arm_pmu xscale1pmu = { | ||
2597 | .id = ARM_PERF_PMU_ID_XSCALE1, | ||
2598 | .handle_irq = xscale1pmu_handle_irq, | ||
2599 | .enable = xscale1pmu_enable_event, | ||
2600 | .disable = xscale1pmu_disable_event, | ||
2601 | .event_map = xscalepmu_event_map, | ||
2602 | .raw_event = xscalepmu_raw_event, | ||
2603 | .read_counter = xscale1pmu_read_counter, | ||
2604 | .write_counter = xscale1pmu_write_counter, | ||
2605 | .get_event_idx = xscale1pmu_get_event_idx, | ||
2606 | .start = xscale1pmu_start, | ||
2607 | .stop = xscale1pmu_stop, | ||
2608 | .num_events = 3, | ||
2609 | .max_period = (1LLU << 32) - 1, | ||
2610 | }; | ||
2611 | |||
2612 | #define XSCALE2_OVERFLOWED_MASK 0x01f | ||
2613 | #define XSCALE2_CCOUNT_OVERFLOW 0x001 | ||
2614 | #define XSCALE2_COUNT0_OVERFLOW 0x002 | ||
2615 | #define XSCALE2_COUNT1_OVERFLOW 0x004 | ||
2616 | #define XSCALE2_COUNT2_OVERFLOW 0x008 | ||
2617 | #define XSCALE2_COUNT3_OVERFLOW 0x010 | ||
2618 | #define XSCALE2_CCOUNT_INT_EN 0x001 | ||
2619 | #define XSCALE2_COUNT0_INT_EN 0x002 | ||
2620 | #define XSCALE2_COUNT1_INT_EN 0x004 | ||
2621 | #define XSCALE2_COUNT2_INT_EN 0x008 | ||
2622 | #define XSCALE2_COUNT3_INT_EN 0x010 | ||
2623 | #define XSCALE2_COUNT0_EVT_SHFT 0 | ||
2624 | #define XSCALE2_COUNT0_EVT_MASK (0xff << XSCALE2_COUNT0_EVT_SHFT) | ||
2625 | #define XSCALE2_COUNT1_EVT_SHFT 8 | ||
2626 | #define XSCALE2_COUNT1_EVT_MASK (0xff << XSCALE2_COUNT1_EVT_SHFT) | ||
2627 | #define XSCALE2_COUNT2_EVT_SHFT 16 | ||
2628 | #define XSCALE2_COUNT2_EVT_MASK (0xff << XSCALE2_COUNT2_EVT_SHFT) | ||
2629 | #define XSCALE2_COUNT3_EVT_SHFT 24 | ||
2630 | #define XSCALE2_COUNT3_EVT_MASK (0xff << XSCALE2_COUNT3_EVT_SHFT) | ||
2631 | |||
2632 | static inline u32 | ||
2633 | xscale2pmu_read_pmnc(void) | ||
2634 | { | ||
2635 | u32 val; | ||
2636 | asm volatile("mrc p14, 0, %0, c0, c1, 0" : "=r" (val)); | ||
2637 | /* bits 1-2 and 4-23 are read-unpredictable */ | ||
2638 | return val & 0xff000009; | ||
2639 | } | ||
2640 | |||
2641 | static inline void | ||
2642 | xscale2pmu_write_pmnc(u32 val) | ||
2643 | { | ||
2644 | /* bits 4-23 are write-as-0, 24-31 are write ignored */ | ||
2645 | val &= 0xf; | ||
2646 | asm volatile("mcr p14, 0, %0, c0, c1, 0" : : "r" (val)); | ||
2647 | } | ||
2648 | |||
2649 | static inline u32 | ||
2650 | xscale2pmu_read_overflow_flags(void) | ||
2651 | { | ||
2652 | u32 val; | ||
2653 | asm volatile("mrc p14, 0, %0, c5, c1, 0" : "=r" (val)); | ||
2654 | return val; | ||
2655 | } | ||
2656 | |||
2657 | static inline void | ||
2658 | xscale2pmu_write_overflow_flags(u32 val) | ||
2659 | { | ||
2660 | asm volatile("mcr p14, 0, %0, c5, c1, 0" : : "r" (val)); | ||
2661 | } | ||
2662 | |||
2663 | static inline u32 | ||
2664 | xscale2pmu_read_event_select(void) | ||
2665 | { | ||
2666 | u32 val; | ||
2667 | asm volatile("mrc p14, 0, %0, c8, c1, 0" : "=r" (val)); | ||
2668 | return val; | ||
2669 | } | ||
2670 | |||
2671 | static inline void | ||
2672 | xscale2pmu_write_event_select(u32 val) | ||
2673 | { | ||
2674 | asm volatile("mcr p14, 0, %0, c8, c1, 0" : : "r"(val)); | ||
2675 | } | ||
2676 | |||
2677 | static inline u32 | ||
2678 | xscale2pmu_read_int_enable(void) | ||
2679 | { | ||
2680 | u32 val; | ||
2681 | asm volatile("mrc p14, 0, %0, c4, c1, 0" : "=r" (val)); | ||
2682 | return val; | ||
2683 | } | ||
2684 | |||
2685 | static void | ||
2686 | xscale2pmu_write_int_enable(u32 val) | ||
2687 | { | ||
2688 | asm volatile("mcr p14, 0, %0, c4, c1, 0" : : "r" (val)); | ||
2689 | } | ||
2690 | |||
2691 | static inline int | ||
2692 | xscale2_pmnc_counter_has_overflowed(unsigned long of_flags, | ||
2693 | enum xscale_counters counter) | ||
2694 | { | ||
2695 | int ret = 0; | ||
2696 | |||
2697 | switch (counter) { | ||
2698 | case XSCALE_CYCLE_COUNTER: | ||
2699 | ret = of_flags & XSCALE2_CCOUNT_OVERFLOW; | ||
2700 | break; | ||
2701 | case XSCALE_COUNTER0: | ||
2702 | ret = of_flags & XSCALE2_COUNT0_OVERFLOW; | ||
2703 | break; | ||
2704 | case XSCALE_COUNTER1: | ||
2705 | ret = of_flags & XSCALE2_COUNT1_OVERFLOW; | ||
2706 | break; | ||
2707 | case XSCALE_COUNTER2: | ||
2708 | ret = of_flags & XSCALE2_COUNT2_OVERFLOW; | ||
2709 | break; | ||
2710 | case XSCALE_COUNTER3: | ||
2711 | ret = of_flags & XSCALE2_COUNT3_OVERFLOW; | ||
2712 | break; | ||
2713 | default: | ||
2714 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
2715 | } | ||
2716 | |||
2717 | return ret; | ||
2718 | } | ||
2719 | |||
2720 | static irqreturn_t | ||
2721 | xscale2pmu_handle_irq(int irq_num, void *dev) | ||
2722 | { | ||
2723 | unsigned long pmnc, of_flags; | ||
2724 | struct perf_sample_data data; | ||
2725 | struct cpu_hw_events *cpuc; | ||
2726 | struct pt_regs *regs; | ||
2727 | int idx; | ||
2728 | |||
2729 | /* Disable the PMU. */ | ||
2730 | pmnc = xscale2pmu_read_pmnc(); | ||
2731 | xscale2pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
2732 | |||
2733 | /* Check the overflow flag register. */ | ||
2734 | of_flags = xscale2pmu_read_overflow_flags(); | ||
2735 | if (!(of_flags & XSCALE2_OVERFLOWED_MASK)) | ||
2736 | return IRQ_NONE; | ||
2737 | |||
2738 | /* Clear the overflow bits. */ | ||
2739 | xscale2pmu_write_overflow_flags(of_flags); | ||
2740 | |||
2741 | regs = get_irq_regs(); | ||
2742 | |||
2743 | perf_sample_data_init(&data, 0); | ||
2744 | |||
2745 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
2746 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
2747 | struct perf_event *event = cpuc->events[idx]; | ||
2748 | struct hw_perf_event *hwc; | ||
2749 | |||
2750 | if (!test_bit(idx, cpuc->active_mask)) | ||
2751 | continue; | ||
2752 | |||
2753 | if (!xscale2_pmnc_counter_has_overflowed(pmnc, idx)) | ||
2754 | continue; | ||
2755 | |||
2756 | hwc = &event->hw; | ||
2757 | armpmu_event_update(event, hwc, idx); | ||
2758 | data.period = event->hw.last_period; | ||
2759 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
2760 | continue; | ||
2761 | |||
2762 | if (perf_event_overflow(event, 0, &data, regs)) | ||
2763 | armpmu->disable(hwc, idx); | ||
2764 | } | ||
2765 | |||
2766 | irq_work_run(); | ||
2767 | |||
2768 | /* | ||
2769 | * Re-enable the PMU. | ||
2770 | */ | ||
2771 | pmnc = xscale2pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
2772 | xscale2pmu_write_pmnc(pmnc); | ||
2773 | |||
2774 | return IRQ_HANDLED; | ||
2775 | } | ||
2776 | |||
2777 | static void | ||
2778 | xscale2pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
2779 | { | ||
2780 | unsigned long flags, ien, evtsel; | ||
2781 | |||
2782 | ien = xscale2pmu_read_int_enable(); | ||
2783 | evtsel = xscale2pmu_read_event_select(); | ||
2784 | |||
2785 | switch (idx) { | ||
2786 | case XSCALE_CYCLE_COUNTER: | ||
2787 | ien |= XSCALE2_CCOUNT_INT_EN; | ||
2788 | break; | ||
2789 | case XSCALE_COUNTER0: | ||
2790 | ien |= XSCALE2_COUNT0_INT_EN; | ||
2791 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
2792 | evtsel |= hwc->config_base << XSCALE2_COUNT0_EVT_SHFT; | ||
2793 | break; | ||
2794 | case XSCALE_COUNTER1: | ||
2795 | ien |= XSCALE2_COUNT1_INT_EN; | ||
2796 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
2797 | evtsel |= hwc->config_base << XSCALE2_COUNT1_EVT_SHFT; | ||
2798 | break; | ||
2799 | case XSCALE_COUNTER2: | ||
2800 | ien |= XSCALE2_COUNT2_INT_EN; | ||
2801 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
2802 | evtsel |= hwc->config_base << XSCALE2_COUNT2_EVT_SHFT; | ||
2803 | break; | ||
2804 | case XSCALE_COUNTER3: | ||
2805 | ien |= XSCALE2_COUNT3_INT_EN; | ||
2806 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
2807 | evtsel |= hwc->config_base << XSCALE2_COUNT3_EVT_SHFT; | ||
2808 | break; | ||
2809 | default: | ||
2810 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2811 | return; | ||
2812 | } | ||
2813 | |||
2814 | spin_lock_irqsave(&pmu_lock, flags); | ||
2815 | xscale2pmu_write_event_select(evtsel); | ||
2816 | xscale2pmu_write_int_enable(ien); | ||
2817 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2818 | } | ||
2819 | |||
2820 | static void | ||
2821 | xscale2pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
2822 | { | ||
2823 | unsigned long flags, ien, evtsel; | ||
2824 | |||
2825 | ien = xscale2pmu_read_int_enable(); | ||
2826 | evtsel = xscale2pmu_read_event_select(); | ||
2827 | |||
2828 | switch (idx) { | ||
2829 | case XSCALE_CYCLE_COUNTER: | ||
2830 | ien &= ~XSCALE2_CCOUNT_INT_EN; | ||
2831 | break; | ||
2832 | case XSCALE_COUNTER0: | ||
2833 | ien &= ~XSCALE2_COUNT0_INT_EN; | ||
2834 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
2835 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT0_EVT_SHFT; | ||
2836 | break; | ||
2837 | case XSCALE_COUNTER1: | ||
2838 | ien &= ~XSCALE2_COUNT1_INT_EN; | ||
2839 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
2840 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT1_EVT_SHFT; | ||
2841 | break; | ||
2842 | case XSCALE_COUNTER2: | ||
2843 | ien &= ~XSCALE2_COUNT2_INT_EN; | ||
2844 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
2845 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT2_EVT_SHFT; | ||
2846 | break; | ||
2847 | case XSCALE_COUNTER3: | ||
2848 | ien &= ~XSCALE2_COUNT3_INT_EN; | ||
2849 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
2850 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT3_EVT_SHFT; | ||
2851 | break; | ||
2852 | default: | ||
2853 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2854 | return; | ||
2855 | } | ||
2856 | |||
2857 | spin_lock_irqsave(&pmu_lock, flags); | ||
2858 | xscale2pmu_write_event_select(evtsel); | ||
2859 | xscale2pmu_write_int_enable(ien); | ||
2860 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2861 | } | ||
2862 | |||
2863 | static int | ||
2864 | xscale2pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
2865 | struct hw_perf_event *event) | ||
2866 | { | ||
2867 | int idx = xscale1pmu_get_event_idx(cpuc, event); | ||
2868 | if (idx >= 0) | ||
2869 | goto out; | ||
2870 | |||
2871 | if (!test_and_set_bit(XSCALE_COUNTER3, cpuc->used_mask)) | ||
2872 | idx = XSCALE_COUNTER3; | ||
2873 | else if (!test_and_set_bit(XSCALE_COUNTER2, cpuc->used_mask)) | ||
2874 | idx = XSCALE_COUNTER2; | ||
2875 | out: | ||
2876 | return idx; | ||
2877 | } | ||
2878 | |||
2879 | static void | ||
2880 | xscale2pmu_start(void) | ||
2881 | { | ||
2882 | unsigned long flags, val; | ||
2883 | |||
2884 | spin_lock_irqsave(&pmu_lock, flags); | ||
2885 | val = xscale2pmu_read_pmnc() & ~XSCALE_PMU_CNT64; | ||
2886 | val |= XSCALE_PMU_ENABLE; | ||
2887 | xscale2pmu_write_pmnc(val); | ||
2888 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2889 | } | ||
2890 | |||
2891 | static void | ||
2892 | xscale2pmu_stop(void) | ||
2893 | { | ||
2894 | unsigned long flags, val; | ||
2895 | |||
2896 | spin_lock_irqsave(&pmu_lock, flags); | ||
2897 | val = xscale2pmu_read_pmnc(); | ||
2898 | val &= ~XSCALE_PMU_ENABLE; | ||
2899 | xscale2pmu_write_pmnc(val); | ||
2900 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2901 | } | ||
2902 | |||
2903 | static inline u32 | ||
2904 | xscale2pmu_read_counter(int counter) | ||
2905 | { | ||
2906 | u32 val = 0; | ||
2907 | |||
2908 | switch (counter) { | ||
2909 | case XSCALE_CYCLE_COUNTER: | ||
2910 | asm volatile("mrc p14, 0, %0, c1, c1, 0" : "=r" (val)); | ||
2911 | break; | ||
2912 | case XSCALE_COUNTER0: | ||
2913 | asm volatile("mrc p14, 0, %0, c0, c2, 0" : "=r" (val)); | ||
2914 | break; | ||
2915 | case XSCALE_COUNTER1: | ||
2916 | asm volatile("mrc p14, 0, %0, c1, c2, 0" : "=r" (val)); | ||
2917 | break; | ||
2918 | case XSCALE_COUNTER2: | ||
2919 | asm volatile("mrc p14, 0, %0, c2, c2, 0" : "=r" (val)); | ||
2920 | break; | ||
2921 | case XSCALE_COUNTER3: | ||
2922 | asm volatile("mrc p14, 0, %0, c3, c2, 0" : "=r" (val)); | ||
2923 | break; | ||
2924 | } | ||
2925 | |||
2926 | return val; | ||
2927 | } | ||
2928 | |||
2929 | static inline void | ||
2930 | xscale2pmu_write_counter(int counter, u32 val) | ||
2931 | { | ||
2932 | switch (counter) { | ||
2933 | case XSCALE_CYCLE_COUNTER: | ||
2934 | asm volatile("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); | ||
2935 | break; | ||
2936 | case XSCALE_COUNTER0: | ||
2937 | asm volatile("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); | ||
2938 | break; | ||
2939 | case XSCALE_COUNTER1: | ||
2940 | asm volatile("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); | ||
2941 | break; | ||
2942 | case XSCALE_COUNTER2: | ||
2943 | asm volatile("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); | ||
2944 | break; | ||
2945 | case XSCALE_COUNTER3: | ||
2946 | asm volatile("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); | ||
2947 | break; | ||
2948 | } | ||
2949 | } | ||
2950 | |||
2951 | static const struct arm_pmu xscale2pmu = { | ||
2952 | .id = ARM_PERF_PMU_ID_XSCALE2, | ||
2953 | .handle_irq = xscale2pmu_handle_irq, | ||
2954 | .enable = xscale2pmu_enable_event, | ||
2955 | .disable = xscale2pmu_disable_event, | ||
2956 | .event_map = xscalepmu_event_map, | ||
2957 | .raw_event = xscalepmu_raw_event, | ||
2958 | .read_counter = xscale2pmu_read_counter, | ||
2959 | .write_counter = xscale2pmu_write_counter, | ||
2960 | .get_event_idx = xscale2pmu_get_event_idx, | ||
2961 | .start = xscale2pmu_start, | ||
2962 | .stop = xscale2pmu_stop, | ||
2963 | .num_events = 5, | ||
2964 | .max_period = (1LLU << 32) - 1, | ||
2965 | }; | ||
2966 | 611 | ||
2967 | static int __init | 612 | static int __init |
2968 | init_hw_perf_events(void) | 613 | init_hw_perf_events(void) |
@@ -2977,37 +622,16 @@ init_hw_perf_events(void) | |||
2977 | case 0xB360: /* ARM1136 */ | 622 | case 0xB360: /* ARM1136 */ |
2978 | case 0xB560: /* ARM1156 */ | 623 | case 0xB560: /* ARM1156 */ |
2979 | case 0xB760: /* ARM1176 */ | 624 | case 0xB760: /* ARM1176 */ |
2980 | armpmu = &armv6pmu; | 625 | armpmu = armv6pmu_init(); |
2981 | memcpy(armpmu_perf_cache_map, armv6_perf_cache_map, | ||
2982 | sizeof(armv6_perf_cache_map)); | ||
2983 | break; | 626 | break; |
2984 | case 0xB020: /* ARM11mpcore */ | 627 | case 0xB020: /* ARM11mpcore */ |
2985 | armpmu = &armv6mpcore_pmu; | 628 | armpmu = armv6mpcore_pmu_init(); |
2986 | memcpy(armpmu_perf_cache_map, | ||
2987 | armv6mpcore_perf_cache_map, | ||
2988 | sizeof(armv6mpcore_perf_cache_map)); | ||
2989 | break; | 629 | break; |
2990 | case 0xC080: /* Cortex-A8 */ | 630 | case 0xC080: /* Cortex-A8 */ |
2991 | armv7pmu.id = ARM_PERF_PMU_ID_CA8; | 631 | armpmu = armv7_a8_pmu_init(); |
2992 | memcpy(armpmu_perf_cache_map, armv7_a8_perf_cache_map, | ||
2993 | sizeof(armv7_a8_perf_cache_map)); | ||
2994 | armv7pmu.event_map = armv7_a8_pmu_event_map; | ||
2995 | armpmu = &armv7pmu; | ||
2996 | |||
2997 | /* Reset PMNC and read the nb of CNTx counters | ||
2998 | supported */ | ||
2999 | armv7pmu.num_events = armv7_reset_read_pmnc(); | ||
3000 | break; | 632 | break; |
3001 | case 0xC090: /* Cortex-A9 */ | 633 | case 0xC090: /* Cortex-A9 */ |
3002 | armv7pmu.id = ARM_PERF_PMU_ID_CA9; | 634 | armpmu = armv7_a9_pmu_init(); |
3003 | memcpy(armpmu_perf_cache_map, armv7_a9_perf_cache_map, | ||
3004 | sizeof(armv7_a9_perf_cache_map)); | ||
3005 | armv7pmu.event_map = armv7_a9_pmu_event_map; | ||
3006 | armpmu = &armv7pmu; | ||
3007 | |||
3008 | /* Reset PMNC and read the nb of CNTx counters | ||
3009 | supported */ | ||
3010 | armv7pmu.num_events = armv7_reset_read_pmnc(); | ||
3011 | break; | 635 | break; |
3012 | } | 636 | } |
3013 | /* Intel CPUs [xscale]. */ | 637 | /* Intel CPUs [xscale]. */ |
@@ -3015,21 +639,17 @@ init_hw_perf_events(void) | |||
3015 | part_number = (cpuid >> 13) & 0x7; | 639 | part_number = (cpuid >> 13) & 0x7; |
3016 | switch (part_number) { | 640 | switch (part_number) { |
3017 | case 1: | 641 | case 1: |
3018 | armpmu = &xscale1pmu; | 642 | armpmu = xscale1pmu_init(); |
3019 | memcpy(armpmu_perf_cache_map, xscale_perf_cache_map, | ||
3020 | sizeof(xscale_perf_cache_map)); | ||
3021 | break; | 643 | break; |
3022 | case 2: | 644 | case 2: |
3023 | armpmu = &xscale2pmu; | 645 | armpmu = xscale2pmu_init(); |
3024 | memcpy(armpmu_perf_cache_map, xscale_perf_cache_map, | ||
3025 | sizeof(xscale_perf_cache_map)); | ||
3026 | break; | 646 | break; |
3027 | } | 647 | } |
3028 | } | 648 | } |
3029 | 649 | ||
3030 | if (armpmu) { | 650 | if (armpmu) { |
3031 | pr_info("enabled with %s PMU driver, %d counters available\n", | 651 | pr_info("enabled with %s PMU driver, %d counters available\n", |
3032 | arm_pmu_names[armpmu->id], armpmu->num_events); | 652 | armpmu->name, armpmu->num_events); |
3033 | } else { | 653 | } else { |
3034 | pr_info("no hardware support available\n"); | 654 | pr_info("no hardware support available\n"); |
3035 | } | 655 | } |
@@ -3053,17 +673,17 @@ early_initcall(init_hw_perf_events); | |||
3053 | * This code has been adapted from the ARM OProfile support. | 673 | * This code has been adapted from the ARM OProfile support. |
3054 | */ | 674 | */ |
3055 | struct frame_tail { | 675 | struct frame_tail { |
3056 | struct frame_tail *fp; | 676 | struct frame_tail __user *fp; |
3057 | unsigned long sp; | 677 | unsigned long sp; |
3058 | unsigned long lr; | 678 | unsigned long lr; |
3059 | } __attribute__((packed)); | 679 | } __attribute__((packed)); |
3060 | 680 | ||
3061 | /* | 681 | /* |
3062 | * Get the return address for a single stackframe and return a pointer to the | 682 | * Get the return address for a single stackframe and return a pointer to the |
3063 | * next frame tail. | 683 | * next frame tail. |
3064 | */ | 684 | */ |
3065 | static struct frame_tail * | 685 | static struct frame_tail __user * |
3066 | user_backtrace(struct frame_tail *tail, | 686 | user_backtrace(struct frame_tail __user *tail, |
3067 | struct perf_callchain_entry *entry) | 687 | struct perf_callchain_entry *entry) |
3068 | { | 688 | { |
3069 | struct frame_tail buftail; | 689 | struct frame_tail buftail; |
@@ -3089,10 +709,10 @@ user_backtrace(struct frame_tail *tail, | |||
3089 | void | 709 | void |
3090 | perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) | 710 | perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) |
3091 | { | 711 | { |
3092 | struct frame_tail *tail; | 712 | struct frame_tail __user *tail; |
3093 | 713 | ||
3094 | 714 | ||
3095 | tail = (struct frame_tail *)regs->ARM_fp - 1; | 715 | tail = (struct frame_tail __user *)regs->ARM_fp - 1; |
3096 | 716 | ||
3097 | while (tail && !((unsigned long)tail & 0x3)) | 717 | while (tail && !((unsigned long)tail & 0x3)) |
3098 | tail = user_backtrace(tail, entry); | 718 | tail = user_backtrace(tail, entry); |
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c new file mode 100644 index 000000000000..c058bfc8532b --- /dev/null +++ b/arch/arm/kernel/perf_event_v6.c | |||
@@ -0,0 +1,672 @@ | |||
1 | /* | ||
2 | * ARMv6 Performance counter handling code. | ||
3 | * | ||
4 | * Copyright (C) 2009 picoChip Designs, Ltd., Jamie Iles | ||
5 | * | ||
6 | * ARMv6 has 2 configurable performance counters and a single cycle counter. | ||
7 | * They all share a single reset bit but can be written to zero so we can use | ||
8 | * that for a reset. | ||
9 | * | ||
10 | * The counters can't be individually enabled or disabled so when we remove | ||
11 | * one event and replace it with another we could get spurious counts from the | ||
12 | * wrong event. However, we can take advantage of the fact that the | ||
13 | * performance counters can export events to the event bus, and the event bus | ||
14 | * itself can be monitored. This requires that we *don't* export the events to | ||
15 | * the event bus. The procedure for disabling a configurable counter is: | ||
16 | * - change the counter to count the ETMEXTOUT[0] signal (0x20). This | ||
17 | * effectively stops the counter from counting. | ||
18 | * - disable the counter's interrupt generation (each counter has it's | ||
19 | * own interrupt enable bit). | ||
20 | * Once stopped, the counter value can be written as 0 to reset. | ||
21 | * | ||
22 | * To enable a counter: | ||
23 | * - enable the counter's interrupt generation. | ||
24 | * - set the new event type. | ||
25 | * | ||
26 | * Note: the dedicated cycle counter only counts cycles and can't be | ||
27 | * enabled/disabled independently of the others. When we want to disable the | ||
28 | * cycle counter, we have to just disable the interrupt reporting and start | ||
29 | * ignoring that counter. When re-enabling, we have to reset the value and | ||
30 | * enable the interrupt. | ||
31 | */ | ||
32 | |||
33 | #ifdef CONFIG_CPU_V6 | ||
34 | enum armv6_perf_types { | ||
35 | ARMV6_PERFCTR_ICACHE_MISS = 0x0, | ||
36 | ARMV6_PERFCTR_IBUF_STALL = 0x1, | ||
37 | ARMV6_PERFCTR_DDEP_STALL = 0x2, | ||
38 | ARMV6_PERFCTR_ITLB_MISS = 0x3, | ||
39 | ARMV6_PERFCTR_DTLB_MISS = 0x4, | ||
40 | ARMV6_PERFCTR_BR_EXEC = 0x5, | ||
41 | ARMV6_PERFCTR_BR_MISPREDICT = 0x6, | ||
42 | ARMV6_PERFCTR_INSTR_EXEC = 0x7, | ||
43 | ARMV6_PERFCTR_DCACHE_HIT = 0x9, | ||
44 | ARMV6_PERFCTR_DCACHE_ACCESS = 0xA, | ||
45 | ARMV6_PERFCTR_DCACHE_MISS = 0xB, | ||
46 | ARMV6_PERFCTR_DCACHE_WBACK = 0xC, | ||
47 | ARMV6_PERFCTR_SW_PC_CHANGE = 0xD, | ||
48 | ARMV6_PERFCTR_MAIN_TLB_MISS = 0xF, | ||
49 | ARMV6_PERFCTR_EXPL_D_ACCESS = 0x10, | ||
50 | ARMV6_PERFCTR_LSU_FULL_STALL = 0x11, | ||
51 | ARMV6_PERFCTR_WBUF_DRAINED = 0x12, | ||
52 | ARMV6_PERFCTR_CPU_CYCLES = 0xFF, | ||
53 | ARMV6_PERFCTR_NOP = 0x20, | ||
54 | }; | ||
55 | |||
56 | enum armv6_counters { | ||
57 | ARMV6_CYCLE_COUNTER = 1, | ||
58 | ARMV6_COUNTER0, | ||
59 | ARMV6_COUNTER1, | ||
60 | }; | ||
61 | |||
62 | /* | ||
63 | * The hardware events that we support. We do support cache operations but | ||
64 | * we have harvard caches and no way to combine instruction and data | ||
65 | * accesses/misses in hardware. | ||
66 | */ | ||
67 | static const unsigned armv6_perf_map[PERF_COUNT_HW_MAX] = { | ||
68 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV6_PERFCTR_CPU_CYCLES, | ||
69 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6_PERFCTR_INSTR_EXEC, | ||
70 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
71 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
72 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6_PERFCTR_BR_EXEC, | ||
73 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6_PERFCTR_BR_MISPREDICT, | ||
74 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
75 | }; | ||
76 | |||
77 | static const unsigned armv6_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
78 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
79 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
80 | [C(L1D)] = { | ||
81 | /* | ||
82 | * The performance counters don't differentiate between read | ||
83 | * and write accesses/misses so this isn't strictly correct, | ||
84 | * but it's the best we can do. Writes and reads get | ||
85 | * combined. | ||
86 | */ | ||
87 | [C(OP_READ)] = { | ||
88 | [C(RESULT_ACCESS)] = ARMV6_PERFCTR_DCACHE_ACCESS, | ||
89 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DCACHE_MISS, | ||
90 | }, | ||
91 | [C(OP_WRITE)] = { | ||
92 | [C(RESULT_ACCESS)] = ARMV6_PERFCTR_DCACHE_ACCESS, | ||
93 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DCACHE_MISS, | ||
94 | }, | ||
95 | [C(OP_PREFETCH)] = { | ||
96 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
97 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
98 | }, | ||
99 | }, | ||
100 | [C(L1I)] = { | ||
101 | [C(OP_READ)] = { | ||
102 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
103 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS, | ||
104 | }, | ||
105 | [C(OP_WRITE)] = { | ||
106 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
107 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ICACHE_MISS, | ||
108 | }, | ||
109 | [C(OP_PREFETCH)] = { | ||
110 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
111 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
112 | }, | ||
113 | }, | ||
114 | [C(LL)] = { | ||
115 | [C(OP_READ)] = { | ||
116 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
117 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
118 | }, | ||
119 | [C(OP_WRITE)] = { | ||
120 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
121 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
122 | }, | ||
123 | [C(OP_PREFETCH)] = { | ||
124 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
125 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
126 | }, | ||
127 | }, | ||
128 | [C(DTLB)] = { | ||
129 | /* | ||
130 | * The ARM performance counters can count micro DTLB misses, | ||
131 | * micro ITLB misses and main TLB misses. There isn't an event | ||
132 | * for TLB misses, so use the micro misses here and if users | ||
133 | * want the main TLB misses they can use a raw counter. | ||
134 | */ | ||
135 | [C(OP_READ)] = { | ||
136 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
137 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DTLB_MISS, | ||
138 | }, | ||
139 | [C(OP_WRITE)] = { | ||
140 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
141 | [C(RESULT_MISS)] = ARMV6_PERFCTR_DTLB_MISS, | ||
142 | }, | ||
143 | [C(OP_PREFETCH)] = { | ||
144 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
145 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
146 | }, | ||
147 | }, | ||
148 | [C(ITLB)] = { | ||
149 | [C(OP_READ)] = { | ||
150 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
151 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ITLB_MISS, | ||
152 | }, | ||
153 | [C(OP_WRITE)] = { | ||
154 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
155 | [C(RESULT_MISS)] = ARMV6_PERFCTR_ITLB_MISS, | ||
156 | }, | ||
157 | [C(OP_PREFETCH)] = { | ||
158 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
159 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
160 | }, | ||
161 | }, | ||
162 | [C(BPU)] = { | ||
163 | [C(OP_READ)] = { | ||
164 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
165 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
166 | }, | ||
167 | [C(OP_WRITE)] = { | ||
168 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
169 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
170 | }, | ||
171 | [C(OP_PREFETCH)] = { | ||
172 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
173 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
174 | }, | ||
175 | }, | ||
176 | }; | ||
177 | |||
178 | enum armv6mpcore_perf_types { | ||
179 | ARMV6MPCORE_PERFCTR_ICACHE_MISS = 0x0, | ||
180 | ARMV6MPCORE_PERFCTR_IBUF_STALL = 0x1, | ||
181 | ARMV6MPCORE_PERFCTR_DDEP_STALL = 0x2, | ||
182 | ARMV6MPCORE_PERFCTR_ITLB_MISS = 0x3, | ||
183 | ARMV6MPCORE_PERFCTR_DTLB_MISS = 0x4, | ||
184 | ARMV6MPCORE_PERFCTR_BR_EXEC = 0x5, | ||
185 | ARMV6MPCORE_PERFCTR_BR_NOTPREDICT = 0x6, | ||
186 | ARMV6MPCORE_PERFCTR_BR_MISPREDICT = 0x7, | ||
187 | ARMV6MPCORE_PERFCTR_INSTR_EXEC = 0x8, | ||
188 | ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS = 0xA, | ||
189 | ARMV6MPCORE_PERFCTR_DCACHE_RDMISS = 0xB, | ||
190 | ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS = 0xC, | ||
191 | ARMV6MPCORE_PERFCTR_DCACHE_WRMISS = 0xD, | ||
192 | ARMV6MPCORE_PERFCTR_DCACHE_EVICTION = 0xE, | ||
193 | ARMV6MPCORE_PERFCTR_SW_PC_CHANGE = 0xF, | ||
194 | ARMV6MPCORE_PERFCTR_MAIN_TLB_MISS = 0x10, | ||
195 | ARMV6MPCORE_PERFCTR_EXPL_MEM_ACCESS = 0x11, | ||
196 | ARMV6MPCORE_PERFCTR_LSU_FULL_STALL = 0x12, | ||
197 | ARMV6MPCORE_PERFCTR_WBUF_DRAINED = 0x13, | ||
198 | ARMV6MPCORE_PERFCTR_CPU_CYCLES = 0xFF, | ||
199 | }; | ||
200 | |||
201 | /* | ||
202 | * The hardware events that we support. We do support cache operations but | ||
203 | * we have harvard caches and no way to combine instruction and data | ||
204 | * accesses/misses in hardware. | ||
205 | */ | ||
206 | static const unsigned armv6mpcore_perf_map[PERF_COUNT_HW_MAX] = { | ||
207 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV6MPCORE_PERFCTR_CPU_CYCLES, | ||
208 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_INSTR_EXEC, | ||
209 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
210 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
211 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV6MPCORE_PERFCTR_BR_EXEC, | ||
212 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV6MPCORE_PERFCTR_BR_MISPREDICT, | ||
213 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
214 | }; | ||
215 | |||
216 | static const unsigned armv6mpcore_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
217 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
218 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
219 | [C(L1D)] = { | ||
220 | [C(OP_READ)] = { | ||
221 | [C(RESULT_ACCESS)] = | ||
222 | ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS, | ||
223 | [C(RESULT_MISS)] = | ||
224 | ARMV6MPCORE_PERFCTR_DCACHE_RDMISS, | ||
225 | }, | ||
226 | [C(OP_WRITE)] = { | ||
227 | [C(RESULT_ACCESS)] = | ||
228 | ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS, | ||
229 | [C(RESULT_MISS)] = | ||
230 | ARMV6MPCORE_PERFCTR_DCACHE_WRMISS, | ||
231 | }, | ||
232 | [C(OP_PREFETCH)] = { | ||
233 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
234 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
235 | }, | ||
236 | }, | ||
237 | [C(L1I)] = { | ||
238 | [C(OP_READ)] = { | ||
239 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
240 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS, | ||
241 | }, | ||
242 | [C(OP_WRITE)] = { | ||
243 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
244 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ICACHE_MISS, | ||
245 | }, | ||
246 | [C(OP_PREFETCH)] = { | ||
247 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
248 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
249 | }, | ||
250 | }, | ||
251 | [C(LL)] = { | ||
252 | [C(OP_READ)] = { | ||
253 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
254 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
255 | }, | ||
256 | [C(OP_WRITE)] = { | ||
257 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
258 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
259 | }, | ||
260 | [C(OP_PREFETCH)] = { | ||
261 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
262 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
263 | }, | ||
264 | }, | ||
265 | [C(DTLB)] = { | ||
266 | /* | ||
267 | * The ARM performance counters can count micro DTLB misses, | ||
268 | * micro ITLB misses and main TLB misses. There isn't an event | ||
269 | * for TLB misses, so use the micro misses here and if users | ||
270 | * want the main TLB misses they can use a raw counter. | ||
271 | */ | ||
272 | [C(OP_READ)] = { | ||
273 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
274 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_DTLB_MISS, | ||
275 | }, | ||
276 | [C(OP_WRITE)] = { | ||
277 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
278 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_DTLB_MISS, | ||
279 | }, | ||
280 | [C(OP_PREFETCH)] = { | ||
281 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
282 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
283 | }, | ||
284 | }, | ||
285 | [C(ITLB)] = { | ||
286 | [C(OP_READ)] = { | ||
287 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
288 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ITLB_MISS, | ||
289 | }, | ||
290 | [C(OP_WRITE)] = { | ||
291 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
292 | [C(RESULT_MISS)] = ARMV6MPCORE_PERFCTR_ITLB_MISS, | ||
293 | }, | ||
294 | [C(OP_PREFETCH)] = { | ||
295 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
296 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
297 | }, | ||
298 | }, | ||
299 | [C(BPU)] = { | ||
300 | [C(OP_READ)] = { | ||
301 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
302 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
303 | }, | ||
304 | [C(OP_WRITE)] = { | ||
305 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
306 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
307 | }, | ||
308 | [C(OP_PREFETCH)] = { | ||
309 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
310 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
311 | }, | ||
312 | }, | ||
313 | }; | ||
314 | |||
315 | static inline unsigned long | ||
316 | armv6_pmcr_read(void) | ||
317 | { | ||
318 | u32 val; | ||
319 | asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r"(val)); | ||
320 | return val; | ||
321 | } | ||
322 | |||
323 | static inline void | ||
324 | armv6_pmcr_write(unsigned long val) | ||
325 | { | ||
326 | asm volatile("mcr p15, 0, %0, c15, c12, 0" : : "r"(val)); | ||
327 | } | ||
328 | |||
329 | #define ARMV6_PMCR_ENABLE (1 << 0) | ||
330 | #define ARMV6_PMCR_CTR01_RESET (1 << 1) | ||
331 | #define ARMV6_PMCR_CCOUNT_RESET (1 << 2) | ||
332 | #define ARMV6_PMCR_CCOUNT_DIV (1 << 3) | ||
333 | #define ARMV6_PMCR_COUNT0_IEN (1 << 4) | ||
334 | #define ARMV6_PMCR_COUNT1_IEN (1 << 5) | ||
335 | #define ARMV6_PMCR_CCOUNT_IEN (1 << 6) | ||
336 | #define ARMV6_PMCR_COUNT0_OVERFLOW (1 << 8) | ||
337 | #define ARMV6_PMCR_COUNT1_OVERFLOW (1 << 9) | ||
338 | #define ARMV6_PMCR_CCOUNT_OVERFLOW (1 << 10) | ||
339 | #define ARMV6_PMCR_EVT_COUNT0_SHIFT 20 | ||
340 | #define ARMV6_PMCR_EVT_COUNT0_MASK (0xFF << ARMV6_PMCR_EVT_COUNT0_SHIFT) | ||
341 | #define ARMV6_PMCR_EVT_COUNT1_SHIFT 12 | ||
342 | #define ARMV6_PMCR_EVT_COUNT1_MASK (0xFF << ARMV6_PMCR_EVT_COUNT1_SHIFT) | ||
343 | |||
344 | #define ARMV6_PMCR_OVERFLOWED_MASK \ | ||
345 | (ARMV6_PMCR_COUNT0_OVERFLOW | ARMV6_PMCR_COUNT1_OVERFLOW | \ | ||
346 | ARMV6_PMCR_CCOUNT_OVERFLOW) | ||
347 | |||
348 | static inline int | ||
349 | armv6_pmcr_has_overflowed(unsigned long pmcr) | ||
350 | { | ||
351 | return pmcr & ARMV6_PMCR_OVERFLOWED_MASK; | ||
352 | } | ||
353 | |||
354 | static inline int | ||
355 | armv6_pmcr_counter_has_overflowed(unsigned long pmcr, | ||
356 | enum armv6_counters counter) | ||
357 | { | ||
358 | int ret = 0; | ||
359 | |||
360 | if (ARMV6_CYCLE_COUNTER == counter) | ||
361 | ret = pmcr & ARMV6_PMCR_CCOUNT_OVERFLOW; | ||
362 | else if (ARMV6_COUNTER0 == counter) | ||
363 | ret = pmcr & ARMV6_PMCR_COUNT0_OVERFLOW; | ||
364 | else if (ARMV6_COUNTER1 == counter) | ||
365 | ret = pmcr & ARMV6_PMCR_COUNT1_OVERFLOW; | ||
366 | else | ||
367 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
368 | |||
369 | return ret; | ||
370 | } | ||
371 | |||
372 | static inline u32 | ||
373 | armv6pmu_read_counter(int counter) | ||
374 | { | ||
375 | unsigned long value = 0; | ||
376 | |||
377 | if (ARMV6_CYCLE_COUNTER == counter) | ||
378 | asm volatile("mrc p15, 0, %0, c15, c12, 1" : "=r"(value)); | ||
379 | else if (ARMV6_COUNTER0 == counter) | ||
380 | asm volatile("mrc p15, 0, %0, c15, c12, 2" : "=r"(value)); | ||
381 | else if (ARMV6_COUNTER1 == counter) | ||
382 | asm volatile("mrc p15, 0, %0, c15, c12, 3" : "=r"(value)); | ||
383 | else | ||
384 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
385 | |||
386 | return value; | ||
387 | } | ||
388 | |||
389 | static inline void | ||
390 | armv6pmu_write_counter(int counter, | ||
391 | u32 value) | ||
392 | { | ||
393 | if (ARMV6_CYCLE_COUNTER == counter) | ||
394 | asm volatile("mcr p15, 0, %0, c15, c12, 1" : : "r"(value)); | ||
395 | else if (ARMV6_COUNTER0 == counter) | ||
396 | asm volatile("mcr p15, 0, %0, c15, c12, 2" : : "r"(value)); | ||
397 | else if (ARMV6_COUNTER1 == counter) | ||
398 | asm volatile("mcr p15, 0, %0, c15, c12, 3" : : "r"(value)); | ||
399 | else | ||
400 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
401 | } | ||
402 | |||
403 | static void | ||
404 | armv6pmu_enable_event(struct hw_perf_event *hwc, | ||
405 | int idx) | ||
406 | { | ||
407 | unsigned long val, mask, evt, flags; | ||
408 | |||
409 | if (ARMV6_CYCLE_COUNTER == idx) { | ||
410 | mask = 0; | ||
411 | evt = ARMV6_PMCR_CCOUNT_IEN; | ||
412 | } else if (ARMV6_COUNTER0 == idx) { | ||
413 | mask = ARMV6_PMCR_EVT_COUNT0_MASK; | ||
414 | evt = (hwc->config_base << ARMV6_PMCR_EVT_COUNT0_SHIFT) | | ||
415 | ARMV6_PMCR_COUNT0_IEN; | ||
416 | } else if (ARMV6_COUNTER1 == idx) { | ||
417 | mask = ARMV6_PMCR_EVT_COUNT1_MASK; | ||
418 | evt = (hwc->config_base << ARMV6_PMCR_EVT_COUNT1_SHIFT) | | ||
419 | ARMV6_PMCR_COUNT1_IEN; | ||
420 | } else { | ||
421 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
422 | return; | ||
423 | } | ||
424 | |||
425 | /* | ||
426 | * Mask out the current event and set the counter to count the event | ||
427 | * that we're interested in. | ||
428 | */ | ||
429 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
430 | val = armv6_pmcr_read(); | ||
431 | val &= ~mask; | ||
432 | val |= evt; | ||
433 | armv6_pmcr_write(val); | ||
434 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
435 | } | ||
436 | |||
437 | static irqreturn_t | ||
438 | armv6pmu_handle_irq(int irq_num, | ||
439 | void *dev) | ||
440 | { | ||
441 | unsigned long pmcr = armv6_pmcr_read(); | ||
442 | struct perf_sample_data data; | ||
443 | struct cpu_hw_events *cpuc; | ||
444 | struct pt_regs *regs; | ||
445 | int idx; | ||
446 | |||
447 | if (!armv6_pmcr_has_overflowed(pmcr)) | ||
448 | return IRQ_NONE; | ||
449 | |||
450 | regs = get_irq_regs(); | ||
451 | |||
452 | /* | ||
453 | * The interrupts are cleared by writing the overflow flags back to | ||
454 | * the control register. All of the other bits don't have any effect | ||
455 | * if they are rewritten, so write the whole value back. | ||
456 | */ | ||
457 | armv6_pmcr_write(pmcr); | ||
458 | |||
459 | perf_sample_data_init(&data, 0); | ||
460 | |||
461 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
462 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
463 | struct perf_event *event = cpuc->events[idx]; | ||
464 | struct hw_perf_event *hwc; | ||
465 | |||
466 | if (!test_bit(idx, cpuc->active_mask)) | ||
467 | continue; | ||
468 | |||
469 | /* | ||
470 | * We have a single interrupt for all counters. Check that | ||
471 | * each counter has overflowed before we process it. | ||
472 | */ | ||
473 | if (!armv6_pmcr_counter_has_overflowed(pmcr, idx)) | ||
474 | continue; | ||
475 | |||
476 | hwc = &event->hw; | ||
477 | armpmu_event_update(event, hwc, idx); | ||
478 | data.period = event->hw.last_period; | ||
479 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
480 | continue; | ||
481 | |||
482 | if (perf_event_overflow(event, 0, &data, regs)) | ||
483 | armpmu->disable(hwc, idx); | ||
484 | } | ||
485 | |||
486 | /* | ||
487 | * Handle the pending perf events. | ||
488 | * | ||
489 | * Note: this call *must* be run with interrupts disabled. For | ||
490 | * platforms that can have the PMU interrupts raised as an NMI, this | ||
491 | * will not work. | ||
492 | */ | ||
493 | irq_work_run(); | ||
494 | |||
495 | return IRQ_HANDLED; | ||
496 | } | ||
497 | |||
498 | static void | ||
499 | armv6pmu_start(void) | ||
500 | { | ||
501 | unsigned long flags, val; | ||
502 | |||
503 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
504 | val = armv6_pmcr_read(); | ||
505 | val |= ARMV6_PMCR_ENABLE; | ||
506 | armv6_pmcr_write(val); | ||
507 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
508 | } | ||
509 | |||
510 | static void | ||
511 | armv6pmu_stop(void) | ||
512 | { | ||
513 | unsigned long flags, val; | ||
514 | |||
515 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
516 | val = armv6_pmcr_read(); | ||
517 | val &= ~ARMV6_PMCR_ENABLE; | ||
518 | armv6_pmcr_write(val); | ||
519 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
520 | } | ||
521 | |||
522 | static int | ||
523 | armv6pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
524 | struct hw_perf_event *event) | ||
525 | { | ||
526 | /* Always place a cycle counter into the cycle counter. */ | ||
527 | if (ARMV6_PERFCTR_CPU_CYCLES == event->config_base) { | ||
528 | if (test_and_set_bit(ARMV6_CYCLE_COUNTER, cpuc->used_mask)) | ||
529 | return -EAGAIN; | ||
530 | |||
531 | return ARMV6_CYCLE_COUNTER; | ||
532 | } else { | ||
533 | /* | ||
534 | * For anything other than a cycle counter, try and use | ||
535 | * counter0 and counter1. | ||
536 | */ | ||
537 | if (!test_and_set_bit(ARMV6_COUNTER1, cpuc->used_mask)) | ||
538 | return ARMV6_COUNTER1; | ||
539 | |||
540 | if (!test_and_set_bit(ARMV6_COUNTER0, cpuc->used_mask)) | ||
541 | return ARMV6_COUNTER0; | ||
542 | |||
543 | /* The counters are all in use. */ | ||
544 | return -EAGAIN; | ||
545 | } | ||
546 | } | ||
547 | |||
548 | static void | ||
549 | armv6pmu_disable_event(struct hw_perf_event *hwc, | ||
550 | int idx) | ||
551 | { | ||
552 | unsigned long val, mask, evt, flags; | ||
553 | |||
554 | if (ARMV6_CYCLE_COUNTER == idx) { | ||
555 | mask = ARMV6_PMCR_CCOUNT_IEN; | ||
556 | evt = 0; | ||
557 | } else if (ARMV6_COUNTER0 == idx) { | ||
558 | mask = ARMV6_PMCR_COUNT0_IEN | ARMV6_PMCR_EVT_COUNT0_MASK; | ||
559 | evt = ARMV6_PERFCTR_NOP << ARMV6_PMCR_EVT_COUNT0_SHIFT; | ||
560 | } else if (ARMV6_COUNTER1 == idx) { | ||
561 | mask = ARMV6_PMCR_COUNT1_IEN | ARMV6_PMCR_EVT_COUNT1_MASK; | ||
562 | evt = ARMV6_PERFCTR_NOP << ARMV6_PMCR_EVT_COUNT1_SHIFT; | ||
563 | } else { | ||
564 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
565 | return; | ||
566 | } | ||
567 | |||
568 | /* | ||
569 | * Mask out the current event and set the counter to count the number | ||
570 | * of ETM bus signal assertion cycles. The external reporting should | ||
571 | * be disabled and so this should never increment. | ||
572 | */ | ||
573 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
574 | val = armv6_pmcr_read(); | ||
575 | val &= ~mask; | ||
576 | val |= evt; | ||
577 | armv6_pmcr_write(val); | ||
578 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
579 | } | ||
580 | |||
581 | static void | ||
582 | armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc, | ||
583 | int idx) | ||
584 | { | ||
585 | unsigned long val, mask, flags, evt = 0; | ||
586 | |||
587 | if (ARMV6_CYCLE_COUNTER == idx) { | ||
588 | mask = ARMV6_PMCR_CCOUNT_IEN; | ||
589 | } else if (ARMV6_COUNTER0 == idx) { | ||
590 | mask = ARMV6_PMCR_COUNT0_IEN; | ||
591 | } else if (ARMV6_COUNTER1 == idx) { | ||
592 | mask = ARMV6_PMCR_COUNT1_IEN; | ||
593 | } else { | ||
594 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
595 | return; | ||
596 | } | ||
597 | |||
598 | /* | ||
599 | * Unlike UP ARMv6, we don't have a way of stopping the counters. We | ||
600 | * simply disable the interrupt reporting. | ||
601 | */ | ||
602 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
603 | val = armv6_pmcr_read(); | ||
604 | val &= ~mask; | ||
605 | val |= evt; | ||
606 | armv6_pmcr_write(val); | ||
607 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
608 | } | ||
609 | |||
610 | static const struct arm_pmu armv6pmu = { | ||
611 | .id = ARM_PERF_PMU_ID_V6, | ||
612 | .name = "v6", | ||
613 | .handle_irq = armv6pmu_handle_irq, | ||
614 | .enable = armv6pmu_enable_event, | ||
615 | .disable = armv6pmu_disable_event, | ||
616 | .read_counter = armv6pmu_read_counter, | ||
617 | .write_counter = armv6pmu_write_counter, | ||
618 | .get_event_idx = armv6pmu_get_event_idx, | ||
619 | .start = armv6pmu_start, | ||
620 | .stop = armv6pmu_stop, | ||
621 | .cache_map = &armv6_perf_cache_map, | ||
622 | .event_map = &armv6_perf_map, | ||
623 | .raw_event_mask = 0xFF, | ||
624 | .num_events = 3, | ||
625 | .max_period = (1LLU << 32) - 1, | ||
626 | }; | ||
627 | |||
628 | static const struct arm_pmu *__init armv6pmu_init(void) | ||
629 | { | ||
630 | return &armv6pmu; | ||
631 | } | ||
632 | |||
633 | /* | ||
634 | * ARMv6mpcore is almost identical to single core ARMv6 with the exception | ||
635 | * that some of the events have different enumerations and that there is no | ||
636 | * *hack* to stop the programmable counters. To stop the counters we simply | ||
637 | * disable the interrupt reporting and update the event. When unthrottling we | ||
638 | * reset the period and enable the interrupt reporting. | ||
639 | */ | ||
640 | static const struct arm_pmu armv6mpcore_pmu = { | ||
641 | .id = ARM_PERF_PMU_ID_V6MP, | ||
642 | .name = "v6mpcore", | ||
643 | .handle_irq = armv6pmu_handle_irq, | ||
644 | .enable = armv6pmu_enable_event, | ||
645 | .disable = armv6mpcore_pmu_disable_event, | ||
646 | .read_counter = armv6pmu_read_counter, | ||
647 | .write_counter = armv6pmu_write_counter, | ||
648 | .get_event_idx = armv6pmu_get_event_idx, | ||
649 | .start = armv6pmu_start, | ||
650 | .stop = armv6pmu_stop, | ||
651 | .cache_map = &armv6mpcore_perf_cache_map, | ||
652 | .event_map = &armv6mpcore_perf_map, | ||
653 | .raw_event_mask = 0xFF, | ||
654 | .num_events = 3, | ||
655 | .max_period = (1LLU << 32) - 1, | ||
656 | }; | ||
657 | |||
658 | static const struct arm_pmu *__init armv6mpcore_pmu_init(void) | ||
659 | { | ||
660 | return &armv6mpcore_pmu; | ||
661 | } | ||
662 | #else | ||
663 | static const struct arm_pmu *__init armv6pmu_init(void) | ||
664 | { | ||
665 | return NULL; | ||
666 | } | ||
667 | |||
668 | static const struct arm_pmu *__init armv6mpcore_pmu_init(void) | ||
669 | { | ||
670 | return NULL; | ||
671 | } | ||
672 | #endif /* CONFIG_CPU_V6 */ | ||
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c new file mode 100644 index 000000000000..2e1402556fa0 --- /dev/null +++ b/arch/arm/kernel/perf_event_v7.c | |||
@@ -0,0 +1,906 @@ | |||
1 | /* | ||
2 | * ARMv7 Cortex-A8 and Cortex-A9 Performance Events handling code. | ||
3 | * | ||
4 | * ARMv7 support: Jean Pihet <jpihet@mvista.com> | ||
5 | * 2010 (c) MontaVista Software, LLC. | ||
6 | * | ||
7 | * Copied from ARMv6 code, with the low level code inspired | ||
8 | * by the ARMv7 Oprofile code. | ||
9 | * | ||
10 | * Cortex-A8 has up to 4 configurable performance counters and | ||
11 | * a single cycle counter. | ||
12 | * Cortex-A9 has up to 31 configurable performance counters and | ||
13 | * a single cycle counter. | ||
14 | * | ||
15 | * All counters can be enabled/disabled and IRQ masked separately. The cycle | ||
16 | * counter and all 4 performance counters together can be reset separately. | ||
17 | */ | ||
18 | |||
19 | #ifdef CONFIG_CPU_V7 | ||
20 | /* Common ARMv7 event types */ | ||
21 | enum armv7_perf_types { | ||
22 | ARMV7_PERFCTR_PMNC_SW_INCR = 0x00, | ||
23 | ARMV7_PERFCTR_IFETCH_MISS = 0x01, | ||
24 | ARMV7_PERFCTR_ITLB_MISS = 0x02, | ||
25 | ARMV7_PERFCTR_DCACHE_REFILL = 0x03, | ||
26 | ARMV7_PERFCTR_DCACHE_ACCESS = 0x04, | ||
27 | ARMV7_PERFCTR_DTLB_REFILL = 0x05, | ||
28 | ARMV7_PERFCTR_DREAD = 0x06, | ||
29 | ARMV7_PERFCTR_DWRITE = 0x07, | ||
30 | |||
31 | ARMV7_PERFCTR_EXC_TAKEN = 0x09, | ||
32 | ARMV7_PERFCTR_EXC_EXECUTED = 0x0A, | ||
33 | ARMV7_PERFCTR_CID_WRITE = 0x0B, | ||
34 | /* ARMV7_PERFCTR_PC_WRITE is equivalent to HW_BRANCH_INSTRUCTIONS. | ||
35 | * It counts: | ||
36 | * - all branch instructions, | ||
37 | * - instructions that explicitly write the PC, | ||
38 | * - exception generating instructions. | ||
39 | */ | ||
40 | ARMV7_PERFCTR_PC_WRITE = 0x0C, | ||
41 | ARMV7_PERFCTR_PC_IMM_BRANCH = 0x0D, | ||
42 | ARMV7_PERFCTR_UNALIGNED_ACCESS = 0x0F, | ||
43 | ARMV7_PERFCTR_PC_BRANCH_MIS_PRED = 0x10, | ||
44 | ARMV7_PERFCTR_CLOCK_CYCLES = 0x11, | ||
45 | |||
46 | ARMV7_PERFCTR_PC_BRANCH_MIS_USED = 0x12, | ||
47 | |||
48 | ARMV7_PERFCTR_CPU_CYCLES = 0xFF | ||
49 | }; | ||
50 | |||
51 | /* ARMv7 Cortex-A8 specific event types */ | ||
52 | enum armv7_a8_perf_types { | ||
53 | ARMV7_PERFCTR_INSTR_EXECUTED = 0x08, | ||
54 | |||
55 | ARMV7_PERFCTR_PC_PROC_RETURN = 0x0E, | ||
56 | |||
57 | ARMV7_PERFCTR_WRITE_BUFFER_FULL = 0x40, | ||
58 | ARMV7_PERFCTR_L2_STORE_MERGED = 0x41, | ||
59 | ARMV7_PERFCTR_L2_STORE_BUFF = 0x42, | ||
60 | ARMV7_PERFCTR_L2_ACCESS = 0x43, | ||
61 | ARMV7_PERFCTR_L2_CACH_MISS = 0x44, | ||
62 | ARMV7_PERFCTR_AXI_READ_CYCLES = 0x45, | ||
63 | ARMV7_PERFCTR_AXI_WRITE_CYCLES = 0x46, | ||
64 | ARMV7_PERFCTR_MEMORY_REPLAY = 0x47, | ||
65 | ARMV7_PERFCTR_UNALIGNED_ACCESS_REPLAY = 0x48, | ||
66 | ARMV7_PERFCTR_L1_DATA_MISS = 0x49, | ||
67 | ARMV7_PERFCTR_L1_INST_MISS = 0x4A, | ||
68 | ARMV7_PERFCTR_L1_DATA_COLORING = 0x4B, | ||
69 | ARMV7_PERFCTR_L1_NEON_DATA = 0x4C, | ||
70 | ARMV7_PERFCTR_L1_NEON_CACH_DATA = 0x4D, | ||
71 | ARMV7_PERFCTR_L2_NEON = 0x4E, | ||
72 | ARMV7_PERFCTR_L2_NEON_HIT = 0x4F, | ||
73 | ARMV7_PERFCTR_L1_INST = 0x50, | ||
74 | ARMV7_PERFCTR_PC_RETURN_MIS_PRED = 0x51, | ||
75 | ARMV7_PERFCTR_PC_BRANCH_FAILED = 0x52, | ||
76 | ARMV7_PERFCTR_PC_BRANCH_TAKEN = 0x53, | ||
77 | ARMV7_PERFCTR_PC_BRANCH_EXECUTED = 0x54, | ||
78 | ARMV7_PERFCTR_OP_EXECUTED = 0x55, | ||
79 | ARMV7_PERFCTR_CYCLES_INST_STALL = 0x56, | ||
80 | ARMV7_PERFCTR_CYCLES_INST = 0x57, | ||
81 | ARMV7_PERFCTR_CYCLES_NEON_DATA_STALL = 0x58, | ||
82 | ARMV7_PERFCTR_CYCLES_NEON_INST_STALL = 0x59, | ||
83 | ARMV7_PERFCTR_NEON_CYCLES = 0x5A, | ||
84 | |||
85 | ARMV7_PERFCTR_PMU0_EVENTS = 0x70, | ||
86 | ARMV7_PERFCTR_PMU1_EVENTS = 0x71, | ||
87 | ARMV7_PERFCTR_PMU_EVENTS = 0x72, | ||
88 | }; | ||
89 | |||
90 | /* ARMv7 Cortex-A9 specific event types */ | ||
91 | enum armv7_a9_perf_types { | ||
92 | ARMV7_PERFCTR_JAVA_HW_BYTECODE_EXEC = 0x40, | ||
93 | ARMV7_PERFCTR_JAVA_SW_BYTECODE_EXEC = 0x41, | ||
94 | ARMV7_PERFCTR_JAZELLE_BRANCH_EXEC = 0x42, | ||
95 | |||
96 | ARMV7_PERFCTR_COHERENT_LINE_MISS = 0x50, | ||
97 | ARMV7_PERFCTR_COHERENT_LINE_HIT = 0x51, | ||
98 | |||
99 | ARMV7_PERFCTR_ICACHE_DEP_STALL_CYCLES = 0x60, | ||
100 | ARMV7_PERFCTR_DCACHE_DEP_STALL_CYCLES = 0x61, | ||
101 | ARMV7_PERFCTR_TLB_MISS_DEP_STALL_CYCLES = 0x62, | ||
102 | ARMV7_PERFCTR_STREX_EXECUTED_PASSED = 0x63, | ||
103 | ARMV7_PERFCTR_STREX_EXECUTED_FAILED = 0x64, | ||
104 | ARMV7_PERFCTR_DATA_EVICTION = 0x65, | ||
105 | ARMV7_PERFCTR_ISSUE_STAGE_NO_INST = 0x66, | ||
106 | ARMV7_PERFCTR_ISSUE_STAGE_EMPTY = 0x67, | ||
107 | ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE = 0x68, | ||
108 | |||
109 | ARMV7_PERFCTR_PREDICTABLE_FUNCT_RETURNS = 0x6E, | ||
110 | |||
111 | ARMV7_PERFCTR_MAIN_UNIT_EXECUTED_INST = 0x70, | ||
112 | ARMV7_PERFCTR_SECOND_UNIT_EXECUTED_INST = 0x71, | ||
113 | ARMV7_PERFCTR_LD_ST_UNIT_EXECUTED_INST = 0x72, | ||
114 | ARMV7_PERFCTR_FP_EXECUTED_INST = 0x73, | ||
115 | ARMV7_PERFCTR_NEON_EXECUTED_INST = 0x74, | ||
116 | |||
117 | ARMV7_PERFCTR_PLD_FULL_DEP_STALL_CYCLES = 0x80, | ||
118 | ARMV7_PERFCTR_DATA_WR_DEP_STALL_CYCLES = 0x81, | ||
119 | ARMV7_PERFCTR_ITLB_MISS_DEP_STALL_CYCLES = 0x82, | ||
120 | ARMV7_PERFCTR_DTLB_MISS_DEP_STALL_CYCLES = 0x83, | ||
121 | ARMV7_PERFCTR_MICRO_ITLB_MISS_DEP_STALL_CYCLES = 0x84, | ||
122 | ARMV7_PERFCTR_MICRO_DTLB_MISS_DEP_STALL_CYCLES = 0x85, | ||
123 | ARMV7_PERFCTR_DMB_DEP_STALL_CYCLES = 0x86, | ||
124 | |||
125 | ARMV7_PERFCTR_INTGR_CLK_ENABLED_CYCLES = 0x8A, | ||
126 | ARMV7_PERFCTR_DATA_ENGINE_CLK_EN_CYCLES = 0x8B, | ||
127 | |||
128 | ARMV7_PERFCTR_ISB_INST = 0x90, | ||
129 | ARMV7_PERFCTR_DSB_INST = 0x91, | ||
130 | ARMV7_PERFCTR_DMB_INST = 0x92, | ||
131 | ARMV7_PERFCTR_EXT_INTERRUPTS = 0x93, | ||
132 | |||
133 | ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_COMPLETED = 0xA0, | ||
134 | ARMV7_PERFCTR_PLE_CACHE_LINE_RQST_SKIPPED = 0xA1, | ||
135 | ARMV7_PERFCTR_PLE_FIFO_FLUSH = 0xA2, | ||
136 | ARMV7_PERFCTR_PLE_RQST_COMPLETED = 0xA3, | ||
137 | ARMV7_PERFCTR_PLE_FIFO_OVERFLOW = 0xA4, | ||
138 | ARMV7_PERFCTR_PLE_RQST_PROG = 0xA5 | ||
139 | }; | ||
140 | |||
141 | /* | ||
142 | * Cortex-A8 HW events mapping | ||
143 | * | ||
144 | * The hardware events that we support. We do support cache operations but | ||
145 | * we have harvard caches and no way to combine instruction and data | ||
146 | * accesses/misses in hardware. | ||
147 | */ | ||
148 | static const unsigned armv7_a8_perf_map[PERF_COUNT_HW_MAX] = { | ||
149 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, | ||
150 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED, | ||
151 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
152 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
153 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, | ||
154 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
155 | [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES, | ||
156 | }; | ||
157 | |||
158 | static const unsigned armv7_a8_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
159 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
160 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
161 | [C(L1D)] = { | ||
162 | /* | ||
163 | * The performance counters don't differentiate between read | ||
164 | * and write accesses/misses so this isn't strictly correct, | ||
165 | * but it's the best we can do. Writes and reads get | ||
166 | * combined. | ||
167 | */ | ||
168 | [C(OP_READ)] = { | ||
169 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
170 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
171 | }, | ||
172 | [C(OP_WRITE)] = { | ||
173 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
174 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
175 | }, | ||
176 | [C(OP_PREFETCH)] = { | ||
177 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
178 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
179 | }, | ||
180 | }, | ||
181 | [C(L1I)] = { | ||
182 | [C(OP_READ)] = { | ||
183 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST, | ||
184 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS, | ||
185 | }, | ||
186 | [C(OP_WRITE)] = { | ||
187 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_INST, | ||
188 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_INST_MISS, | ||
189 | }, | ||
190 | [C(OP_PREFETCH)] = { | ||
191 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
192 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
193 | }, | ||
194 | }, | ||
195 | [C(LL)] = { | ||
196 | [C(OP_READ)] = { | ||
197 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS, | ||
198 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS, | ||
199 | }, | ||
200 | [C(OP_WRITE)] = { | ||
201 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L2_ACCESS, | ||
202 | [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACH_MISS, | ||
203 | }, | ||
204 | [C(OP_PREFETCH)] = { | ||
205 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
206 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
207 | }, | ||
208 | }, | ||
209 | [C(DTLB)] = { | ||
210 | /* | ||
211 | * Only ITLB misses and DTLB refills are supported. | ||
212 | * If users want the DTLB refills misses a raw counter | ||
213 | * must be used. | ||
214 | */ | ||
215 | [C(OP_READ)] = { | ||
216 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
217 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
218 | }, | ||
219 | [C(OP_WRITE)] = { | ||
220 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
221 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
222 | }, | ||
223 | [C(OP_PREFETCH)] = { | ||
224 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
225 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
226 | }, | ||
227 | }, | ||
228 | [C(ITLB)] = { | ||
229 | [C(OP_READ)] = { | ||
230 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
231 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
232 | }, | ||
233 | [C(OP_WRITE)] = { | ||
234 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
235 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
236 | }, | ||
237 | [C(OP_PREFETCH)] = { | ||
238 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
239 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
240 | }, | ||
241 | }, | ||
242 | [C(BPU)] = { | ||
243 | [C(OP_READ)] = { | ||
244 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
245 | [C(RESULT_MISS)] | ||
246 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
247 | }, | ||
248 | [C(OP_WRITE)] = { | ||
249 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
250 | [C(RESULT_MISS)] | ||
251 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
252 | }, | ||
253 | [C(OP_PREFETCH)] = { | ||
254 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
255 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
256 | }, | ||
257 | }, | ||
258 | }; | ||
259 | |||
260 | /* | ||
261 | * Cortex-A9 HW events mapping | ||
262 | */ | ||
263 | static const unsigned armv7_a9_perf_map[PERF_COUNT_HW_MAX] = { | ||
264 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, | ||
265 | [PERF_COUNT_HW_INSTRUCTIONS] = | ||
266 | ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE, | ||
267 | [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_COHERENT_LINE_HIT, | ||
268 | [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_COHERENT_LINE_MISS, | ||
269 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, | ||
270 | [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
271 | [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES, | ||
272 | }; | ||
273 | |||
274 | static const unsigned armv7_a9_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
275 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
276 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
277 | [C(L1D)] = { | ||
278 | /* | ||
279 | * The performance counters don't differentiate between read | ||
280 | * and write accesses/misses so this isn't strictly correct, | ||
281 | * but it's the best we can do. Writes and reads get | ||
282 | * combined. | ||
283 | */ | ||
284 | [C(OP_READ)] = { | ||
285 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
286 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
287 | }, | ||
288 | [C(OP_WRITE)] = { | ||
289 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_DCACHE_ACCESS, | ||
290 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DCACHE_REFILL, | ||
291 | }, | ||
292 | [C(OP_PREFETCH)] = { | ||
293 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
294 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
295 | }, | ||
296 | }, | ||
297 | [C(L1I)] = { | ||
298 | [C(OP_READ)] = { | ||
299 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
300 | [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, | ||
301 | }, | ||
302 | [C(OP_WRITE)] = { | ||
303 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
304 | [C(RESULT_MISS)] = ARMV7_PERFCTR_IFETCH_MISS, | ||
305 | }, | ||
306 | [C(OP_PREFETCH)] = { | ||
307 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
308 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
309 | }, | ||
310 | }, | ||
311 | [C(LL)] = { | ||
312 | [C(OP_READ)] = { | ||
313 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
314 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
315 | }, | ||
316 | [C(OP_WRITE)] = { | ||
317 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
318 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
319 | }, | ||
320 | [C(OP_PREFETCH)] = { | ||
321 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
322 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
323 | }, | ||
324 | }, | ||
325 | [C(DTLB)] = { | ||
326 | /* | ||
327 | * Only ITLB misses and DTLB refills are supported. | ||
328 | * If users want the DTLB refills misses a raw counter | ||
329 | * must be used. | ||
330 | */ | ||
331 | [C(OP_READ)] = { | ||
332 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
333 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
334 | }, | ||
335 | [C(OP_WRITE)] = { | ||
336 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
337 | [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL, | ||
338 | }, | ||
339 | [C(OP_PREFETCH)] = { | ||
340 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
341 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
342 | }, | ||
343 | }, | ||
344 | [C(ITLB)] = { | ||
345 | [C(OP_READ)] = { | ||
346 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
347 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
348 | }, | ||
349 | [C(OP_WRITE)] = { | ||
350 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
351 | [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_MISS, | ||
352 | }, | ||
353 | [C(OP_PREFETCH)] = { | ||
354 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
355 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
356 | }, | ||
357 | }, | ||
358 | [C(BPU)] = { | ||
359 | [C(OP_READ)] = { | ||
360 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
361 | [C(RESULT_MISS)] | ||
362 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
363 | }, | ||
364 | [C(OP_WRITE)] = { | ||
365 | [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_WRITE, | ||
366 | [C(RESULT_MISS)] | ||
367 | = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, | ||
368 | }, | ||
369 | [C(OP_PREFETCH)] = { | ||
370 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
371 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
372 | }, | ||
373 | }, | ||
374 | }; | ||
375 | |||
376 | /* | ||
377 | * Perf Events counters | ||
378 | */ | ||
379 | enum armv7_counters { | ||
380 | ARMV7_CYCLE_COUNTER = 1, /* Cycle counter */ | ||
381 | ARMV7_COUNTER0 = 2, /* First event counter */ | ||
382 | }; | ||
383 | |||
384 | /* | ||
385 | * The cycle counter is ARMV7_CYCLE_COUNTER. | ||
386 | * The first event counter is ARMV7_COUNTER0. | ||
387 | * The last event counter is (ARMV7_COUNTER0 + armpmu->num_events - 1). | ||
388 | */ | ||
389 | #define ARMV7_COUNTER_LAST (ARMV7_COUNTER0 + armpmu->num_events - 1) | ||
390 | |||
391 | /* | ||
392 | * ARMv7 low level PMNC access | ||
393 | */ | ||
394 | |||
395 | /* | ||
396 | * Per-CPU PMNC: config reg | ||
397 | */ | ||
398 | #define ARMV7_PMNC_E (1 << 0) /* Enable all counters */ | ||
399 | #define ARMV7_PMNC_P (1 << 1) /* Reset all counters */ | ||
400 | #define ARMV7_PMNC_C (1 << 2) /* Cycle counter reset */ | ||
401 | #define ARMV7_PMNC_D (1 << 3) /* CCNT counts every 64th cpu cycle */ | ||
402 | #define ARMV7_PMNC_X (1 << 4) /* Export to ETM */ | ||
403 | #define ARMV7_PMNC_DP (1 << 5) /* Disable CCNT if non-invasive debug*/ | ||
404 | #define ARMV7_PMNC_N_SHIFT 11 /* Number of counters supported */ | ||
405 | #define ARMV7_PMNC_N_MASK 0x1f | ||
406 | #define ARMV7_PMNC_MASK 0x3f /* Mask for writable bits */ | ||
407 | |||
408 | /* | ||
409 | * Available counters | ||
410 | */ | ||
411 | #define ARMV7_CNT0 0 /* First event counter */ | ||
412 | #define ARMV7_CCNT 31 /* Cycle counter */ | ||
413 | |||
414 | /* Perf Event to low level counters mapping */ | ||
415 | #define ARMV7_EVENT_CNT_TO_CNTx (ARMV7_COUNTER0 - ARMV7_CNT0) | ||
416 | |||
417 | /* | ||
418 | * CNTENS: counters enable reg | ||
419 | */ | ||
420 | #define ARMV7_CNTENS_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
421 | #define ARMV7_CNTENS_C (1 << ARMV7_CCNT) | ||
422 | |||
423 | /* | ||
424 | * CNTENC: counters disable reg | ||
425 | */ | ||
426 | #define ARMV7_CNTENC_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
427 | #define ARMV7_CNTENC_C (1 << ARMV7_CCNT) | ||
428 | |||
429 | /* | ||
430 | * INTENS: counters overflow interrupt enable reg | ||
431 | */ | ||
432 | #define ARMV7_INTENS_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
433 | #define ARMV7_INTENS_C (1 << ARMV7_CCNT) | ||
434 | |||
435 | /* | ||
436 | * INTENC: counters overflow interrupt disable reg | ||
437 | */ | ||
438 | #define ARMV7_INTENC_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
439 | #define ARMV7_INTENC_C (1 << ARMV7_CCNT) | ||
440 | |||
441 | /* | ||
442 | * EVTSEL: Event selection reg | ||
443 | */ | ||
444 | #define ARMV7_EVTSEL_MASK 0xff /* Mask for writable bits */ | ||
445 | |||
446 | /* | ||
447 | * SELECT: Counter selection reg | ||
448 | */ | ||
449 | #define ARMV7_SELECT_MASK 0x1f /* Mask for writable bits */ | ||
450 | |||
451 | /* | ||
452 | * FLAG: counters overflow flag status reg | ||
453 | */ | ||
454 | #define ARMV7_FLAG_P(idx) (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx)) | ||
455 | #define ARMV7_FLAG_C (1 << ARMV7_CCNT) | ||
456 | #define ARMV7_FLAG_MASK 0xffffffff /* Mask for writable bits */ | ||
457 | #define ARMV7_OVERFLOWED_MASK ARMV7_FLAG_MASK | ||
458 | |||
459 | static inline unsigned long armv7_pmnc_read(void) | ||
460 | { | ||
461 | u32 val; | ||
462 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(val)); | ||
463 | return val; | ||
464 | } | ||
465 | |||
466 | static inline void armv7_pmnc_write(unsigned long val) | ||
467 | { | ||
468 | val &= ARMV7_PMNC_MASK; | ||
469 | asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val)); | ||
470 | } | ||
471 | |||
472 | static inline int armv7_pmnc_has_overflowed(unsigned long pmnc) | ||
473 | { | ||
474 | return pmnc & ARMV7_OVERFLOWED_MASK; | ||
475 | } | ||
476 | |||
477 | static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc, | ||
478 | enum armv7_counters counter) | ||
479 | { | ||
480 | int ret = 0; | ||
481 | |||
482 | if (counter == ARMV7_CYCLE_COUNTER) | ||
483 | ret = pmnc & ARMV7_FLAG_C; | ||
484 | else if ((counter >= ARMV7_COUNTER0) && (counter <= ARMV7_COUNTER_LAST)) | ||
485 | ret = pmnc & ARMV7_FLAG_P(counter); | ||
486 | else | ||
487 | pr_err("CPU%u checking wrong counter %d overflow status\n", | ||
488 | smp_processor_id(), counter); | ||
489 | |||
490 | return ret; | ||
491 | } | ||
492 | |||
493 | static inline int armv7_pmnc_select_counter(unsigned int idx) | ||
494 | { | ||
495 | u32 val; | ||
496 | |||
497 | if ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST)) { | ||
498 | pr_err("CPU%u selecting wrong PMNC counter" | ||
499 | " %d\n", smp_processor_id(), idx); | ||
500 | return -1; | ||
501 | } | ||
502 | |||
503 | val = (idx - ARMV7_EVENT_CNT_TO_CNTx) & ARMV7_SELECT_MASK; | ||
504 | asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (val)); | ||
505 | |||
506 | return idx; | ||
507 | } | ||
508 | |||
509 | static inline u32 armv7pmu_read_counter(int idx) | ||
510 | { | ||
511 | unsigned long value = 0; | ||
512 | |||
513 | if (idx == ARMV7_CYCLE_COUNTER) | ||
514 | asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (value)); | ||
515 | else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) { | ||
516 | if (armv7_pmnc_select_counter(idx) == idx) | ||
517 | asm volatile("mrc p15, 0, %0, c9, c13, 2" | ||
518 | : "=r" (value)); | ||
519 | } else | ||
520 | pr_err("CPU%u reading wrong counter %d\n", | ||
521 | smp_processor_id(), idx); | ||
522 | |||
523 | return value; | ||
524 | } | ||
525 | |||
526 | static inline void armv7pmu_write_counter(int idx, u32 value) | ||
527 | { | ||
528 | if (idx == ARMV7_CYCLE_COUNTER) | ||
529 | asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (value)); | ||
530 | else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) { | ||
531 | if (armv7_pmnc_select_counter(idx) == idx) | ||
532 | asm volatile("mcr p15, 0, %0, c9, c13, 2" | ||
533 | : : "r" (value)); | ||
534 | } else | ||
535 | pr_err("CPU%u writing wrong counter %d\n", | ||
536 | smp_processor_id(), idx); | ||
537 | } | ||
538 | |||
539 | static inline void armv7_pmnc_write_evtsel(unsigned int idx, u32 val) | ||
540 | { | ||
541 | if (armv7_pmnc_select_counter(idx) == idx) { | ||
542 | val &= ARMV7_EVTSEL_MASK; | ||
543 | asm volatile("mcr p15, 0, %0, c9, c13, 1" : : "r" (val)); | ||
544 | } | ||
545 | } | ||
546 | |||
547 | static inline u32 armv7_pmnc_enable_counter(unsigned int idx) | ||
548 | { | ||
549 | u32 val; | ||
550 | |||
551 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
552 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
553 | pr_err("CPU%u enabling wrong PMNC counter" | ||
554 | " %d\n", smp_processor_id(), idx); | ||
555 | return -1; | ||
556 | } | ||
557 | |||
558 | if (idx == ARMV7_CYCLE_COUNTER) | ||
559 | val = ARMV7_CNTENS_C; | ||
560 | else | ||
561 | val = ARMV7_CNTENS_P(idx); | ||
562 | |||
563 | asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (val)); | ||
564 | |||
565 | return idx; | ||
566 | } | ||
567 | |||
568 | static inline u32 armv7_pmnc_disable_counter(unsigned int idx) | ||
569 | { | ||
570 | u32 val; | ||
571 | |||
572 | |||
573 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
574 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
575 | pr_err("CPU%u disabling wrong PMNC counter" | ||
576 | " %d\n", smp_processor_id(), idx); | ||
577 | return -1; | ||
578 | } | ||
579 | |||
580 | if (idx == ARMV7_CYCLE_COUNTER) | ||
581 | val = ARMV7_CNTENC_C; | ||
582 | else | ||
583 | val = ARMV7_CNTENC_P(idx); | ||
584 | |||
585 | asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (val)); | ||
586 | |||
587 | return idx; | ||
588 | } | ||
589 | |||
590 | static inline u32 armv7_pmnc_enable_intens(unsigned int idx) | ||
591 | { | ||
592 | u32 val; | ||
593 | |||
594 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
595 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
596 | pr_err("CPU%u enabling wrong PMNC counter" | ||
597 | " interrupt enable %d\n", smp_processor_id(), idx); | ||
598 | return -1; | ||
599 | } | ||
600 | |||
601 | if (idx == ARMV7_CYCLE_COUNTER) | ||
602 | val = ARMV7_INTENS_C; | ||
603 | else | ||
604 | val = ARMV7_INTENS_P(idx); | ||
605 | |||
606 | asm volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (val)); | ||
607 | |||
608 | return idx; | ||
609 | } | ||
610 | |||
611 | static inline u32 armv7_pmnc_disable_intens(unsigned int idx) | ||
612 | { | ||
613 | u32 val; | ||
614 | |||
615 | if ((idx != ARMV7_CYCLE_COUNTER) && | ||
616 | ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) { | ||
617 | pr_err("CPU%u disabling wrong PMNC counter" | ||
618 | " interrupt enable %d\n", smp_processor_id(), idx); | ||
619 | return -1; | ||
620 | } | ||
621 | |||
622 | if (idx == ARMV7_CYCLE_COUNTER) | ||
623 | val = ARMV7_INTENC_C; | ||
624 | else | ||
625 | val = ARMV7_INTENC_P(idx); | ||
626 | |||
627 | asm volatile("mcr p15, 0, %0, c9, c14, 2" : : "r" (val)); | ||
628 | |||
629 | return idx; | ||
630 | } | ||
631 | |||
632 | static inline u32 armv7_pmnc_getreset_flags(void) | ||
633 | { | ||
634 | u32 val; | ||
635 | |||
636 | /* Read */ | ||
637 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
638 | |||
639 | /* Write to clear flags */ | ||
640 | val &= ARMV7_FLAG_MASK; | ||
641 | asm volatile("mcr p15, 0, %0, c9, c12, 3" : : "r" (val)); | ||
642 | |||
643 | return val; | ||
644 | } | ||
645 | |||
646 | #ifdef DEBUG | ||
647 | static void armv7_pmnc_dump_regs(void) | ||
648 | { | ||
649 | u32 val; | ||
650 | unsigned int cnt; | ||
651 | |||
652 | printk(KERN_INFO "PMNC registers dump:\n"); | ||
653 | |||
654 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (val)); | ||
655 | printk(KERN_INFO "PMNC =0x%08x\n", val); | ||
656 | |||
657 | asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r" (val)); | ||
658 | printk(KERN_INFO "CNTENS=0x%08x\n", val); | ||
659 | |||
660 | asm volatile("mrc p15, 0, %0, c9, c14, 1" : "=r" (val)); | ||
661 | printk(KERN_INFO "INTENS=0x%08x\n", val); | ||
662 | |||
663 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
664 | printk(KERN_INFO "FLAGS =0x%08x\n", val); | ||
665 | |||
666 | asm volatile("mrc p15, 0, %0, c9, c12, 5" : "=r" (val)); | ||
667 | printk(KERN_INFO "SELECT=0x%08x\n", val); | ||
668 | |||
669 | asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (val)); | ||
670 | printk(KERN_INFO "CCNT =0x%08x\n", val); | ||
671 | |||
672 | for (cnt = ARMV7_COUNTER0; cnt < ARMV7_COUNTER_LAST; cnt++) { | ||
673 | armv7_pmnc_select_counter(cnt); | ||
674 | asm volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (val)); | ||
675 | printk(KERN_INFO "CNT[%d] count =0x%08x\n", | ||
676 | cnt-ARMV7_EVENT_CNT_TO_CNTx, val); | ||
677 | asm volatile("mrc p15, 0, %0, c9, c13, 1" : "=r" (val)); | ||
678 | printk(KERN_INFO "CNT[%d] evtsel=0x%08x\n", | ||
679 | cnt-ARMV7_EVENT_CNT_TO_CNTx, val); | ||
680 | } | ||
681 | } | ||
682 | #endif | ||
683 | |||
684 | static void armv7pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
685 | { | ||
686 | unsigned long flags; | ||
687 | |||
688 | /* | ||
689 | * Enable counter and interrupt, and set the counter to count | ||
690 | * the event that we're interested in. | ||
691 | */ | ||
692 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
693 | |||
694 | /* | ||
695 | * Disable counter | ||
696 | */ | ||
697 | armv7_pmnc_disable_counter(idx); | ||
698 | |||
699 | /* | ||
700 | * Set event (if destined for PMNx counters) | ||
701 | * We don't need to set the event if it's a cycle count | ||
702 | */ | ||
703 | if (idx != ARMV7_CYCLE_COUNTER) | ||
704 | armv7_pmnc_write_evtsel(idx, hwc->config_base); | ||
705 | |||
706 | /* | ||
707 | * Enable interrupt for this counter | ||
708 | */ | ||
709 | armv7_pmnc_enable_intens(idx); | ||
710 | |||
711 | /* | ||
712 | * Enable counter | ||
713 | */ | ||
714 | armv7_pmnc_enable_counter(idx); | ||
715 | |||
716 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
717 | } | ||
718 | |||
719 | static void armv7pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
720 | { | ||
721 | unsigned long flags; | ||
722 | |||
723 | /* | ||
724 | * Disable counter and interrupt | ||
725 | */ | ||
726 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
727 | |||
728 | /* | ||
729 | * Disable counter | ||
730 | */ | ||
731 | armv7_pmnc_disable_counter(idx); | ||
732 | |||
733 | /* | ||
734 | * Disable interrupt for this counter | ||
735 | */ | ||
736 | armv7_pmnc_disable_intens(idx); | ||
737 | |||
738 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
739 | } | ||
740 | |||
741 | static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev) | ||
742 | { | ||
743 | unsigned long pmnc; | ||
744 | struct perf_sample_data data; | ||
745 | struct cpu_hw_events *cpuc; | ||
746 | struct pt_regs *regs; | ||
747 | int idx; | ||
748 | |||
749 | /* | ||
750 | * Get and reset the IRQ flags | ||
751 | */ | ||
752 | pmnc = armv7_pmnc_getreset_flags(); | ||
753 | |||
754 | /* | ||
755 | * Did an overflow occur? | ||
756 | */ | ||
757 | if (!armv7_pmnc_has_overflowed(pmnc)) | ||
758 | return IRQ_NONE; | ||
759 | |||
760 | /* | ||
761 | * Handle the counter(s) overflow(s) | ||
762 | */ | ||
763 | regs = get_irq_regs(); | ||
764 | |||
765 | perf_sample_data_init(&data, 0); | ||
766 | |||
767 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
768 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
769 | struct perf_event *event = cpuc->events[idx]; | ||
770 | struct hw_perf_event *hwc; | ||
771 | |||
772 | if (!test_bit(idx, cpuc->active_mask)) | ||
773 | continue; | ||
774 | |||
775 | /* | ||
776 | * We have a single interrupt for all counters. Check that | ||
777 | * each counter has overflowed before we process it. | ||
778 | */ | ||
779 | if (!armv7_pmnc_counter_has_overflowed(pmnc, idx)) | ||
780 | continue; | ||
781 | |||
782 | hwc = &event->hw; | ||
783 | armpmu_event_update(event, hwc, idx); | ||
784 | data.period = event->hw.last_period; | ||
785 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
786 | continue; | ||
787 | |||
788 | if (perf_event_overflow(event, 0, &data, regs)) | ||
789 | armpmu->disable(hwc, idx); | ||
790 | } | ||
791 | |||
792 | /* | ||
793 | * Handle the pending perf events. | ||
794 | * | ||
795 | * Note: this call *must* be run with interrupts disabled. For | ||
796 | * platforms that can have the PMU interrupts raised as an NMI, this | ||
797 | * will not work. | ||
798 | */ | ||
799 | irq_work_run(); | ||
800 | |||
801 | return IRQ_HANDLED; | ||
802 | } | ||
803 | |||
804 | static void armv7pmu_start(void) | ||
805 | { | ||
806 | unsigned long flags; | ||
807 | |||
808 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
809 | /* Enable all counters */ | ||
810 | armv7_pmnc_write(armv7_pmnc_read() | ARMV7_PMNC_E); | ||
811 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
812 | } | ||
813 | |||
814 | static void armv7pmu_stop(void) | ||
815 | { | ||
816 | unsigned long flags; | ||
817 | |||
818 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
819 | /* Disable all counters */ | ||
820 | armv7_pmnc_write(armv7_pmnc_read() & ~ARMV7_PMNC_E); | ||
821 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
822 | } | ||
823 | |||
824 | static int armv7pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
825 | struct hw_perf_event *event) | ||
826 | { | ||
827 | int idx; | ||
828 | |||
829 | /* Always place a cycle counter into the cycle counter. */ | ||
830 | if (event->config_base == ARMV7_PERFCTR_CPU_CYCLES) { | ||
831 | if (test_and_set_bit(ARMV7_CYCLE_COUNTER, cpuc->used_mask)) | ||
832 | return -EAGAIN; | ||
833 | |||
834 | return ARMV7_CYCLE_COUNTER; | ||
835 | } else { | ||
836 | /* | ||
837 | * For anything other than a cycle counter, try and use | ||
838 | * the events counters | ||
839 | */ | ||
840 | for (idx = ARMV7_COUNTER0; idx <= armpmu->num_events; ++idx) { | ||
841 | if (!test_and_set_bit(idx, cpuc->used_mask)) | ||
842 | return idx; | ||
843 | } | ||
844 | |||
845 | /* The counters are all in use. */ | ||
846 | return -EAGAIN; | ||
847 | } | ||
848 | } | ||
849 | |||
850 | static struct arm_pmu armv7pmu = { | ||
851 | .handle_irq = armv7pmu_handle_irq, | ||
852 | .enable = armv7pmu_enable_event, | ||
853 | .disable = armv7pmu_disable_event, | ||
854 | .read_counter = armv7pmu_read_counter, | ||
855 | .write_counter = armv7pmu_write_counter, | ||
856 | .get_event_idx = armv7pmu_get_event_idx, | ||
857 | .start = armv7pmu_start, | ||
858 | .stop = armv7pmu_stop, | ||
859 | .raw_event_mask = 0xFF, | ||
860 | .max_period = (1LLU << 32) - 1, | ||
861 | }; | ||
862 | |||
863 | static u32 __init armv7_reset_read_pmnc(void) | ||
864 | { | ||
865 | u32 nb_cnt; | ||
866 | |||
867 | /* Initialize & Reset PMNC: C and P bits */ | ||
868 | armv7_pmnc_write(ARMV7_PMNC_P | ARMV7_PMNC_C); | ||
869 | |||
870 | /* Read the nb of CNTx counters supported from PMNC */ | ||
871 | nb_cnt = (armv7_pmnc_read() >> ARMV7_PMNC_N_SHIFT) & ARMV7_PMNC_N_MASK; | ||
872 | |||
873 | /* Add the CPU cycles counter and return */ | ||
874 | return nb_cnt + 1; | ||
875 | } | ||
876 | |||
877 | static const struct arm_pmu *__init armv7_a8_pmu_init(void) | ||
878 | { | ||
879 | armv7pmu.id = ARM_PERF_PMU_ID_CA8; | ||
880 | armv7pmu.name = "ARMv7 Cortex-A8"; | ||
881 | armv7pmu.cache_map = &armv7_a8_perf_cache_map; | ||
882 | armv7pmu.event_map = &armv7_a8_perf_map; | ||
883 | armv7pmu.num_events = armv7_reset_read_pmnc(); | ||
884 | return &armv7pmu; | ||
885 | } | ||
886 | |||
887 | static const struct arm_pmu *__init armv7_a9_pmu_init(void) | ||
888 | { | ||
889 | armv7pmu.id = ARM_PERF_PMU_ID_CA9; | ||
890 | armv7pmu.name = "ARMv7 Cortex-A9"; | ||
891 | armv7pmu.cache_map = &armv7_a9_perf_cache_map; | ||
892 | armv7pmu.event_map = &armv7_a9_perf_map; | ||
893 | armv7pmu.num_events = armv7_reset_read_pmnc(); | ||
894 | return &armv7pmu; | ||
895 | } | ||
896 | #else | ||
897 | static const struct arm_pmu *__init armv7_a8_pmu_init(void) | ||
898 | { | ||
899 | return NULL; | ||
900 | } | ||
901 | |||
902 | static const struct arm_pmu *__init armv7_a9_pmu_init(void) | ||
903 | { | ||
904 | return NULL; | ||
905 | } | ||
906 | #endif /* CONFIG_CPU_V7 */ | ||
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c new file mode 100644 index 000000000000..28cd3b025bc3 --- /dev/null +++ b/arch/arm/kernel/perf_event_xscale.c | |||
@@ -0,0 +1,807 @@ | |||
1 | /* | ||
2 | * ARMv5 [xscale] Performance counter handling code. | ||
3 | * | ||
4 | * Copyright (C) 2010, ARM Ltd., Will Deacon <will.deacon@arm.com> | ||
5 | * | ||
6 | * Based on the previous xscale OProfile code. | ||
7 | * | ||
8 | * There are two variants of the xscale PMU that we support: | ||
9 | * - xscale1pmu: 2 event counters and a cycle counter | ||
10 | * - xscale2pmu: 4 event counters and a cycle counter | ||
11 | * The two variants share event definitions, but have different | ||
12 | * PMU structures. | ||
13 | */ | ||
14 | |||
15 | #ifdef CONFIG_CPU_XSCALE | ||
16 | enum xscale_perf_types { | ||
17 | XSCALE_PERFCTR_ICACHE_MISS = 0x00, | ||
18 | XSCALE_PERFCTR_ICACHE_NO_DELIVER = 0x01, | ||
19 | XSCALE_PERFCTR_DATA_STALL = 0x02, | ||
20 | XSCALE_PERFCTR_ITLB_MISS = 0x03, | ||
21 | XSCALE_PERFCTR_DTLB_MISS = 0x04, | ||
22 | XSCALE_PERFCTR_BRANCH = 0x05, | ||
23 | XSCALE_PERFCTR_BRANCH_MISS = 0x06, | ||
24 | XSCALE_PERFCTR_INSTRUCTION = 0x07, | ||
25 | XSCALE_PERFCTR_DCACHE_FULL_STALL = 0x08, | ||
26 | XSCALE_PERFCTR_DCACHE_FULL_STALL_CONTIG = 0x09, | ||
27 | XSCALE_PERFCTR_DCACHE_ACCESS = 0x0A, | ||
28 | XSCALE_PERFCTR_DCACHE_MISS = 0x0B, | ||
29 | XSCALE_PERFCTR_DCACHE_WRITE_BACK = 0x0C, | ||
30 | XSCALE_PERFCTR_PC_CHANGED = 0x0D, | ||
31 | XSCALE_PERFCTR_BCU_REQUEST = 0x10, | ||
32 | XSCALE_PERFCTR_BCU_FULL = 0x11, | ||
33 | XSCALE_PERFCTR_BCU_DRAIN = 0x12, | ||
34 | XSCALE_PERFCTR_BCU_ECC_NO_ELOG = 0x14, | ||
35 | XSCALE_PERFCTR_BCU_1_BIT_ERR = 0x15, | ||
36 | XSCALE_PERFCTR_RMW = 0x16, | ||
37 | /* XSCALE_PERFCTR_CCNT is not hardware defined */ | ||
38 | XSCALE_PERFCTR_CCNT = 0xFE, | ||
39 | XSCALE_PERFCTR_UNUSED = 0xFF, | ||
40 | }; | ||
41 | |||
42 | enum xscale_counters { | ||
43 | XSCALE_CYCLE_COUNTER = 1, | ||
44 | XSCALE_COUNTER0, | ||
45 | XSCALE_COUNTER1, | ||
46 | XSCALE_COUNTER2, | ||
47 | XSCALE_COUNTER3, | ||
48 | }; | ||
49 | |||
50 | static const unsigned xscale_perf_map[PERF_COUNT_HW_MAX] = { | ||
51 | [PERF_COUNT_HW_CPU_CYCLES] = XSCALE_PERFCTR_CCNT, | ||
52 | [PERF_COUNT_HW_INSTRUCTIONS] = XSCALE_PERFCTR_INSTRUCTION, | ||
53 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
54 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
55 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = XSCALE_PERFCTR_BRANCH, | ||
56 | [PERF_COUNT_HW_BRANCH_MISSES] = XSCALE_PERFCTR_BRANCH_MISS, | ||
57 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
58 | }; | ||
59 | |||
60 | static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
61 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
62 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
63 | [C(L1D)] = { | ||
64 | [C(OP_READ)] = { | ||
65 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
66 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
67 | }, | ||
68 | [C(OP_WRITE)] = { | ||
69 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
70 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
71 | }, | ||
72 | [C(OP_PREFETCH)] = { | ||
73 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
74 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
75 | }, | ||
76 | }, | ||
77 | [C(L1I)] = { | ||
78 | [C(OP_READ)] = { | ||
79 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
80 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
81 | }, | ||
82 | [C(OP_WRITE)] = { | ||
83 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
84 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
85 | }, | ||
86 | [C(OP_PREFETCH)] = { | ||
87 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
88 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
89 | }, | ||
90 | }, | ||
91 | [C(LL)] = { | ||
92 | [C(OP_READ)] = { | ||
93 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
94 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
95 | }, | ||
96 | [C(OP_WRITE)] = { | ||
97 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
98 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
99 | }, | ||
100 | [C(OP_PREFETCH)] = { | ||
101 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
102 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
103 | }, | ||
104 | }, | ||
105 | [C(DTLB)] = { | ||
106 | [C(OP_READ)] = { | ||
107 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
108 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
109 | }, | ||
110 | [C(OP_WRITE)] = { | ||
111 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
112 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
113 | }, | ||
114 | [C(OP_PREFETCH)] = { | ||
115 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
116 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
117 | }, | ||
118 | }, | ||
119 | [C(ITLB)] = { | ||
120 | [C(OP_READ)] = { | ||
121 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
122 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
123 | }, | ||
124 | [C(OP_WRITE)] = { | ||
125 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
126 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
127 | }, | ||
128 | [C(OP_PREFETCH)] = { | ||
129 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
130 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
131 | }, | ||
132 | }, | ||
133 | [C(BPU)] = { | ||
134 | [C(OP_READ)] = { | ||
135 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
136 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
137 | }, | ||
138 | [C(OP_WRITE)] = { | ||
139 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
140 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
141 | }, | ||
142 | [C(OP_PREFETCH)] = { | ||
143 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
144 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
145 | }, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | #define XSCALE_PMU_ENABLE 0x001 | ||
150 | #define XSCALE_PMN_RESET 0x002 | ||
151 | #define XSCALE_CCNT_RESET 0x004 | ||
152 | #define XSCALE_PMU_RESET (CCNT_RESET | PMN_RESET) | ||
153 | #define XSCALE_PMU_CNT64 0x008 | ||
154 | |||
155 | #define XSCALE1_OVERFLOWED_MASK 0x700 | ||
156 | #define XSCALE1_CCOUNT_OVERFLOW 0x400 | ||
157 | #define XSCALE1_COUNT0_OVERFLOW 0x100 | ||
158 | #define XSCALE1_COUNT1_OVERFLOW 0x200 | ||
159 | #define XSCALE1_CCOUNT_INT_EN 0x040 | ||
160 | #define XSCALE1_COUNT0_INT_EN 0x010 | ||
161 | #define XSCALE1_COUNT1_INT_EN 0x020 | ||
162 | #define XSCALE1_COUNT0_EVT_SHFT 12 | ||
163 | #define XSCALE1_COUNT0_EVT_MASK (0xff << XSCALE1_COUNT0_EVT_SHFT) | ||
164 | #define XSCALE1_COUNT1_EVT_SHFT 20 | ||
165 | #define XSCALE1_COUNT1_EVT_MASK (0xff << XSCALE1_COUNT1_EVT_SHFT) | ||
166 | |||
167 | static inline u32 | ||
168 | xscale1pmu_read_pmnc(void) | ||
169 | { | ||
170 | u32 val; | ||
171 | asm volatile("mrc p14, 0, %0, c0, c0, 0" : "=r" (val)); | ||
172 | return val; | ||
173 | } | ||
174 | |||
175 | static inline void | ||
176 | xscale1pmu_write_pmnc(u32 val) | ||
177 | { | ||
178 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
179 | val &= 0xffff77f; | ||
180 | asm volatile("mcr p14, 0, %0, c0, c0, 0" : : "r" (val)); | ||
181 | } | ||
182 | |||
183 | static inline int | ||
184 | xscale1_pmnc_counter_has_overflowed(unsigned long pmnc, | ||
185 | enum xscale_counters counter) | ||
186 | { | ||
187 | int ret = 0; | ||
188 | |||
189 | switch (counter) { | ||
190 | case XSCALE_CYCLE_COUNTER: | ||
191 | ret = pmnc & XSCALE1_CCOUNT_OVERFLOW; | ||
192 | break; | ||
193 | case XSCALE_COUNTER0: | ||
194 | ret = pmnc & XSCALE1_COUNT0_OVERFLOW; | ||
195 | break; | ||
196 | case XSCALE_COUNTER1: | ||
197 | ret = pmnc & XSCALE1_COUNT1_OVERFLOW; | ||
198 | break; | ||
199 | default: | ||
200 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
201 | } | ||
202 | |||
203 | return ret; | ||
204 | } | ||
205 | |||
206 | static irqreturn_t | ||
207 | xscale1pmu_handle_irq(int irq_num, void *dev) | ||
208 | { | ||
209 | unsigned long pmnc; | ||
210 | struct perf_sample_data data; | ||
211 | struct cpu_hw_events *cpuc; | ||
212 | struct pt_regs *regs; | ||
213 | int idx; | ||
214 | |||
215 | /* | ||
216 | * NOTE: there's an A stepping erratum that states if an overflow | ||
217 | * bit already exists and another occurs, the previous | ||
218 | * Overflow bit gets cleared. There's no workaround. | ||
219 | * Fixed in B stepping or later. | ||
220 | */ | ||
221 | pmnc = xscale1pmu_read_pmnc(); | ||
222 | |||
223 | /* | ||
224 | * Write the value back to clear the overflow flags. Overflow | ||
225 | * flags remain in pmnc for use below. We also disable the PMU | ||
226 | * while we process the interrupt. | ||
227 | */ | ||
228 | xscale1pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
229 | |||
230 | if (!(pmnc & XSCALE1_OVERFLOWED_MASK)) | ||
231 | return IRQ_NONE; | ||
232 | |||
233 | regs = get_irq_regs(); | ||
234 | |||
235 | perf_sample_data_init(&data, 0); | ||
236 | |||
237 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
238 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
239 | struct perf_event *event = cpuc->events[idx]; | ||
240 | struct hw_perf_event *hwc; | ||
241 | |||
242 | if (!test_bit(idx, cpuc->active_mask)) | ||
243 | continue; | ||
244 | |||
245 | if (!xscale1_pmnc_counter_has_overflowed(pmnc, idx)) | ||
246 | continue; | ||
247 | |||
248 | hwc = &event->hw; | ||
249 | armpmu_event_update(event, hwc, idx); | ||
250 | data.period = event->hw.last_period; | ||
251 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
252 | continue; | ||
253 | |||
254 | if (perf_event_overflow(event, 0, &data, regs)) | ||
255 | armpmu->disable(hwc, idx); | ||
256 | } | ||
257 | |||
258 | irq_work_run(); | ||
259 | |||
260 | /* | ||
261 | * Re-enable the PMU. | ||
262 | */ | ||
263 | pmnc = xscale1pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
264 | xscale1pmu_write_pmnc(pmnc); | ||
265 | |||
266 | return IRQ_HANDLED; | ||
267 | } | ||
268 | |||
269 | static void | ||
270 | xscale1pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
271 | { | ||
272 | unsigned long val, mask, evt, flags; | ||
273 | |||
274 | switch (idx) { | ||
275 | case XSCALE_CYCLE_COUNTER: | ||
276 | mask = 0; | ||
277 | evt = XSCALE1_CCOUNT_INT_EN; | ||
278 | break; | ||
279 | case XSCALE_COUNTER0: | ||
280 | mask = XSCALE1_COUNT0_EVT_MASK; | ||
281 | evt = (hwc->config_base << XSCALE1_COUNT0_EVT_SHFT) | | ||
282 | XSCALE1_COUNT0_INT_EN; | ||
283 | break; | ||
284 | case XSCALE_COUNTER1: | ||
285 | mask = XSCALE1_COUNT1_EVT_MASK; | ||
286 | evt = (hwc->config_base << XSCALE1_COUNT1_EVT_SHFT) | | ||
287 | XSCALE1_COUNT1_INT_EN; | ||
288 | break; | ||
289 | default: | ||
290 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
291 | return; | ||
292 | } | ||
293 | |||
294 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
295 | val = xscale1pmu_read_pmnc(); | ||
296 | val &= ~mask; | ||
297 | val |= evt; | ||
298 | xscale1pmu_write_pmnc(val); | ||
299 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
300 | } | ||
301 | |||
302 | static void | ||
303 | xscale1pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
304 | { | ||
305 | unsigned long val, mask, evt, flags; | ||
306 | |||
307 | switch (idx) { | ||
308 | case XSCALE_CYCLE_COUNTER: | ||
309 | mask = XSCALE1_CCOUNT_INT_EN; | ||
310 | evt = 0; | ||
311 | break; | ||
312 | case XSCALE_COUNTER0: | ||
313 | mask = XSCALE1_COUNT0_INT_EN | XSCALE1_COUNT0_EVT_MASK; | ||
314 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT0_EVT_SHFT; | ||
315 | break; | ||
316 | case XSCALE_COUNTER1: | ||
317 | mask = XSCALE1_COUNT1_INT_EN | XSCALE1_COUNT1_EVT_MASK; | ||
318 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT1_EVT_SHFT; | ||
319 | break; | ||
320 | default: | ||
321 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
322 | return; | ||
323 | } | ||
324 | |||
325 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
326 | val = xscale1pmu_read_pmnc(); | ||
327 | val &= ~mask; | ||
328 | val |= evt; | ||
329 | xscale1pmu_write_pmnc(val); | ||
330 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
331 | } | ||
332 | |||
333 | static int | ||
334 | xscale1pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
335 | struct hw_perf_event *event) | ||
336 | { | ||
337 | if (XSCALE_PERFCTR_CCNT == event->config_base) { | ||
338 | if (test_and_set_bit(XSCALE_CYCLE_COUNTER, cpuc->used_mask)) | ||
339 | return -EAGAIN; | ||
340 | |||
341 | return XSCALE_CYCLE_COUNTER; | ||
342 | } else { | ||
343 | if (!test_and_set_bit(XSCALE_COUNTER1, cpuc->used_mask)) | ||
344 | return XSCALE_COUNTER1; | ||
345 | |||
346 | if (!test_and_set_bit(XSCALE_COUNTER0, cpuc->used_mask)) | ||
347 | return XSCALE_COUNTER0; | ||
348 | |||
349 | return -EAGAIN; | ||
350 | } | ||
351 | } | ||
352 | |||
353 | static void | ||
354 | xscale1pmu_start(void) | ||
355 | { | ||
356 | unsigned long flags, val; | ||
357 | |||
358 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
359 | val = xscale1pmu_read_pmnc(); | ||
360 | val |= XSCALE_PMU_ENABLE; | ||
361 | xscale1pmu_write_pmnc(val); | ||
362 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
363 | } | ||
364 | |||
365 | static void | ||
366 | xscale1pmu_stop(void) | ||
367 | { | ||
368 | unsigned long flags, val; | ||
369 | |||
370 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
371 | val = xscale1pmu_read_pmnc(); | ||
372 | val &= ~XSCALE_PMU_ENABLE; | ||
373 | xscale1pmu_write_pmnc(val); | ||
374 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
375 | } | ||
376 | |||
377 | static inline u32 | ||
378 | xscale1pmu_read_counter(int counter) | ||
379 | { | ||
380 | u32 val = 0; | ||
381 | |||
382 | switch (counter) { | ||
383 | case XSCALE_CYCLE_COUNTER: | ||
384 | asm volatile("mrc p14, 0, %0, c1, c0, 0" : "=r" (val)); | ||
385 | break; | ||
386 | case XSCALE_COUNTER0: | ||
387 | asm volatile("mrc p14, 0, %0, c2, c0, 0" : "=r" (val)); | ||
388 | break; | ||
389 | case XSCALE_COUNTER1: | ||
390 | asm volatile("mrc p14, 0, %0, c3, c0, 0" : "=r" (val)); | ||
391 | break; | ||
392 | } | ||
393 | |||
394 | return val; | ||
395 | } | ||
396 | |||
397 | static inline void | ||
398 | xscale1pmu_write_counter(int counter, u32 val) | ||
399 | { | ||
400 | switch (counter) { | ||
401 | case XSCALE_CYCLE_COUNTER: | ||
402 | asm volatile("mcr p14, 0, %0, c1, c0, 0" : : "r" (val)); | ||
403 | break; | ||
404 | case XSCALE_COUNTER0: | ||
405 | asm volatile("mcr p14, 0, %0, c2, c0, 0" : : "r" (val)); | ||
406 | break; | ||
407 | case XSCALE_COUNTER1: | ||
408 | asm volatile("mcr p14, 0, %0, c3, c0, 0" : : "r" (val)); | ||
409 | break; | ||
410 | } | ||
411 | } | ||
412 | |||
413 | static const struct arm_pmu xscale1pmu = { | ||
414 | .id = ARM_PERF_PMU_ID_XSCALE1, | ||
415 | .name = "xscale1", | ||
416 | .handle_irq = xscale1pmu_handle_irq, | ||
417 | .enable = xscale1pmu_enable_event, | ||
418 | .disable = xscale1pmu_disable_event, | ||
419 | .read_counter = xscale1pmu_read_counter, | ||
420 | .write_counter = xscale1pmu_write_counter, | ||
421 | .get_event_idx = xscale1pmu_get_event_idx, | ||
422 | .start = xscale1pmu_start, | ||
423 | .stop = xscale1pmu_stop, | ||
424 | .cache_map = &xscale_perf_cache_map, | ||
425 | .event_map = &xscale_perf_map, | ||
426 | .raw_event_mask = 0xFF, | ||
427 | .num_events = 3, | ||
428 | .max_period = (1LLU << 32) - 1, | ||
429 | }; | ||
430 | |||
431 | static const struct arm_pmu *__init xscale1pmu_init(void) | ||
432 | { | ||
433 | return &xscale1pmu; | ||
434 | } | ||
435 | |||
436 | #define XSCALE2_OVERFLOWED_MASK 0x01f | ||
437 | #define XSCALE2_CCOUNT_OVERFLOW 0x001 | ||
438 | #define XSCALE2_COUNT0_OVERFLOW 0x002 | ||
439 | #define XSCALE2_COUNT1_OVERFLOW 0x004 | ||
440 | #define XSCALE2_COUNT2_OVERFLOW 0x008 | ||
441 | #define XSCALE2_COUNT3_OVERFLOW 0x010 | ||
442 | #define XSCALE2_CCOUNT_INT_EN 0x001 | ||
443 | #define XSCALE2_COUNT0_INT_EN 0x002 | ||
444 | #define XSCALE2_COUNT1_INT_EN 0x004 | ||
445 | #define XSCALE2_COUNT2_INT_EN 0x008 | ||
446 | #define XSCALE2_COUNT3_INT_EN 0x010 | ||
447 | #define XSCALE2_COUNT0_EVT_SHFT 0 | ||
448 | #define XSCALE2_COUNT0_EVT_MASK (0xff << XSCALE2_COUNT0_EVT_SHFT) | ||
449 | #define XSCALE2_COUNT1_EVT_SHFT 8 | ||
450 | #define XSCALE2_COUNT1_EVT_MASK (0xff << XSCALE2_COUNT1_EVT_SHFT) | ||
451 | #define XSCALE2_COUNT2_EVT_SHFT 16 | ||
452 | #define XSCALE2_COUNT2_EVT_MASK (0xff << XSCALE2_COUNT2_EVT_SHFT) | ||
453 | #define XSCALE2_COUNT3_EVT_SHFT 24 | ||
454 | #define XSCALE2_COUNT3_EVT_MASK (0xff << XSCALE2_COUNT3_EVT_SHFT) | ||
455 | |||
456 | static inline u32 | ||
457 | xscale2pmu_read_pmnc(void) | ||
458 | { | ||
459 | u32 val; | ||
460 | asm volatile("mrc p14, 0, %0, c0, c1, 0" : "=r" (val)); | ||
461 | /* bits 1-2 and 4-23 are read-unpredictable */ | ||
462 | return val & 0xff000009; | ||
463 | } | ||
464 | |||
465 | static inline void | ||
466 | xscale2pmu_write_pmnc(u32 val) | ||
467 | { | ||
468 | /* bits 4-23 are write-as-0, 24-31 are write ignored */ | ||
469 | val &= 0xf; | ||
470 | asm volatile("mcr p14, 0, %0, c0, c1, 0" : : "r" (val)); | ||
471 | } | ||
472 | |||
473 | static inline u32 | ||
474 | xscale2pmu_read_overflow_flags(void) | ||
475 | { | ||
476 | u32 val; | ||
477 | asm volatile("mrc p14, 0, %0, c5, c1, 0" : "=r" (val)); | ||
478 | return val; | ||
479 | } | ||
480 | |||
481 | static inline void | ||
482 | xscale2pmu_write_overflow_flags(u32 val) | ||
483 | { | ||
484 | asm volatile("mcr p14, 0, %0, c5, c1, 0" : : "r" (val)); | ||
485 | } | ||
486 | |||
487 | static inline u32 | ||
488 | xscale2pmu_read_event_select(void) | ||
489 | { | ||
490 | u32 val; | ||
491 | asm volatile("mrc p14, 0, %0, c8, c1, 0" : "=r" (val)); | ||
492 | return val; | ||
493 | } | ||
494 | |||
495 | static inline void | ||
496 | xscale2pmu_write_event_select(u32 val) | ||
497 | { | ||
498 | asm volatile("mcr p14, 0, %0, c8, c1, 0" : : "r"(val)); | ||
499 | } | ||
500 | |||
501 | static inline u32 | ||
502 | xscale2pmu_read_int_enable(void) | ||
503 | { | ||
504 | u32 val; | ||
505 | asm volatile("mrc p14, 0, %0, c4, c1, 0" : "=r" (val)); | ||
506 | return val; | ||
507 | } | ||
508 | |||
509 | static void | ||
510 | xscale2pmu_write_int_enable(u32 val) | ||
511 | { | ||
512 | asm volatile("mcr p14, 0, %0, c4, c1, 0" : : "r" (val)); | ||
513 | } | ||
514 | |||
515 | static inline int | ||
516 | xscale2_pmnc_counter_has_overflowed(unsigned long of_flags, | ||
517 | enum xscale_counters counter) | ||
518 | { | ||
519 | int ret = 0; | ||
520 | |||
521 | switch (counter) { | ||
522 | case XSCALE_CYCLE_COUNTER: | ||
523 | ret = of_flags & XSCALE2_CCOUNT_OVERFLOW; | ||
524 | break; | ||
525 | case XSCALE_COUNTER0: | ||
526 | ret = of_flags & XSCALE2_COUNT0_OVERFLOW; | ||
527 | break; | ||
528 | case XSCALE_COUNTER1: | ||
529 | ret = of_flags & XSCALE2_COUNT1_OVERFLOW; | ||
530 | break; | ||
531 | case XSCALE_COUNTER2: | ||
532 | ret = of_flags & XSCALE2_COUNT2_OVERFLOW; | ||
533 | break; | ||
534 | case XSCALE_COUNTER3: | ||
535 | ret = of_flags & XSCALE2_COUNT3_OVERFLOW; | ||
536 | break; | ||
537 | default: | ||
538 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
539 | } | ||
540 | |||
541 | return ret; | ||
542 | } | ||
543 | |||
544 | static irqreturn_t | ||
545 | xscale2pmu_handle_irq(int irq_num, void *dev) | ||
546 | { | ||
547 | unsigned long pmnc, of_flags; | ||
548 | struct perf_sample_data data; | ||
549 | struct cpu_hw_events *cpuc; | ||
550 | struct pt_regs *regs; | ||
551 | int idx; | ||
552 | |||
553 | /* Disable the PMU. */ | ||
554 | pmnc = xscale2pmu_read_pmnc(); | ||
555 | xscale2pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
556 | |||
557 | /* Check the overflow flag register. */ | ||
558 | of_flags = xscale2pmu_read_overflow_flags(); | ||
559 | if (!(of_flags & XSCALE2_OVERFLOWED_MASK)) | ||
560 | return IRQ_NONE; | ||
561 | |||
562 | /* Clear the overflow bits. */ | ||
563 | xscale2pmu_write_overflow_flags(of_flags); | ||
564 | |||
565 | regs = get_irq_regs(); | ||
566 | |||
567 | perf_sample_data_init(&data, 0); | ||
568 | |||
569 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
570 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
571 | struct perf_event *event = cpuc->events[idx]; | ||
572 | struct hw_perf_event *hwc; | ||
573 | |||
574 | if (!test_bit(idx, cpuc->active_mask)) | ||
575 | continue; | ||
576 | |||
577 | if (!xscale2_pmnc_counter_has_overflowed(pmnc, idx)) | ||
578 | continue; | ||
579 | |||
580 | hwc = &event->hw; | ||
581 | armpmu_event_update(event, hwc, idx); | ||
582 | data.period = event->hw.last_period; | ||
583 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
584 | continue; | ||
585 | |||
586 | if (perf_event_overflow(event, 0, &data, regs)) | ||
587 | armpmu->disable(hwc, idx); | ||
588 | } | ||
589 | |||
590 | irq_work_run(); | ||
591 | |||
592 | /* | ||
593 | * Re-enable the PMU. | ||
594 | */ | ||
595 | pmnc = xscale2pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
596 | xscale2pmu_write_pmnc(pmnc); | ||
597 | |||
598 | return IRQ_HANDLED; | ||
599 | } | ||
600 | |||
601 | static void | ||
602 | xscale2pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
603 | { | ||
604 | unsigned long flags, ien, evtsel; | ||
605 | |||
606 | ien = xscale2pmu_read_int_enable(); | ||
607 | evtsel = xscale2pmu_read_event_select(); | ||
608 | |||
609 | switch (idx) { | ||
610 | case XSCALE_CYCLE_COUNTER: | ||
611 | ien |= XSCALE2_CCOUNT_INT_EN; | ||
612 | break; | ||
613 | case XSCALE_COUNTER0: | ||
614 | ien |= XSCALE2_COUNT0_INT_EN; | ||
615 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
616 | evtsel |= hwc->config_base << XSCALE2_COUNT0_EVT_SHFT; | ||
617 | break; | ||
618 | case XSCALE_COUNTER1: | ||
619 | ien |= XSCALE2_COUNT1_INT_EN; | ||
620 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
621 | evtsel |= hwc->config_base << XSCALE2_COUNT1_EVT_SHFT; | ||
622 | break; | ||
623 | case XSCALE_COUNTER2: | ||
624 | ien |= XSCALE2_COUNT2_INT_EN; | ||
625 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
626 | evtsel |= hwc->config_base << XSCALE2_COUNT2_EVT_SHFT; | ||
627 | break; | ||
628 | case XSCALE_COUNTER3: | ||
629 | ien |= XSCALE2_COUNT3_INT_EN; | ||
630 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
631 | evtsel |= hwc->config_base << XSCALE2_COUNT3_EVT_SHFT; | ||
632 | break; | ||
633 | default: | ||
634 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
635 | return; | ||
636 | } | ||
637 | |||
638 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
639 | xscale2pmu_write_event_select(evtsel); | ||
640 | xscale2pmu_write_int_enable(ien); | ||
641 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
642 | } | ||
643 | |||
644 | static void | ||
645 | xscale2pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
646 | { | ||
647 | unsigned long flags, ien, evtsel; | ||
648 | |||
649 | ien = xscale2pmu_read_int_enable(); | ||
650 | evtsel = xscale2pmu_read_event_select(); | ||
651 | |||
652 | switch (idx) { | ||
653 | case XSCALE_CYCLE_COUNTER: | ||
654 | ien &= ~XSCALE2_CCOUNT_INT_EN; | ||
655 | break; | ||
656 | case XSCALE_COUNTER0: | ||
657 | ien &= ~XSCALE2_COUNT0_INT_EN; | ||
658 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
659 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT0_EVT_SHFT; | ||
660 | break; | ||
661 | case XSCALE_COUNTER1: | ||
662 | ien &= ~XSCALE2_COUNT1_INT_EN; | ||
663 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
664 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT1_EVT_SHFT; | ||
665 | break; | ||
666 | case XSCALE_COUNTER2: | ||
667 | ien &= ~XSCALE2_COUNT2_INT_EN; | ||
668 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
669 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT2_EVT_SHFT; | ||
670 | break; | ||
671 | case XSCALE_COUNTER3: | ||
672 | ien &= ~XSCALE2_COUNT3_INT_EN; | ||
673 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
674 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT3_EVT_SHFT; | ||
675 | break; | ||
676 | default: | ||
677 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
678 | return; | ||
679 | } | ||
680 | |||
681 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
682 | xscale2pmu_write_event_select(evtsel); | ||
683 | xscale2pmu_write_int_enable(ien); | ||
684 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
685 | } | ||
686 | |||
687 | static int | ||
688 | xscale2pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
689 | struct hw_perf_event *event) | ||
690 | { | ||
691 | int idx = xscale1pmu_get_event_idx(cpuc, event); | ||
692 | if (idx >= 0) | ||
693 | goto out; | ||
694 | |||
695 | if (!test_and_set_bit(XSCALE_COUNTER3, cpuc->used_mask)) | ||
696 | idx = XSCALE_COUNTER3; | ||
697 | else if (!test_and_set_bit(XSCALE_COUNTER2, cpuc->used_mask)) | ||
698 | idx = XSCALE_COUNTER2; | ||
699 | out: | ||
700 | return idx; | ||
701 | } | ||
702 | |||
703 | static void | ||
704 | xscale2pmu_start(void) | ||
705 | { | ||
706 | unsigned long flags, val; | ||
707 | |||
708 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
709 | val = xscale2pmu_read_pmnc() & ~XSCALE_PMU_CNT64; | ||
710 | val |= XSCALE_PMU_ENABLE; | ||
711 | xscale2pmu_write_pmnc(val); | ||
712 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
713 | } | ||
714 | |||
715 | static void | ||
716 | xscale2pmu_stop(void) | ||
717 | { | ||
718 | unsigned long flags, val; | ||
719 | |||
720 | raw_spin_lock_irqsave(&pmu_lock, flags); | ||
721 | val = xscale2pmu_read_pmnc(); | ||
722 | val &= ~XSCALE_PMU_ENABLE; | ||
723 | xscale2pmu_write_pmnc(val); | ||
724 | raw_spin_unlock_irqrestore(&pmu_lock, flags); | ||
725 | } | ||
726 | |||
727 | static inline u32 | ||
728 | xscale2pmu_read_counter(int counter) | ||
729 | { | ||
730 | u32 val = 0; | ||
731 | |||
732 | switch (counter) { | ||
733 | case XSCALE_CYCLE_COUNTER: | ||
734 | asm volatile("mrc p14, 0, %0, c1, c1, 0" : "=r" (val)); | ||
735 | break; | ||
736 | case XSCALE_COUNTER0: | ||
737 | asm volatile("mrc p14, 0, %0, c0, c2, 0" : "=r" (val)); | ||
738 | break; | ||
739 | case XSCALE_COUNTER1: | ||
740 | asm volatile("mrc p14, 0, %0, c1, c2, 0" : "=r" (val)); | ||
741 | break; | ||
742 | case XSCALE_COUNTER2: | ||
743 | asm volatile("mrc p14, 0, %0, c2, c2, 0" : "=r" (val)); | ||
744 | break; | ||
745 | case XSCALE_COUNTER3: | ||
746 | asm volatile("mrc p14, 0, %0, c3, c2, 0" : "=r" (val)); | ||
747 | break; | ||
748 | } | ||
749 | |||
750 | return val; | ||
751 | } | ||
752 | |||
753 | static inline void | ||
754 | xscale2pmu_write_counter(int counter, u32 val) | ||
755 | { | ||
756 | switch (counter) { | ||
757 | case XSCALE_CYCLE_COUNTER: | ||
758 | asm volatile("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); | ||
759 | break; | ||
760 | case XSCALE_COUNTER0: | ||
761 | asm volatile("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); | ||
762 | break; | ||
763 | case XSCALE_COUNTER1: | ||
764 | asm volatile("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); | ||
765 | break; | ||
766 | case XSCALE_COUNTER2: | ||
767 | asm volatile("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); | ||
768 | break; | ||
769 | case XSCALE_COUNTER3: | ||
770 | asm volatile("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); | ||
771 | break; | ||
772 | } | ||
773 | } | ||
774 | |||
775 | static const struct arm_pmu xscale2pmu = { | ||
776 | .id = ARM_PERF_PMU_ID_XSCALE2, | ||
777 | .name = "xscale2", | ||
778 | .handle_irq = xscale2pmu_handle_irq, | ||
779 | .enable = xscale2pmu_enable_event, | ||
780 | .disable = xscale2pmu_disable_event, | ||
781 | .read_counter = xscale2pmu_read_counter, | ||
782 | .write_counter = xscale2pmu_write_counter, | ||
783 | .get_event_idx = xscale2pmu_get_event_idx, | ||
784 | .start = xscale2pmu_start, | ||
785 | .stop = xscale2pmu_stop, | ||
786 | .cache_map = &xscale_perf_cache_map, | ||
787 | .event_map = &xscale_perf_map, | ||
788 | .raw_event_mask = 0xFF, | ||
789 | .num_events = 5, | ||
790 | .max_period = (1LLU << 32) - 1, | ||
791 | }; | ||
792 | |||
793 | static const struct arm_pmu *__init xscale2pmu_init(void) | ||
794 | { | ||
795 | return &xscale2pmu; | ||
796 | } | ||
797 | #else | ||
798 | static const struct arm_pmu *__init xscale1pmu_init(void) | ||
799 | { | ||
800 | return NULL; | ||
801 | } | ||
802 | |||
803 | static const struct arm_pmu *__init xscale2pmu_init(void) | ||
804 | { | ||
805 | return NULL; | ||
806 | } | ||
807 | #endif /* CONFIG_CPU_XSCALE */ | ||
diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c new file mode 100644 index 000000000000..a4b1b0748fd3 --- /dev/null +++ b/arch/arm/kernel/pj4-cp0.c | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/pj4-cp0.c | ||
3 | * | ||
4 | * PJ4 iWMMXt coprocessor context switching and handling | ||
5 | * | ||
6 | * Copyright (c) 2010 Marvell International Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/module.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/signal.h> | ||
17 | #include <linux/sched.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <asm/thread_notify.h> | ||
21 | |||
22 | static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t) | ||
23 | { | ||
24 | struct thread_info *thread = t; | ||
25 | |||
26 | switch (cmd) { | ||
27 | case THREAD_NOTIFY_FLUSH: | ||
28 | /* | ||
29 | * flush_thread() zeroes thread->fpstate, so no need | ||
30 | * to do anything here. | ||
31 | * | ||
32 | * FALLTHROUGH: Ensure we don't try to overwrite our newly | ||
33 | * initialised state information on the first fault. | ||
34 | */ | ||
35 | |||
36 | case THREAD_NOTIFY_EXIT: | ||
37 | iwmmxt_task_release(thread); | ||
38 | break; | ||
39 | |||
40 | case THREAD_NOTIFY_SWITCH: | ||
41 | iwmmxt_task_switch(thread); | ||
42 | break; | ||
43 | } | ||
44 | |||
45 | return NOTIFY_DONE; | ||
46 | } | ||
47 | |||
48 | static struct notifier_block iwmmxt_notifier_block = { | ||
49 | .notifier_call = iwmmxt_do, | ||
50 | }; | ||
51 | |||
52 | |||
53 | static u32 __init pj4_cp_access_read(void) | ||
54 | { | ||
55 | u32 value; | ||
56 | |||
57 | __asm__ __volatile__ ( | ||
58 | "mrc p15, 0, %0, c1, c0, 2\n\t" | ||
59 | : "=r" (value)); | ||
60 | return value; | ||
61 | } | ||
62 | |||
63 | static void __init pj4_cp_access_write(u32 value) | ||
64 | { | ||
65 | u32 temp; | ||
66 | |||
67 | __asm__ __volatile__ ( | ||
68 | "mcr p15, 0, %1, c1, c0, 2\n\t" | ||
69 | "mrc p15, 0, %0, c1, c0, 2\n\t" | ||
70 | "mov %0, %0\n\t" | ||
71 | "sub pc, pc, #4\n\t" | ||
72 | : "=r" (temp) : "r" (value)); | ||
73 | } | ||
74 | |||
75 | |||
76 | /* | ||
77 | * Disable CP0/CP1 on boot, and let call_fpe() and the iWMMXt lazy | ||
78 | * switch code handle iWMMXt context switching. | ||
79 | */ | ||
80 | static int __init pj4_cp0_init(void) | ||
81 | { | ||
82 | u32 cp_access; | ||
83 | |||
84 | cp_access = pj4_cp_access_read() & ~0xf; | ||
85 | pj4_cp_access_write(cp_access); | ||
86 | |||
87 | printk(KERN_INFO "PJ4 iWMMXt coprocessor enabled.\n"); | ||
88 | elf_hwcap |= HWCAP_IWMMXT; | ||
89 | thread_register_notifier(&iwmmxt_notifier_block); | ||
90 | |||
91 | return 0; | ||
92 | } | ||
93 | |||
94 | late_initcall(pj4_cp0_init); | ||
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 3e97483abcf0..19c6816db61e 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -1060,8 +1060,8 @@ static int ptrace_sethbpregs(struct task_struct *tsk, long num, | |||
1060 | goto out; | 1060 | goto out; |
1061 | 1061 | ||
1062 | if ((gen_type & implied_type) != gen_type) { | 1062 | if ((gen_type & implied_type) != gen_type) { |
1063 | ret = -EINVAL; | 1063 | ret = -EINVAL; |
1064 | goto out; | 1064 | goto out; |
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | attr.bp_len = gen_len; | 1067 | attr.bp_len = gen_len; |
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c new file mode 100644 index 000000000000..2cdcc9287c74 --- /dev/null +++ b/arch/arm/kernel/sched_clock.c | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * sched_clock.c: support for extending counters to full 64-bit ns counter | ||
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 | #include <linux/clocksource.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/jiffies.h> | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/sched.h> | ||
13 | #include <linux/timer.h> | ||
14 | |||
15 | #include <asm/sched_clock.h> | ||
16 | |||
17 | static void sched_clock_poll(unsigned long wrap_ticks); | ||
18 | static DEFINE_TIMER(sched_clock_timer, sched_clock_poll, 0, 0); | ||
19 | static void (*sched_clock_update_fn)(void); | ||
20 | |||
21 | static void sched_clock_poll(unsigned long wrap_ticks) | ||
22 | { | ||
23 | mod_timer(&sched_clock_timer, round_jiffies(jiffies + wrap_ticks)); | ||
24 | sched_clock_update_fn(); | ||
25 | } | ||
26 | |||
27 | void __init init_sched_clock(struct clock_data *cd, void (*update)(void), | ||
28 | unsigned int clock_bits, unsigned long rate) | ||
29 | { | ||
30 | unsigned long r, w; | ||
31 | u64 res, wrap; | ||
32 | char r_unit; | ||
33 | |||
34 | sched_clock_update_fn = update; | ||
35 | |||
36 | /* calculate the mult/shift to convert counter ticks to ns. */ | ||
37 | clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 60); | ||
38 | |||
39 | r = rate; | ||
40 | if (r >= 4000000) { | ||
41 | r /= 1000000; | ||
42 | r_unit = 'M'; | ||
43 | } else { | ||
44 | r /= 1000; | ||
45 | r_unit = 'k'; | ||
46 | } | ||
47 | |||
48 | /* calculate how many ns until we wrap */ | ||
49 | wrap = cyc_to_ns((1ULL << clock_bits) - 1, cd->mult, cd->shift); | ||
50 | do_div(wrap, NSEC_PER_MSEC); | ||
51 | w = wrap; | ||
52 | |||
53 | /* calculate the ns resolution of this counter */ | ||
54 | res = cyc_to_ns(1ULL, cd->mult, cd->shift); | ||
55 | pr_info("sched_clock: %u bits at %lu%cHz, resolution %lluns, wraps every %lums\n", | ||
56 | clock_bits, r, r_unit, res, w); | ||
57 | |||
58 | /* | ||
59 | * Start the timer to keep sched_clock() properly updated and | ||
60 | * sets the initial epoch. | ||
61 | */ | ||
62 | sched_clock_timer.data = msecs_to_jiffies(w - (w / 10)); | ||
63 | sched_clock_poll(sched_clock_timer.data); | ||
64 | |||
65 | /* | ||
66 | * Ensure that sched_clock() starts off at 0ns | ||
67 | */ | ||
68 | cd->epoch_ns = 0; | ||
69 | } | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 336f14e0e5c2..3455ad33de4c 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -75,9 +75,9 @@ extern void reboot_setup(char *str); | |||
75 | 75 | ||
76 | unsigned int processor_id; | 76 | unsigned int processor_id; |
77 | EXPORT_SYMBOL(processor_id); | 77 | EXPORT_SYMBOL(processor_id); |
78 | unsigned int __machine_arch_type; | 78 | unsigned int __machine_arch_type __read_mostly; |
79 | EXPORT_SYMBOL(__machine_arch_type); | 79 | EXPORT_SYMBOL(__machine_arch_type); |
80 | unsigned int cacheid; | 80 | unsigned int cacheid __read_mostly; |
81 | EXPORT_SYMBOL(cacheid); | 81 | EXPORT_SYMBOL(cacheid); |
82 | 82 | ||
83 | unsigned int __atags_pointer __initdata; | 83 | unsigned int __atags_pointer __initdata; |
@@ -91,24 +91,24 @@ EXPORT_SYMBOL(system_serial_low); | |||
91 | unsigned int system_serial_high; | 91 | unsigned int system_serial_high; |
92 | EXPORT_SYMBOL(system_serial_high); | 92 | EXPORT_SYMBOL(system_serial_high); |
93 | 93 | ||
94 | unsigned int elf_hwcap; | 94 | unsigned int elf_hwcap __read_mostly; |
95 | EXPORT_SYMBOL(elf_hwcap); | 95 | EXPORT_SYMBOL(elf_hwcap); |
96 | 96 | ||
97 | 97 | ||
98 | #ifdef MULTI_CPU | 98 | #ifdef MULTI_CPU |
99 | struct processor processor; | 99 | struct processor processor __read_mostly; |
100 | #endif | 100 | #endif |
101 | #ifdef MULTI_TLB | 101 | #ifdef MULTI_TLB |
102 | struct cpu_tlb_fns cpu_tlb; | 102 | struct cpu_tlb_fns cpu_tlb __read_mostly; |
103 | #endif | 103 | #endif |
104 | #ifdef MULTI_USER | 104 | #ifdef MULTI_USER |
105 | struct cpu_user_fns cpu_user; | 105 | struct cpu_user_fns cpu_user __read_mostly; |
106 | #endif | 106 | #endif |
107 | #ifdef MULTI_CACHE | 107 | #ifdef MULTI_CACHE |
108 | struct cpu_cache_fns cpu_cache; | 108 | struct cpu_cache_fns cpu_cache __read_mostly; |
109 | #endif | 109 | #endif |
110 | #ifdef CONFIG_OUTER_CACHE | 110 | #ifdef CONFIG_OUTER_CACHE |
111 | struct outer_cache_fns outer_cache; | 111 | struct outer_cache_fns outer_cache __read_mostly; |
112 | EXPORT_SYMBOL(outer_cache); | 112 | EXPORT_SYMBOL(outer_cache); |
113 | #endif | 113 | #endif |
114 | 114 | ||
@@ -126,6 +126,7 @@ EXPORT_SYMBOL(elf_platform); | |||
126 | static const char *cpu_name; | 126 | static const char *cpu_name; |
127 | static const char *machine_name; | 127 | static const char *machine_name; |
128 | static char __initdata cmd_line[COMMAND_LINE_SIZE]; | 128 | static char __initdata cmd_line[COMMAND_LINE_SIZE]; |
129 | struct machine_desc *machine_desc __initdata; | ||
129 | 130 | ||
130 | static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; | 131 | static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; |
131 | static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; | 132 | static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; |
@@ -708,13 +709,11 @@ static struct init_tags { | |||
708 | { 0, ATAG_NONE } | 709 | { 0, ATAG_NONE } |
709 | }; | 710 | }; |
710 | 711 | ||
711 | static void (*init_machine)(void) __initdata; | ||
712 | |||
713 | static int __init customize_machine(void) | 712 | static int __init customize_machine(void) |
714 | { | 713 | { |
715 | /* customizes platform devices, or adds new ones */ | 714 | /* customizes platform devices, or adds new ones */ |
716 | if (init_machine) | 715 | if (machine_desc->init_machine) |
717 | init_machine(); | 716 | machine_desc->init_machine(); |
718 | return 0; | 717 | return 0; |
719 | } | 718 | } |
720 | arch_initcall(customize_machine); | 719 | arch_initcall(customize_machine); |
@@ -809,6 +808,7 @@ void __init setup_arch(char **cmdline_p) | |||
809 | 808 | ||
810 | setup_processor(); | 809 | setup_processor(); |
811 | mdesc = setup_machine(machine_arch_type); | 810 | mdesc = setup_machine(machine_arch_type); |
811 | machine_desc = mdesc; | ||
812 | machine_name = mdesc->name; | 812 | machine_name = mdesc->name; |
813 | 813 | ||
814 | if (mdesc->soft_reboot) | 814 | if (mdesc->soft_reboot) |
@@ -868,13 +868,9 @@ void __init setup_arch(char **cmdline_p) | |||
868 | cpu_init(); | 868 | cpu_init(); |
869 | tcm_init(); | 869 | tcm_init(); |
870 | 870 | ||
871 | /* | 871 | #ifdef CONFIG_MULTI_IRQ_HANDLER |
872 | * Set up various architecture-specific pointers | 872 | handle_arch_irq = mdesc->handle_irq; |
873 | */ | 873 | #endif |
874 | arch_nr_irqs = mdesc->nr_irqs; | ||
875 | init_arch_irq = mdesc->init_irq; | ||
876 | system_timer = mdesc->timer; | ||
877 | init_machine = mdesc->init_machine; | ||
878 | 874 | ||
879 | #ifdef CONFIG_VT | 875 | #ifdef CONFIG_VT |
880 | #if defined(CONFIG_VGA_CONSOLE) | 876 | #if defined(CONFIG_VGA_CONSOLE) |
@@ -884,6 +880,9 @@ void __init setup_arch(char **cmdline_p) | |||
884 | #endif | 880 | #endif |
885 | #endif | 881 | #endif |
886 | early_trap_init(); | 882 | early_trap_init(); |
883 | |||
884 | if (mdesc->init_early) | ||
885 | mdesc->init_early(); | ||
887 | } | 886 | } |
888 | 887 | ||
889 | 888 | ||
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 9066473c0ebc..4539ebcb089f 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/cache.h> | 16 | #include <linux/cache.h> |
17 | #include <linux/profile.h> | 17 | #include <linux/profile.h> |
18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
19 | #include <linux/ftrace.h> | ||
19 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
20 | #include <linux/err.h> | 21 | #include <linux/err.h> |
21 | #include <linux/cpu.h> | 22 | #include <linux/cpu.h> |
@@ -24,6 +25,7 @@ | |||
24 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
25 | #include <linux/percpu.h> | 26 | #include <linux/percpu.h> |
26 | #include <linux/clockchips.h> | 27 | #include <linux/clockchips.h> |
28 | #include <linux/completion.h> | ||
27 | 29 | ||
28 | #include <asm/atomic.h> | 30 | #include <asm/atomic.h> |
29 | #include <asm/cacheflush.h> | 31 | #include <asm/cacheflush.h> |
@@ -37,7 +39,6 @@ | |||
37 | #include <asm/tlbflush.h> | 39 | #include <asm/tlbflush.h> |
38 | #include <asm/ptrace.h> | 40 | #include <asm/ptrace.h> |
39 | #include <asm/localtimer.h> | 41 | #include <asm/localtimer.h> |
40 | #include <asm/smp_plat.h> | ||
41 | 42 | ||
42 | /* | 43 | /* |
43 | * as from 2.5, kernels no longer have an init_tasks structure | 44 | * as from 2.5, kernels no longer have an init_tasks structure |
@@ -46,64 +47,14 @@ | |||
46 | */ | 47 | */ |
47 | struct secondary_data secondary_data; | 48 | struct secondary_data secondary_data; |
48 | 49 | ||
49 | /* | ||
50 | * structures for inter-processor calls | ||
51 | * - A collection of single bit ipi messages. | ||
52 | */ | ||
53 | struct ipi_data { | ||
54 | spinlock_t lock; | ||
55 | unsigned long ipi_count; | ||
56 | unsigned long bits; | ||
57 | }; | ||
58 | |||
59 | static DEFINE_PER_CPU(struct ipi_data, ipi_data) = { | ||
60 | .lock = SPIN_LOCK_UNLOCKED, | ||
61 | }; | ||
62 | |||
63 | enum ipi_msg_type { | 50 | enum ipi_msg_type { |
64 | IPI_TIMER, | 51 | IPI_TIMER = 2, |
65 | IPI_RESCHEDULE, | 52 | IPI_RESCHEDULE, |
66 | IPI_CALL_FUNC, | 53 | IPI_CALL_FUNC, |
67 | IPI_CALL_FUNC_SINGLE, | 54 | IPI_CALL_FUNC_SINGLE, |
68 | IPI_CPU_STOP, | 55 | IPI_CPU_STOP, |
69 | }; | 56 | }; |
70 | 57 | ||
71 | static inline void identity_mapping_add(pgd_t *pgd, unsigned long start, | ||
72 | unsigned long end) | ||
73 | { | ||
74 | unsigned long addr, prot; | ||
75 | pmd_t *pmd; | ||
76 | |||
77 | prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE; | ||
78 | if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) | ||
79 | prot |= PMD_BIT4; | ||
80 | |||
81 | for (addr = start & PGDIR_MASK; addr < end;) { | ||
82 | pmd = pmd_offset(pgd + pgd_index(addr), addr); | ||
83 | pmd[0] = __pmd(addr | prot); | ||
84 | addr += SECTION_SIZE; | ||
85 | pmd[1] = __pmd(addr | prot); | ||
86 | addr += SECTION_SIZE; | ||
87 | flush_pmd_entry(pmd); | ||
88 | outer_clean_range(__pa(pmd), __pa(pmd + 1)); | ||
89 | } | ||
90 | } | ||
91 | |||
92 | static inline void identity_mapping_del(pgd_t *pgd, unsigned long start, | ||
93 | unsigned long end) | ||
94 | { | ||
95 | unsigned long addr; | ||
96 | pmd_t *pmd; | ||
97 | |||
98 | for (addr = start & PGDIR_MASK; addr < end; addr += PGDIR_SIZE) { | ||
99 | pmd = pmd_offset(pgd + pgd_index(addr), addr); | ||
100 | pmd[0] = __pmd(0); | ||
101 | pmd[1] = __pmd(0); | ||
102 | clean_pmd_entry(pmd); | ||
103 | outer_clean_range(__pa(pmd), __pa(pmd + 1)); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | int __cpuinit __cpu_up(unsigned int cpu) | 58 | int __cpuinit __cpu_up(unsigned int cpu) |
108 | { | 59 | { |
109 | struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); | 60 | struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); |
@@ -177,8 +128,12 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
177 | barrier(); | 128 | barrier(); |
178 | } | 129 | } |
179 | 130 | ||
180 | if (!cpu_online(cpu)) | 131 | if (!cpu_online(cpu)) { |
132 | pr_crit("CPU%u: failed to come online\n", cpu); | ||
181 | ret = -EIO; | 133 | ret = -EIO; |
134 | } | ||
135 | } else { | ||
136 | pr_err("CPU%u: failed to boot: %d\n", cpu, ret); | ||
182 | } | 137 | } |
183 | 138 | ||
184 | secondary_data.stack = NULL; | 139 | secondary_data.stack = NULL; |
@@ -194,18 +149,12 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
194 | 149 | ||
195 | pgd_free(&init_mm, pgd); | 150 | pgd_free(&init_mm, pgd); |
196 | 151 | ||
197 | if (ret) { | ||
198 | printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu); | ||
199 | |||
200 | /* | ||
201 | * FIXME: We need to clean up the new idle thread. --rmk | ||
202 | */ | ||
203 | } | ||
204 | |||
205 | return ret; | 152 | return ret; |
206 | } | 153 | } |
207 | 154 | ||
208 | #ifdef CONFIG_HOTPLUG_CPU | 155 | #ifdef CONFIG_HOTPLUG_CPU |
156 | static void percpu_timer_stop(void); | ||
157 | |||
209 | /* | 158 | /* |
210 | * __cpu_disable runs on the processor to be shutdown. | 159 | * __cpu_disable runs on the processor to be shutdown. |
211 | */ | 160 | */ |
@@ -233,7 +182,7 @@ int __cpu_disable(void) | |||
233 | /* | 182 | /* |
234 | * Stop the local timer for this CPU. | 183 | * Stop the local timer for this CPU. |
235 | */ | 184 | */ |
236 | local_timer_stop(); | 185 | percpu_timer_stop(); |
237 | 186 | ||
238 | /* | 187 | /* |
239 | * Flush user cache and TLB mappings, and then remove this CPU | 188 | * Flush user cache and TLB mappings, and then remove this CPU |
@@ -252,12 +201,20 @@ int __cpu_disable(void) | |||
252 | return 0; | 201 | return 0; |
253 | } | 202 | } |
254 | 203 | ||
204 | static DECLARE_COMPLETION(cpu_died); | ||
205 | |||
255 | /* | 206 | /* |
256 | * called on the thread which is asking for a CPU to be shutdown - | 207 | * called on the thread which is asking for a CPU to be shutdown - |
257 | * waits until shutdown has completed, or it is timed out. | 208 | * waits until shutdown has completed, or it is timed out. |
258 | */ | 209 | */ |
259 | void __cpu_die(unsigned int cpu) | 210 | void __cpu_die(unsigned int cpu) |
260 | { | 211 | { |
212 | if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { | ||
213 | pr_err("CPU%u: cpu didn't die\n", cpu); | ||
214 | return; | ||
215 | } | ||
216 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
217 | |||
261 | if (!platform_cpu_kill(cpu)) | 218 | if (!platform_cpu_kill(cpu)) |
262 | printk("CPU%u: unable to kill\n", cpu); | 219 | printk("CPU%u: unable to kill\n", cpu); |
263 | } | 220 | } |
@@ -274,12 +231,17 @@ void __ref cpu_die(void) | |||
274 | { | 231 | { |
275 | unsigned int cpu = smp_processor_id(); | 232 | unsigned int cpu = smp_processor_id(); |
276 | 233 | ||
277 | local_irq_disable(); | ||
278 | idle_task_exit(); | 234 | idle_task_exit(); |
279 | 235 | ||
236 | local_irq_disable(); | ||
237 | mb(); | ||
238 | |||
239 | /* Tell __cpu_die() that this CPU is now safe to dispose of */ | ||
240 | complete(&cpu_died); | ||
241 | |||
280 | /* | 242 | /* |
281 | * actual CPU shutdown procedure is at least platform (if not | 243 | * actual CPU shutdown procedure is at least platform (if not |
282 | * CPU) specific | 244 | * CPU) specific. |
283 | */ | 245 | */ |
284 | platform_cpu_die(cpu); | 246 | platform_cpu_die(cpu); |
285 | 247 | ||
@@ -289,6 +251,7 @@ void __ref cpu_die(void) | |||
289 | * to be repeated to undo the effects of taking the CPU offline. | 251 | * to be repeated to undo the effects of taking the CPU offline. |
290 | */ | 252 | */ |
291 | __asm__("mov sp, %0\n" | 253 | __asm__("mov sp, %0\n" |
254 | " mov fp, #0\n" | ||
292 | " b secondary_start_kernel" | 255 | " b secondary_start_kernel" |
293 | : | 256 | : |
294 | : "r" (task_stack_page(current) + THREAD_SIZE - 8)); | 257 | : "r" (task_stack_page(current) + THREAD_SIZE - 8)); |
@@ -296,6 +259,17 @@ void __ref cpu_die(void) | |||
296 | #endif /* CONFIG_HOTPLUG_CPU */ | 259 | #endif /* CONFIG_HOTPLUG_CPU */ |
297 | 260 | ||
298 | /* | 261 | /* |
262 | * Called by both boot and secondaries to move global data into | ||
263 | * per-processor storage. | ||
264 | */ | ||
265 | static void __cpuinit smp_store_cpu_info(unsigned int cpuid) | ||
266 | { | ||
267 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); | ||
268 | |||
269 | cpu_info->loops_per_jiffy = loops_per_jiffy; | ||
270 | } | ||
271 | |||
272 | /* | ||
299 | * This is the secondary CPU boot entry. We're using this CPUs | 273 | * This is the secondary CPU boot entry. We're using this CPUs |
300 | * idle thread stack, but a set of temporary page tables. | 274 | * idle thread stack, but a set of temporary page tables. |
301 | */ | 275 | */ |
@@ -319,6 +293,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
319 | 293 | ||
320 | cpu_init(); | 294 | cpu_init(); |
321 | preempt_disable(); | 295 | preempt_disable(); |
296 | trace_hardirqs_off(); | ||
322 | 297 | ||
323 | /* | 298 | /* |
324 | * Give the platform a chance to do its own initialisation. | 299 | * Give the platform a chance to do its own initialisation. |
@@ -352,17 +327,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
352 | cpu_idle(); | 327 | cpu_idle(); |
353 | } | 328 | } |
354 | 329 | ||
355 | /* | ||
356 | * Called by both boot and secondaries to move global data into | ||
357 | * per-processor storage. | ||
358 | */ | ||
359 | void __cpuinit smp_store_cpu_info(unsigned int cpuid) | ||
360 | { | ||
361 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); | ||
362 | |||
363 | cpu_info->loops_per_jiffy = loops_per_jiffy; | ||
364 | } | ||
365 | |||
366 | void __init smp_cpus_done(unsigned int max_cpus) | 330 | void __init smp_cpus_done(unsigned int max_cpus) |
367 | { | 331 | { |
368 | int cpu; | 332 | int cpu; |
@@ -385,61 +349,80 @@ void __init smp_prepare_boot_cpu(void) | |||
385 | per_cpu(cpu_data, cpu).idle = current; | 349 | per_cpu(cpu_data, cpu).idle = current; |
386 | } | 350 | } |
387 | 351 | ||
388 | static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg) | 352 | void __init smp_prepare_cpus(unsigned int max_cpus) |
389 | { | 353 | { |
390 | unsigned long flags; | 354 | unsigned int ncores = num_possible_cpus(); |
391 | unsigned int cpu; | ||
392 | 355 | ||
393 | local_irq_save(flags); | 356 | smp_store_cpu_info(smp_processor_id()); |
394 | |||
395 | for_each_cpu(cpu, mask) { | ||
396 | struct ipi_data *ipi = &per_cpu(ipi_data, cpu); | ||
397 | |||
398 | spin_lock(&ipi->lock); | ||
399 | ipi->bits |= 1 << msg; | ||
400 | spin_unlock(&ipi->lock); | ||
401 | } | ||
402 | 357 | ||
403 | /* | 358 | /* |
404 | * Call the platform specific cross-CPU call function. | 359 | * are we trying to boot more cores than exist? |
405 | */ | 360 | */ |
406 | smp_cross_call(mask); | 361 | if (max_cpus > ncores) |
362 | max_cpus = ncores; | ||
363 | |||
364 | if (max_cpus > 1) { | ||
365 | /* | ||
366 | * Enable the local timer or broadcast device for the | ||
367 | * boot CPU, but only if we have more than one CPU. | ||
368 | */ | ||
369 | percpu_timer_setup(); | ||
407 | 370 | ||
408 | local_irq_restore(flags); | 371 | /* |
372 | * Initialise the SCU if there are more than one CPU | ||
373 | * and let them know where to start. | ||
374 | */ | ||
375 | platform_smp_prepare_cpus(max_cpus); | ||
376 | } | ||
409 | } | 377 | } |
410 | 378 | ||
411 | void arch_send_call_function_ipi_mask(const struct cpumask *mask) | 379 | void arch_send_call_function_ipi_mask(const struct cpumask *mask) |
412 | { | 380 | { |
413 | send_ipi_message(mask, IPI_CALL_FUNC); | 381 | smp_cross_call(mask, IPI_CALL_FUNC); |
414 | } | 382 | } |
415 | 383 | ||
416 | void arch_send_call_function_single_ipi(int cpu) | 384 | void arch_send_call_function_single_ipi(int cpu) |
417 | { | 385 | { |
418 | send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); | 386 | smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); |
419 | } | 387 | } |
420 | 388 | ||
421 | void show_ipi_list(struct seq_file *p) | 389 | static const char *ipi_types[NR_IPI] = { |
390 | #define S(x,s) [x - IPI_TIMER] = s | ||
391 | S(IPI_TIMER, "Timer broadcast interrupts"), | ||
392 | S(IPI_RESCHEDULE, "Rescheduling interrupts"), | ||
393 | S(IPI_CALL_FUNC, "Function call interrupts"), | ||
394 | S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"), | ||
395 | S(IPI_CPU_STOP, "CPU stop interrupts"), | ||
396 | }; | ||
397 | |||
398 | void show_ipi_list(struct seq_file *p, int prec) | ||
422 | { | 399 | { |
423 | unsigned int cpu; | 400 | unsigned int cpu, i; |
424 | 401 | ||
425 | seq_puts(p, "IPI:"); | 402 | for (i = 0; i < NR_IPI; i++) { |
403 | seq_printf(p, "%*s%u: ", prec - 1, "IPI", i); | ||
426 | 404 | ||
427 | for_each_present_cpu(cpu) | 405 | for_each_present_cpu(cpu) |
428 | seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count); | 406 | seq_printf(p, "%10u ", |
407 | __get_irq_stat(cpu, ipi_irqs[i])); | ||
429 | 408 | ||
430 | seq_putc(p, '\n'); | 409 | seq_printf(p, " %s\n", ipi_types[i]); |
410 | } | ||
431 | } | 411 | } |
432 | 412 | ||
433 | void show_local_irqs(struct seq_file *p) | 413 | u64 smp_irq_stat_cpu(unsigned int cpu) |
434 | { | 414 | { |
435 | unsigned int cpu; | 415 | u64 sum = 0; |
416 | int i; | ||
436 | 417 | ||
437 | seq_printf(p, "LOC: "); | 418 | for (i = 0; i < NR_IPI; i++) |
419 | sum += __get_irq_stat(cpu, ipi_irqs[i]); | ||
438 | 420 | ||
439 | for_each_present_cpu(cpu) | 421 | #ifdef CONFIG_LOCAL_TIMERS |
440 | seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs); | 422 | sum += __get_irq_stat(cpu, local_timer_irqs); |
423 | #endif | ||
441 | 424 | ||
442 | seq_putc(p, '\n'); | 425 | return sum; |
443 | } | 426 | } |
444 | 427 | ||
445 | /* | 428 | /* |
@@ -456,24 +439,36 @@ static void ipi_timer(void) | |||
456 | } | 439 | } |
457 | 440 | ||
458 | #ifdef CONFIG_LOCAL_TIMERS | 441 | #ifdef CONFIG_LOCAL_TIMERS |
459 | asmlinkage void __exception do_local_timer(struct pt_regs *regs) | 442 | asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs) |
460 | { | 443 | { |
461 | struct pt_regs *old_regs = set_irq_regs(regs); | 444 | struct pt_regs *old_regs = set_irq_regs(regs); |
462 | int cpu = smp_processor_id(); | 445 | int cpu = smp_processor_id(); |
463 | 446 | ||
464 | if (local_timer_ack()) { | 447 | if (local_timer_ack()) { |
465 | irq_stat[cpu].local_timer_irqs++; | 448 | __inc_irq_stat(cpu, local_timer_irqs); |
466 | ipi_timer(); | 449 | ipi_timer(); |
467 | } | 450 | } |
468 | 451 | ||
469 | set_irq_regs(old_regs); | 452 | set_irq_regs(old_regs); |
470 | } | 453 | } |
454 | |||
455 | void show_local_irqs(struct seq_file *p, int prec) | ||
456 | { | ||
457 | unsigned int cpu; | ||
458 | |||
459 | seq_printf(p, "%*s: ", prec, "LOC"); | ||
460 | |||
461 | for_each_present_cpu(cpu) | ||
462 | seq_printf(p, "%10u ", __get_irq_stat(cpu, local_timer_irqs)); | ||
463 | |||
464 | seq_printf(p, " Local timer interrupts\n"); | ||
465 | } | ||
471 | #endif | 466 | #endif |
472 | 467 | ||
473 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 468 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
474 | static void smp_timer_broadcast(const struct cpumask *mask) | 469 | static void smp_timer_broadcast(const struct cpumask *mask) |
475 | { | 470 | { |
476 | send_ipi_message(mask, IPI_TIMER); | 471 | smp_cross_call(mask, IPI_TIMER); |
477 | } | 472 | } |
478 | #else | 473 | #else |
479 | #define smp_timer_broadcast NULL | 474 | #define smp_timer_broadcast NULL |
@@ -510,6 +505,21 @@ void __cpuinit percpu_timer_setup(void) | |||
510 | local_timer_setup(evt); | 505 | local_timer_setup(evt); |
511 | } | 506 | } |
512 | 507 | ||
508 | #ifdef CONFIG_HOTPLUG_CPU | ||
509 | /* | ||
510 | * The generic clock events code purposely does not stop the local timer | ||
511 | * on CPU_DEAD/CPU_DEAD_FROZEN hotplug events, so we have to do it | ||
512 | * manually here. | ||
513 | */ | ||
514 | static void percpu_timer_stop(void) | ||
515 | { | ||
516 | unsigned int cpu = smp_processor_id(); | ||
517 | struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); | ||
518 | |||
519 | evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); | ||
520 | } | ||
521 | #endif | ||
522 | |||
513 | static DEFINE_SPINLOCK(stop_lock); | 523 | static DEFINE_SPINLOCK(stop_lock); |
514 | 524 | ||
515 | /* | 525 | /* |
@@ -536,216 +546,76 @@ static void ipi_cpu_stop(unsigned int cpu) | |||
536 | 546 | ||
537 | /* | 547 | /* |
538 | * Main handler for inter-processor interrupts | 548 | * Main handler for inter-processor interrupts |
539 | * | ||
540 | * For ARM, the ipimask now only identifies a single | ||
541 | * category of IPI (Bit 1 IPIs have been replaced by a | ||
542 | * different mechanism): | ||
543 | * | ||
544 | * Bit 0 - Inter-processor function call | ||
545 | */ | 549 | */ |
546 | asmlinkage void __exception do_IPI(struct pt_regs *regs) | 550 | asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs) |
547 | { | 551 | { |
548 | unsigned int cpu = smp_processor_id(); | 552 | unsigned int cpu = smp_processor_id(); |
549 | struct ipi_data *ipi = &per_cpu(ipi_data, cpu); | ||
550 | struct pt_regs *old_regs = set_irq_regs(regs); | 553 | struct pt_regs *old_regs = set_irq_regs(regs); |
551 | 554 | ||
552 | ipi->ipi_count++; | 555 | if (ipinr >= IPI_TIMER && ipinr < IPI_TIMER + NR_IPI) |
553 | 556 | __inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_TIMER]); | |
554 | for (;;) { | ||
555 | unsigned long msgs; | ||
556 | |||
557 | spin_lock(&ipi->lock); | ||
558 | msgs = ipi->bits; | ||
559 | ipi->bits = 0; | ||
560 | spin_unlock(&ipi->lock); | ||
561 | 557 | ||
562 | if (!msgs) | 558 | switch (ipinr) { |
563 | break; | 559 | case IPI_TIMER: |
564 | 560 | ipi_timer(); | |
565 | do { | 561 | break; |
566 | unsigned nextmsg; | ||
567 | |||
568 | nextmsg = msgs & -msgs; | ||
569 | msgs &= ~nextmsg; | ||
570 | nextmsg = ffz(~nextmsg); | ||
571 | |||
572 | switch (nextmsg) { | ||
573 | case IPI_TIMER: | ||
574 | ipi_timer(); | ||
575 | break; | ||
576 | 562 | ||
577 | case IPI_RESCHEDULE: | 563 | case IPI_RESCHEDULE: |
578 | /* | 564 | /* |
579 | * nothing more to do - eveything is | 565 | * nothing more to do - eveything is |
580 | * done on the interrupt return path | 566 | * done on the interrupt return path |
581 | */ | 567 | */ |
582 | break; | 568 | break; |
583 | 569 | ||
584 | case IPI_CALL_FUNC: | 570 | case IPI_CALL_FUNC: |
585 | generic_smp_call_function_interrupt(); | 571 | generic_smp_call_function_interrupt(); |
586 | break; | 572 | break; |
587 | 573 | ||
588 | case IPI_CALL_FUNC_SINGLE: | 574 | case IPI_CALL_FUNC_SINGLE: |
589 | generic_smp_call_function_single_interrupt(); | 575 | generic_smp_call_function_single_interrupt(); |
590 | break; | 576 | break; |
591 | 577 | ||
592 | case IPI_CPU_STOP: | 578 | case IPI_CPU_STOP: |
593 | ipi_cpu_stop(cpu); | 579 | ipi_cpu_stop(cpu); |
594 | break; | 580 | break; |
595 | 581 | ||
596 | default: | 582 | default: |
597 | printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n", | 583 | printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n", |
598 | cpu, nextmsg); | 584 | cpu, ipinr); |
599 | break; | 585 | break; |
600 | } | ||
601 | } while (msgs); | ||
602 | } | 586 | } |
603 | |||
604 | set_irq_regs(old_regs); | 587 | set_irq_regs(old_regs); |
605 | } | 588 | } |
606 | 589 | ||
607 | void smp_send_reschedule(int cpu) | 590 | void smp_send_reschedule(int cpu) |
608 | { | 591 | { |
609 | send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE); | 592 | smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE); |
610 | } | 593 | } |
611 | 594 | ||
612 | void smp_send_stop(void) | 595 | void smp_send_stop(void) |
613 | { | 596 | { |
614 | cpumask_t mask = cpu_online_map; | 597 | unsigned long timeout; |
615 | cpu_clear(smp_processor_id(), mask); | ||
616 | if (!cpus_empty(mask)) | ||
617 | send_ipi_message(&mask, IPI_CPU_STOP); | ||
618 | } | ||
619 | 598 | ||
620 | /* | 599 | if (num_online_cpus() > 1) { |
621 | * not supported here | 600 | cpumask_t mask = cpu_online_map; |
622 | */ | 601 | cpu_clear(smp_processor_id(), mask); |
623 | int setup_profiling_timer(unsigned int multiplier) | ||
624 | { | ||
625 | return -EINVAL; | ||
626 | } | ||
627 | 602 | ||
628 | static void | 603 | smp_cross_call(&mask, IPI_CPU_STOP); |
629 | on_each_cpu_mask(void (*func)(void *), void *info, int wait, | 604 | } |
630 | const struct cpumask *mask) | ||
631 | { | ||
632 | preempt_disable(); | ||
633 | 605 | ||
634 | smp_call_function_many(mask, func, info, wait); | 606 | /* Wait up to one second for other CPUs to stop */ |
635 | if (cpumask_test_cpu(smp_processor_id(), mask)) | 607 | timeout = USEC_PER_SEC; |
636 | func(info); | 608 | while (num_online_cpus() > 1 && timeout--) |
609 | udelay(1); | ||
637 | 610 | ||
638 | preempt_enable(); | 611 | if (num_online_cpus() > 1) |
612 | pr_warning("SMP: failed to stop secondary CPUs\n"); | ||
639 | } | 613 | } |
640 | 614 | ||
641 | /**********************************************************************/ | ||
642 | |||
643 | /* | 615 | /* |
644 | * TLB operations | 616 | * not supported here |
645 | */ | 617 | */ |
646 | struct tlb_args { | 618 | int setup_profiling_timer(unsigned int multiplier) |
647 | struct vm_area_struct *ta_vma; | ||
648 | unsigned long ta_start; | ||
649 | unsigned long ta_end; | ||
650 | }; | ||
651 | |||
652 | static inline void ipi_flush_tlb_all(void *ignored) | ||
653 | { | ||
654 | local_flush_tlb_all(); | ||
655 | } | ||
656 | |||
657 | static inline void ipi_flush_tlb_mm(void *arg) | ||
658 | { | ||
659 | struct mm_struct *mm = (struct mm_struct *)arg; | ||
660 | |||
661 | local_flush_tlb_mm(mm); | ||
662 | } | ||
663 | |||
664 | static inline void ipi_flush_tlb_page(void *arg) | ||
665 | { | ||
666 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
667 | |||
668 | local_flush_tlb_page(ta->ta_vma, ta->ta_start); | ||
669 | } | ||
670 | |||
671 | static inline void ipi_flush_tlb_kernel_page(void *arg) | ||
672 | { | ||
673 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
674 | |||
675 | local_flush_tlb_kernel_page(ta->ta_start); | ||
676 | } | ||
677 | |||
678 | static inline void ipi_flush_tlb_range(void *arg) | ||
679 | { | ||
680 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
681 | |||
682 | local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end); | ||
683 | } | ||
684 | |||
685 | static inline void ipi_flush_tlb_kernel_range(void *arg) | ||
686 | { | ||
687 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
688 | |||
689 | local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end); | ||
690 | } | ||
691 | |||
692 | void flush_tlb_all(void) | ||
693 | { | ||
694 | if (tlb_ops_need_broadcast()) | ||
695 | on_each_cpu(ipi_flush_tlb_all, NULL, 1); | ||
696 | else | ||
697 | local_flush_tlb_all(); | ||
698 | } | ||
699 | |||
700 | void flush_tlb_mm(struct mm_struct *mm) | ||
701 | { | ||
702 | if (tlb_ops_need_broadcast()) | ||
703 | on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm)); | ||
704 | else | ||
705 | local_flush_tlb_mm(mm); | ||
706 | } | ||
707 | |||
708 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | ||
709 | { | ||
710 | if (tlb_ops_need_broadcast()) { | ||
711 | struct tlb_args ta; | ||
712 | ta.ta_vma = vma; | ||
713 | ta.ta_start = uaddr; | ||
714 | on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
715 | } else | ||
716 | local_flush_tlb_page(vma, uaddr); | ||
717 | } | ||
718 | |||
719 | void flush_tlb_kernel_page(unsigned long kaddr) | ||
720 | { | ||
721 | if (tlb_ops_need_broadcast()) { | ||
722 | struct tlb_args ta; | ||
723 | ta.ta_start = kaddr; | ||
724 | on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); | ||
725 | } else | ||
726 | local_flush_tlb_kernel_page(kaddr); | ||
727 | } | ||
728 | |||
729 | void flush_tlb_range(struct vm_area_struct *vma, | ||
730 | unsigned long start, unsigned long end) | ||
731 | { | ||
732 | if (tlb_ops_need_broadcast()) { | ||
733 | struct tlb_args ta; | ||
734 | ta.ta_vma = vma; | ||
735 | ta.ta_start = start; | ||
736 | ta.ta_end = end; | ||
737 | on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
738 | } else | ||
739 | local_flush_tlb_range(vma, start, end); | ||
740 | } | ||
741 | |||
742 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
743 | { | 619 | { |
744 | if (tlb_ops_need_broadcast()) { | 620 | return -EINVAL; |
745 | struct tlb_args ta; | ||
746 | ta.ta_start = start; | ||
747 | ta.ta_end = end; | ||
748 | on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1); | ||
749 | } else | ||
750 | local_flush_tlb_kernel_range(start, end); | ||
751 | } | 621 | } |
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c new file mode 100644 index 000000000000..7dcb35285be7 --- /dev/null +++ b/arch/arm/kernel/smp_tlb.c | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/smp_tlb.c | ||
3 | * | ||
4 | * Copyright (C) 2002 ARM Limited, All Rights Reserved. | ||
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 | #include <linux/preempt.h> | ||
11 | #include <linux/smp.h> | ||
12 | |||
13 | #include <asm/smp_plat.h> | ||
14 | #include <asm/tlbflush.h> | ||
15 | |||
16 | static void on_each_cpu_mask(void (*func)(void *), void *info, int wait, | ||
17 | const struct cpumask *mask) | ||
18 | { | ||
19 | preempt_disable(); | ||
20 | |||
21 | smp_call_function_many(mask, func, info, wait); | ||
22 | if (cpumask_test_cpu(smp_processor_id(), mask)) | ||
23 | func(info); | ||
24 | |||
25 | preempt_enable(); | ||
26 | } | ||
27 | |||
28 | /**********************************************************************/ | ||
29 | |||
30 | /* | ||
31 | * TLB operations | ||
32 | */ | ||
33 | struct tlb_args { | ||
34 | struct vm_area_struct *ta_vma; | ||
35 | unsigned long ta_start; | ||
36 | unsigned long ta_end; | ||
37 | }; | ||
38 | |||
39 | static inline void ipi_flush_tlb_all(void *ignored) | ||
40 | { | ||
41 | local_flush_tlb_all(); | ||
42 | } | ||
43 | |||
44 | static inline void ipi_flush_tlb_mm(void *arg) | ||
45 | { | ||
46 | struct mm_struct *mm = (struct mm_struct *)arg; | ||
47 | |||
48 | local_flush_tlb_mm(mm); | ||
49 | } | ||
50 | |||
51 | static inline void ipi_flush_tlb_page(void *arg) | ||
52 | { | ||
53 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
54 | |||
55 | local_flush_tlb_page(ta->ta_vma, ta->ta_start); | ||
56 | } | ||
57 | |||
58 | static inline void ipi_flush_tlb_kernel_page(void *arg) | ||
59 | { | ||
60 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
61 | |||
62 | local_flush_tlb_kernel_page(ta->ta_start); | ||
63 | } | ||
64 | |||
65 | static inline void ipi_flush_tlb_range(void *arg) | ||
66 | { | ||
67 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
68 | |||
69 | local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end); | ||
70 | } | ||
71 | |||
72 | static inline void ipi_flush_tlb_kernel_range(void *arg) | ||
73 | { | ||
74 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
75 | |||
76 | local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end); | ||
77 | } | ||
78 | |||
79 | void flush_tlb_all(void) | ||
80 | { | ||
81 | if (tlb_ops_need_broadcast()) | ||
82 | on_each_cpu(ipi_flush_tlb_all, NULL, 1); | ||
83 | else | ||
84 | local_flush_tlb_all(); | ||
85 | } | ||
86 | |||
87 | void flush_tlb_mm(struct mm_struct *mm) | ||
88 | { | ||
89 | if (tlb_ops_need_broadcast()) | ||
90 | on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm)); | ||
91 | else | ||
92 | local_flush_tlb_mm(mm); | ||
93 | } | ||
94 | |||
95 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | ||
96 | { | ||
97 | if (tlb_ops_need_broadcast()) { | ||
98 | struct tlb_args ta; | ||
99 | ta.ta_vma = vma; | ||
100 | ta.ta_start = uaddr; | ||
101 | on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
102 | } else | ||
103 | local_flush_tlb_page(vma, uaddr); | ||
104 | } | ||
105 | |||
106 | void flush_tlb_kernel_page(unsigned long kaddr) | ||
107 | { | ||
108 | if (tlb_ops_need_broadcast()) { | ||
109 | struct tlb_args ta; | ||
110 | ta.ta_start = kaddr; | ||
111 | on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); | ||
112 | } else | ||
113 | local_flush_tlb_kernel_page(kaddr); | ||
114 | } | ||
115 | |||
116 | void flush_tlb_range(struct vm_area_struct *vma, | ||
117 | unsigned long start, unsigned long end) | ||
118 | { | ||
119 | if (tlb_ops_need_broadcast()) { | ||
120 | struct tlb_args ta; | ||
121 | ta.ta_vma = vma; | ||
122 | ta.ta_start = start; | ||
123 | ta.ta_end = end; | ||
124 | on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
125 | } else | ||
126 | local_flush_tlb_range(vma, start, end); | ||
127 | } | ||
128 | |||
129 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
130 | { | ||
131 | if (tlb_ops_need_broadcast()) { | ||
132 | struct tlb_args ta; | ||
133 | ta.ta_start = start; | ||
134 | ta.ta_end = end; | ||
135 | on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1); | ||
136 | } else | ||
137 | local_flush_tlb_kernel_range(start, end); | ||
138 | } | ||
139 | |||
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 35882fbf37f9..dd790745b3ef 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -127,8 +127,6 @@ static void __cpuinit twd_calibrate_rate(void) | |||
127 | */ | 127 | */ |
128 | void __cpuinit twd_timer_setup(struct clock_event_device *clk) | 128 | void __cpuinit twd_timer_setup(struct clock_event_device *clk) |
129 | { | 129 | { |
130 | unsigned long flags; | ||
131 | |||
132 | twd_calibrate_rate(); | 130 | twd_calibrate_rate(); |
133 | 131 | ||
134 | clk->name = "local_timer"; | 132 | clk->name = "local_timer"; |
@@ -143,20 +141,7 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk) | |||
143 | clk->min_delta_ns = clockevent_delta2ns(0xf, clk); | 141 | clk->min_delta_ns = clockevent_delta2ns(0xf, clk); |
144 | 142 | ||
145 | /* Make sure our local interrupt controller has this enabled */ | 143 | /* Make sure our local interrupt controller has this enabled */ |
146 | local_irq_save(flags); | 144 | gic_enable_ppi(clk->irq); |
147 | irq_to_desc(clk->irq)->status |= IRQ_NOPROBE; | ||
148 | get_irq_chip(clk->irq)->unmask(clk->irq); | ||
149 | local_irq_restore(flags); | ||
150 | 145 | ||
151 | clockevents_register_device(clk); | 146 | clockevents_register_device(clk); |
152 | } | 147 | } |
153 | |||
154 | #ifdef CONFIG_HOTPLUG_CPU | ||
155 | /* | ||
156 | * take a local timer down | ||
157 | */ | ||
158 | void twd_timer_stop(void) | ||
159 | { | ||
160 | __raw_writel(0, twd_base + TWD_TIMER_CONTROL); | ||
161 | } | ||
162 | #endif | ||
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c new file mode 100644 index 000000000000..7a5760922914 --- /dev/null +++ b/arch/arm/kernel/swp_emulate.c | |||
@@ -0,0 +1,267 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/swp_emulate.c | ||
3 | * | ||
4 | * Copyright (C) 2009 ARM Limited | ||
5 | * __user_* functions adapted from include/asm/uaccess.h | ||
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 | * Implements emulation of the SWP/SWPB instructions using load-exclusive and | ||
12 | * store-exclusive for processors that have them disabled (or future ones that | ||
13 | * might not implement them). | ||
14 | * | ||
15 | * Syntax of SWP{B} instruction: SWP{B}<c> <Rt>, <Rt2>, [<Rn>] | ||
16 | * Where: Rt = destination | ||
17 | * Rt2 = source | ||
18 | * Rn = address | ||
19 | */ | ||
20 | |||
21 | #include <linux/init.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/proc_fs.h> | ||
24 | #include <linux/sched.h> | ||
25 | #include <linux/syscalls.h> | ||
26 | #include <linux/perf_event.h> | ||
27 | |||
28 | #include <asm/traps.h> | ||
29 | #include <asm/uaccess.h> | ||
30 | |||
31 | /* | ||
32 | * Error-checking SWP macros implemented using ldrex{b}/strex{b} | ||
33 | */ | ||
34 | #define __user_swpX_asm(data, addr, res, temp, B) \ | ||
35 | __asm__ __volatile__( \ | ||
36 | " mov %2, %1\n" \ | ||
37 | "0: ldrex"B" %1, [%3]\n" \ | ||
38 | "1: strex"B" %0, %2, [%3]\n" \ | ||
39 | " cmp %0, #0\n" \ | ||
40 | " movne %0, %4\n" \ | ||
41 | "2:\n" \ | ||
42 | " .section .fixup,\"ax\"\n" \ | ||
43 | " .align 2\n" \ | ||
44 | "3: mov %0, %5\n" \ | ||
45 | " b 2b\n" \ | ||
46 | " .previous\n" \ | ||
47 | " .section __ex_table,\"a\"\n" \ | ||
48 | " .align 3\n" \ | ||
49 | " .long 0b, 3b\n" \ | ||
50 | " .long 1b, 3b\n" \ | ||
51 | " .previous" \ | ||
52 | : "=&r" (res), "+r" (data), "=&r" (temp) \ | ||
53 | : "r" (addr), "i" (-EAGAIN), "i" (-EFAULT) \ | ||
54 | : "cc", "memory") | ||
55 | |||
56 | #define __user_swp_asm(data, addr, res, temp) \ | ||
57 | __user_swpX_asm(data, addr, res, temp, "") | ||
58 | #define __user_swpb_asm(data, addr, res, temp) \ | ||
59 | __user_swpX_asm(data, addr, res, temp, "b") | ||
60 | |||
61 | /* | ||
62 | * Macros/defines for extracting register numbers from instruction. | ||
63 | */ | ||
64 | #define EXTRACT_REG_NUM(instruction, offset) \ | ||
65 | (((instruction) & (0xf << (offset))) >> (offset)) | ||
66 | #define RN_OFFSET 16 | ||
67 | #define RT_OFFSET 12 | ||
68 | #define RT2_OFFSET 0 | ||
69 | /* | ||
70 | * Bit 22 of the instruction encoding distinguishes between | ||
71 | * the SWP and SWPB variants (bit set means SWPB). | ||
72 | */ | ||
73 | #define TYPE_SWPB (1 << 22) | ||
74 | |||
75 | static unsigned long swpcounter; | ||
76 | static unsigned long swpbcounter; | ||
77 | static unsigned long abtcounter; | ||
78 | static pid_t previous_pid; | ||
79 | |||
80 | #ifdef CONFIG_PROC_FS | ||
81 | static int proc_read_status(char *page, char **start, off_t off, int count, | ||
82 | int *eof, void *data) | ||
83 | { | ||
84 | char *p = page; | ||
85 | int len; | ||
86 | |||
87 | p += sprintf(p, "Emulated SWP:\t\t%lu\n", swpcounter); | ||
88 | p += sprintf(p, "Emulated SWPB:\t\t%lu\n", swpbcounter); | ||
89 | p += sprintf(p, "Aborted SWP{B}:\t\t%lu\n", abtcounter); | ||
90 | if (previous_pid != 0) | ||
91 | p += sprintf(p, "Last process:\t\t%d\n", previous_pid); | ||
92 | |||
93 | len = (p - page) - off; | ||
94 | if (len < 0) | ||
95 | len = 0; | ||
96 | |||
97 | *eof = (len <= count) ? 1 : 0; | ||
98 | *start = page + off; | ||
99 | |||
100 | return len; | ||
101 | } | ||
102 | #endif | ||
103 | |||
104 | /* | ||
105 | * Set up process info to signal segmentation fault - called on access error. | ||
106 | */ | ||
107 | static void set_segfault(struct pt_regs *regs, unsigned long addr) | ||
108 | { | ||
109 | siginfo_t info; | ||
110 | |||
111 | if (find_vma(current->mm, addr) == NULL) | ||
112 | info.si_code = SEGV_MAPERR; | ||
113 | else | ||
114 | info.si_code = SEGV_ACCERR; | ||
115 | |||
116 | info.si_signo = SIGSEGV; | ||
117 | info.si_errno = 0; | ||
118 | info.si_addr = (void *) instruction_pointer(regs); | ||
119 | |||
120 | pr_debug("SWP{B} emulation: access caused memory abort!\n"); | ||
121 | arm_notify_die("Illegal memory access", regs, &info, 0, 0); | ||
122 | |||
123 | abtcounter++; | ||
124 | } | ||
125 | |||
126 | static int emulate_swpX(unsigned int address, unsigned int *data, | ||
127 | unsigned int type) | ||
128 | { | ||
129 | unsigned int res = 0; | ||
130 | |||
131 | if ((type != TYPE_SWPB) && (address & 0x3)) { | ||
132 | /* SWP to unaligned address not permitted */ | ||
133 | pr_debug("SWP instruction on unaligned pointer!\n"); | ||
134 | return -EFAULT; | ||
135 | } | ||
136 | |||
137 | while (1) { | ||
138 | unsigned long temp; | ||
139 | |||
140 | /* | ||
141 | * Barrier required between accessing protected resource and | ||
142 | * releasing a lock for it. Legacy code might not have done | ||
143 | * this, and we cannot determine that this is not the case | ||
144 | * being emulated, so insert always. | ||
145 | */ | ||
146 | smp_mb(); | ||
147 | |||
148 | if (type == TYPE_SWPB) | ||
149 | __user_swpb_asm(*data, address, res, temp); | ||
150 | else | ||
151 | __user_swp_asm(*data, address, res, temp); | ||
152 | |||
153 | if (likely(res != -EAGAIN) || signal_pending(current)) | ||
154 | break; | ||
155 | |||
156 | cond_resched(); | ||
157 | } | ||
158 | |||
159 | if (res == 0) { | ||
160 | /* | ||
161 | * Barrier also required between aquiring a lock for a | ||
162 | * protected resource and accessing the resource. Inserted for | ||
163 | * same reason as above. | ||
164 | */ | ||
165 | smp_mb(); | ||
166 | |||
167 | if (type == TYPE_SWPB) | ||
168 | swpbcounter++; | ||
169 | else | ||
170 | swpcounter++; | ||
171 | } | ||
172 | |||
173 | return res; | ||
174 | } | ||
175 | |||
176 | /* | ||
177 | * swp_handler logs the id of calling process, dissects the instruction, sanity | ||
178 | * checks the memory location, calls emulate_swpX for the actual operation and | ||
179 | * deals with fixup/error handling before returning | ||
180 | */ | ||
181 | static int swp_handler(struct pt_regs *regs, unsigned int instr) | ||
182 | { | ||
183 | unsigned int address, destreg, data, type; | ||
184 | unsigned int res = 0; | ||
185 | |||
186 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, regs->ARM_pc); | ||
187 | |||
188 | if (current->pid != previous_pid) { | ||
189 | pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n", | ||
190 | current->comm, (unsigned long)current->pid); | ||
191 | previous_pid = current->pid; | ||
192 | } | ||
193 | |||
194 | address = regs->uregs[EXTRACT_REG_NUM(instr, RN_OFFSET)]; | ||
195 | data = regs->uregs[EXTRACT_REG_NUM(instr, RT2_OFFSET)]; | ||
196 | destreg = EXTRACT_REG_NUM(instr, RT_OFFSET); | ||
197 | |||
198 | type = instr & TYPE_SWPB; | ||
199 | |||
200 | pr_debug("addr in r%d->0x%08x, dest is r%d, source in r%d->0x%08x)\n", | ||
201 | EXTRACT_REG_NUM(instr, RN_OFFSET), address, | ||
202 | destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data); | ||
203 | |||
204 | /* Check access in reasonable access range for both SWP and SWPB */ | ||
205 | if (!access_ok(VERIFY_WRITE, (address & ~3), 4)) { | ||
206 | pr_debug("SWP{B} emulation: access to %p not allowed!\n", | ||
207 | (void *)address); | ||
208 | res = -EFAULT; | ||
209 | } else { | ||
210 | res = emulate_swpX(address, &data, type); | ||
211 | } | ||
212 | |||
213 | if (res == 0) { | ||
214 | /* | ||
215 | * On successful emulation, revert the adjustment to the PC | ||
216 | * made in kernel/traps.c in order to resume execution at the | ||
217 | * instruction following the SWP{B}. | ||
218 | */ | ||
219 | regs->ARM_pc += 4; | ||
220 | regs->uregs[destreg] = data; | ||
221 | } else if (res == -EFAULT) { | ||
222 | /* | ||
223 | * Memory errors do not mean emulation failed. | ||
224 | * Set up signal info to return SEGV, then return OK | ||
225 | */ | ||
226 | set_segfault(regs, address); | ||
227 | } | ||
228 | |||
229 | return 0; | ||
230 | } | ||
231 | |||
232 | /* | ||
233 | * Only emulate SWP/SWPB executed in ARM state/User mode. | ||
234 | * The kernel must be SWP free and SWP{B} does not exist in Thumb/ThumbEE. | ||
235 | */ | ||
236 | static struct undef_hook swp_hook = { | ||
237 | .instr_mask = 0x0fb00ff0, | ||
238 | .instr_val = 0x01000090, | ||
239 | .cpsr_mask = MODE_MASK | PSR_T_BIT | PSR_J_BIT, | ||
240 | .cpsr_val = USR_MODE, | ||
241 | .fn = swp_handler | ||
242 | }; | ||
243 | |||
244 | /* | ||
245 | * Register handler and create status file in /proc/cpu | ||
246 | * Invoked as late_initcall, since not needed before init spawned. | ||
247 | */ | ||
248 | static int __init swp_emulation_init(void) | ||
249 | { | ||
250 | #ifdef CONFIG_PROC_FS | ||
251 | struct proc_dir_entry *res; | ||
252 | |||
253 | res = create_proc_entry("cpu/swp_emulation", S_IRUGO, NULL); | ||
254 | |||
255 | if (!res) | ||
256 | return -ENOMEM; | ||
257 | |||
258 | res->read_proc = proc_read_status; | ||
259 | #endif /* CONFIG_PROC_FS */ | ||
260 | |||
261 | printk(KERN_NOTICE "Registering SWP/SWPB emulation handler\n"); | ||
262 | register_undef_hook(&swp_hook); | ||
263 | |||
264 | return 0; | ||
265 | } | ||
266 | |||
267 | late_initcall(swp_emulation_init); | ||
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 38c261f9951c..f1e2eb19a67d 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -30,12 +30,13 @@ | |||
30 | #include <asm/leds.h> | 30 | #include <asm/leds.h> |
31 | #include <asm/thread_info.h> | 31 | #include <asm/thread_info.h> |
32 | #include <asm/stacktrace.h> | 32 | #include <asm/stacktrace.h> |
33 | #include <asm/mach/arch.h> | ||
33 | #include <asm/mach/time.h> | 34 | #include <asm/mach/time.h> |
34 | 35 | ||
35 | /* | 36 | /* |
36 | * Our system timer. | 37 | * Our system timer. |
37 | */ | 38 | */ |
38 | struct sys_timer *system_timer; | 39 | static struct sys_timer *system_timer; |
39 | 40 | ||
40 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) | 41 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) |
41 | /* this needs a better home */ | 42 | /* this needs a better home */ |
@@ -160,6 +161,7 @@ device_initcall(timer_init_sysfs); | |||
160 | 161 | ||
161 | void __init time_init(void) | 162 | void __init time_init(void) |
162 | { | 163 | { |
164 | system_timer = machine_desc->timer; | ||
163 | system_timer->init(); | 165 | system_timer->init(); |
164 | } | 166 | } |
165 | 167 | ||
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 446aee97436f..ee57640ba2bb 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -37,6 +37,8 @@ | |||
37 | 37 | ||
38 | static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; | 38 | static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; |
39 | 39 | ||
40 | void *vectors_page; | ||
41 | |||
40 | #ifdef CONFIG_DEBUG_USER | 42 | #ifdef CONFIG_DEBUG_USER |
41 | unsigned int user_debug; | 43 | unsigned int user_debug; |
42 | 44 | ||
@@ -708,19 +710,19 @@ void __readwrite_bug(const char *fn) | |||
708 | } | 710 | } |
709 | EXPORT_SYMBOL(__readwrite_bug); | 711 | EXPORT_SYMBOL(__readwrite_bug); |
710 | 712 | ||
711 | void __pte_error(const char *file, int line, unsigned long val) | 713 | void __pte_error(const char *file, int line, pte_t pte) |
712 | { | 714 | { |
713 | printk("%s:%d: bad pte %08lx.\n", file, line, val); | 715 | printk("%s:%d: bad pte %08lx.\n", file, line, pte_val(pte)); |
714 | } | 716 | } |
715 | 717 | ||
716 | void __pmd_error(const char *file, int line, unsigned long val) | 718 | void __pmd_error(const char *file, int line, pmd_t pmd) |
717 | { | 719 | { |
718 | printk("%s:%d: bad pmd %08lx.\n", file, line, val); | 720 | printk("%s:%d: bad pmd %08lx.\n", file, line, pmd_val(pmd)); |
719 | } | 721 | } |
720 | 722 | ||
721 | void __pgd_error(const char *file, int line, unsigned long val) | 723 | void __pgd_error(const char *file, int line, pgd_t pgd) |
722 | { | 724 | { |
723 | printk("%s:%d: bad pgd %08lx.\n", file, line, val); | 725 | printk("%s:%d: bad pgd %08lx.\n", file, line, pgd_val(pgd)); |
724 | } | 726 | } |
725 | 727 | ||
726 | asmlinkage void __div0(void) | 728 | asmlinkage void __div0(void) |
@@ -756,7 +758,11 @@ static void __init kuser_get_tls_init(unsigned long vectors) | |||
756 | 758 | ||
757 | void __init early_trap_init(void) | 759 | void __init early_trap_init(void) |
758 | { | 760 | { |
761 | #if defined(CONFIG_CPU_USE_DOMAINS) | ||
759 | unsigned long vectors = CONFIG_VECTORS_BASE; | 762 | unsigned long vectors = CONFIG_VECTORS_BASE; |
763 | #else | ||
764 | unsigned long vectors = (unsigned long)vectors_page; | ||
765 | #endif | ||
760 | extern char __stubs_start[], __stubs_end[]; | 766 | extern char __stubs_start[], __stubs_end[]; |
761 | extern char __vectors_start[], __vectors_end[]; | 767 | extern char __vectors_start[], __vectors_end[]; |
762 | extern char __kuser_helper_start[], __kuser_helper_end[]; | 768 | extern char __kuser_helper_start[], __kuser_helper_end[]; |
@@ -780,10 +786,10 @@ void __init early_trap_init(void) | |||
780 | * Copy signal return handlers into the vector page, and | 786 | * Copy signal return handlers into the vector page, and |
781 | * set sigreturn to be a pointer to these. | 787 | * set sigreturn to be a pointer to these. |
782 | */ | 788 | */ |
783 | memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, | 789 | memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE), |
784 | sizeof(sigreturn_codes)); | 790 | sigreturn_codes, sizeof(sigreturn_codes)); |
785 | memcpy((void *)KERN_RESTART_CODE, syscall_restart_code, | 791 | memcpy((void *)(vectors + KERN_RESTART_CODE - CONFIG_VECTORS_BASE), |
786 | sizeof(syscall_restart_code)); | 792 | syscall_restart_code, sizeof(syscall_restart_code)); |
787 | 793 | ||
788 | flush_icache_range(vectors, vectors + PAGE_SIZE); | 794 | flush_icache_range(vectors, vectors + PAGE_SIZE); |
789 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); | 795 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index cead8893b46b..86b66f3f2031 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -101,6 +101,7 @@ SECTIONS | |||
101 | __exception_text_start = .; | 101 | __exception_text_start = .; |
102 | *(.exception.text) | 102 | *(.exception.text) |
103 | __exception_text_end = .; | 103 | __exception_text_end = .; |
104 | IRQENTRY_TEXT | ||
104 | TEXT_TEXT | 105 | TEXT_TEXT |
105 | SCHED_TEXT | 106 | SCHED_TEXT |
106 | LOCK_TEXT | 107 | LOCK_TEXT |
@@ -167,6 +168,7 @@ SECTIONS | |||
167 | 168 | ||
168 | NOSAVE_DATA | 169 | NOSAVE_DATA |
169 | CACHELINE_ALIGNED_DATA(32) | 170 | CACHELINE_ALIGNED_DATA(32) |
171 | READ_MOSTLY_DATA(32) | ||
170 | 172 | ||
171 | /* | 173 | /* |
172 | * The exception fixup table (might need resorting at runtime) | 174 | * The exception fixup table (might need resorting at runtime) |
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S index b1631a7dbe75..1b049cd7a49a 100644 --- a/arch/arm/lib/getuser.S +++ b/arch/arm/lib/getuser.S | |||
@@ -28,20 +28,21 @@ | |||
28 | */ | 28 | */ |
29 | #include <linux/linkage.h> | 29 | #include <linux/linkage.h> |
30 | #include <asm/errno.h> | 30 | #include <asm/errno.h> |
31 | #include <asm/domain.h> | ||
31 | 32 | ||
32 | ENTRY(__get_user_1) | 33 | ENTRY(__get_user_1) |
33 | 1: ldrbt r2, [r0] | 34 | 1: T(ldrb) r2, [r0] |
34 | mov r0, #0 | 35 | mov r0, #0 |
35 | mov pc, lr | 36 | mov pc, lr |
36 | ENDPROC(__get_user_1) | 37 | ENDPROC(__get_user_1) |
37 | 38 | ||
38 | ENTRY(__get_user_2) | 39 | ENTRY(__get_user_2) |
39 | #ifdef CONFIG_THUMB2_KERNEL | 40 | #ifdef CONFIG_THUMB2_KERNEL |
40 | 2: ldrbt r2, [r0] | 41 | 2: T(ldrb) r2, [r0] |
41 | 3: ldrbt r3, [r0, #1] | 42 | 3: T(ldrb) r3, [r0, #1] |
42 | #else | 43 | #else |
43 | 2: ldrbt r2, [r0], #1 | 44 | 2: T(ldrb) r2, [r0], #1 |
44 | 3: ldrbt r3, [r0] | 45 | 3: T(ldrb) r3, [r0] |
45 | #endif | 46 | #endif |
46 | #ifndef __ARMEB__ | 47 | #ifndef __ARMEB__ |
47 | orr r2, r2, r3, lsl #8 | 48 | orr r2, r2, r3, lsl #8 |
@@ -53,7 +54,7 @@ ENTRY(__get_user_2) | |||
53 | ENDPROC(__get_user_2) | 54 | ENDPROC(__get_user_2) |
54 | 55 | ||
55 | ENTRY(__get_user_4) | 56 | ENTRY(__get_user_4) |
56 | 4: ldrt r2, [r0] | 57 | 4: T(ldr) r2, [r0] |
57 | mov r0, #0 | 58 | mov r0, #0 |
58 | mov pc, lr | 59 | mov pc, lr |
59 | ENDPROC(__get_user_4) | 60 | ENDPROC(__get_user_4) |
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S index 5a01a23c6c06..c023fc11e86c 100644 --- a/arch/arm/lib/putuser.S +++ b/arch/arm/lib/putuser.S | |||
@@ -28,9 +28,10 @@ | |||
28 | */ | 28 | */ |
29 | #include <linux/linkage.h> | 29 | #include <linux/linkage.h> |
30 | #include <asm/errno.h> | 30 | #include <asm/errno.h> |
31 | #include <asm/domain.h> | ||
31 | 32 | ||
32 | ENTRY(__put_user_1) | 33 | ENTRY(__put_user_1) |
33 | 1: strbt r2, [r0] | 34 | 1: T(strb) r2, [r0] |
34 | mov r0, #0 | 35 | mov r0, #0 |
35 | mov pc, lr | 36 | mov pc, lr |
36 | ENDPROC(__put_user_1) | 37 | ENDPROC(__put_user_1) |
@@ -39,19 +40,19 @@ ENTRY(__put_user_2) | |||
39 | mov ip, r2, lsr #8 | 40 | mov ip, r2, lsr #8 |
40 | #ifdef CONFIG_THUMB2_KERNEL | 41 | #ifdef CONFIG_THUMB2_KERNEL |
41 | #ifndef __ARMEB__ | 42 | #ifndef __ARMEB__ |
42 | 2: strbt r2, [r0] | 43 | 2: T(strb) r2, [r0] |
43 | 3: strbt ip, [r0, #1] | 44 | 3: T(strb) ip, [r0, #1] |
44 | #else | 45 | #else |
45 | 2: strbt ip, [r0] | 46 | 2: T(strb) ip, [r0] |
46 | 3: strbt r2, [r0, #1] | 47 | 3: T(strb) r2, [r0, #1] |
47 | #endif | 48 | #endif |
48 | #else /* !CONFIG_THUMB2_KERNEL */ | 49 | #else /* !CONFIG_THUMB2_KERNEL */ |
49 | #ifndef __ARMEB__ | 50 | #ifndef __ARMEB__ |
50 | 2: strbt r2, [r0], #1 | 51 | 2: T(strb) r2, [r0], #1 |
51 | 3: strbt ip, [r0] | 52 | 3: T(strb) ip, [r0] |
52 | #else | 53 | #else |
53 | 2: strbt ip, [r0], #1 | 54 | 2: T(strb) ip, [r0], #1 |
54 | 3: strbt r2, [r0] | 55 | 3: T(strb) r2, [r0] |
55 | #endif | 56 | #endif |
56 | #endif /* CONFIG_THUMB2_KERNEL */ | 57 | #endif /* CONFIG_THUMB2_KERNEL */ |
57 | mov r0, #0 | 58 | mov r0, #0 |
@@ -59,18 +60,18 @@ ENTRY(__put_user_2) | |||
59 | ENDPROC(__put_user_2) | 60 | ENDPROC(__put_user_2) |
60 | 61 | ||
61 | ENTRY(__put_user_4) | 62 | ENTRY(__put_user_4) |
62 | 4: strt r2, [r0] | 63 | 4: T(str) r2, [r0] |
63 | mov r0, #0 | 64 | mov r0, #0 |
64 | mov pc, lr | 65 | mov pc, lr |
65 | ENDPROC(__put_user_4) | 66 | ENDPROC(__put_user_4) |
66 | 67 | ||
67 | ENTRY(__put_user_8) | 68 | ENTRY(__put_user_8) |
68 | #ifdef CONFIG_THUMB2_KERNEL | 69 | #ifdef CONFIG_THUMB2_KERNEL |
69 | 5: strt r2, [r0] | 70 | 5: T(str) r2, [r0] |
70 | 6: strt r3, [r0, #4] | 71 | 6: T(str) r3, [r0, #4] |
71 | #else | 72 | #else |
72 | 5: strt r2, [r0], #4 | 73 | 5: T(str) r2, [r0], #4 |
73 | 6: strt r3, [r0] | 74 | 6: T(str) r3, [r0] |
74 | #endif | 75 | #endif |
75 | mov r0, #0 | 76 | mov r0, #0 |
76 | mov pc, lr | 77 | mov pc, lr |
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S index fee9f6f88adb..d0ece2aeb70d 100644 --- a/arch/arm/lib/uaccess.S +++ b/arch/arm/lib/uaccess.S | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | #include <asm/assembler.h> | 15 | #include <asm/assembler.h> |
16 | #include <asm/errno.h> | 16 | #include <asm/errno.h> |
17 | #include <asm/domain.h> | ||
17 | 18 | ||
18 | .text | 19 | .text |
19 | 20 | ||
@@ -31,11 +32,11 @@ | |||
31 | rsb ip, ip, #4 | 32 | rsb ip, ip, #4 |
32 | cmp ip, #2 | 33 | cmp ip, #2 |
33 | ldrb r3, [r1], #1 | 34 | ldrb r3, [r1], #1 |
34 | USER( strbt r3, [r0], #1) @ May fault | 35 | USER( T(strb) r3, [r0], #1) @ May fault |
35 | ldrgeb r3, [r1], #1 | 36 | ldrgeb r3, [r1], #1 |
36 | USER( strgebt r3, [r0], #1) @ May fault | 37 | USER( T(strgeb) r3, [r0], #1) @ May fault |
37 | ldrgtb r3, [r1], #1 | 38 | ldrgtb r3, [r1], #1 |
38 | USER( strgtbt r3, [r0], #1) @ May fault | 39 | USER( T(strgtb) r3, [r0], #1) @ May fault |
39 | sub r2, r2, ip | 40 | sub r2, r2, ip |
40 | b .Lc2u_dest_aligned | 41 | b .Lc2u_dest_aligned |
41 | 42 | ||
@@ -58,7 +59,7 @@ ENTRY(__copy_to_user) | |||
58 | addmi ip, r2, #4 | 59 | addmi ip, r2, #4 |
59 | bmi .Lc2u_0nowords | 60 | bmi .Lc2u_0nowords |
60 | ldr r3, [r1], #4 | 61 | ldr r3, [r1], #4 |
61 | USER( strt r3, [r0], #4) @ May fault | 62 | USER( T(str) r3, [r0], #4) @ May fault |
62 | mov ip, r0, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction | 63 | mov ip, r0, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction |
63 | rsb ip, ip, #0 | 64 | rsb ip, ip, #0 |
64 | movs ip, ip, lsr #32 - PAGE_SHIFT | 65 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -87,18 +88,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
87 | stmneia r0!, {r3 - r4} @ Shouldnt fault | 88 | stmneia r0!, {r3 - r4} @ Shouldnt fault |
88 | tst ip, #4 | 89 | tst ip, #4 |
89 | ldrne r3, [r1], #4 | 90 | ldrne r3, [r1], #4 |
90 | strnet r3, [r0], #4 @ Shouldnt fault | 91 | T(strne) r3, [r0], #4 @ Shouldnt fault |
91 | ands ip, ip, #3 | 92 | ands ip, ip, #3 |
92 | beq .Lc2u_0fupi | 93 | beq .Lc2u_0fupi |
93 | .Lc2u_0nowords: teq ip, #0 | 94 | .Lc2u_0nowords: teq ip, #0 |
94 | beq .Lc2u_finished | 95 | beq .Lc2u_finished |
95 | .Lc2u_nowords: cmp ip, #2 | 96 | .Lc2u_nowords: cmp ip, #2 |
96 | ldrb r3, [r1], #1 | 97 | ldrb r3, [r1], #1 |
97 | USER( strbt r3, [r0], #1) @ May fault | 98 | USER( T(strb) r3, [r0], #1) @ May fault |
98 | ldrgeb r3, [r1], #1 | 99 | ldrgeb r3, [r1], #1 |
99 | USER( strgebt r3, [r0], #1) @ May fault | 100 | USER( T(strgeb) r3, [r0], #1) @ May fault |
100 | ldrgtb r3, [r1], #1 | 101 | ldrgtb r3, [r1], #1 |
101 | USER( strgtbt r3, [r0], #1) @ May fault | 102 | USER( T(strgtb) r3, [r0], #1) @ May fault |
102 | b .Lc2u_finished | 103 | b .Lc2u_finished |
103 | 104 | ||
104 | .Lc2u_not_enough: | 105 | .Lc2u_not_enough: |
@@ -119,7 +120,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
119 | mov r3, r7, pull #8 | 120 | mov r3, r7, pull #8 |
120 | ldr r7, [r1], #4 | 121 | ldr r7, [r1], #4 |
121 | orr r3, r3, r7, push #24 | 122 | orr r3, r3, r7, push #24 |
122 | USER( strt r3, [r0], #4) @ May fault | 123 | USER( T(str) r3, [r0], #4) @ May fault |
123 | mov ip, r0, lsl #32 - PAGE_SHIFT | 124 | mov ip, r0, lsl #32 - PAGE_SHIFT |
124 | rsb ip, ip, #0 | 125 | rsb ip, ip, #0 |
125 | movs ip, ip, lsr #32 - PAGE_SHIFT | 126 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -154,18 +155,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
154 | movne r3, r7, pull #8 | 155 | movne r3, r7, pull #8 |
155 | ldrne r7, [r1], #4 | 156 | ldrne r7, [r1], #4 |
156 | orrne r3, r3, r7, push #24 | 157 | orrne r3, r3, r7, push #24 |
157 | strnet r3, [r0], #4 @ Shouldnt fault | 158 | T(strne) r3, [r0], #4 @ Shouldnt fault |
158 | ands ip, ip, #3 | 159 | ands ip, ip, #3 |
159 | beq .Lc2u_1fupi | 160 | beq .Lc2u_1fupi |
160 | .Lc2u_1nowords: mov r3, r7, get_byte_1 | 161 | .Lc2u_1nowords: mov r3, r7, get_byte_1 |
161 | teq ip, #0 | 162 | teq ip, #0 |
162 | beq .Lc2u_finished | 163 | beq .Lc2u_finished |
163 | cmp ip, #2 | 164 | cmp ip, #2 |
164 | USER( strbt r3, [r0], #1) @ May fault | 165 | USER( T(strb) r3, [r0], #1) @ May fault |
165 | movge r3, r7, get_byte_2 | 166 | movge r3, r7, get_byte_2 |
166 | USER( strgebt r3, [r0], #1) @ May fault | 167 | USER( T(strgeb) r3, [r0], #1) @ May fault |
167 | movgt r3, r7, get_byte_3 | 168 | movgt r3, r7, get_byte_3 |
168 | USER( strgtbt r3, [r0], #1) @ May fault | 169 | USER( T(strgtb) r3, [r0], #1) @ May fault |
169 | b .Lc2u_finished | 170 | b .Lc2u_finished |
170 | 171 | ||
171 | .Lc2u_2fupi: subs r2, r2, #4 | 172 | .Lc2u_2fupi: subs r2, r2, #4 |
@@ -174,7 +175,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
174 | mov r3, r7, pull #16 | 175 | mov r3, r7, pull #16 |
175 | ldr r7, [r1], #4 | 176 | ldr r7, [r1], #4 |
176 | orr r3, r3, r7, push #16 | 177 | orr r3, r3, r7, push #16 |
177 | USER( strt r3, [r0], #4) @ May fault | 178 | USER( T(str) r3, [r0], #4) @ May fault |
178 | mov ip, r0, lsl #32 - PAGE_SHIFT | 179 | mov ip, r0, lsl #32 - PAGE_SHIFT |
179 | rsb ip, ip, #0 | 180 | rsb ip, ip, #0 |
180 | movs ip, ip, lsr #32 - PAGE_SHIFT | 181 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -209,18 +210,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
209 | movne r3, r7, pull #16 | 210 | movne r3, r7, pull #16 |
210 | ldrne r7, [r1], #4 | 211 | ldrne r7, [r1], #4 |
211 | orrne r3, r3, r7, push #16 | 212 | orrne r3, r3, r7, push #16 |
212 | strnet r3, [r0], #4 @ Shouldnt fault | 213 | T(strne) r3, [r0], #4 @ Shouldnt fault |
213 | ands ip, ip, #3 | 214 | ands ip, ip, #3 |
214 | beq .Lc2u_2fupi | 215 | beq .Lc2u_2fupi |
215 | .Lc2u_2nowords: mov r3, r7, get_byte_2 | 216 | .Lc2u_2nowords: mov r3, r7, get_byte_2 |
216 | teq ip, #0 | 217 | teq ip, #0 |
217 | beq .Lc2u_finished | 218 | beq .Lc2u_finished |
218 | cmp ip, #2 | 219 | cmp ip, #2 |
219 | USER( strbt r3, [r0], #1) @ May fault | 220 | USER( T(strb) r3, [r0], #1) @ May fault |
220 | movge r3, r7, get_byte_3 | 221 | movge r3, r7, get_byte_3 |
221 | USER( strgebt r3, [r0], #1) @ May fault | 222 | USER( T(strgeb) r3, [r0], #1) @ May fault |
222 | ldrgtb r3, [r1], #0 | 223 | ldrgtb r3, [r1], #0 |
223 | USER( strgtbt r3, [r0], #1) @ May fault | 224 | USER( T(strgtb) r3, [r0], #1) @ May fault |
224 | b .Lc2u_finished | 225 | b .Lc2u_finished |
225 | 226 | ||
226 | .Lc2u_3fupi: subs r2, r2, #4 | 227 | .Lc2u_3fupi: subs r2, r2, #4 |
@@ -229,7 +230,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
229 | mov r3, r7, pull #24 | 230 | mov r3, r7, pull #24 |
230 | ldr r7, [r1], #4 | 231 | ldr r7, [r1], #4 |
231 | orr r3, r3, r7, push #8 | 232 | orr r3, r3, r7, push #8 |
232 | USER( strt r3, [r0], #4) @ May fault | 233 | USER( T(str) r3, [r0], #4) @ May fault |
233 | mov ip, r0, lsl #32 - PAGE_SHIFT | 234 | mov ip, r0, lsl #32 - PAGE_SHIFT |
234 | rsb ip, ip, #0 | 235 | rsb ip, ip, #0 |
235 | movs ip, ip, lsr #32 - PAGE_SHIFT | 236 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -264,18 +265,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
264 | movne r3, r7, pull #24 | 265 | movne r3, r7, pull #24 |
265 | ldrne r7, [r1], #4 | 266 | ldrne r7, [r1], #4 |
266 | orrne r3, r3, r7, push #8 | 267 | orrne r3, r3, r7, push #8 |
267 | strnet r3, [r0], #4 @ Shouldnt fault | 268 | T(strne) r3, [r0], #4 @ Shouldnt fault |
268 | ands ip, ip, #3 | 269 | ands ip, ip, #3 |
269 | beq .Lc2u_3fupi | 270 | beq .Lc2u_3fupi |
270 | .Lc2u_3nowords: mov r3, r7, get_byte_3 | 271 | .Lc2u_3nowords: mov r3, r7, get_byte_3 |
271 | teq ip, #0 | 272 | teq ip, #0 |
272 | beq .Lc2u_finished | 273 | beq .Lc2u_finished |
273 | cmp ip, #2 | 274 | cmp ip, #2 |
274 | USER( strbt r3, [r0], #1) @ May fault | 275 | USER( T(strb) r3, [r0], #1) @ May fault |
275 | ldrgeb r3, [r1], #1 | 276 | ldrgeb r3, [r1], #1 |
276 | USER( strgebt r3, [r0], #1) @ May fault | 277 | USER( T(strgeb) r3, [r0], #1) @ May fault |
277 | ldrgtb r3, [r1], #0 | 278 | ldrgtb r3, [r1], #0 |
278 | USER( strgtbt r3, [r0], #1) @ May fault | 279 | USER( T(strgtb) r3, [r0], #1) @ May fault |
279 | b .Lc2u_finished | 280 | b .Lc2u_finished |
280 | ENDPROC(__copy_to_user) | 281 | ENDPROC(__copy_to_user) |
281 | 282 | ||
@@ -294,11 +295,11 @@ ENDPROC(__copy_to_user) | |||
294 | .Lcfu_dest_not_aligned: | 295 | .Lcfu_dest_not_aligned: |
295 | rsb ip, ip, #4 | 296 | rsb ip, ip, #4 |
296 | cmp ip, #2 | 297 | cmp ip, #2 |
297 | USER( ldrbt r3, [r1], #1) @ May fault | 298 | USER( T(ldrb) r3, [r1], #1) @ May fault |
298 | strb r3, [r0], #1 | 299 | strb r3, [r0], #1 |
299 | USER( ldrgebt r3, [r1], #1) @ May fault | 300 | USER( T(ldrgeb) r3, [r1], #1) @ May fault |
300 | strgeb r3, [r0], #1 | 301 | strgeb r3, [r0], #1 |
301 | USER( ldrgtbt r3, [r1], #1) @ May fault | 302 | USER( T(ldrgtb) r3, [r1], #1) @ May fault |
302 | strgtb r3, [r0], #1 | 303 | strgtb r3, [r0], #1 |
303 | sub r2, r2, ip | 304 | sub r2, r2, ip |
304 | b .Lcfu_dest_aligned | 305 | b .Lcfu_dest_aligned |
@@ -321,7 +322,7 @@ ENTRY(__copy_from_user) | |||
321 | .Lcfu_0fupi: subs r2, r2, #4 | 322 | .Lcfu_0fupi: subs r2, r2, #4 |
322 | addmi ip, r2, #4 | 323 | addmi ip, r2, #4 |
323 | bmi .Lcfu_0nowords | 324 | bmi .Lcfu_0nowords |
324 | USER( ldrt r3, [r1], #4) | 325 | USER( T(ldr) r3, [r1], #4) |
325 | str r3, [r0], #4 | 326 | str r3, [r0], #4 |
326 | mov ip, r1, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction | 327 | mov ip, r1, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction |
327 | rsb ip, ip, #0 | 328 | rsb ip, ip, #0 |
@@ -350,18 +351,18 @@ USER( ldrt r3, [r1], #4) | |||
350 | ldmneia r1!, {r3 - r4} @ Shouldnt fault | 351 | ldmneia r1!, {r3 - r4} @ Shouldnt fault |
351 | stmneia r0!, {r3 - r4} | 352 | stmneia r0!, {r3 - r4} |
352 | tst ip, #4 | 353 | tst ip, #4 |
353 | ldrnet r3, [r1], #4 @ Shouldnt fault | 354 | T(ldrne) r3, [r1], #4 @ Shouldnt fault |
354 | strne r3, [r0], #4 | 355 | strne r3, [r0], #4 |
355 | ands ip, ip, #3 | 356 | ands ip, ip, #3 |
356 | beq .Lcfu_0fupi | 357 | beq .Lcfu_0fupi |
357 | .Lcfu_0nowords: teq ip, #0 | 358 | .Lcfu_0nowords: teq ip, #0 |
358 | beq .Lcfu_finished | 359 | beq .Lcfu_finished |
359 | .Lcfu_nowords: cmp ip, #2 | 360 | .Lcfu_nowords: cmp ip, #2 |
360 | USER( ldrbt r3, [r1], #1) @ May fault | 361 | USER( T(ldrb) r3, [r1], #1) @ May fault |
361 | strb r3, [r0], #1 | 362 | strb r3, [r0], #1 |
362 | USER( ldrgebt r3, [r1], #1) @ May fault | 363 | USER( T(ldrgeb) r3, [r1], #1) @ May fault |
363 | strgeb r3, [r0], #1 | 364 | strgeb r3, [r0], #1 |
364 | USER( ldrgtbt r3, [r1], #1) @ May fault | 365 | USER( T(ldrgtb) r3, [r1], #1) @ May fault |
365 | strgtb r3, [r0], #1 | 366 | strgtb r3, [r0], #1 |
366 | b .Lcfu_finished | 367 | b .Lcfu_finished |
367 | 368 | ||
@@ -374,7 +375,7 @@ USER( ldrgtbt r3, [r1], #1) @ May fault | |||
374 | 375 | ||
375 | .Lcfu_src_not_aligned: | 376 | .Lcfu_src_not_aligned: |
376 | bic r1, r1, #3 | 377 | bic r1, r1, #3 |
377 | USER( ldrt r7, [r1], #4) @ May fault | 378 | USER( T(ldr) r7, [r1], #4) @ May fault |
378 | cmp ip, #2 | 379 | cmp ip, #2 |
379 | bgt .Lcfu_3fupi | 380 | bgt .Lcfu_3fupi |
380 | beq .Lcfu_2fupi | 381 | beq .Lcfu_2fupi |
@@ -382,7 +383,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
382 | addmi ip, r2, #4 | 383 | addmi ip, r2, #4 |
383 | bmi .Lcfu_1nowords | 384 | bmi .Lcfu_1nowords |
384 | mov r3, r7, pull #8 | 385 | mov r3, r7, pull #8 |
385 | USER( ldrt r7, [r1], #4) @ May fault | 386 | USER( T(ldr) r7, [r1], #4) @ May fault |
386 | orr r3, r3, r7, push #24 | 387 | orr r3, r3, r7, push #24 |
387 | str r3, [r0], #4 | 388 | str r3, [r0], #4 |
388 | mov ip, r1, lsl #32 - PAGE_SHIFT | 389 | mov ip, r1, lsl #32 - PAGE_SHIFT |
@@ -417,7 +418,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
417 | stmneia r0!, {r3 - r4} | 418 | stmneia r0!, {r3 - r4} |
418 | tst ip, #4 | 419 | tst ip, #4 |
419 | movne r3, r7, pull #8 | 420 | movne r3, r7, pull #8 |
420 | USER( ldrnet r7, [r1], #4) @ May fault | 421 | USER( T(ldrne) r7, [r1], #4) @ May fault |
421 | orrne r3, r3, r7, push #24 | 422 | orrne r3, r3, r7, push #24 |
422 | strne r3, [r0], #4 | 423 | strne r3, [r0], #4 |
423 | ands ip, ip, #3 | 424 | ands ip, ip, #3 |
@@ -437,7 +438,7 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
437 | addmi ip, r2, #4 | 438 | addmi ip, r2, #4 |
438 | bmi .Lcfu_2nowords | 439 | bmi .Lcfu_2nowords |
439 | mov r3, r7, pull #16 | 440 | mov r3, r7, pull #16 |
440 | USER( ldrt r7, [r1], #4) @ May fault | 441 | USER( T(ldr) r7, [r1], #4) @ May fault |
441 | orr r3, r3, r7, push #16 | 442 | orr r3, r3, r7, push #16 |
442 | str r3, [r0], #4 | 443 | str r3, [r0], #4 |
443 | mov ip, r1, lsl #32 - PAGE_SHIFT | 444 | mov ip, r1, lsl #32 - PAGE_SHIFT |
@@ -473,7 +474,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
473 | stmneia r0!, {r3 - r4} | 474 | stmneia r0!, {r3 - r4} |
474 | tst ip, #4 | 475 | tst ip, #4 |
475 | movne r3, r7, pull #16 | 476 | movne r3, r7, pull #16 |
476 | USER( ldrnet r7, [r1], #4) @ May fault | 477 | USER( T(ldrne) r7, [r1], #4) @ May fault |
477 | orrne r3, r3, r7, push #16 | 478 | orrne r3, r3, r7, push #16 |
478 | strne r3, [r0], #4 | 479 | strne r3, [r0], #4 |
479 | ands ip, ip, #3 | 480 | ands ip, ip, #3 |
@@ -485,7 +486,7 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
485 | strb r3, [r0], #1 | 486 | strb r3, [r0], #1 |
486 | movge r3, r7, get_byte_3 | 487 | movge r3, r7, get_byte_3 |
487 | strgeb r3, [r0], #1 | 488 | strgeb r3, [r0], #1 |
488 | USER( ldrgtbt r3, [r1], #0) @ May fault | 489 | USER( T(ldrgtb) r3, [r1], #0) @ May fault |
489 | strgtb r3, [r0], #1 | 490 | strgtb r3, [r0], #1 |
490 | b .Lcfu_finished | 491 | b .Lcfu_finished |
491 | 492 | ||
@@ -493,7 +494,7 @@ USER( ldrgtbt r3, [r1], #0) @ May fault | |||
493 | addmi ip, r2, #4 | 494 | addmi ip, r2, #4 |
494 | bmi .Lcfu_3nowords | 495 | bmi .Lcfu_3nowords |
495 | mov r3, r7, pull #24 | 496 | mov r3, r7, pull #24 |
496 | USER( ldrt r7, [r1], #4) @ May fault | 497 | USER( T(ldr) r7, [r1], #4) @ May fault |
497 | orr r3, r3, r7, push #8 | 498 | orr r3, r3, r7, push #8 |
498 | str r3, [r0], #4 | 499 | str r3, [r0], #4 |
499 | mov ip, r1, lsl #32 - PAGE_SHIFT | 500 | mov ip, r1, lsl #32 - PAGE_SHIFT |
@@ -528,7 +529,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
528 | stmneia r0!, {r3 - r4} | 529 | stmneia r0!, {r3 - r4} |
529 | tst ip, #4 | 530 | tst ip, #4 |
530 | movne r3, r7, pull #24 | 531 | movne r3, r7, pull #24 |
531 | USER( ldrnet r7, [r1], #4) @ May fault | 532 | USER( T(ldrne) r7, [r1], #4) @ May fault |
532 | orrne r3, r3, r7, push #8 | 533 | orrne r3, r3, r7, push #8 |
533 | strne r3, [r0], #4 | 534 | strne r3, [r0], #4 |
534 | ands ip, ip, #3 | 535 | ands ip, ip, #3 |
@@ -538,9 +539,9 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
538 | beq .Lcfu_finished | 539 | beq .Lcfu_finished |
539 | cmp ip, #2 | 540 | cmp ip, #2 |
540 | strb r3, [r0], #1 | 541 | strb r3, [r0], #1 |
541 | USER( ldrgebt r3, [r1], #1) @ May fault | 542 | USER( T(ldrgeb) r3, [r1], #1) @ May fault |
542 | strgeb r3, [r0], #1 | 543 | strgeb r3, [r0], #1 |
543 | USER( ldrgtbt r3, [r1], #1) @ May fault | 544 | USER( T(ldrgtb) r3, [r1], #1) @ May fault |
544 | strgtb r3, [r0], #1 | 545 | strgtb r3, [r0], #1 |
545 | b .Lcfu_finished | 546 | b .Lcfu_finished |
546 | ENDPROC(__copy_from_user) | 547 | ENDPROC(__copy_from_user) |
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 2500f41d8d2d..1dd69c85dfec 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c | |||
@@ -101,7 +101,6 @@ static struct clocksource clk32k = { | |||
101 | .rating = 150, | 101 | .rating = 150, |
102 | .read = read_clk32k, | 102 | .read = read_clk32k, |
103 | .mask = CLOCKSOURCE_MASK(20), | 103 | .mask = CLOCKSOURCE_MASK(20), |
104 | .shift = 10, | ||
105 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 104 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
106 | }; | 105 | }; |
107 | 106 | ||
@@ -201,8 +200,7 @@ void __init at91rm9200_timer_init(void) | |||
201 | clockevents_register_device(&clkevt); | 200 | clockevents_register_device(&clkevt); |
202 | 201 | ||
203 | /* register clocksource */ | 202 | /* register clocksource */ |
204 | clk32k.mult = clocksource_hz2mult(AT91_SLOW_CLOCK, clk32k.shift); | 203 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); |
205 | clocksource_register(&clk32k); | ||
206 | } | 204 | } |
207 | 205 | ||
208 | struct sys_timer at91rm9200_timer = { | 206 | struct sys_timer at91rm9200_timer = { |
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c index 608a63240b64..4ba85499fa97 100644 --- a/arch/arm/mach-at91/at91sam926x_time.c +++ b/arch/arm/mach-at91/at91sam926x_time.c | |||
@@ -51,7 +51,6 @@ static struct clocksource pit_clk = { | |||
51 | .name = "pit", | 51 | .name = "pit", |
52 | .rating = 175, | 52 | .rating = 175, |
53 | .read = read_pit_clk, | 53 | .read = read_pit_clk, |
54 | .shift = 20, | ||
55 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 54 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
56 | }; | 55 | }; |
57 | 56 | ||
@@ -163,10 +162,9 @@ static void __init at91sam926x_pit_init(void) | |||
163 | * Register clocksource. The high order bits of PIV are unused, | 162 | * Register clocksource. The high order bits of PIV are unused, |
164 | * so this isn't a 32-bit counter unless we get clockevent irqs. | 163 | * so this isn't a 32-bit counter unless we get clockevent irqs. |
165 | */ | 164 | */ |
166 | pit_clk.mult = clocksource_hz2mult(pit_rate, pit_clk.shift); | ||
167 | bits = 12 /* PICNT */ + ilog2(pit_cycle) /* PIV */; | 165 | bits = 12 /* PICNT */ + ilog2(pit_cycle) /* PIV */; |
168 | pit_clk.mask = CLOCKSOURCE_MASK(bits); | 166 | pit_clk.mask = CLOCKSOURCE_MASK(bits); |
169 | clocksource_register(&pit_clk); | 167 | clocksource_register_hz(&pit_clk, pit_rate); |
170 | 168 | ||
171 | /* Set up irq handler */ | 169 | /* Set up irq handler */ |
172 | setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq); | 170 | setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq); |
diff --git a/arch/arm/mach-bcmring/clock.c b/arch/arm/mach-bcmring/clock.c index 14bafc38f2dc..ad237a42d265 100644 --- a/arch/arm/mach-bcmring/clock.c +++ b/arch/arm/mach-bcmring/clock.c | |||
@@ -21,13 +21,12 @@ | |||
21 | #include <linux/string.h> | 21 | #include <linux/string.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/clkdev.h> | ||
24 | #include <mach/csp/hw_cfg.h> | 25 | #include <mach/csp/hw_cfg.h> |
25 | #include <mach/csp/chipcHw_def.h> | 26 | #include <mach/csp/chipcHw_def.h> |
26 | #include <mach/csp/chipcHw_reg.h> | 27 | #include <mach/csp/chipcHw_reg.h> |
27 | #include <mach/csp/chipcHw_inline.h> | 28 | #include <mach/csp/chipcHw_inline.h> |
28 | 29 | ||
29 | #include <asm/clkdev.h> | ||
30 | |||
31 | #include "clock.h" | 30 | #include "clock.h" |
32 | 31 | ||
33 | #define clk_is_primary(x) ((x)->type & CLK_TYPE_PRIMARY) | 32 | #define clk_is_primary(x) ((x)->type & CLK_TYPE_PRIMARY) |
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c index d3f959e92b2d..8fc2035759fb 100644 --- a/arch/arm/mach-bcmring/core.c +++ b/arch/arm/mach-bcmring/core.c | |||
@@ -30,10 +30,10 @@ | |||
30 | #include <linux/amba/bus.h> | 30 | #include <linux/amba/bus.h> |
31 | #include <linux/clocksource.h> | 31 | #include <linux/clocksource.h> |
32 | #include <linux/clockchips.h> | 32 | #include <linux/clockchips.h> |
33 | #include <linux/clkdev.h> | ||
33 | 34 | ||
34 | #include <mach/csp/mm_addr.h> | 35 | #include <mach/csp/mm_addr.h> |
35 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
36 | #include <asm/clkdev.h> | ||
37 | #include <linux/io.h> | 37 | #include <linux/io.h> |
38 | #include <asm/irq.h> | 38 | #include <asm/irq.h> |
39 | #include <asm/hardware/arm_timer.h> | 39 | #include <asm/hardware/arm_timer.h> |
@@ -294,7 +294,6 @@ static struct clocksource clocksource_bcmring_timer1 = { | |||
294 | .rating = 200, | 294 | .rating = 200, |
295 | .read = bcmring_get_cycles_timer1, | 295 | .read = bcmring_get_cycles_timer1, |
296 | .mask = CLOCKSOURCE_MASK(32), | 296 | .mask = CLOCKSOURCE_MASK(32), |
297 | .shift = 20, | ||
298 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 297 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
299 | }; | 298 | }; |
300 | 299 | ||
@@ -303,7 +302,6 @@ static struct clocksource clocksource_bcmring_timer3 = { | |||
303 | .rating = 100, | 302 | .rating = 100, |
304 | .read = bcmring_get_cycles_timer3, | 303 | .read = bcmring_get_cycles_timer3, |
305 | .mask = CLOCKSOURCE_MASK(32), | 304 | .mask = CLOCKSOURCE_MASK(32), |
306 | .shift = 20, | ||
307 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 305 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
308 | }; | 306 | }; |
309 | 307 | ||
@@ -316,10 +314,8 @@ static int __init bcmring_clocksource_init(void) | |||
316 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | 314 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, |
317 | TIMER1_VA_BASE + TIMER_CTRL); | 315 | TIMER1_VA_BASE + TIMER_CTRL); |
318 | 316 | ||
319 | clocksource_bcmring_timer1.mult = | 317 | clocksource_register_khz(&clocksource_bcmring_timer1, |
320 | clocksource_khz2mult(TIMER1_FREQUENCY_MHZ * 1000, | 318 | TIMER1_FREQUENCY_MHZ * 1000); |
321 | clocksource_bcmring_timer1.shift); | ||
322 | clocksource_register(&clocksource_bcmring_timer1); | ||
323 | 319 | ||
324 | /* setup timer3 as free-running clocksource */ | 320 | /* setup timer3 as free-running clocksource */ |
325 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); | 321 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); |
@@ -328,10 +324,8 @@ static int __init bcmring_clocksource_init(void) | |||
328 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | 324 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, |
329 | TIMER3_VA_BASE + TIMER_CTRL); | 325 | TIMER3_VA_BASE + TIMER_CTRL); |
330 | 326 | ||
331 | clocksource_bcmring_timer3.mult = | 327 | clocksource_register_khz(&clocksource_bcmring_timer3, |
332 | clocksource_khz2mult(TIMER3_FREQUENCY_KHZ, | 328 | TIMER3_FREQUENCY_KHZ); |
333 | clocksource_bcmring_timer3.shift); | ||
334 | clocksource_register(&clocksource_bcmring_timer3); | ||
335 | 329 | ||
336 | return 0; | 330 | return 0; |
337 | } | 331 | } |
diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig index 9ebfcc46feb1..29b13f249aa9 100644 --- a/arch/arm/mach-cns3xxx/Kconfig +++ b/arch/arm/mach-cns3xxx/Kconfig | |||
@@ -3,6 +3,7 @@ menu "CNS3XXX platform type" | |||
3 | 3 | ||
4 | config MACH_CNS3420VB | 4 | config MACH_CNS3420VB |
5 | bool "Support for CNS3420 Validation Board" | 5 | bool "Support for CNS3420 Validation Board" |
6 | select MIGHT_HAVE_PCI | ||
6 | help | 7 | help |
7 | Include support for the Cavium Networks CNS3420 MPCore Platform | 8 | Include support for the Cavium Networks CNS3420 MPCore Platform |
8 | Baseboard. | 9 | Baseboard. |
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c index 90fe9ab8591d..08e5c8759502 100644 --- a/arch/arm/mach-cns3xxx/cns3420vb.c +++ b/arch/arm/mach-cns3xxx/cns3420vb.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/dma-mapping.h> | ||
20 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
21 | #include <linux/serial_8250.h> | 22 | #include <linux/serial_8250.h> |
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
@@ -108,10 +109,63 @@ static void __init cns3420_early_serial_setup(void) | |||
108 | } | 109 | } |
109 | 110 | ||
110 | /* | 111 | /* |
112 | * USB | ||
113 | */ | ||
114 | static struct resource cns3xxx_usb_ehci_resources[] = { | ||
115 | [0] = { | ||
116 | .start = CNS3XXX_USB_BASE, | ||
117 | .end = CNS3XXX_USB_BASE + SZ_16M - 1, | ||
118 | .flags = IORESOURCE_MEM, | ||
119 | }, | ||
120 | [1] = { | ||
121 | .start = IRQ_CNS3XXX_USB_EHCI, | ||
122 | .flags = IORESOURCE_IRQ, | ||
123 | }, | ||
124 | }; | ||
125 | |||
126 | static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32); | ||
127 | |||
128 | static struct platform_device cns3xxx_usb_ehci_device = { | ||
129 | .name = "cns3xxx-ehci", | ||
130 | .num_resources = ARRAY_SIZE(cns3xxx_usb_ehci_resources), | ||
131 | .resource = cns3xxx_usb_ehci_resources, | ||
132 | .dev = { | ||
133 | .dma_mask = &cns3xxx_usb_ehci_dma_mask, | ||
134 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
135 | }, | ||
136 | }; | ||
137 | |||
138 | static struct resource cns3xxx_usb_ohci_resources[] = { | ||
139 | [0] = { | ||
140 | .start = CNS3XXX_USB_OHCI_BASE, | ||
141 | .end = CNS3XXX_USB_OHCI_BASE + SZ_16M - 1, | ||
142 | .flags = IORESOURCE_MEM, | ||
143 | }, | ||
144 | [1] = { | ||
145 | .start = IRQ_CNS3XXX_USB_OHCI, | ||
146 | .flags = IORESOURCE_IRQ, | ||
147 | }, | ||
148 | }; | ||
149 | |||
150 | static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32); | ||
151 | |||
152 | static struct platform_device cns3xxx_usb_ohci_device = { | ||
153 | .name = "cns3xxx-ohci", | ||
154 | .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources), | ||
155 | .resource = cns3xxx_usb_ohci_resources, | ||
156 | .dev = { | ||
157 | .dma_mask = &cns3xxx_usb_ohci_dma_mask, | ||
158 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
159 | }, | ||
160 | }; | ||
161 | |||
162 | /* | ||
111 | * Initialization | 163 | * Initialization |
112 | */ | 164 | */ |
113 | static struct platform_device *cns3420_pdevs[] __initdata = { | 165 | static struct platform_device *cns3420_pdevs[] __initdata = { |
114 | &cns3420_nor_pdev, | 166 | &cns3420_nor_pdev, |
167 | &cns3xxx_usb_ehci_device, | ||
168 | &cns3xxx_usb_ohci_device, | ||
115 | }; | 169 | }; |
116 | 170 | ||
117 | static void __init cns3420_init(void) | 171 | static void __init cns3420_init(void) |
diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c index 9ca4d581016f..da30078a80c1 100644 --- a/arch/arm/mach-cns3xxx/core.c +++ b/arch/arm/mach-cns3xxx/core.c | |||
@@ -69,13 +69,10 @@ void __init cns3xxx_map_io(void) | |||
69 | } | 69 | } |
70 | 70 | ||
71 | /* used by entry-macro.S */ | 71 | /* used by entry-macro.S */ |
72 | void __iomem *gic_cpu_base_addr; | ||
73 | |||
74 | void __init cns3xxx_init_irq(void) | 72 | void __init cns3xxx_init_irq(void) |
75 | { | 73 | { |
76 | gic_cpu_base_addr = __io(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT); | 74 | gic_init(0, 29, __io(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT), |
77 | gic_dist_init(0, __io(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT), 29); | 75 | __io(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT)); |
78 | gic_cpu_init(0, gic_cpu_base_addr); | ||
79 | } | 76 | } |
80 | 77 | ||
81 | void cns3xxx_power_off(void) | 78 | void cns3xxx_power_off(void) |
diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h index 6b33ec11346e..ffeb3a8b73ba 100644 --- a/arch/arm/mach-cns3xxx/core.h +++ b/arch/arm/mach-cns3xxx/core.h | |||
@@ -11,13 +11,10 @@ | |||
11 | #ifndef __CNS3XXX_CORE_H | 11 | #ifndef __CNS3XXX_CORE_H |
12 | #define __CNS3XXX_CORE_H | 12 | #define __CNS3XXX_CORE_H |
13 | 13 | ||
14 | extern void __iomem *gic_cpu_base_addr; | ||
15 | extern struct sys_timer cns3xxx_timer; | 14 | extern struct sys_timer cns3xxx_timer; |
16 | 15 | ||
17 | void __init cns3xxx_map_io(void); | 16 | void __init cns3xxx_map_io(void); |
18 | void __init cns3xxx_init_irq(void); | 17 | void __init cns3xxx_init_irq(void); |
19 | void cns3xxx_power_off(void); | 18 | void cns3xxx_power_off(void); |
20 | void cns3xxx_pwr_power_up(unsigned int block); | ||
21 | void cns3xxx_pwr_power_down(unsigned int block); | ||
22 | 19 | ||
23 | #endif /* __CNS3XXX_CORE_H */ | 20 | #endif /* __CNS3XXX_CORE_H */ |
diff --git a/arch/arm/mach-cns3xxx/devices.c b/arch/arm/mach-cns3xxx/devices.c index 50b4d31c27c0..79d1fb02c23f 100644 --- a/arch/arm/mach-cns3xxx/devices.c +++ b/arch/arm/mach-cns3xxx/devices.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <mach/cns3xxx.h> | 19 | #include <mach/cns3xxx.h> |
20 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
21 | #include <mach/pm.h> | ||
21 | #include "core.h" | 22 | #include "core.h" |
22 | #include "devices.h" | 23 | #include "devices.h" |
23 | 24 | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h index 6dbce13771ca..191c8e57f289 100644 --- a/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h +++ b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h | |||
@@ -165,7 +165,6 @@ | |||
165 | #define CNS3XXX_USBOTG_BASE_VIRT 0xFFF15000 | 165 | #define CNS3XXX_USBOTG_BASE_VIRT 0xFFF15000 |
166 | 166 | ||
167 | #define CNS3XXX_USB_BASE 0x82000000 /* USB Host Control */ | 167 | #define CNS3XXX_USB_BASE 0x82000000 /* USB Host Control */ |
168 | #define CNS3XXX_USB_BASE_VIRT 0xFFF16000 | ||
169 | 168 | ||
170 | #define CNS3XXX_SATA2_BASE 0x83000000 /* SATA */ | 169 | #define CNS3XXX_SATA2_BASE 0x83000000 /* SATA */ |
171 | #define CNS3XXX_SATA2_SIZE SZ_16M | 170 | #define CNS3XXX_SATA2_SIZE SZ_16M |
@@ -184,7 +183,6 @@ | |||
184 | #define CNS3XXX_2DG_BASE_VIRT 0xFFF1B000 | 183 | #define CNS3XXX_2DG_BASE_VIRT 0xFFF1B000 |
185 | 184 | ||
186 | #define CNS3XXX_USB_OHCI_BASE 0x88000000 /* USB OHCI */ | 185 | #define CNS3XXX_USB_OHCI_BASE 0x88000000 /* USB OHCI */ |
187 | #define CNS3XXX_USB_OHCI_BASE_VIRT 0xFFF1C000 | ||
188 | 186 | ||
189 | #define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */ | 187 | #define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */ |
190 | #define CNS3XXX_L2C_BASE_VIRT 0xFFF27000 | 188 | #define CNS3XXX_L2C_BASE_VIRT 0xFFF27000 |
diff --git a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S index 5e1c5545680f..6bd83ed90afe 100644 --- a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S +++ b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S | |||
@@ -9,74 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <mach/hardware.h> | 11 | #include <mach/hardware.h> |
12 | #include <asm/hardware/gic.h> | 12 | #include <asm/hardware/entry-macro-gic.S> |
13 | 13 | ||
14 | .macro disable_fiq | 14 | .macro disable_fiq |
15 | .endm | 15 | .endm |
16 | 16 | ||
17 | .macro get_irqnr_preamble, base, tmp | ||
18 | ldr \base, =gic_cpu_base_addr | ||
19 | ldr \base, [\base] | ||
20 | .endm | ||
21 | |||
22 | .macro arch_ret_to_user, tmp1, tmp2 | 17 | .macro arch_ret_to_user, tmp1, tmp2 |
23 | .endm | 18 | .endm |
24 | |||
25 | /* | ||
26 | * The interrupt numbering scheme is defined in the | ||
27 | * interrupt controller spec. To wit: | ||
28 | * | ||
29 | * Interrupts 0-15 are IPI | ||
30 | * 16-28 are reserved | ||
31 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
32 | * 32-1020 are global | ||
33 | * 1021-1022 are reserved | ||
34 | * 1023 is "spurious" (no interrupt) | ||
35 | * | ||
36 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
37 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
38 | * | ||
39 | * A simple read from the controller will tell us the number of the highest | ||
40 | * priority enabled interrupt. We then just need to check whether it is in the | ||
41 | * valid range for an IRQ (30-1020 inclusive). | ||
42 | */ | ||
43 | |||
44 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
45 | |||
46 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ | ||
47 | |||
48 | ldr \tmp, =1021 | ||
49 | |||
50 | bic \irqnr, \irqstat, #0x1c00 | ||
51 | |||
52 | cmp \irqnr, #29 | ||
53 | cmpcc \irqnr, \irqnr | ||
54 | cmpne \irqnr, \tmp | ||
55 | cmpcs \irqnr, \irqnr | ||
56 | |||
57 | .endm | ||
58 | |||
59 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
60 | * register) is preserved from the macro above. | ||
61 | * If there is an IPI, we immediately signal end of interrupt on the | ||
62 | * controller, since this requires the original irqstat value which | ||
63 | * we won't easily be able to recreate later. | ||
64 | */ | ||
65 | |||
66 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
67 | bic \irqnr, \irqstat, #0x1c00 | ||
68 | cmp \irqnr, #16 | ||
69 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
70 | cmpcs \irqnr, \irqnr | ||
71 | .endm | ||
72 | |||
73 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
74 | |||
75 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
76 | bic \irqnr, \irqstat, #0x1c00 | ||
77 | mov \tmp, #0 | ||
78 | cmp \irqnr, #29 | ||
79 | moveq \tmp, #1 | ||
80 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
81 | cmp \tmp, #0 | ||
82 | .endm | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/pm.h b/arch/arm/mach-cns3xxx/include/mach/pm.h new file mode 100644 index 000000000000..6eae7f764d1d --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/pm.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright 2000 Deep Blue Solutions Ltd | ||
3 | * Copyright 2004 ARM Limited | ||
4 | * Copyright 2008 Cavium Networks | ||
5 | * | ||
6 | * This file 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 __CNS3XXX_PM_H | ||
12 | #define __CNS3XXX_PM_H | ||
13 | |||
14 | #include <asm/atomic.h> | ||
15 | |||
16 | void cns3xxx_pwr_clk_en(unsigned int block); | ||
17 | void cns3xxx_pwr_clk_dis(unsigned int block); | ||
18 | void cns3xxx_pwr_power_up(unsigned int block); | ||
19 | void cns3xxx_pwr_power_down(unsigned int block); | ||
20 | |||
21 | extern atomic_t usb_pwr_ref; | ||
22 | |||
23 | #endif /* __CNS3XXX_PM_H */ | ||
diff --git a/arch/arm/mach-cns3xxx/pm.c b/arch/arm/mach-cns3xxx/pm.c index 38e44706feab..5e579552aa54 100644 --- a/arch/arm/mach-cns3xxx/pm.c +++ b/arch/arm/mach-cns3xxx/pm.c | |||
@@ -6,10 +6,14 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/module.h> | ||
9 | #include <linux/io.h> | 11 | #include <linux/io.h> |
10 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
13 | #include <asm/atomic.h> | ||
11 | #include <mach/system.h> | 14 | #include <mach/system.h> |
12 | #include <mach/cns3xxx.h> | 15 | #include <mach/cns3xxx.h> |
16 | #include <mach/pm.h> | ||
13 | 17 | ||
14 | void cns3xxx_pwr_clk_en(unsigned int block) | 18 | void cns3xxx_pwr_clk_en(unsigned int block) |
15 | { | 19 | { |
@@ -18,6 +22,16 @@ void cns3xxx_pwr_clk_en(unsigned int block) | |||
18 | reg |= (block & PM_CLK_GATE_REG_MASK); | 22 | reg |= (block & PM_CLK_GATE_REG_MASK); |
19 | __raw_writel(reg, PM_CLK_GATE_REG); | 23 | __raw_writel(reg, PM_CLK_GATE_REG); |
20 | } | 24 | } |
25 | EXPORT_SYMBOL(cns3xxx_pwr_clk_en); | ||
26 | |||
27 | void cns3xxx_pwr_clk_dis(unsigned int block) | ||
28 | { | ||
29 | u32 reg = __raw_readl(PM_CLK_GATE_REG); | ||
30 | |||
31 | reg &= ~(block & PM_CLK_GATE_REG_MASK); | ||
32 | __raw_writel(reg, PM_CLK_GATE_REG); | ||
33 | } | ||
34 | EXPORT_SYMBOL(cns3xxx_pwr_clk_dis); | ||
21 | 35 | ||
22 | void cns3xxx_pwr_power_up(unsigned int block) | 36 | void cns3xxx_pwr_power_up(unsigned int block) |
23 | { | 37 | { |
@@ -29,6 +43,7 @@ void cns3xxx_pwr_power_up(unsigned int block) | |||
29 | /* Wait for 300us for the PLL output clock locked. */ | 43 | /* Wait for 300us for the PLL output clock locked. */ |
30 | udelay(300); | 44 | udelay(300); |
31 | }; | 45 | }; |
46 | EXPORT_SYMBOL(cns3xxx_pwr_power_up); | ||
32 | 47 | ||
33 | void cns3xxx_pwr_power_down(unsigned int block) | 48 | void cns3xxx_pwr_power_down(unsigned int block) |
34 | { | 49 | { |
@@ -38,6 +53,7 @@ void cns3xxx_pwr_power_down(unsigned int block) | |||
38 | reg |= (block & CNS3XXX_PWR_PLL_ALL); | 53 | reg |= (block & CNS3XXX_PWR_PLL_ALL); |
39 | __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG); | 54 | __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG); |
40 | }; | 55 | }; |
56 | EXPORT_SYMBOL(cns3xxx_pwr_power_down); | ||
41 | 57 | ||
42 | static void cns3xxx_pwr_soft_rst_force(unsigned int block) | 58 | static void cns3xxx_pwr_soft_rst_force(unsigned int block) |
43 | { | 59 | { |
@@ -51,11 +67,13 @@ static void cns3xxx_pwr_soft_rst_force(unsigned int block) | |||
51 | reg &= ~(block & PM_SOFT_RST_REG_MASK); | 67 | reg &= ~(block & PM_SOFT_RST_REG_MASK); |
52 | } else { | 68 | } else { |
53 | reg &= ~(block & PM_SOFT_RST_REG_MASK); | 69 | reg &= ~(block & PM_SOFT_RST_REG_MASK); |
70 | __raw_writel(reg, PM_SOFT_RST_REG); | ||
54 | reg |= (block & PM_SOFT_RST_REG_MASK); | 71 | reg |= (block & PM_SOFT_RST_REG_MASK); |
55 | } | 72 | } |
56 | 73 | ||
57 | __raw_writel(reg, PM_SOFT_RST_REG); | 74 | __raw_writel(reg, PM_SOFT_RST_REG); |
58 | } | 75 | } |
76 | EXPORT_SYMBOL(cns3xxx_pwr_soft_rst_force); | ||
59 | 77 | ||
60 | void cns3xxx_pwr_soft_rst(unsigned int block) | 78 | void cns3xxx_pwr_soft_rst(unsigned int block) |
61 | { | 79 | { |
@@ -69,6 +87,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block) | |||
69 | } | 87 | } |
70 | cns3xxx_pwr_soft_rst_force(block); | 88 | cns3xxx_pwr_soft_rst_force(block); |
71 | } | 89 | } |
90 | EXPORT_SYMBOL(cns3xxx_pwr_soft_rst); | ||
72 | 91 | ||
73 | void arch_reset(char mode, const char *cmd) | 92 | void arch_reset(char mode, const char *cmd) |
74 | { | 93 | { |
@@ -99,3 +118,7 @@ int cns3xxx_cpu_clock(void) | |||
99 | 118 | ||
100 | return cpu; | 119 | return cpu; |
101 | } | 120 | } |
121 | EXPORT_SYMBOL(cns3xxx_cpu_clock); | ||
122 | |||
123 | atomic_t usb_pwr_ref = ATOMIC_INIT(0); | ||
124 | EXPORT_SYMBOL(usb_pwr_ref); | ||
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index b77b860b36d7..32f147998cd9 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig | |||
@@ -61,6 +61,8 @@ config MACH_DAVINCI_EVM | |||
61 | bool "TI DM644x EVM" | 61 | bool "TI DM644x EVM" |
62 | default ARCH_DAVINCI_DM644x | 62 | default ARCH_DAVINCI_DM644x |
63 | depends on ARCH_DAVINCI_DM644x | 63 | depends on ARCH_DAVINCI_DM644x |
64 | select MISC_DEVICES | ||
65 | select EEPROM_AT24 | ||
64 | help | 66 | help |
65 | Configure this option to specify the whether the board used | 67 | Configure this option to specify the whether the board used |
66 | for development is a DM644x EVM | 68 | for development is a DM644x EVM |
@@ -68,6 +70,8 @@ config MACH_DAVINCI_EVM | |||
68 | config MACH_SFFSDR | 70 | config MACH_SFFSDR |
69 | bool "Lyrtech SFFSDR" | 71 | bool "Lyrtech SFFSDR" |
70 | depends on ARCH_DAVINCI_DM644x | 72 | depends on ARCH_DAVINCI_DM644x |
73 | select MISC_DEVICES | ||
74 | select EEPROM_AT24 | ||
71 | help | 75 | help |
72 | Say Y here to select the Lyrtech Small Form Factor | 76 | Say Y here to select the Lyrtech Small Form Factor |
73 | Software Defined Radio (SFFSDR) board. | 77 | Software Defined Radio (SFFSDR) board. |
@@ -99,6 +103,8 @@ config MACH_DAVINCI_DM6467_EVM | |||
99 | default ARCH_DAVINCI_DM646x | 103 | default ARCH_DAVINCI_DM646x |
100 | depends on ARCH_DAVINCI_DM646x | 104 | depends on ARCH_DAVINCI_DM646x |
101 | select MACH_DAVINCI_DM6467TEVM | 105 | select MACH_DAVINCI_DM6467TEVM |
106 | select MISC_DEVICES | ||
107 | select EEPROM_AT24 | ||
102 | help | 108 | help |
103 | Configure this option to specify the whether the board used | 109 | Configure this option to specify the whether the board used |
104 | for development is a DM6467 EVM | 110 | for development is a DM6467 EVM |
@@ -110,6 +116,8 @@ config MACH_DAVINCI_DM365_EVM | |||
110 | bool "TI DM365 EVM" | 116 | bool "TI DM365 EVM" |
111 | default ARCH_DAVINCI_DM365 | 117 | default ARCH_DAVINCI_DM365 |
112 | depends on ARCH_DAVINCI_DM365 | 118 | depends on ARCH_DAVINCI_DM365 |
119 | select MISC_DEVICES | ||
120 | select EEPROM_AT24 | ||
113 | help | 121 | help |
114 | Configure this option to specify whether the board used | 122 | Configure this option to specify whether the board used |
115 | for development is a DM365 EVM | 123 | for development is a DM365 EVM |
@@ -119,6 +127,8 @@ config MACH_DAVINCI_DA830_EVM | |||
119 | default ARCH_DAVINCI_DA830 | 127 | default ARCH_DAVINCI_DA830 |
120 | depends on ARCH_DAVINCI_DA830 | 128 | depends on ARCH_DAVINCI_DA830 |
121 | select GPIO_PCF857X | 129 | select GPIO_PCF857X |
130 | select MISC_DEVICES | ||
131 | select EEPROM_AT24 | ||
122 | help | 132 | help |
123 | Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module. | 133 | Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module. |
124 | 134 | ||
@@ -148,7 +158,6 @@ config MACH_DAVINCI_DA850_EVM | |||
148 | bool "TI DA850/OMAP-L138/AM18x Reference Platform" | 158 | bool "TI DA850/OMAP-L138/AM18x Reference Platform" |
149 | default ARCH_DAVINCI_DA850 | 159 | default ARCH_DAVINCI_DA850 |
150 | depends on ARCH_DAVINCI_DA850 | 160 | depends on ARCH_DAVINCI_DA850 |
151 | select GPIO_PCA953X | ||
152 | help | 161 | help |
153 | Say Y here to select the TI DA850/OMAP-L138/AM18x Evaluation Module. | 162 | Say Y here to select the TI DA850/OMAP-L138/AM18x Evaluation Module. |
154 | 163 | ||
@@ -178,6 +187,12 @@ config DA850_UI_RMII | |||
178 | 187 | ||
179 | endchoice | 188 | endchoice |
180 | 189 | ||
190 | config GPIO_PCA953X | ||
191 | default MACH_DAVINCI_DA850_EVM | ||
192 | |||
193 | config KEYBOARD_GPIO_POLLED | ||
194 | default MACH_DAVINCI_DA850_EVM | ||
195 | |||
181 | config MACH_TNETV107X | 196 | config MACH_TNETV107X |
182 | bool "TI TNETV107X Reference Platform" | 197 | bool "TI TNETV107X Reference Platform" |
183 | default ARCH_DAVINCI_TNETV107X | 198 | default ARCH_DAVINCI_TNETV107X |
@@ -188,6 +203,8 @@ config MACH_TNETV107X | |||
188 | config MACH_MITYOMAPL138 | 203 | config MACH_MITYOMAPL138 |
189 | bool "Critical Link MityDSP-L138/MityARM-1808 SoM" | 204 | bool "Critical Link MityDSP-L138/MityARM-1808 SoM" |
190 | depends on ARCH_DAVINCI_DA850 | 205 | depends on ARCH_DAVINCI_DA850 |
206 | select MISC_DEVICES | ||
207 | select EEPROM_AT24 | ||
191 | help | 208 | help |
192 | Say Y here to select the Critical Link MityDSP-L138/MityARM-1808 | 209 | Say Y here to select the Critical Link MityDSP-L138/MityARM-1808 |
193 | System on Module. Information on this SoM may be found at | 210 | System on Module. Information on this SoM may be found at |
diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c index 9c3f500fc12f..1ce70a91f2e9 100644 --- a/arch/arm/mach-davinci/aemif.c +++ b/arch/arm/mach-davinci/aemif.c | |||
@@ -90,7 +90,7 @@ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, | |||
90 | void __iomem *base, unsigned cs) | 90 | void __iomem *base, unsigned cs) |
91 | { | 91 | { |
92 | unsigned set, val; | 92 | unsigned set, val; |
93 | unsigned ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; | 93 | int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; |
94 | unsigned offset = A1CR_OFFSET + cs * 4; | 94 | unsigned offset = A1CR_OFFSET + cs * 4; |
95 | struct clk *aemif_clk; | 95 | struct clk *aemif_clk; |
96 | unsigned long clkrate; | 96 | unsigned long clkrate; |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index c6e11c682e4c..b01fb2ab944a 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -17,8 +17,10 @@ | |||
17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
18 | #include <linux/i2c/at24.h> | 18 | #include <linux/i2c/at24.h> |
19 | #include <linux/i2c/pca953x.h> | 19 | #include <linux/i2c/pca953x.h> |
20 | #include <linux/input.h> | ||
20 | #include <linux/mfd/tps6507x.h> | 21 | #include <linux/mfd/tps6507x.h> |
21 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/gpio_keys.h> | ||
22 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
23 | #include <linux/mtd/mtd.h> | 25 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/nand.h> | 26 | #include <linux/mtd/nand.h> |
@@ -266,34 +268,115 @@ static inline void da850_evm_setup_emac_rmii(int rmii_sel) | |||
266 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 268 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
267 | 269 | ||
268 | soc_info->emac_pdata->rmii_en = 1; | 270 | soc_info->emac_pdata->rmii_en = 1; |
269 | gpio_set_value(rmii_sel, 0); | 271 | gpio_set_value_cansleep(rmii_sel, 0); |
270 | } | 272 | } |
271 | #else | 273 | #else |
272 | static inline void da850_evm_setup_emac_rmii(int rmii_sel) { } | 274 | static inline void da850_evm_setup_emac_rmii(int rmii_sel) { } |
273 | #endif | 275 | #endif |
274 | 276 | ||
277 | |||
278 | #define DA850_KEYS_DEBOUNCE_MS 10 | ||
279 | /* | ||
280 | * At 200ms polling interval it is possible to miss an | ||
281 | * event by tapping very lightly on the push button but most | ||
282 | * pushes do result in an event; longer intervals require the | ||
283 | * user to hold the button whereas shorter intervals require | ||
284 | * more CPU time for polling. | ||
285 | */ | ||
286 | #define DA850_GPIO_KEYS_POLL_MS 200 | ||
287 | |||
288 | enum da850_evm_ui_exp_pins { | ||
289 | DA850_EVM_UI_EXP_SEL_C = 5, | ||
290 | DA850_EVM_UI_EXP_SEL_B, | ||
291 | DA850_EVM_UI_EXP_SEL_A, | ||
292 | DA850_EVM_UI_EXP_PB8, | ||
293 | DA850_EVM_UI_EXP_PB7, | ||
294 | DA850_EVM_UI_EXP_PB6, | ||
295 | DA850_EVM_UI_EXP_PB5, | ||
296 | DA850_EVM_UI_EXP_PB4, | ||
297 | DA850_EVM_UI_EXP_PB3, | ||
298 | DA850_EVM_UI_EXP_PB2, | ||
299 | DA850_EVM_UI_EXP_PB1, | ||
300 | }; | ||
301 | |||
302 | static const char const *da850_evm_ui_exp[] = { | ||
303 | [DA850_EVM_UI_EXP_SEL_C] = "sel_c", | ||
304 | [DA850_EVM_UI_EXP_SEL_B] = "sel_b", | ||
305 | [DA850_EVM_UI_EXP_SEL_A] = "sel_a", | ||
306 | [DA850_EVM_UI_EXP_PB8] = "pb8", | ||
307 | [DA850_EVM_UI_EXP_PB7] = "pb7", | ||
308 | [DA850_EVM_UI_EXP_PB6] = "pb6", | ||
309 | [DA850_EVM_UI_EXP_PB5] = "pb5", | ||
310 | [DA850_EVM_UI_EXP_PB4] = "pb4", | ||
311 | [DA850_EVM_UI_EXP_PB3] = "pb3", | ||
312 | [DA850_EVM_UI_EXP_PB2] = "pb2", | ||
313 | [DA850_EVM_UI_EXP_PB1] = "pb1", | ||
314 | }; | ||
315 | |||
316 | #define DA850_N_UI_PB 8 | ||
317 | |||
318 | static struct gpio_keys_button da850_evm_ui_keys[] = { | ||
319 | [0 ... DA850_N_UI_PB - 1] = { | ||
320 | .type = EV_KEY, | ||
321 | .active_low = 1, | ||
322 | .wakeup = 0, | ||
323 | .debounce_interval = DA850_KEYS_DEBOUNCE_MS, | ||
324 | .code = -1, /* assigned at runtime */ | ||
325 | .gpio = -1, /* assigned at runtime */ | ||
326 | .desc = NULL, /* assigned at runtime */ | ||
327 | }, | ||
328 | }; | ||
329 | |||
330 | static struct gpio_keys_platform_data da850_evm_ui_keys_pdata = { | ||
331 | .buttons = da850_evm_ui_keys, | ||
332 | .nbuttons = ARRAY_SIZE(da850_evm_ui_keys), | ||
333 | .poll_interval = DA850_GPIO_KEYS_POLL_MS, | ||
334 | }; | ||
335 | |||
336 | static struct platform_device da850_evm_ui_keys_device = { | ||
337 | .name = "gpio-keys-polled", | ||
338 | .id = 0, | ||
339 | .dev = { | ||
340 | .platform_data = &da850_evm_ui_keys_pdata | ||
341 | }, | ||
342 | }; | ||
343 | |||
344 | static void da850_evm_ui_keys_init(unsigned gpio) | ||
345 | { | ||
346 | int i; | ||
347 | struct gpio_keys_button *button; | ||
348 | |||
349 | for (i = 0; i < DA850_N_UI_PB; i++) { | ||
350 | button = &da850_evm_ui_keys[i]; | ||
351 | button->code = KEY_F8 - i; | ||
352 | button->desc = (char *) | ||
353 | da850_evm_ui_exp[DA850_EVM_UI_EXP_PB8 + i]; | ||
354 | button->gpio = gpio + DA850_EVM_UI_EXP_PB8 + i; | ||
355 | } | ||
356 | } | ||
357 | |||
275 | static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, | 358 | static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, |
276 | unsigned ngpio, void *c) | 359 | unsigned ngpio, void *c) |
277 | { | 360 | { |
278 | int sel_a, sel_b, sel_c, ret; | 361 | int sel_a, sel_b, sel_c, ret; |
279 | 362 | ||
280 | sel_a = gpio + 7; | 363 | sel_a = gpio + DA850_EVM_UI_EXP_SEL_A; |
281 | sel_b = gpio + 6; | 364 | sel_b = gpio + DA850_EVM_UI_EXP_SEL_B; |
282 | sel_c = gpio + 5; | 365 | sel_c = gpio + DA850_EVM_UI_EXP_SEL_C; |
283 | 366 | ||
284 | ret = gpio_request(sel_a, "sel_a"); | 367 | ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]); |
285 | if (ret) { | 368 | if (ret) { |
286 | pr_warning("Cannot open UI expander pin %d\n", sel_a); | 369 | pr_warning("Cannot open UI expander pin %d\n", sel_a); |
287 | goto exp_setup_sela_fail; | 370 | goto exp_setup_sela_fail; |
288 | } | 371 | } |
289 | 372 | ||
290 | ret = gpio_request(sel_b, "sel_b"); | 373 | ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]); |
291 | if (ret) { | 374 | if (ret) { |
292 | pr_warning("Cannot open UI expander pin %d\n", sel_b); | 375 | pr_warning("Cannot open UI expander pin %d\n", sel_b); |
293 | goto exp_setup_selb_fail; | 376 | goto exp_setup_selb_fail; |
294 | } | 377 | } |
295 | 378 | ||
296 | ret = gpio_request(sel_c, "sel_c"); | 379 | ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]); |
297 | if (ret) { | 380 | if (ret) { |
298 | pr_warning("Cannot open UI expander pin %d\n", sel_c); | 381 | pr_warning("Cannot open UI expander pin %d\n", sel_c); |
299 | goto exp_setup_selc_fail; | 382 | goto exp_setup_selc_fail; |
@@ -304,6 +387,13 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, | |||
304 | gpio_direction_output(sel_b, 1); | 387 | gpio_direction_output(sel_b, 1); |
305 | gpio_direction_output(sel_c, 1); | 388 | gpio_direction_output(sel_c, 1); |
306 | 389 | ||
390 | da850_evm_ui_keys_init(gpio); | ||
391 | ret = platform_device_register(&da850_evm_ui_keys_device); | ||
392 | if (ret) { | ||
393 | pr_warning("Could not register UI GPIO expander push-buttons"); | ||
394 | goto exp_setup_keys_fail; | ||
395 | } | ||
396 | |||
307 | ui_card_detected = 1; | 397 | ui_card_detected = 1; |
308 | pr_info("DA850/OMAP-L138 EVM UI card detected\n"); | 398 | pr_info("DA850/OMAP-L138 EVM UI card detected\n"); |
309 | 399 | ||
@@ -313,6 +403,8 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, | |||
313 | 403 | ||
314 | return 0; | 404 | return 0; |
315 | 405 | ||
406 | exp_setup_keys_fail: | ||
407 | gpio_free(sel_c); | ||
316 | exp_setup_selc_fail: | 408 | exp_setup_selc_fail: |
317 | gpio_free(sel_b); | 409 | gpio_free(sel_b); |
318 | exp_setup_selb_fail: | 410 | exp_setup_selb_fail: |
@@ -324,14 +416,192 @@ exp_setup_sela_fail: | |||
324 | static int da850_evm_ui_expander_teardown(struct i2c_client *client, | 416 | static int da850_evm_ui_expander_teardown(struct i2c_client *client, |
325 | unsigned gpio, unsigned ngpio, void *c) | 417 | unsigned gpio, unsigned ngpio, void *c) |
326 | { | 418 | { |
419 | platform_device_unregister(&da850_evm_ui_keys_device); | ||
420 | |||
327 | /* deselect all functionalities */ | 421 | /* deselect all functionalities */ |
328 | gpio_set_value(gpio + 5, 1); | 422 | gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_C, 1); |
329 | gpio_set_value(gpio + 6, 1); | 423 | gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_B, 1); |
330 | gpio_set_value(gpio + 7, 1); | 424 | gpio_set_value_cansleep(gpio + DA850_EVM_UI_EXP_SEL_A, 1); |
425 | |||
426 | gpio_free(gpio + DA850_EVM_UI_EXP_SEL_C); | ||
427 | gpio_free(gpio + DA850_EVM_UI_EXP_SEL_B); | ||
428 | gpio_free(gpio + DA850_EVM_UI_EXP_SEL_A); | ||
429 | |||
430 | return 0; | ||
431 | } | ||
432 | |||
433 | /* assign the baseboard expander's GPIOs after the UI board's */ | ||
434 | #define DA850_UI_EXPANDER_N_GPIOS ARRAY_SIZE(da850_evm_ui_exp) | ||
435 | #define DA850_BB_EXPANDER_GPIO_BASE (DAVINCI_N_GPIO + DA850_UI_EXPANDER_N_GPIOS) | ||
436 | |||
437 | enum da850_evm_bb_exp_pins { | ||
438 | DA850_EVM_BB_EXP_DEEP_SLEEP_EN = 0, | ||
439 | DA850_EVM_BB_EXP_SW_RST, | ||
440 | DA850_EVM_BB_EXP_TP_23, | ||
441 | DA850_EVM_BB_EXP_TP_22, | ||
442 | DA850_EVM_BB_EXP_TP_21, | ||
443 | DA850_EVM_BB_EXP_USER_PB1, | ||
444 | DA850_EVM_BB_EXP_USER_LED2, | ||
445 | DA850_EVM_BB_EXP_USER_LED1, | ||
446 | DA850_EVM_BB_EXP_USER_SW1, | ||
447 | DA850_EVM_BB_EXP_USER_SW2, | ||
448 | DA850_EVM_BB_EXP_USER_SW3, | ||
449 | DA850_EVM_BB_EXP_USER_SW4, | ||
450 | DA850_EVM_BB_EXP_USER_SW5, | ||
451 | DA850_EVM_BB_EXP_USER_SW6, | ||
452 | DA850_EVM_BB_EXP_USER_SW7, | ||
453 | DA850_EVM_BB_EXP_USER_SW8 | ||
454 | }; | ||
455 | |||
456 | static const char const *da850_evm_bb_exp[] = { | ||
457 | [DA850_EVM_BB_EXP_DEEP_SLEEP_EN] = "deep_sleep_en", | ||
458 | [DA850_EVM_BB_EXP_SW_RST] = "sw_rst", | ||
459 | [DA850_EVM_BB_EXP_TP_23] = "tp_23", | ||
460 | [DA850_EVM_BB_EXP_TP_22] = "tp_22", | ||
461 | [DA850_EVM_BB_EXP_TP_21] = "tp_21", | ||
462 | [DA850_EVM_BB_EXP_USER_PB1] = "user_pb1", | ||
463 | [DA850_EVM_BB_EXP_USER_LED2] = "user_led2", | ||
464 | [DA850_EVM_BB_EXP_USER_LED1] = "user_led1", | ||
465 | [DA850_EVM_BB_EXP_USER_SW1] = "user_sw1", | ||
466 | [DA850_EVM_BB_EXP_USER_SW2] = "user_sw2", | ||
467 | [DA850_EVM_BB_EXP_USER_SW3] = "user_sw3", | ||
468 | [DA850_EVM_BB_EXP_USER_SW4] = "user_sw4", | ||
469 | [DA850_EVM_BB_EXP_USER_SW5] = "user_sw5", | ||
470 | [DA850_EVM_BB_EXP_USER_SW6] = "user_sw6", | ||
471 | [DA850_EVM_BB_EXP_USER_SW7] = "user_sw7", | ||
472 | [DA850_EVM_BB_EXP_USER_SW8] = "user_sw8", | ||
473 | }; | ||
474 | |||
475 | #define DA850_N_BB_USER_SW 8 | ||
476 | |||
477 | static struct gpio_keys_button da850_evm_bb_keys[] = { | ||
478 | [0] = { | ||
479 | .type = EV_KEY, | ||
480 | .active_low = 1, | ||
481 | .wakeup = 0, | ||
482 | .debounce_interval = DA850_KEYS_DEBOUNCE_MS, | ||
483 | .code = KEY_PROG1, | ||
484 | .desc = NULL, /* assigned at runtime */ | ||
485 | .gpio = -1, /* assigned at runtime */ | ||
486 | }, | ||
487 | [1 ... DA850_N_BB_USER_SW] = { | ||
488 | .type = EV_SW, | ||
489 | .active_low = 1, | ||
490 | .wakeup = 0, | ||
491 | .debounce_interval = DA850_KEYS_DEBOUNCE_MS, | ||
492 | .code = -1, /* assigned at runtime */ | ||
493 | .desc = NULL, /* assigned at runtime */ | ||
494 | .gpio = -1, /* assigned at runtime */ | ||
495 | }, | ||
496 | }; | ||
497 | |||
498 | static struct gpio_keys_platform_data da850_evm_bb_keys_pdata = { | ||
499 | .buttons = da850_evm_bb_keys, | ||
500 | .nbuttons = ARRAY_SIZE(da850_evm_bb_keys), | ||
501 | .poll_interval = DA850_GPIO_KEYS_POLL_MS, | ||
502 | }; | ||
503 | |||
504 | static struct platform_device da850_evm_bb_keys_device = { | ||
505 | .name = "gpio-keys-polled", | ||
506 | .id = 1, | ||
507 | .dev = { | ||
508 | .platform_data = &da850_evm_bb_keys_pdata | ||
509 | }, | ||
510 | }; | ||
511 | |||
512 | static void da850_evm_bb_keys_init(unsigned gpio) | ||
513 | { | ||
514 | int i; | ||
515 | struct gpio_keys_button *button; | ||
516 | |||
517 | button = &da850_evm_bb_keys[0]; | ||
518 | button->desc = (char *) | ||
519 | da850_evm_bb_exp[DA850_EVM_BB_EXP_USER_PB1]; | ||
520 | button->gpio = gpio + DA850_EVM_BB_EXP_USER_PB1; | ||
521 | |||
522 | for (i = 0; i < DA850_N_BB_USER_SW; i++) { | ||
523 | button = &da850_evm_bb_keys[i + 1]; | ||
524 | button->code = SW_LID + i; | ||
525 | button->desc = (char *) | ||
526 | da850_evm_bb_exp[DA850_EVM_BB_EXP_USER_SW1 + i]; | ||
527 | button->gpio = gpio + DA850_EVM_BB_EXP_USER_SW1 + i; | ||
528 | } | ||
529 | } | ||
331 | 530 | ||
332 | gpio_free(gpio + 5); | 531 | #define DA850_N_BB_USER_LED 2 |
333 | gpio_free(gpio + 6); | 532 | |
334 | gpio_free(gpio + 7); | 533 | static struct gpio_led da850_evm_bb_leds[] = { |
534 | [0 ... DA850_N_BB_USER_LED - 1] = { | ||
535 | .active_low = 1, | ||
536 | .gpio = -1, /* assigned at runtime */ | ||
537 | .name = NULL, /* assigned at runtime */ | ||
538 | }, | ||
539 | }; | ||
540 | |||
541 | static struct gpio_led_platform_data da850_evm_bb_leds_pdata = { | ||
542 | .leds = da850_evm_bb_leds, | ||
543 | .num_leds = ARRAY_SIZE(da850_evm_bb_leds), | ||
544 | }; | ||
545 | |||
546 | static struct platform_device da850_evm_bb_leds_device = { | ||
547 | .name = "leds-gpio", | ||
548 | .id = -1, | ||
549 | .dev = { | ||
550 | .platform_data = &da850_evm_bb_leds_pdata | ||
551 | } | ||
552 | }; | ||
553 | |||
554 | static void da850_evm_bb_leds_init(unsigned gpio) | ||
555 | { | ||
556 | int i; | ||
557 | struct gpio_led *led; | ||
558 | |||
559 | for (i = 0; i < DA850_N_BB_USER_LED; i++) { | ||
560 | led = &da850_evm_bb_leds[i]; | ||
561 | |||
562 | led->gpio = gpio + DA850_EVM_BB_EXP_USER_LED2 + i; | ||
563 | led->name = | ||
564 | da850_evm_bb_exp[DA850_EVM_BB_EXP_USER_LED2 + i]; | ||
565 | } | ||
566 | } | ||
567 | |||
568 | static int da850_evm_bb_expander_setup(struct i2c_client *client, | ||
569 | unsigned gpio, unsigned ngpio, | ||
570 | void *c) | ||
571 | { | ||
572 | int ret; | ||
573 | |||
574 | /* | ||
575 | * Register the switches and pushbutton on the baseboard as a gpio-keys | ||
576 | * device. | ||
577 | */ | ||
578 | da850_evm_bb_keys_init(gpio); | ||
579 | ret = platform_device_register(&da850_evm_bb_keys_device); | ||
580 | if (ret) { | ||
581 | pr_warning("Could not register baseboard GPIO expander keys"); | ||
582 | goto io_exp_setup_sw_fail; | ||
583 | } | ||
584 | |||
585 | da850_evm_bb_leds_init(gpio); | ||
586 | ret = platform_device_register(&da850_evm_bb_leds_device); | ||
587 | if (ret) { | ||
588 | pr_warning("Could not register baseboard GPIO expander LEDS"); | ||
589 | goto io_exp_setup_leds_fail; | ||
590 | } | ||
591 | |||
592 | return 0; | ||
593 | |||
594 | io_exp_setup_leds_fail: | ||
595 | platform_device_unregister(&da850_evm_bb_keys_device); | ||
596 | io_exp_setup_sw_fail: | ||
597 | return ret; | ||
598 | } | ||
599 | |||
600 | static int da850_evm_bb_expander_teardown(struct i2c_client *client, | ||
601 | unsigned gpio, unsigned ngpio, void *c) | ||
602 | { | ||
603 | platform_device_unregister(&da850_evm_bb_leds_device); | ||
604 | platform_device_unregister(&da850_evm_bb_keys_device); | ||
335 | 605 | ||
336 | return 0; | 606 | return 0; |
337 | } | 607 | } |
@@ -340,6 +610,14 @@ static struct pca953x_platform_data da850_evm_ui_expander_info = { | |||
340 | .gpio_base = DAVINCI_N_GPIO, | 610 | .gpio_base = DAVINCI_N_GPIO, |
341 | .setup = da850_evm_ui_expander_setup, | 611 | .setup = da850_evm_ui_expander_setup, |
342 | .teardown = da850_evm_ui_expander_teardown, | 612 | .teardown = da850_evm_ui_expander_teardown, |
613 | .names = da850_evm_ui_exp, | ||
614 | }; | ||
615 | |||
616 | static struct pca953x_platform_data da850_evm_bb_expander_info = { | ||
617 | .gpio_base = DA850_BB_EXPANDER_GPIO_BASE, | ||
618 | .setup = da850_evm_bb_expander_setup, | ||
619 | .teardown = da850_evm_bb_expander_teardown, | ||
620 | .names = da850_evm_bb_exp, | ||
343 | }; | 621 | }; |
344 | 622 | ||
345 | static struct i2c_board_info __initdata da850_evm_i2c_devices[] = { | 623 | static struct i2c_board_info __initdata da850_evm_i2c_devices[] = { |
@@ -350,6 +628,10 @@ static struct i2c_board_info __initdata da850_evm_i2c_devices[] = { | |||
350 | I2C_BOARD_INFO("tca6416", 0x20), | 628 | I2C_BOARD_INFO("tca6416", 0x20), |
351 | .platform_data = &da850_evm_ui_expander_info, | 629 | .platform_data = &da850_evm_ui_expander_info, |
352 | }, | 630 | }, |
631 | { | ||
632 | I2C_BOARD_INFO("tca6416", 0x21), | ||
633 | .platform_data = &da850_evm_bb_expander_info, | ||
634 | }, | ||
353 | }; | 635 | }; |
354 | 636 | ||
355 | static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { | 637 | static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { |
@@ -540,7 +822,7 @@ static struct regulator_init_data tps65070_regulator_data[] = { | |||
540 | { | 822 | { |
541 | .constraints = { | 823 | .constraints = { |
542 | .min_uV = 950000, | 824 | .min_uV = 950000, |
543 | .max_uV = 1320000, | 825 | .max_uV = 1350000, |
544 | .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | | 826 | .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE | |
545 | REGULATOR_CHANGE_STATUS), | 827 | REGULATOR_CHANGE_STATUS), |
546 | .boot_on = 1, | 828 | .boot_on = 1, |
@@ -591,7 +873,7 @@ static struct tps6507x_board tps_board = { | |||
591 | .tps6507x_ts_init_data = &tps6507x_touchscreen_data, | 873 | .tps6507x_ts_init_data = &tps6507x_touchscreen_data, |
592 | }; | 874 | }; |
593 | 875 | ||
594 | static struct i2c_board_info __initdata da850evm_tps65070_info[] = { | 876 | static struct i2c_board_info __initdata da850_evm_tps65070_info[] = { |
595 | { | 877 | { |
596 | I2C_BOARD_INFO("tps6507x", 0x48), | 878 | I2C_BOARD_INFO("tps6507x", 0x48), |
597 | .platform_data = &tps_board, | 879 | .platform_data = &tps_board, |
@@ -600,8 +882,8 @@ static struct i2c_board_info __initdata da850evm_tps65070_info[] = { | |||
600 | 882 | ||
601 | static int __init pmic_tps65070_init(void) | 883 | static int __init pmic_tps65070_init(void) |
602 | { | 884 | { |
603 | return i2c_register_board_info(1, da850evm_tps65070_info, | 885 | return i2c_register_board_info(1, da850_evm_tps65070_info, |
604 | ARRAY_SIZE(da850evm_tps65070_info)); | 886 | ARRAY_SIZE(da850_evm_tps65070_info)); |
605 | } | 887 | } |
606 | 888 | ||
607 | static const short da850_evm_lcdc_pins[] = { | 889 | static const short da850_evm_lcdc_pins[] = { |
@@ -736,6 +1018,27 @@ static struct edma_rsv_info *da850_edma_rsv[2] = { | |||
736 | &da850_edma_cc1_rsv, | 1018 | &da850_edma_cc1_rsv, |
737 | }; | 1019 | }; |
738 | 1020 | ||
1021 | #ifdef CONFIG_CPU_FREQ | ||
1022 | static __init int da850_evm_init_cpufreq(void) | ||
1023 | { | ||
1024 | switch (system_rev & 0xF) { | ||
1025 | case 3: | ||
1026 | da850_max_speed = 456000; | ||
1027 | break; | ||
1028 | case 2: | ||
1029 | da850_max_speed = 408000; | ||
1030 | break; | ||
1031 | case 1: | ||
1032 | da850_max_speed = 372000; | ||
1033 | break; | ||
1034 | } | ||
1035 | |||
1036 | return da850_register_cpufreq("pll0_sysclk3"); | ||
1037 | } | ||
1038 | #else | ||
1039 | static __init int da850_evm_init_cpufreq(void) { return 0; } | ||
1040 | #endif | ||
1041 | |||
739 | static __init void da850_evm_init(void) | 1042 | static __init void da850_evm_init(void) |
740 | { | 1043 | { |
741 | int ret; | 1044 | int ret; |
@@ -836,7 +1139,7 @@ static __init void da850_evm_init(void) | |||
836 | if (ret) | 1139 | if (ret) |
837 | pr_warning("da850_evm_init: rtc setup failed: %d\n", ret); | 1140 | pr_warning("da850_evm_init: rtc setup failed: %d\n", ret); |
838 | 1141 | ||
839 | ret = da850_register_cpufreq("pll0_sysclk3"); | 1142 | ret = da850_evm_init_cpufreq(); |
840 | if (ret) | 1143 | if (ret) |
841 | pr_warning("da850_evm_init: cpufreq registration failed: %d\n", | 1144 | pr_warning("da850_evm_init: cpufreq registration failed: %d\n", |
842 | ret); | 1145 | ret); |
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index 01ba080433db..e4e3af179f02 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c | |||
@@ -336,7 +336,7 @@ int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate) | |||
336 | ratio--; | 336 | ratio--; |
337 | } | 337 | } |
338 | 338 | ||
339 | if (ratio > PLLDIV_RATIO_MASK) | 339 | if (ratio > pll->div_ratio_mask) |
340 | return -EINVAL; | 340 | return -EINVAL; |
341 | 341 | ||
342 | do { | 342 | do { |
@@ -344,7 +344,7 @@ int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate) | |||
344 | } while (v & PLLSTAT_GOSTAT); | 344 | } while (v & PLLSTAT_GOSTAT); |
345 | 345 | ||
346 | v = __raw_readl(pll->base + clk->div_reg); | 346 | v = __raw_readl(pll->base + clk->div_reg); |
347 | v &= ~PLLDIV_RATIO_MASK; | 347 | v &= ~pll->div_ratio_mask; |
348 | v |= ratio | PLLDIV_EN; | 348 | v |= ratio | PLLDIV_EN; |
349 | __raw_writel(v, pll->base + clk->div_reg); | 349 | __raw_writel(v, pll->base + clk->div_reg); |
350 | 350 | ||
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index 11099980b58b..0dd22031ec62 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h | |||
@@ -68,7 +68,7 @@ | |||
68 | #ifndef __ASSEMBLER__ | 68 | #ifndef __ASSEMBLER__ |
69 | 69 | ||
70 | #include <linux/list.h> | 70 | #include <linux/list.h> |
71 | #include <asm/clkdev.h> | 71 | #include <linux/clkdev.h> |
72 | 72 | ||
73 | #define PLLSTAT_GOSTAT BIT(0) | 73 | #define PLLSTAT_GOSTAT BIT(0) |
74 | #define PLLCMD_GOSET BIT(0) | 74 | #define PLLCMD_GOSET BIT(0) |
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 63916b902760..78b5ae29ae40 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c | |||
@@ -830,8 +830,7 @@ static void da850_set_async3_src(int pllnum) | |||
830 | * According to the TRM, minimum PLLM results in maximum power savings. | 830 | * According to the TRM, minimum PLLM results in maximum power savings. |
831 | * The OPP definitions below should keep the PLLM as low as possible. | 831 | * The OPP definitions below should keep the PLLM as low as possible. |
832 | * | 832 | * |
833 | * The output of the PLLM must be between 400 to 600 MHz. | 833 | * The output of the PLLM must be between 300 to 600 MHz. |
834 | * This rules out prediv of anything but divide-by-one for 24Mhz OSC input. | ||
835 | */ | 834 | */ |
836 | struct da850_opp { | 835 | struct da850_opp { |
837 | unsigned int freq; /* in KHz */ | 836 | unsigned int freq; /* in KHz */ |
@@ -842,6 +841,33 @@ struct da850_opp { | |||
842 | unsigned int cvdd_max; /* in uV */ | 841 | unsigned int cvdd_max; /* in uV */ |
843 | }; | 842 | }; |
844 | 843 | ||
844 | static const struct da850_opp da850_opp_456 = { | ||
845 | .freq = 456000, | ||
846 | .prediv = 1, | ||
847 | .mult = 19, | ||
848 | .postdiv = 1, | ||
849 | .cvdd_min = 1300000, | ||
850 | .cvdd_max = 1350000, | ||
851 | }; | ||
852 | |||
853 | static const struct da850_opp da850_opp_408 = { | ||
854 | .freq = 408000, | ||
855 | .prediv = 1, | ||
856 | .mult = 17, | ||
857 | .postdiv = 1, | ||
858 | .cvdd_min = 1300000, | ||
859 | .cvdd_max = 1350000, | ||
860 | }; | ||
861 | |||
862 | static const struct da850_opp da850_opp_372 = { | ||
863 | .freq = 372000, | ||
864 | .prediv = 2, | ||
865 | .mult = 31, | ||
866 | .postdiv = 1, | ||
867 | .cvdd_min = 1200000, | ||
868 | .cvdd_max = 1320000, | ||
869 | }; | ||
870 | |||
845 | static const struct da850_opp da850_opp_300 = { | 871 | static const struct da850_opp da850_opp_300 = { |
846 | .freq = 300000, | 872 | .freq = 300000, |
847 | .prediv = 1, | 873 | .prediv = 1, |
@@ -876,6 +902,9 @@ static const struct da850_opp da850_opp_96 = { | |||
876 | } | 902 | } |
877 | 903 | ||
878 | static struct cpufreq_frequency_table da850_freq_table[] = { | 904 | static struct cpufreq_frequency_table da850_freq_table[] = { |
905 | OPP(456), | ||
906 | OPP(408), | ||
907 | OPP(372), | ||
879 | OPP(300), | 908 | OPP(300), |
880 | OPP(200), | 909 | OPP(200), |
881 | OPP(96), | 910 | OPP(96), |
@@ -886,6 +915,19 @@ static struct cpufreq_frequency_table da850_freq_table[] = { | |||
886 | }; | 915 | }; |
887 | 916 | ||
888 | #ifdef CONFIG_REGULATOR | 917 | #ifdef CONFIG_REGULATOR |
918 | static int da850_set_voltage(unsigned int index); | ||
919 | static int da850_regulator_init(void); | ||
920 | #endif | ||
921 | |||
922 | static struct davinci_cpufreq_config cpufreq_info = { | ||
923 | .freq_table = da850_freq_table, | ||
924 | #ifdef CONFIG_REGULATOR | ||
925 | .init = da850_regulator_init, | ||
926 | .set_voltage = da850_set_voltage, | ||
927 | #endif | ||
928 | }; | ||
929 | |||
930 | #ifdef CONFIG_REGULATOR | ||
889 | static struct regulator *cvdd; | 931 | static struct regulator *cvdd; |
890 | 932 | ||
891 | static int da850_set_voltage(unsigned int index) | 933 | static int da850_set_voltage(unsigned int index) |
@@ -895,7 +937,7 @@ static int da850_set_voltage(unsigned int index) | |||
895 | if (!cvdd) | 937 | if (!cvdd) |
896 | return -ENODEV; | 938 | return -ENODEV; |
897 | 939 | ||
898 | opp = (struct da850_opp *) da850_freq_table[index].index; | 940 | opp = (struct da850_opp *) cpufreq_info.freq_table[index].index; |
899 | 941 | ||
900 | return regulator_set_voltage(cvdd, opp->cvdd_min, opp->cvdd_max); | 942 | return regulator_set_voltage(cvdd, opp->cvdd_min, opp->cvdd_max); |
901 | } | 943 | } |
@@ -912,14 +954,6 @@ static int da850_regulator_init(void) | |||
912 | } | 954 | } |
913 | #endif | 955 | #endif |
914 | 956 | ||
915 | static struct davinci_cpufreq_config cpufreq_info = { | ||
916 | .freq_table = &da850_freq_table[0], | ||
917 | #ifdef CONFIG_REGULATOR | ||
918 | .init = da850_regulator_init, | ||
919 | .set_voltage = da850_set_voltage, | ||
920 | #endif | ||
921 | }; | ||
922 | |||
923 | static struct platform_device da850_cpufreq_device = { | 957 | static struct platform_device da850_cpufreq_device = { |
924 | .name = "cpufreq-davinci", | 958 | .name = "cpufreq-davinci", |
925 | .dev = { | 959 | .dev = { |
@@ -928,12 +962,22 @@ static struct platform_device da850_cpufreq_device = { | |||
928 | .id = -1, | 962 | .id = -1, |
929 | }; | 963 | }; |
930 | 964 | ||
965 | unsigned int da850_max_speed = 300000; | ||
966 | |||
931 | int __init da850_register_cpufreq(char *async_clk) | 967 | int __init da850_register_cpufreq(char *async_clk) |
932 | { | 968 | { |
969 | int i; | ||
970 | |||
933 | /* cpufreq driver can help keep an "async" clock constant */ | 971 | /* cpufreq driver can help keep an "async" clock constant */ |
934 | if (async_clk) | 972 | if (async_clk) |
935 | clk_add_alias("async", da850_cpufreq_device.name, | 973 | clk_add_alias("async", da850_cpufreq_device.name, |
936 | async_clk, NULL); | 974 | async_clk, NULL); |
975 | for (i = 0; i < ARRAY_SIZE(da850_freq_table); i++) { | ||
976 | if (da850_freq_table[i].frequency <= da850_max_speed) { | ||
977 | cpufreq_info.freq_table = &da850_freq_table[i]; | ||
978 | break; | ||
979 | } | ||
980 | } | ||
937 | 981 | ||
938 | return platform_device_register(&da850_cpufreq_device); | 982 | return platform_device_register(&da850_cpufreq_device); |
939 | } | 983 | } |
@@ -942,17 +986,18 @@ static int da850_round_armrate(struct clk *clk, unsigned long rate) | |||
942 | { | 986 | { |
943 | int i, ret = 0, diff; | 987 | int i, ret = 0, diff; |
944 | unsigned int best = (unsigned int) -1; | 988 | unsigned int best = (unsigned int) -1; |
989 | struct cpufreq_frequency_table *table = cpufreq_info.freq_table; | ||
945 | 990 | ||
946 | rate /= 1000; /* convert to kHz */ | 991 | rate /= 1000; /* convert to kHz */ |
947 | 992 | ||
948 | for (i = 0; da850_freq_table[i].frequency != CPUFREQ_TABLE_END; i++) { | 993 | for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) { |
949 | diff = da850_freq_table[i].frequency - rate; | 994 | diff = table[i].frequency - rate; |
950 | if (diff < 0) | 995 | if (diff < 0) |
951 | diff = -diff; | 996 | diff = -diff; |
952 | 997 | ||
953 | if (diff < best) { | 998 | if (diff < best) { |
954 | best = diff; | 999 | best = diff; |
955 | ret = da850_freq_table[i].frequency; | 1000 | ret = table[i].frequency; |
956 | } | 1001 | } |
957 | } | 1002 | } |
958 | 1003 | ||
@@ -973,7 +1018,7 @@ static int da850_set_pll0rate(struct clk *clk, unsigned long index) | |||
973 | struct pll_data *pll = clk->pll_data; | 1018 | struct pll_data *pll = clk->pll_data; |
974 | int ret; | 1019 | int ret; |
975 | 1020 | ||
976 | opp = (struct da850_opp *) da850_freq_table[index].index; | 1021 | opp = (struct da850_opp *) cpufreq_info.freq_table[index].index; |
977 | prediv = opp->prediv; | 1022 | prediv = opp->prediv; |
978 | mult = opp->mult; | 1023 | mult = opp->mult; |
979 | postdiv = opp->postdiv; | 1024 | postdiv = opp->postdiv; |
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c index c9a86d8130d1..85503debda51 100644 --- a/arch/arm/mach-davinci/devices-tnetv107x.c +++ b/arch/arm/mach-davinci/devices-tnetv107x.c | |||
@@ -344,7 +344,20 @@ static struct platform_device tsc_device = { | |||
344 | 344 | ||
345 | void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) | 345 | void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) |
346 | { | 346 | { |
347 | int i; | 347 | int i, error; |
348 | struct clk *tsc_clk; | ||
349 | |||
350 | /* | ||
351 | * The reset defaults for tnetv107x tsc clock divider is set too high. | ||
352 | * This forces the clock down to a range that allows the ADC to | ||
353 | * complete sample conversion in time. | ||
354 | */ | ||
355 | tsc_clk = clk_get(NULL, "sys_tsc_clk"); | ||
356 | if (tsc_clk) { | ||
357 | error = clk_set_rate(tsc_clk, 5000000); | ||
358 | WARN_ON(error < 0); | ||
359 | clk_put(tsc_clk); | ||
360 | } | ||
348 | 361 | ||
349 | platform_device_register(&edma_device); | 362 | platform_device_register(&edma_device); |
350 | platform_device_register(&tnetv107x_wdt_device); | 363 | platform_device_register(&tnetv107x_wdt_device); |
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index 4247b3f53b33..e7f952066527 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h | |||
@@ -28,6 +28,13 @@ extern void __iomem *da8xx_syscfg0_base; | |||
28 | extern void __iomem *da8xx_syscfg1_base; | 28 | extern void __iomem *da8xx_syscfg1_base; |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * If the DA850/OMAP-L138/AM18x SoC on board is of a higher speed grade | ||
32 | * (than the regular 300Mhz variant), the board code should set this up | ||
33 | * with the supported speed before calling da850_register_cpufreq(). | ||
34 | */ | ||
35 | extern unsigned int da850_max_speed; | ||
36 | |||
37 | /* | ||
31 | * The cp_intc interrupt controller for the da8xx isn't in the same | 38 | * The cp_intc interrupt controller for the da8xx isn't in the same |
32 | * chunk of physical memory space as the other registers (like it is | 39 | * chunk of physical memory space as the other registers (like it is |
33 | * on the davincis) so it needs to be mapped separately. It will be | 40 | * on the davincis) so it needs to be mapped separately. It will be |
diff --git a/arch/arm/mach-davinci/include/mach/io.h b/arch/arm/mach-davinci/include/mach/io.h index 62b0a90309ad..d1b954955c12 100644 --- a/arch/arm/mach-davinci/include/mach/io.h +++ b/arch/arm/mach-davinci/include/mach/io.h | |||
@@ -22,8 +22,8 @@ | |||
22 | #define __mem_isa(a) (a) | 22 | #define __mem_isa(a) (a) |
23 | 23 | ||
24 | #ifndef __ASSEMBLER__ | 24 | #ifndef __ASSEMBLER__ |
25 | #define __arch_ioremap(p, s, t) davinci_ioremap(p, s, t) | 25 | #define __arch_ioremap davinci_ioremap |
26 | #define __arch_iounmap(v) davinci_iounmap(v) | 26 | #define __arch_iounmap davinci_iounmap |
27 | 27 | ||
28 | void __iomem *davinci_ioremap(unsigned long phys, size_t size, | 28 | void __iomem *davinci_ioremap(unsigned long phys, size_t size, |
29 | unsigned int type); | 29 | unsigned int type); |
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index 1b15dbd0a77b..a41580400701 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c | |||
@@ -83,21 +83,16 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
83 | pdctl1 = __raw_readl(psc_base + PDCTL1); | 83 | pdctl1 = __raw_readl(psc_base + PDCTL1); |
84 | pdctl1 |= 0x100; | 84 | pdctl1 |= 0x100; |
85 | __raw_writel(pdctl1, psc_base + PDCTL1); | 85 | __raw_writel(pdctl1, psc_base + PDCTL1); |
86 | |||
87 | do { | ||
88 | ptstat = __raw_readl(psc_base + | ||
89 | PTSTAT); | ||
90 | } while (!(((ptstat >> domain) & 1) == 0)); | ||
91 | } else { | 86 | } else { |
92 | ptcmd = 1 << domain; | 87 | ptcmd = 1 << domain; |
93 | __raw_writel(ptcmd, psc_base + PTCMD); | 88 | __raw_writel(ptcmd, psc_base + PTCMD); |
94 | |||
95 | do { | ||
96 | ptstat = __raw_readl(psc_base + PTSTAT); | ||
97 | } while (!(((ptstat >> domain) & 1) == 0)); | ||
98 | } | 89 | } |
99 | 90 | ||
100 | do { | 91 | do { |
92 | ptstat = __raw_readl(psc_base + PTSTAT); | ||
93 | } while (!(((ptstat >> domain) & 1) == 0)); | ||
94 | |||
95 | do { | ||
101 | mdstat = __raw_readl(psc_base + MDSTAT + 4 * id); | 96 | mdstat = __raw_readl(psc_base + MDSTAT + 4 * id); |
102 | } while (!((mdstat & MDSTAT_STATE_MASK) == next_state)); | 97 | } while (!((mdstat & MDSTAT_STATE_MASK) == next_state)); |
103 | 98 | ||
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 0f21c36e65dd..e1969ce904dc 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c | |||
@@ -272,15 +272,35 @@ static cycle_t read_cycles(struct clocksource *cs) | |||
272 | return (cycles_t)timer32_read(t); | 272 | return (cycles_t)timer32_read(t); |
273 | } | 273 | } |
274 | 274 | ||
275 | /* | ||
276 | * Kernel assumes that sched_clock can be called early but may not have | ||
277 | * things ready yet. | ||
278 | */ | ||
279 | static cycle_t read_dummy(struct clocksource *cs) | ||
280 | { | ||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | |||
275 | static struct clocksource clocksource_davinci = { | 285 | static struct clocksource clocksource_davinci = { |
276 | .rating = 300, | 286 | .rating = 300, |
277 | .read = read_cycles, | 287 | .read = read_dummy, |
278 | .mask = CLOCKSOURCE_MASK(32), | 288 | .mask = CLOCKSOURCE_MASK(32), |
279 | .shift = 24, | ||
280 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 289 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
281 | }; | 290 | }; |
282 | 291 | ||
283 | /* | 292 | /* |
293 | * Overwrite weak default sched_clock with something more precise | ||
294 | */ | ||
295 | unsigned long long notrace sched_clock(void) | ||
296 | { | ||
297 | const cycle_t cyc = clocksource_davinci.read(&clocksource_davinci); | ||
298 | |||
299 | return clocksource_cyc2ns(cyc, clocksource_davinci.mult, | ||
300 | clocksource_davinci.shift); | ||
301 | } | ||
302 | |||
303 | /* | ||
284 | * clockevent | 304 | * clockevent |
285 | */ | 305 | */ |
286 | static int davinci_set_next_event(unsigned long cycles, | 306 | static int davinci_set_next_event(unsigned long cycles, |
@@ -377,11 +397,10 @@ static void __init davinci_timer_init(void) | |||
377 | davinci_clock_tick_rate = clk_get_rate(timer_clk); | 397 | davinci_clock_tick_rate = clk_get_rate(timer_clk); |
378 | 398 | ||
379 | /* setup clocksource */ | 399 | /* setup clocksource */ |
400 | clocksource_davinci.read = read_cycles; | ||
380 | clocksource_davinci.name = id_to_name[clocksource_id]; | 401 | clocksource_davinci.name = id_to_name[clocksource_id]; |
381 | clocksource_davinci.mult = | 402 | if (clocksource_register_hz(&clocksource_davinci, |
382 | clocksource_khz2mult(davinci_clock_tick_rate/1000, | 403 | davinci_clock_tick_rate)) |
383 | clocksource_davinci.shift); | ||
384 | if (clocksource_register(&clocksource_davinci)) | ||
385 | printk(err, clocksource_davinci.name); | 404 | printk(err, clocksource_davinci.name); |
386 | 405 | ||
387 | /* setup clockevent */ | 406 | /* setup clockevent */ |
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c index daeae06430b9..6fcdecec8d8c 100644 --- a/arch/arm/mach-davinci/tnetv107x.c +++ b/arch/arm/mach-davinci/tnetv107x.c | |||
@@ -131,12 +131,13 @@ define_pll_clk(tdm, 1, 0x0ff, 0x200); | |||
131 | define_pll_clk(eth, 2, 0x0ff, 0x400); | 131 | define_pll_clk(eth, 2, 0x0ff, 0x400); |
132 | 132 | ||
133 | /* Level 2 - divided outputs from the PLLs */ | 133 | /* Level 2 - divided outputs from the PLLs */ |
134 | #define define_pll_div_clk(pll, cname, div) \ | 134 | #define define_pll_div_clk(pll, cname, div) \ |
135 | static struct clk pll##_##cname##_clk = { \ | 135 | static struct clk pll##_##cname##_clk = { \ |
136 | .name = #pll "_" #cname "_clk",\ | 136 | .name = #pll "_" #cname "_clk", \ |
137 | .parent = &pll_##pll##_clk, \ | 137 | .parent = &pll_##pll##_clk, \ |
138 | .flags = CLK_PLL, \ | 138 | .flags = CLK_PLL, \ |
139 | .div_reg = PLLDIV##div, \ | 139 | .div_reg = PLLDIV##div, \ |
140 | .set_rate = davinci_set_sysclk_rate, \ | ||
140 | } | 141 | } |
141 | 142 | ||
142 | define_pll_div_clk(sys, arm1176, 1); | 143 | define_pll_div_clk(sys, arm1176, 1); |
@@ -192,6 +193,7 @@ lpsc_clk_enabled(system, sys_half_clk, SYSTEM); | |||
192 | lpsc_clk_enabled(ddr2_vrst, sys_ddr_clk, DDR2_EMIF1_VRST); | 193 | lpsc_clk_enabled(ddr2_vrst, sys_ddr_clk, DDR2_EMIF1_VRST); |
193 | lpsc_clk_enabled(ddr2_vctl_rst, sys_ddr_clk, DDR2_EMIF2_VCTL_RST); | 194 | lpsc_clk_enabled(ddr2_vctl_rst, sys_ddr_clk, DDR2_EMIF2_VCTL_RST); |
194 | lpsc_clk_enabled(wdt_arm, sys_half_clk, WDT_ARM); | 195 | lpsc_clk_enabled(wdt_arm, sys_half_clk, WDT_ARM); |
196 | lpsc_clk_enabled(timer1, sys_half_clk, TIMER1); | ||
195 | 197 | ||
196 | lpsc_clk(mbx_lite, sys_arm1176_clk, MBX_LITE); | 198 | lpsc_clk(mbx_lite, sys_arm1176_clk, MBX_LITE); |
197 | lpsc_clk(ethss, eth_125mhz_clk, ETHSS); | 199 | lpsc_clk(ethss, eth_125mhz_clk, ETHSS); |
@@ -205,16 +207,15 @@ lpsc_clk(mdio, sys_half_clk, MDIO); | |||
205 | lpsc_clk(sdio0, sys_half_clk, SDIO0); | 207 | lpsc_clk(sdio0, sys_half_clk, SDIO0); |
206 | lpsc_clk(sdio1, sys_half_clk, SDIO1); | 208 | lpsc_clk(sdio1, sys_half_clk, SDIO1); |
207 | lpsc_clk(timer0, sys_half_clk, TIMER0); | 209 | lpsc_clk(timer0, sys_half_clk, TIMER0); |
208 | lpsc_clk(timer1, sys_half_clk, TIMER1); | ||
209 | lpsc_clk(wdt_dsp, sys_half_clk, WDT_DSP); | 210 | lpsc_clk(wdt_dsp, sys_half_clk, WDT_DSP); |
210 | lpsc_clk(ssp, sys_half_clk, SSP); | 211 | lpsc_clk(ssp, sys_half_clk, SSP); |
211 | lpsc_clk(tdm0, tdm_0_clk, TDM0); | 212 | lpsc_clk(tdm0, tdm_0_clk, TDM0); |
212 | lpsc_clk(tdm1, tdm_1_clk, TDM1); | 213 | lpsc_clk(tdm1, tdm_1_clk, TDM1); |
213 | lpsc_clk(vlynq, sys_vlynq_ref_clk, VLYNQ); | 214 | lpsc_clk(vlynq, sys_vlynq_ref_clk, VLYNQ); |
214 | lpsc_clk(mcdma, sys_half_clk, MCDMA); | 215 | lpsc_clk(mcdma, sys_half_clk, MCDMA); |
215 | lpsc_clk(usb0, sys_half_clk, USB0); | ||
216 | lpsc_clk(usb1, sys_half_clk, USB1); | ||
217 | lpsc_clk(usbss, sys_half_clk, USBSS); | 216 | lpsc_clk(usbss, sys_half_clk, USBSS); |
217 | lpsc_clk(usb0, clk_usbss, USB0); | ||
218 | lpsc_clk(usb1, clk_usbss, USB1); | ||
218 | lpsc_clk(ethss_rgmii, eth_250mhz_clk, ETHSS_RGMII); | 219 | lpsc_clk(ethss_rgmii, eth_250mhz_clk, ETHSS_RGMII); |
219 | lpsc_clk(imcop, sys_dsp_clk, IMCOP); | 220 | lpsc_clk(imcop, sys_dsp_clk, IMCOP); |
220 | lpsc_clk(spare, sys_half_clk, SPARE); | 221 | lpsc_clk(spare, sys_half_clk, SPARE); |
@@ -281,7 +282,9 @@ static struct clk_lookup clks[] = { | |||
281 | CLK(NULL, "clk_tdm0", &clk_tdm0), | 282 | CLK(NULL, "clk_tdm0", &clk_tdm0), |
282 | CLK(NULL, "clk_vlynq", &clk_vlynq), | 283 | CLK(NULL, "clk_vlynq", &clk_vlynq), |
283 | CLK(NULL, "clk_mcdma", &clk_mcdma), | 284 | CLK(NULL, "clk_mcdma", &clk_mcdma), |
285 | CLK(NULL, "clk_usbss", &clk_usbss), | ||
284 | CLK(NULL, "clk_usb0", &clk_usb0), | 286 | CLK(NULL, "clk_usb0", &clk_usb0), |
287 | CLK(NULL, "clk_usb1", &clk_usb1), | ||
285 | CLK(NULL, "clk_tdm1", &clk_tdm1), | 288 | CLK(NULL, "clk_tdm1", &clk_tdm1), |
286 | CLK(NULL, "clk_debugss", &clk_debugss), | 289 | CLK(NULL, "clk_debugss", &clk_debugss), |
287 | CLK(NULL, "clk_ethss_rgmii", &clk_ethss_rgmii), | 290 | CLK(NULL, "clk_ethss_rgmii", &clk_ethss_rgmii), |
@@ -289,8 +292,6 @@ static struct clk_lookup clks[] = { | |||
289 | CLK(NULL, "clk_imcop", &clk_imcop), | 292 | CLK(NULL, "clk_imcop", &clk_imcop), |
290 | CLK(NULL, "clk_spare", &clk_spare), | 293 | CLK(NULL, "clk_spare", &clk_spare), |
291 | CLK("davinci_mmc.1", NULL, &clk_sdio1), | 294 | CLK("davinci_mmc.1", NULL, &clk_sdio1), |
292 | CLK(NULL, "clk_usb1", &clk_usb1), | ||
293 | CLK(NULL, "clk_usbss", &clk_usbss), | ||
294 | CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst), | 295 | CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst), |
295 | CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst), | 296 | CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst), |
296 | CLK(NULL, NULL, NULL), | 297 | CLK(NULL, NULL, NULL), |
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig index 3b9a32ace909..a4ed3900912a 100644 --- a/arch/arm/mach-dove/Kconfig +++ b/arch/arm/mach-dove/Kconfig | |||
@@ -9,6 +9,12 @@ config MACH_DOVE_DB | |||
9 | Say 'Y' here if you want your kernel to support the | 9 | Say 'Y' here if you want your kernel to support the |
10 | Marvell DB-MV88AP510 Development Board. | 10 | Marvell DB-MV88AP510 Development Board. |
11 | 11 | ||
12 | config MACH_CM_A510 | ||
13 | bool "CompuLab CM-A510 Board" | ||
14 | help | ||
15 | Say 'Y' here if you want your kernel to support the | ||
16 | CompuLab CM-A510 Board. | ||
17 | |||
12 | endmenu | 18 | endmenu |
13 | 19 | ||
14 | endif | 20 | endif |
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile index 7ab3be53f642..fa0f01856060 100644 --- a/arch/arm/mach-dove/Makefile +++ b/arch/arm/mach-dove/Makefile | |||
@@ -1,3 +1,4 @@ | |||
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_DOVE_DB) += dove-db-setup.o | 3 | obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o |
4 | obj-$(CONFIG_MACH_CM_A510) += cm-a510.o | ||
diff --git a/arch/arm/mach-dove/cm-a510.c b/arch/arm/mach-dove/cm-a510.c new file mode 100644 index 000000000000..96e0e94e5fa9 --- /dev/null +++ b/arch/arm/mach-dove/cm-a510.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-dove/cm-a510.c | ||
3 | * | ||
4 | * Copyright (C) 2010 CompuLab, Ltd. | ||
5 | * Konstantin Sinyuk <kostyas@compulab.co.il> | ||
6 | * | ||
7 | * Based on Marvell DB-MV88AP510-BP Development Board Setup | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/ata_platform.h> | ||
18 | #include <linux/mv643xx_eth.h> | ||
19 | #include <linux/spi/spi.h> | ||
20 | #include <linux/spi/flash.h> | ||
21 | |||
22 | #include <asm/mach-types.h> | ||
23 | #include <asm/mach/arch.h> | ||
24 | |||
25 | #include <mach/dove.h> | ||
26 | |||
27 | #include "common.h" | ||
28 | |||
29 | static struct mv643xx_eth_platform_data cm_a510_ge00_data = { | ||
30 | .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT, | ||
31 | }; | ||
32 | |||
33 | static struct mv_sata_platform_data cm_a510_sata_data = { | ||
34 | .n_ports = 1, | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * SPI Devices: | ||
39 | * SPI0: 1M Flash Winbond w25q32bv | ||
40 | */ | ||
41 | static const struct flash_platform_data cm_a510_spi_flash_data = { | ||
42 | .type = "w25q32bv", | ||
43 | }; | ||
44 | |||
45 | static struct spi_board_info __initdata cm_a510_spi_flash_info[] = { | ||
46 | { | ||
47 | .modalias = "m25p80", | ||
48 | .platform_data = &cm_a510_spi_flash_data, | ||
49 | .irq = -1, | ||
50 | .max_speed_hz = 20000000, | ||
51 | .bus_num = 0, | ||
52 | .chip_select = 0, | ||
53 | }, | ||
54 | }; | ||
55 | |||
56 | static int __init cm_a510_pci_init(void) | ||
57 | { | ||
58 | if (machine_is_cm_a510()) | ||
59 | dove_pcie_init(1, 1); | ||
60 | |||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | subsys_initcall(cm_a510_pci_init); | ||
65 | |||
66 | /* Board Init */ | ||
67 | static void __init cm_a510_init(void) | ||
68 | { | ||
69 | /* | ||
70 | * Basic Dove setup. Needs to be called early. | ||
71 | */ | ||
72 | dove_init(); | ||
73 | |||
74 | dove_ge00_init(&cm_a510_ge00_data); | ||
75 | dove_ehci0_init(); | ||
76 | dove_ehci1_init(); | ||
77 | dove_sata_init(&cm_a510_sata_data); | ||
78 | dove_sdio0_init(); | ||
79 | dove_sdio1_init(); | ||
80 | dove_spi0_init(); | ||
81 | dove_spi1_init(); | ||
82 | dove_uart0_init(); | ||
83 | dove_uart1_init(); | ||
84 | dove_i2c_init(); | ||
85 | spi_register_board_info(cm_a510_spi_flash_info, | ||
86 | ARRAY_SIZE(cm_a510_spi_flash_info)); | ||
87 | } | ||
88 | |||
89 | MACHINE_START(CM_A510, "Compulab CM-A510 Board") | ||
90 | .boot_params = 0x00000100, | ||
91 | .init_machine = cm_a510_init, | ||
92 | .map_io = dove_map_io, | ||
93 | .init_irq = dove_init_irq, | ||
94 | .timer = &dove_timer, | ||
95 | MACHINE_END | ||
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h index f6a08397f046..27b414578f2e 100644 --- a/arch/arm/mach-dove/include/mach/dove.h +++ b/arch/arm/mach-dove/include/mach/dove.h | |||
@@ -131,14 +131,21 @@ | |||
131 | #define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014) | 131 | #define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014) |
132 | #define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018) | 132 | #define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018) |
133 | #define DOVE_GPIO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400) | 133 | #define DOVE_GPIO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400) |
134 | #define DOVE_GPIO2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe8400) | ||
134 | #define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c) | 135 | #define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c) |
135 | #define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1) | 136 | #define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1) |
136 | #define DOVE_NAND_GPIO_EN (1 << 0) | 137 | #define DOVE_NAND_GPIO_EN (1 << 0) |
137 | #define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_VIRT_BASE + 0x40) | 138 | #define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_VIRT_BASE + 0x40) |
138 | 139 | #define DOVE_SPI_GPIO_SEL (1 << 5) | |
140 | #define DOVE_UART1_GPIO_SEL (1 << 4) | ||
141 | #define DOVE_AU1_GPIO_SEL (1 << 3) | ||
142 | #define DOVE_CAM_GPIO_SEL (1 << 2) | ||
143 | #define DOVE_SD1_GPIO_SEL (1 << 1) | ||
144 | #define DOVE_SD0_GPIO_SEL (1 << 0) | ||
139 | 145 | ||
140 | /* Power Management */ | 146 | /* Power Management */ |
141 | #define DOVE_PMU_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0000) | 147 | #define DOVE_PMU_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0000) |
148 | #define DOVE_PMU_SIG_CTRL (DOVE_PMU_VIRT_BASE + 0x802c) | ||
142 | 149 | ||
143 | /* Real Time Clock */ | 150 | /* Real Time Clock */ |
144 | #define DOVE_RTC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xd8500) | 151 | #define DOVE_RTC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xd8500) |
diff --git a/arch/arm/mach-dove/include/mach/gpio.h b/arch/arm/mach-dove/include/mach/gpio.h index 0ee70ff39e11..340bb7af529d 100644 --- a/arch/arm/mach-dove/include/mach/gpio.h +++ b/arch/arm/mach-dove/include/mach/gpio.h | |||
@@ -14,12 +14,14 @@ | |||
14 | #include <plat/gpio.h> | 14 | #include <plat/gpio.h> |
15 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | 15 | #include <asm-generic/gpio.h> /* cansleep wrappers */ |
16 | 16 | ||
17 | #define GPIO_MAX 64 | 17 | #define GPIO_MAX 72 |
18 | 18 | ||
19 | #define GPIO_BASE_LO (DOVE_GPIO_VIRT_BASE + 0x00) | 19 | #define GPIO_BASE_LO (DOVE_GPIO_VIRT_BASE + 0x00) |
20 | #define GPIO_BASE_HI (DOVE_GPIO_VIRT_BASE + 0x20) | 20 | #define GPIO_BASE_HI (DOVE_GPIO_VIRT_BASE + 0x20) |
21 | 21 | ||
22 | #define GPIO_BASE(pin) ((pin < 32) ? GPIO_BASE_LO : GPIO_BASE_HI) | 22 | #define GPIO_BASE(pin) ((pin < 32) ? GPIO_BASE_LO : \ |
23 | ((pin < 64) ? GPIO_BASE_HI : \ | ||
24 | DOVE_GPIO2_VIRT_BASE)) | ||
23 | 25 | ||
24 | #define GPIO_OUT(pin) (GPIO_BASE(pin) + 0x00) | 26 | #define GPIO_OUT(pin) (GPIO_BASE(pin) + 0x00) |
25 | #define GPIO_IO_CONF(pin) (GPIO_BASE(pin) + 0x04) | 27 | #define GPIO_IO_CONF(pin) (GPIO_BASE(pin) + 0x04) |
diff --git a/arch/arm/mach-dove/mpp.c b/arch/arm/mach-dove/mpp.c new file mode 100644 index 000000000000..71db2bdf2f28 --- /dev/null +++ b/arch/arm/mach-dove/mpp.c | |||
@@ -0,0 +1,212 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-dove/mpp.c | ||
3 | * | ||
4 | * MPP functions for Marvell Dove 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/gpio.h> | ||
13 | #include <linux/io.h> | ||
14 | |||
15 | #include <mach/dove.h> | ||
16 | |||
17 | #include "mpp.h" | ||
18 | |||
19 | #define MPP_NR_REGS 4 | ||
20 | #define MPP_CTRL(i) ((i) == 3 ? \ | ||
21 | DOVE_MPP_CTRL4_VIRT_BASE : \ | ||
22 | DOVE_MPP_VIRT_BASE + (i) * 4) | ||
23 | #define PMU_SIG_REGS 2 | ||
24 | #define PMU_SIG_CTRL(i) (DOVE_PMU_SIG_CTRL + (i) * 4) | ||
25 | |||
26 | struct dove_mpp_grp { | ||
27 | int start; | ||
28 | int end; | ||
29 | }; | ||
30 | |||
31 | static struct dove_mpp_grp dove_mpp_grp[] = { | ||
32 | [MPP_24_39] = { | ||
33 | .start = 24, | ||
34 | .end = 39, | ||
35 | }, | ||
36 | [MPP_40_45] = { | ||
37 | .start = 40, | ||
38 | .end = 45, | ||
39 | }, | ||
40 | [MPP_46_51] = { | ||
41 | .start = 40, | ||
42 | .end = 45, | ||
43 | }, | ||
44 | [MPP_58_61] = { | ||
45 | .start = 58, | ||
46 | .end = 61, | ||
47 | }, | ||
48 | [MPP_62_63] = { | ||
49 | .start = 62, | ||
50 | .end = 63, | ||
51 | }, | ||
52 | }; | ||
53 | |||
54 | static void dove_mpp_gpio_mode(int start, int end, int gpio_mode) | ||
55 | { | ||
56 | int i; | ||
57 | |||
58 | for (i = start; i <= end; i++) | ||
59 | orion_gpio_set_valid(i, gpio_mode); | ||
60 | } | ||
61 | |||
62 | static void dove_mpp_dump_regs(void) | ||
63 | { | ||
64 | #ifdef DEBUG | ||
65 | int i; | ||
66 | |||
67 | pr_debug("MPP_CTRL regs:"); | ||
68 | for (i = 0; i < MPP_NR_REGS; i++) | ||
69 | printk(" %08x", readl(MPP_CTRL(i))); | ||
70 | printk("\n"); | ||
71 | |||
72 | pr_debug("PMU_SIG_CTRL regs:"); | ||
73 | for (i = 0; i < PMU_SIG_REGS; i++) | ||
74 | printk(" %08x", readl(PMU_SIG_CTRL(i))); | ||
75 | printk("\n"); | ||
76 | |||
77 | pr_debug("PMU_MPP_GENERAL_CTRL: %08x\n", readl(DOVE_PMU_MPP_GENERAL_CTRL)); | ||
78 | pr_debug("MPP_GENERAL: %08x\n", readl(DOVE_MPP_GENERAL_VIRT_BASE)); | ||
79 | #endif | ||
80 | } | ||
81 | |||
82 | static void dove_mpp_cfg_nfc(int sel) | ||
83 | { | ||
84 | u32 mpp_gen_cfg = readl(DOVE_MPP_GENERAL_VIRT_BASE); | ||
85 | |||
86 | mpp_gen_cfg &= ~0x1; | ||
87 | mpp_gen_cfg |= sel; | ||
88 | writel(mpp_gen_cfg, DOVE_MPP_GENERAL_VIRT_BASE); | ||
89 | |||
90 | dove_mpp_gpio_mode(64, 71, GPIO_OUTPUT_OK); | ||
91 | } | ||
92 | |||
93 | static void dove_mpp_cfg_au1(int sel) | ||
94 | { | ||
95 | u32 mpp_ctrl4 = readl(DOVE_MPP_CTRL4_VIRT_BASE); | ||
96 | u32 ssp_ctrl1 = readl(DOVE_SSP_CTRL_STATUS_1); | ||
97 | u32 mpp_gen_ctrl = readl(DOVE_MPP_GENERAL_VIRT_BASE); | ||
98 | u32 global_cfg_2 = readl(DOVE_GLOBAL_CONFIG_2); | ||
99 | |||
100 | mpp_ctrl4 &= ~(DOVE_AU1_GPIO_SEL); | ||
101 | ssp_ctrl1 &= ~(DOVE_SSP_ON_AU1); | ||
102 | mpp_gen_ctrl &= ~(DOVE_AU1_SPDIFO_GPIO_EN); | ||
103 | global_cfg_2 &= ~(DOVE_TWSI_OPTION3_GPIO); | ||
104 | |||
105 | if (!sel || sel == 0x2) | ||
106 | dove_mpp_gpio_mode(52, 57, 0); | ||
107 | else | ||
108 | dove_mpp_gpio_mode(52, 57, GPIO_OUTPUT_OK | GPIO_INPUT_OK); | ||
109 | |||
110 | if (sel & 0x1) { | ||
111 | global_cfg_2 |= DOVE_TWSI_OPTION3_GPIO; | ||
112 | dove_mpp_gpio_mode(56, 57, 0); | ||
113 | } | ||
114 | if (sel & 0x2) { | ||
115 | mpp_gen_ctrl |= DOVE_AU1_SPDIFO_GPIO_EN; | ||
116 | dove_mpp_gpio_mode(57, 57, GPIO_OUTPUT_OK | GPIO_INPUT_OK); | ||
117 | } | ||
118 | if (sel & 0x4) { | ||
119 | ssp_ctrl1 |= DOVE_SSP_ON_AU1; | ||
120 | dove_mpp_gpio_mode(52, 55, 0); | ||
121 | } | ||
122 | if (sel & 0x8) | ||
123 | mpp_ctrl4 |= DOVE_AU1_GPIO_SEL; | ||
124 | |||
125 | writel(mpp_ctrl4, DOVE_MPP_CTRL4_VIRT_BASE); | ||
126 | writel(ssp_ctrl1, DOVE_SSP_CTRL_STATUS_1); | ||
127 | writel(mpp_gen_ctrl, DOVE_MPP_GENERAL_VIRT_BASE); | ||
128 | writel(global_cfg_2, DOVE_GLOBAL_CONFIG_2); | ||
129 | } | ||
130 | |||
131 | static void dove_mpp_conf_grp(int num, int sel, u32 *mpp_ctrl) | ||
132 | { | ||
133 | int start = dove_mpp_grp[num].start; | ||
134 | int end = dove_mpp_grp[num].end; | ||
135 | int gpio_mode = sel ? GPIO_OUTPUT_OK | GPIO_INPUT_OK : 0; | ||
136 | |||
137 | *mpp_ctrl &= ~(0x1 << num); | ||
138 | *mpp_ctrl |= sel << num; | ||
139 | |||
140 | dove_mpp_gpio_mode(start, end, gpio_mode); | ||
141 | } | ||
142 | |||
143 | void __init dove_mpp_conf(unsigned int *mpp_list) | ||
144 | { | ||
145 | u32 mpp_ctrl[MPP_NR_REGS]; | ||
146 | u32 pmu_mpp_ctrl = 0; | ||
147 | u32 pmu_sig_ctrl[PMU_SIG_REGS]; | ||
148 | int i; | ||
149 | |||
150 | /* Initialize gpiolib. */ | ||
151 | orion_gpio_init(); | ||
152 | |||
153 | for (i = 0; i < MPP_NR_REGS; i++) | ||
154 | mpp_ctrl[i] = readl(MPP_CTRL(i)); | ||
155 | |||
156 | for (i = 0; i < PMU_SIG_REGS; i++) | ||
157 | pmu_sig_ctrl[i] = readl(PMU_SIG_CTRL(i)); | ||
158 | |||
159 | pmu_mpp_ctrl = readl(DOVE_PMU_MPP_GENERAL_CTRL); | ||
160 | |||
161 | dove_mpp_dump_regs(); | ||
162 | |||
163 | for ( ; *mpp_list != MPP_END; mpp_list++) { | ||
164 | unsigned int num = MPP_NUM(*mpp_list); | ||
165 | unsigned int sel = MPP_SEL(*mpp_list); | ||
166 | int shift, gpio_mode; | ||
167 | |||
168 | if (num > MPP_MAX) { | ||
169 | pr_err("dove: invalid MPP number (%u)\n", num); | ||
170 | continue; | ||
171 | } | ||
172 | |||
173 | if (*mpp_list & MPP_NFC_MASK) { | ||
174 | dove_mpp_cfg_nfc(sel); | ||
175 | continue; | ||
176 | } | ||
177 | |||
178 | if (*mpp_list & MPP_AU1_MASK) { | ||
179 | dove_mpp_cfg_au1(sel); | ||
180 | continue; | ||
181 | } | ||
182 | |||
183 | if (*mpp_list & MPP_GRP_MASK) { | ||
184 | dove_mpp_conf_grp(num, sel, &mpp_ctrl[3]); | ||
185 | continue; | ||
186 | } | ||
187 | |||
188 | shift = (num & 7) << 2; | ||
189 | if (*mpp_list & MPP_PMU_MASK) { | ||
190 | pmu_mpp_ctrl |= (0x1 << num); | ||
191 | pmu_sig_ctrl[num / 8] &= ~(0xf << shift); | ||
192 | pmu_sig_ctrl[num / 8] |= 0xf << shift; | ||
193 | gpio_mode = 0; | ||
194 | } else { | ||
195 | mpp_ctrl[num / 8] &= ~(0xf << shift); | ||
196 | mpp_ctrl[num / 8] |= sel << shift; | ||
197 | gpio_mode = GPIO_OUTPUT_OK | GPIO_INPUT_OK; | ||
198 | } | ||
199 | |||
200 | orion_gpio_set_valid(num, gpio_mode); | ||
201 | } | ||
202 | |||
203 | for (i = 0; i < MPP_NR_REGS; i++) | ||
204 | writel(mpp_ctrl[i], MPP_CTRL(i)); | ||
205 | |||
206 | for (i = 0; i < PMU_SIG_REGS; i++) | ||
207 | writel(pmu_sig_ctrl[i], PMU_SIG_CTRL(i)); | ||
208 | |||
209 | writel(pmu_mpp_ctrl, DOVE_PMU_MPP_GENERAL_CTRL); | ||
210 | |||
211 | dove_mpp_dump_regs(); | ||
212 | } | ||
diff --git a/arch/arm/mach-dove/mpp.h b/arch/arm/mach-dove/mpp.h new file mode 100644 index 000000000000..2a43ce413b15 --- /dev/null +++ b/arch/arm/mach-dove/mpp.h | |||
@@ -0,0 +1,220 @@ | |||
1 | #ifndef __ARCH_DOVE_MPP_CODED_H | ||
2 | #define __ARCH_DOVE_MPP_CODED_H | ||
3 | |||
4 | #define MPP(_num, _mode, _pmu, _grp, _au1, _nfc) ( \ | ||
5 | /* MPP/group number */ ((_num) & 0xff) | \ | ||
6 | /* MPP select value */ (((_mode) & 0xf) << 8) | \ | ||
7 | /* MPP PMU */ ((!!(_pmu)) << 12) | \ | ||
8 | /* group flag */ ((!!(_grp)) << 13) | \ | ||
9 | /* AU1 flag */ ((!!(_au1)) << 14) | \ | ||
10 | /* NFCE flag */ ((!!(_nfc)) << 15)) | ||
11 | |||
12 | #define MPP_MAX 71 | ||
13 | |||
14 | #define MPP_NUM(x) ((x) & 0xff) | ||
15 | #define MPP_SEL(x) (((x) >> 8) & 0xf) | ||
16 | |||
17 | #define MPP_PMU_MASK MPP(0, 0x0, 1, 0, 0, 0) | ||
18 | #define MPP_GRP_MASK MPP(0, 0x0, 0, 1, 0, 0) | ||
19 | #define MPP_AU1_MASK MPP(0, 0x0, 0, 0, 1, 0) | ||
20 | #define MPP_NFC_MASK MPP(0, 0x0, 0, 0, 0, 1) | ||
21 | |||
22 | #define MPP_END MPP(0xff, 0xf, 1, 1, 1, 1) | ||
23 | |||
24 | #define MPP_PMU_DRIVE_0 0x1 | ||
25 | #define MPP_PMU_DRIVE_1 0x2 | ||
26 | #define MPP_PMU_SDI 0x3 | ||
27 | #define MPP_PMU_CPU_PWRDWN 0x4 | ||
28 | #define MPP_PMU_STBY_PWRDWN 0x5 | ||
29 | #define MPP_PMU_CORE_PWR_GOOD 0x8 | ||
30 | #define MPP_PMU_BAT_FAULT 0xa | ||
31 | #define MPP_PMU_EXT0_WU 0xb | ||
32 | #define MPP_PMU_EXT1_WU 0xc | ||
33 | #define MPP_PMU_EXT2_WU 0xd | ||
34 | #define MPP_PMU_BLINK 0xe | ||
35 | #define MPP_PMU(_num, _mode) MPP((_num), MPP_PMU_##_mode, 1, 0, 0, 0) | ||
36 | |||
37 | #define MPP_PIN(_num, _mode) MPP((_num), (_mode), 0, 0, 0, 0) | ||
38 | #define MPP_GRP(_grp, _mode) MPP((_grp), (_mode), 0, 1, 0, 0) | ||
39 | #define MPP_GRP_AU1(_mode) MPP(0, (_mode), 0, 0, 1, 0) | ||
40 | #define MPP_GRP_NFC(_mode) MPP(0, (_mode), 0, 0, 0, 1) | ||
41 | |||
42 | #define MPP0_GPIO0 MPP_PIN(0, 0x0) | ||
43 | #define MPP0_UA2_RTSn MPP_PIN(0, 0x2) | ||
44 | #define MPP0_SDIO0_CD MPP_PIN(0, 0x3) | ||
45 | #define MPP0_LCD0_PWM MPP_PIN(0, 0xf) | ||
46 | |||
47 | #define MPP1_GPIO1 MPP_PIN(1, 0x0) | ||
48 | #define MPP1_UA2_CTSn MPP_PIN(1, 0x2) | ||
49 | #define MPP1_SDIO0_WP MPP_PIN(1, 0x3) | ||
50 | #define MPP1_LCD1_PWM MPP_PIN(1, 0xf) | ||
51 | |||
52 | #define MPP2_GPIO2 MPP_PIN(2, 0x0) | ||
53 | #define MPP2_SATA_PRESENT MPP_PIN(2, 0x1) | ||
54 | #define MPP2_UA2_TXD MPP_PIN(2, 0x2) | ||
55 | #define MPP2_SDIO0_BUS_POWER MPP_PIN(2, 0x3) | ||
56 | #define MPP2_UA_RTSn1 MPP_PIN(2, 0x4) | ||
57 | |||
58 | #define MPP3_GPIO3 MPP_PIN(3, 0x0) | ||
59 | #define MPP3_SATA_ACT MPP_PIN(3, 0x1) | ||
60 | #define MPP3_UA2_RXD MPP_PIN(3, 0x2) | ||
61 | #define MPP3_SDIO0_LED_CTRL MPP_PIN(3, 0x3) | ||
62 | #define MPP3_UA_CTSn1 MPP_PIN(3, 0x4) | ||
63 | #define MPP3_SPI_LCD_CS1 MPP_PIN(3, 0xf) | ||
64 | |||
65 | #define MPP4_GPIO4 MPP_PIN(4, 0x0) | ||
66 | #define MPP4_UA3_RTSn MPP_PIN(4, 0x2) | ||
67 | #define MPP4_SDIO1_CD MPP_PIN(4, 0x3) | ||
68 | #define MPP4_SPI_1_MISO MPP_PIN(4, 0x4) | ||
69 | |||
70 | #define MPP5_GPIO5 MPP_PIN(5, 0x0) | ||
71 | #define MPP5_UA3_CTSn MPP_PIN(5, 0x2) | ||
72 | #define MPP5_SDIO1_WP MPP_PIN(5, 0x3) | ||
73 | #define MPP5_SPI_1_CS MPP_PIN(5, 0x4) | ||
74 | |||
75 | #define MPP6_GPIO6 MPP_PIN(6, 0x0) | ||
76 | #define MPP6_UA3_TXD MPP_PIN(6, 0x2) | ||
77 | #define MPP6_SDIO1_BUS_POWER MPP_PIN(6, 0x3) | ||
78 | #define MPP6_SPI_1_MOSI MPP_PIN(6, 0x4) | ||
79 | |||
80 | #define MPP7_GPIO7 MPP_PIN(7, 0x0) | ||
81 | #define MPP7_UA3_RXD MPP_PIN(7, 0x2) | ||
82 | #define MPP7_SDIO1_LED_CTRL MPP_PIN(7, 0x3) | ||
83 | #define MPP7_SPI_1_SCK MPP_PIN(7, 0x4) | ||
84 | |||
85 | #define MPP8_GPIO8 MPP_PIN(8, 0x0) | ||
86 | #define MPP8_WD_RST_OUT MPP_PIN(8, 0x1) | ||
87 | |||
88 | #define MPP9_GPIO9 MPP_PIN(9, 0x0) | ||
89 | #define MPP9_PEX1_CLKREQn MPP_PIN(9, 0x5) | ||
90 | |||
91 | #define MPP10_GPIO10 MPP_PIN(10, 0x0) | ||
92 | #define MPP10_SSP_SCLK MPP_PIN(10, 0x5) | ||
93 | |||
94 | #define MPP11_GPIO11 MPP_PIN(11, 0x0) | ||
95 | #define MPP11_SATA_PRESENT MPP_PIN(11, 0x1) | ||
96 | #define MPP11_SATA_ACT MPP_PIN(11, 0x2) | ||
97 | #define MPP11_SDIO0_LED_CTRL MPP_PIN(11, 0x3) | ||
98 | #define MPP11_SDIO1_LED_CTRL MPP_PIN(11, 0x4) | ||
99 | #define MPP11_PEX0_CLKREQn MPP_PIN(11, 0x5) | ||
100 | |||
101 | #define MPP12_GPIO12 MPP_PIN(12, 0x0) | ||
102 | #define MPP12_SATA_ACT MPP_PIN(12, 0x1) | ||
103 | #define MPP12_UA2_RTSn MPP_PIN(12, 0x2) | ||
104 | #define MPP12_AD0_I2S_EXT_MCLK MPP_PIN(12, 0x3) | ||
105 | #define MPP12_SDIO1_CD MPP_PIN(12, 0x4) | ||
106 | |||
107 | #define MPP13_GPIO13 MPP_PIN(13, 0x0) | ||
108 | #define MPP13_UA2_CTSn MPP_PIN(13, 0x2) | ||
109 | #define MPP13_AD1_I2S_EXT_MCLK MPP_PIN(13, 0x3) | ||
110 | #define MPP13_SDIO1WP MPP_PIN(13, 0x4) | ||
111 | #define MPP13_SSP_EXTCLK MPP_PIN(13, 0x5) | ||
112 | |||
113 | #define MPP14_GPIO14 MPP_PIN(14, 0x0) | ||
114 | #define MPP14_UA2_TXD MPP_PIN(14, 0x2) | ||
115 | #define MPP14_SDIO1_BUS_POWER MPP_PIN(14, 0x4) | ||
116 | #define MPP14_SSP_RXD MPP_PIN(14, 0x5) | ||
117 | |||
118 | #define MPP15_GPIO15 MPP_PIN(15, 0x0) | ||
119 | #define MPP15_UA2_RXD MPP_PIN(15, 0x2) | ||
120 | #define MPP15_SDIO1_LED_CTRL MPP_PIN(15, 0x4) | ||
121 | #define MPP15_SSP_SFRM MPP_PIN(15, 0x5) | ||
122 | |||
123 | #define MPP16_GPIO16 MPP_PIN(16, 0x0) | ||
124 | #define MPP16_UA3_RTSn MPP_PIN(16, 0x2) | ||
125 | #define MPP16_SDIO0_CD MPP_PIN(16, 0x3) | ||
126 | #define MPP16_SPI_LCD_CS1 MPP_PIN(16, 0x4) | ||
127 | #define MPP16_AC97_SDATA_IN1 MPP_PIN(16, 0x5) | ||
128 | |||
129 | #define MPP17_GPIO17 MPP_PIN(17, 0x0) | ||
130 | #define MPP17_AC97_SYSCLK_OUT MPP_PIN(17, 0x1) | ||
131 | #define MPP17_UA3_CTSn MPP_PIN(17, 0x2) | ||
132 | #define MPP17_SDIO0_WP MPP_PIN(17, 0x3) | ||
133 | #define MPP17_TW_SDA2 MPP_PIN(17, 0x4) | ||
134 | #define MPP17_AC97_SDATA_IN2 MPP_PIN(17, 0x5) | ||
135 | |||
136 | #define MPP18_GPIO18 MPP_PIN(18, 0x0) | ||
137 | #define MPP18_UA3_TXD MPP_PIN(18, 0x2) | ||
138 | #define MPP18_SDIO0_BUS_POWER MPP_PIN(18, 0x3) | ||
139 | #define MPP18_LCD0_PWM MPP_PIN(18, 0x4) | ||
140 | #define MPP18_AC_SDATA_IN3 MPP_PIN(18, 0x5) | ||
141 | |||
142 | #define MPP19_GPIO19 MPP_PIN(19, 0x0) | ||
143 | #define MPP19_UA3_RXD MPP_PIN(19, 0x2) | ||
144 | #define MPP19_SDIO0_LED_CTRL MPP_PIN(19, 0x3) | ||
145 | #define MPP19_TW_SCK2 MPP_PIN(19, 0x4) | ||
146 | |||
147 | #define MPP20_GPIO20 MPP_PIN(20, 0x0) | ||
148 | #define MPP20_AC97_SYSCLK_OUT MPP_PIN(20, 0x1) | ||
149 | #define MPP20_SPI_LCD_MISO MPP_PIN(20, 0x2) | ||
150 | #define MPP20_SDIO1_CD MPP_PIN(20, 0x3) | ||
151 | #define MPP20_SDIO0_CD MPP_PIN(20, 0x5) | ||
152 | #define MPP20_SPI_1_MISO MPP_PIN(20, 0x6) | ||
153 | |||
154 | #define MPP21_GPIO21 MPP_PIN(21, 0x0) | ||
155 | #define MPP21_UA1_RTSn MPP_PIN(21, 0x1) | ||
156 | #define MPP21_SPI_LCD_CS0 MPP_PIN(21, 0x2) | ||
157 | #define MPP21_SDIO1_WP MPP_PIN(21, 0x3) | ||
158 | #define MPP21_SSP_SFRM MPP_PIN(21, 0x4) | ||
159 | #define MPP21_SDIO0_WP MPP_PIN(21, 0x5) | ||
160 | #define MPP21_SPI_1_CS MPP_PIN(21, 0x6) | ||
161 | |||
162 | #define MPP22_GPIO22 MPP_PIN(22, 0x0) | ||
163 | #define MPP22_UA1_CTSn MPP_PIN(22, 0x1) | ||
164 | #define MPP22_SPI_LCD_MOSI MPP_PIN(22, 0x2) | ||
165 | #define MPP22_SDIO1_BUS_POWER MPP_PIN(22, 0x3) | ||
166 | #define MPP22_SSP_TXD MPP_PIN(22, 0x4) | ||
167 | #define MPP22_SDIO0_BUS_POWER MPP_PIN(22, 0x5) | ||
168 | #define MPP22_SPI_1_MOSI MPP_PIN(22, 0x6) | ||
169 | |||
170 | #define MPP23_GPIO23 MPP_PIN(23, 0x0) | ||
171 | #define MPP23_SPI_LCD_SCK MPP_PIN(23, 0x2) | ||
172 | #define MPP23_SDIO1_LED_CTRL MPP_PIN(23, 0x3) | ||
173 | #define MPP23_SSP_SCLK MPP_PIN(23, 0x4) | ||
174 | #define MPP23_SDIO0_LED_CTRL MPP_PIN(23, 0x5) | ||
175 | #define MPP23_SPI_1_SCK MPP_PIN(23, 0x6) | ||
176 | |||
177 | /* for MPP groups _num is a group index */ | ||
178 | enum dove_mpp_grp_idx { | ||
179 | MPP_24_39 = 2, | ||
180 | MPP_40_45 = 0, | ||
181 | MPP_46_51 = 1, | ||
182 | MPP_58_61 = 5, | ||
183 | MPP_62_63 = 4, | ||
184 | }; | ||
185 | |||
186 | #define MPP24_39_GPIO MPP_GRP(MPP_24_39, 0x1) | ||
187 | #define MPP24_39_CAM MPP_GRP(MPP_24_39, 0x0) | ||
188 | |||
189 | #define MPP40_45_GPIO MPP_GRP(MPP_40_45, 0x1) | ||
190 | #define MPP40_45_SD0 MPP_GRP(MPP_40_45, 0x0) | ||
191 | |||
192 | #define MPP46_51_GPIO MPP_GRP(MPP_46_51, 0x1) | ||
193 | #define MPP46_51_SD1 MPP_GRP(MPP_46_51, 0x0) | ||
194 | |||
195 | #define MPP58_61_GPIO MPP_GRP(MPP_58_61, 0x1) | ||
196 | #define MPP58_61_SPI MPP_GRP(MPP_58_61, 0x0) | ||
197 | |||
198 | #define MPP62_63_GPIO MPP_GRP(MPP_62_63, 0x1) | ||
199 | #define MPP62_63_UA1 MPP_GRP(MPP_62_63, 0x0) | ||
200 | |||
201 | /* The MPP[64:71] control differs from other groups */ | ||
202 | #define MPP64_71_GPO MPP_GRP_NFC(0x1) | ||
203 | #define MPP64_71_NFC MPP_GRP_NFC(0x0) | ||
204 | |||
205 | /* | ||
206 | * The MPP[52:57] functionality is encoded by 4 bits in different | ||
207 | * registers. The _num field in this case encodes those bits in | ||
208 | * correspodence with Table 135 of 88AP510 Functional specification | ||
209 | */ | ||
210 | #define MPP52_57_AU1 MPP_GRP_AU1(0x0) | ||
211 | #define MPP52_57_AU1_GPIO57 MPP_GRP_AU1(0x2) | ||
212 | #define MPP52_57_GPIO MPP_GRP_AU1(0xa) | ||
213 | #define MPP52_57_TW_GPIO MPP_GRP_AU1(0xb) | ||
214 | #define MPP52_57_AU1_SSP MPP_GRP_AU1(0xc) | ||
215 | #define MPP52_57_SSP_GPIO MPP_GRP_AU1(0xe) | ||
216 | #define MPP52_57_SSP_TW MPP_GRP_AU1(0xf) | ||
217 | |||
218 | void dove_mpp_conf(unsigned int *mpp_list); | ||
219 | |||
220 | #endif /* __ARCH_DOVE_MPP_CODED_H */ | ||
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index ef06c66a6f16..ca4de7105097 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
@@ -19,10 +19,10 @@ | |||
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <linux/clkdev.h> | ||
22 | 23 | ||
23 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
24 | 25 | ||
25 | #include <asm/clkdev.h> | ||
26 | #include <asm/div64.h> | 26 | #include <asm/div64.h> |
27 | 27 | ||
28 | 28 | ||
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 197f9e241cff..17d2e608a214 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -1,13 +1,37 @@ | |||
1 | config IMX_HAVE_DMA_V1 | 1 | config IMX_HAVE_DMA_V1 |
2 | bool | 2 | bool |
3 | 3 | ||
4 | if ARCH_MX1 | ||
5 | |||
6 | config SOC_IMX1 | 4 | config SOC_IMX1 |
5 | bool | ||
7 | select CPU_ARM920T | 6 | select CPU_ARM920T |
8 | select IMX_HAVE_DMA_V1 | 7 | select IMX_HAVE_DMA_V1 |
9 | select IMX_HAVE_IOMUX_V1 | 8 | select IMX_HAVE_IOMUX_V1 |
9 | select MXC_AVIC | ||
10 | |||
11 | config SOC_IMX21 | ||
12 | bool | ||
13 | select CPU_ARM926T | ||
14 | select ARCH_MXC_AUDMUX_V1 | ||
15 | select IMX_HAVE_DMA_V1 | ||
16 | select IMX_HAVE_IOMUX_V1 | ||
17 | select MXC_AVIC | ||
18 | |||
19 | config SOC_IMX25 | ||
10 | bool | 20 | bool |
21 | select CPU_ARM926T | ||
22 | select ARCH_MXC_AUDMUX_V2 | ||
23 | select ARCH_MXC_IOMUX_V3 | ||
24 | select MXC_AVIC | ||
25 | |||
26 | config SOC_IMX27 | ||
27 | bool | ||
28 | select CPU_ARM926T | ||
29 | select ARCH_MXC_AUDMUX_V1 | ||
30 | select IMX_HAVE_DMA_V1 | ||
31 | select IMX_HAVE_IOMUX_V1 | ||
32 | select MXC_AVIC | ||
33 | |||
34 | if ARCH_MX1 | ||
11 | 35 | ||
12 | comment "MX1 platforms:" | 36 | comment "MX1 platforms:" |
13 | config MACH_MXLADS | 37 | config MACH_MXLADS |
@@ -31,33 +55,17 @@ endif | |||
31 | 55 | ||
32 | if ARCH_MX2 | 56 | if ARCH_MX2 |
33 | 57 | ||
34 | config SOC_IMX21 | ||
35 | select CPU_ARM926T | ||
36 | select ARCH_MXC_AUDMUX_V1 | ||
37 | select IMX_HAVE_DMA_V1 | ||
38 | select IMX_HAVE_IOMUX_V1 | ||
39 | bool | ||
40 | |||
41 | config SOC_IMX27 | ||
42 | select CPU_ARM926T | ||
43 | select ARCH_MXC_AUDMUX_V1 | ||
44 | select IMX_HAVE_DMA_V1 | ||
45 | select IMX_HAVE_IOMUX_V1 | ||
46 | bool | ||
47 | |||
48 | choice | 58 | choice |
49 | prompt "CPUs:" | 59 | prompt "CPUs:" |
50 | default MACH_MX21 | 60 | default MACH_MX21 |
51 | 61 | ||
52 | config MACH_MX21 | 62 | config MACH_MX21 |
53 | bool "i.MX21 support" | 63 | bool "i.MX21 support" |
54 | select SOC_IMX21 | ||
55 | help | 64 | help |
56 | This enables support for Freescale's MX2 based i.MX21 processor. | 65 | This enables support for Freescale's MX2 based i.MX21 processor. |
57 | 66 | ||
58 | config MACH_MX27 | 67 | config MACH_MX27 |
59 | bool "i.MX27 support" | 68 | bool "i.MX27 support" |
60 | select SOC_IMX27 | ||
61 | help | 69 | help |
62 | This enables support for Freescale's MX2 based i.MX27 processor. | 70 | This enables support for Freescale's MX2 based i.MX27 processor. |
63 | 71 | ||
@@ -71,7 +79,10 @@ comment "MX21 platforms:" | |||
71 | 79 | ||
72 | config MACH_MX21ADS | 80 | config MACH_MX21ADS |
73 | bool "MX21ADS platform" | 81 | bool "MX21ADS platform" |
82 | select SOC_IMX21 | ||
83 | select IMX_HAVE_PLATFORM_IMX_FB | ||
74 | select IMX_HAVE_PLATFORM_IMX_UART | 84 | select IMX_HAVE_PLATFORM_IMX_UART |
85 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
75 | select IMX_HAVE_PLATFORM_MXC_NAND | 86 | select IMX_HAVE_PLATFORM_MXC_NAND |
76 | help | 87 | help |
77 | Include support for MX21ADS platform. This includes specific | 88 | Include support for MX21ADS platform. This includes specific |
@@ -79,24 +90,79 @@ config MACH_MX21ADS | |||
79 | 90 | ||
80 | endif | 91 | endif |
81 | 92 | ||
93 | if ARCH_MX25 | ||
94 | |||
95 | comment "MX25 platforms:" | ||
96 | |||
97 | config MACH_MX25_3DS | ||
98 | bool "Support MX25PDK (3DS) Platform" | ||
99 | select SOC_IMX25 | ||
100 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
101 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
102 | select IMX_HAVE_PLATFORM_IMXDI_RTC | ||
103 | select IMX_HAVE_PLATFORM_IMX_FB | ||
104 | select IMX_HAVE_PLATFORM_IMX_KEYPAD | ||
105 | select IMX_HAVE_PLATFORM_IMX_UART | ||
106 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
107 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
108 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | ||
109 | |||
110 | config MACH_EUKREA_CPUIMX25 | ||
111 | bool "Support Eukrea CPUIMX25 Platform" | ||
112 | select SOC_IMX25 | ||
113 | select IMX_HAVE_PLATFORM_FLEXCAN | ||
114 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
115 | select IMX_HAVE_PLATFORM_IMXDI_RTC | ||
116 | select IMX_HAVE_PLATFORM_IMX_FB | ||
117 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
118 | select IMX_HAVE_PLATFORM_IMX_UART | ||
119 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
120 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
121 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | ||
122 | select MXC_ULPI if USB_ULPI | ||
123 | |||
124 | choice | ||
125 | prompt "Baseboard" | ||
126 | depends on MACH_EUKREA_CPUIMX25 | ||
127 | default MACH_EUKREA_MBIMXSD25_BASEBOARD | ||
128 | |||
129 | config MACH_EUKREA_MBIMXSD25_BASEBOARD | ||
130 | bool "Eukrea MBIMXSD development board" | ||
131 | select IMX_HAVE_PLATFORM_IMX_SSI | ||
132 | help | ||
133 | This adds board specific devices that can be found on Eukrea's | ||
134 | MBIMXSD evaluation board. | ||
135 | |||
136 | endchoice | ||
137 | |||
138 | endif | ||
139 | |||
82 | if MACH_MX27 | 140 | if MACH_MX27 |
83 | 141 | ||
84 | comment "MX27 platforms:" | 142 | comment "MX27 platforms:" |
85 | 143 | ||
86 | config MACH_MX27ADS | 144 | config MACH_MX27ADS |
87 | bool "MX27ADS platform" | 145 | bool "MX27ADS platform" |
146 | select SOC_IMX27 | ||
147 | select IMX_HAVE_PLATFORM_IMX_FB | ||
88 | select IMX_HAVE_PLATFORM_IMX_I2C | 148 | select IMX_HAVE_PLATFORM_IMX_I2C |
89 | select IMX_HAVE_PLATFORM_IMX_UART | 149 | select IMX_HAVE_PLATFORM_IMX_UART |
150 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
90 | select IMX_HAVE_PLATFORM_MXC_NAND | 151 | select IMX_HAVE_PLATFORM_MXC_NAND |
152 | select IMX_HAVE_PLATFORM_MXC_W1 | ||
91 | help | 153 | help |
92 | Include support for MX27ADS platform. This includes specific | 154 | Include support for MX27ADS platform. This includes specific |
93 | configurations for the board and its peripherals. | 155 | configurations for the board and its peripherals. |
94 | 156 | ||
95 | config MACH_PCM038 | 157 | config MACH_PCM038 |
96 | bool "Phytec phyCORE-i.MX27 CPU module (pcm038)" | 158 | bool "Phytec phyCORE-i.MX27 CPU module (pcm038)" |
159 | select SOC_IMX27 | ||
160 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
97 | select IMX_HAVE_PLATFORM_IMX_I2C | 161 | select IMX_HAVE_PLATFORM_IMX_I2C |
98 | select IMX_HAVE_PLATFORM_IMX_UART | 162 | select IMX_HAVE_PLATFORM_IMX_UART |
163 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
99 | select IMX_HAVE_PLATFORM_MXC_NAND | 164 | select IMX_HAVE_PLATFORM_MXC_NAND |
165 | select IMX_HAVE_PLATFORM_MXC_W1 | ||
100 | select IMX_HAVE_PLATFORM_SPI_IMX | 166 | select IMX_HAVE_PLATFORM_SPI_IMX |
101 | select MXC_ULPI if USB_ULPI | 167 | select MXC_ULPI if USB_ULPI |
102 | help | 168 | help |
@@ -109,8 +175,9 @@ choice | |||
109 | default MACH_PCM970_BASEBOARD | 175 | default MACH_PCM970_BASEBOARD |
110 | 176 | ||
111 | config MACH_PCM970_BASEBOARD | 177 | config MACH_PCM970_BASEBOARD |
112 | prompt "PHYTEC PCM970 development board" | 178 | bool "PHYTEC PCM970 development board" |
113 | bool | 179 | select IMX_HAVE_PLATFORM_IMX_FB |
180 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
114 | help | 181 | help |
115 | This adds board specific devices that can be found on Phytec's | 182 | This adds board specific devices that can be found on Phytec's |
116 | PCM970 evaluation board. | 183 | PCM970 evaluation board. |
@@ -119,9 +186,14 @@ endchoice | |||
119 | 186 | ||
120 | config MACH_CPUIMX27 | 187 | config MACH_CPUIMX27 |
121 | bool "Eukrea CPUIMX27 module" | 188 | bool "Eukrea CPUIMX27 module" |
189 | select SOC_IMX27 | ||
190 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
191 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
122 | select IMX_HAVE_PLATFORM_IMX_I2C | 192 | select IMX_HAVE_PLATFORM_IMX_I2C |
123 | select IMX_HAVE_PLATFORM_IMX_UART | 193 | select IMX_HAVE_PLATFORM_IMX_UART |
194 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
124 | select IMX_HAVE_PLATFORM_MXC_NAND | 195 | select IMX_HAVE_PLATFORM_MXC_NAND |
196 | select IMX_HAVE_PLATFORM_MXC_W1 | ||
125 | select MXC_ULPI if USB_ULPI | 197 | select MXC_ULPI if USB_ULPI |
126 | help | 198 | help |
127 | Include support for Eukrea CPUIMX27 platform. This includes | 199 | Include support for Eukrea CPUIMX27 platform. This includes |
@@ -130,6 +202,7 @@ config MACH_CPUIMX27 | |||
130 | config MACH_EUKREA_CPUIMX27_USESDHC2 | 202 | config MACH_EUKREA_CPUIMX27_USESDHC2 |
131 | bool "CPUIMX27 integrates SDHC2 module" | 203 | bool "CPUIMX27 integrates SDHC2 module" |
132 | depends on MACH_CPUIMX27 | 204 | depends on MACH_CPUIMX27 |
205 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
133 | help | 206 | help |
134 | This adds support for the internal SDHC2 used on CPUIMX27 | 207 | This adds support for the internal SDHC2 used on CPUIMX27 |
135 | for wifi or eMMC. | 208 | for wifi or eMMC. |
@@ -148,8 +221,11 @@ choice | |||
148 | 221 | ||
149 | config MACH_EUKREA_MBIMX27_BASEBOARD | 222 | config MACH_EUKREA_MBIMX27_BASEBOARD |
150 | bool "Eukrea MBIMX27 development board" | 223 | bool "Eukrea MBIMX27 development board" |
224 | select IMX_HAVE_PLATFORM_IMX_FB | ||
225 | select IMX_HAVE_PLATFORM_IMX_KEYPAD | ||
151 | select IMX_HAVE_PLATFORM_IMX_SSI | 226 | select IMX_HAVE_PLATFORM_IMX_SSI |
152 | select IMX_HAVE_PLATFORM_IMX_UART | 227 | select IMX_HAVE_PLATFORM_IMX_UART |
228 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
153 | select IMX_HAVE_PLATFORM_SPI_IMX | 229 | select IMX_HAVE_PLATFORM_SPI_IMX |
154 | help | 230 | help |
155 | This adds board specific devices that can be found on Eukrea's | 231 | This adds board specific devices that can be found on Eukrea's |
@@ -159,15 +235,26 @@ endchoice | |||
159 | 235 | ||
160 | config MACH_MX27_3DS | 236 | config MACH_MX27_3DS |
161 | bool "MX27PDK platform" | 237 | bool "MX27PDK platform" |
238 | select SOC_IMX27 | ||
239 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
240 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
241 | select IMX_HAVE_PLATFORM_IMX_KEYPAD | ||
162 | select IMX_HAVE_PLATFORM_IMX_UART | 242 | select IMX_HAVE_PLATFORM_IMX_UART |
243 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
244 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
245 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
246 | select MXC_ULPI if USB_ULPI | ||
163 | help | 247 | help |
164 | Include support for MX27PDK platform. This includes specific | 248 | Include support for MX27PDK platform. This includes specific |
165 | configurations for the board and its peripherals. | 249 | configurations for the board and its peripherals. |
166 | 250 | ||
167 | config MACH_IMX27_VISSTRIM_M10 | 251 | config MACH_IMX27_VISSTRIM_M10 |
168 | bool "Vista Silicon i.MX27 Visstrim_m10" | 252 | bool "Vista Silicon i.MX27 Visstrim_m10" |
253 | select SOC_IMX27 | ||
169 | select IMX_HAVE_PLATFORM_IMX_I2C | 254 | select IMX_HAVE_PLATFORM_IMX_I2C |
170 | select IMX_HAVE_PLATFORM_IMX_UART | 255 | select IMX_HAVE_PLATFORM_IMX_UART |
256 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
257 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
171 | help | 258 | help |
172 | Include support for Visstrim_m10 platform and its different variants. | 259 | Include support for Visstrim_m10 platform and its different variants. |
173 | This includes specific configurations for the board and its | 260 | This includes specific configurations for the board and its |
@@ -175,6 +262,7 @@ config MACH_IMX27_VISSTRIM_M10 | |||
175 | 262 | ||
176 | config MACH_IMX27LITE | 263 | config MACH_IMX27LITE |
177 | bool "LogicPD MX27 LITEKIT platform" | 264 | bool "LogicPD MX27 LITEKIT platform" |
265 | select SOC_IMX27 | ||
178 | select IMX_HAVE_PLATFORM_IMX_UART | 266 | select IMX_HAVE_PLATFORM_IMX_UART |
179 | help | 267 | help |
180 | Include support for MX27 LITEKIT platform. This includes specific | 268 | Include support for MX27 LITEKIT platform. This includes specific |
@@ -182,10 +270,17 @@ config MACH_IMX27LITE | |||
182 | 270 | ||
183 | config MACH_PCA100 | 271 | config MACH_PCA100 |
184 | bool "Phytec phyCARD-s (pca100)" | 272 | bool "Phytec phyCARD-s (pca100)" |
273 | select SOC_IMX27 | ||
274 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
275 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
276 | select IMX_HAVE_PLATFORM_IMX_FB | ||
185 | select IMX_HAVE_PLATFORM_IMX_I2C | 277 | select IMX_HAVE_PLATFORM_IMX_I2C |
186 | select IMX_HAVE_PLATFORM_IMX_SSI | 278 | select IMX_HAVE_PLATFORM_IMX_SSI |
187 | select IMX_HAVE_PLATFORM_IMX_UART | 279 | select IMX_HAVE_PLATFORM_IMX_UART |
280 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
281 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
188 | select IMX_HAVE_PLATFORM_MXC_NAND | 282 | select IMX_HAVE_PLATFORM_MXC_NAND |
283 | select IMX_HAVE_PLATFORM_MXC_W1 | ||
189 | select IMX_HAVE_PLATFORM_SPI_IMX | 284 | select IMX_HAVE_PLATFORM_SPI_IMX |
190 | select MXC_ULPI if USB_ULPI | 285 | select MXC_ULPI if USB_ULPI |
191 | help | 286 | help |
@@ -194,8 +289,11 @@ config MACH_PCA100 | |||
194 | 289 | ||
195 | config MACH_MXT_TD60 | 290 | config MACH_MXT_TD60 |
196 | bool "Maxtrack i-MXT TD60" | 291 | bool "Maxtrack i-MXT TD60" |
292 | select SOC_IMX27 | ||
293 | select IMX_HAVE_PLATFORM_IMX_FB | ||
197 | select IMX_HAVE_PLATFORM_IMX_I2C | 294 | select IMX_HAVE_PLATFORM_IMX_I2C |
198 | select IMX_HAVE_PLATFORM_IMX_UART | 295 | select IMX_HAVE_PLATFORM_IMX_UART |
296 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
199 | select IMX_HAVE_PLATFORM_MXC_NAND | 297 | select IMX_HAVE_PLATFORM_MXC_NAND |
200 | help | 298 | help |
201 | Include support for i-MXT (aka td60) platform. This | 299 | Include support for i-MXT (aka td60) platform. This |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 5582692bb176..77100bf26153 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -4,13 +4,13 @@ | |||
4 | 4 | ||
5 | # Object file lists. | 5 | # Object file lists. |
6 | 6 | ||
7 | obj-y := devices.o | ||
8 | |||
9 | obj-$(CONFIG_IMX_HAVE_DMA_V1) += dma-v1.o | 7 | obj-$(CONFIG_IMX_HAVE_DMA_V1) += dma-v1.o |
10 | 8 | ||
11 | obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o | 9 | obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o |
12 | obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o | 10 | obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o |
13 | 11 | ||
12 | obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o | ||
13 | |||
14 | obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o | 14 | obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o |
15 | obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o | 15 | obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o |
16 | 16 | ||
@@ -22,6 +22,10 @@ obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o | |||
22 | 22 | ||
23 | obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o | 23 | obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o |
24 | 24 | ||
25 | obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o | ||
26 | obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-eukrea_cpuimx25.o | ||
27 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o | ||
28 | |||
25 | obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o | 29 | obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o |
26 | obj-$(CONFIG_MACH_PCM038) += mach-pcm038.o | 30 | obj-$(CONFIG_MACH_PCM038) += mach-pcm038.o |
27 | obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o | 31 | obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o |
diff --git a/arch/arm/mach-imx/Makefile.boot b/arch/arm/mach-imx/Makefile.boot index 7988a85cf07d..3953d60bff0b 100644 --- a/arch/arm/mach-imx/Makefile.boot +++ b/arch/arm/mach-imx/Makefile.boot | |||
@@ -6,6 +6,10 @@ zreladdr-$(CONFIG_MACH_MX21) := 0xC0008000 | |||
6 | params_phys-$(CONFIG_MACH_MX21) := 0xC0000100 | 6 | params_phys-$(CONFIG_MACH_MX21) := 0xC0000100 |
7 | initrd_phys-$(CONFIG_MACH_MX21) := 0xC0800000 | 7 | initrd_phys-$(CONFIG_MACH_MX21) := 0xC0800000 |
8 | 8 | ||
9 | zreladdr-$(CONFIG_ARCH_MX25) := 0x80008000 | ||
10 | params_phys-$(CONFIG_ARCH_MX25) := 0x80000100 | ||
11 | initrd_phys-$(CONFIG_ARCH_MX25) := 0x80800000 | ||
12 | |||
9 | zreladdr-$(CONFIG_MACH_MX27) := 0xA0008000 | 13 | zreladdr-$(CONFIG_MACH_MX27) := 0xA0008000 |
10 | params_phys-$(CONFIG_MACH_MX27) := 0xA0000100 | 14 | params_phys-$(CONFIG_MACH_MX27) := 0xA0000100 |
11 | initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 | 15 | initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 |
diff --git a/arch/arm/mach-imx/clock-imx1.c b/arch/arm/mach-imx/clock-imx1.c index daca30b2d5b1..3938a563b280 100644 --- a/arch/arm/mach-imx/clock-imx1.c +++ b/arch/arm/mach-imx/clock-imx1.c | |||
@@ -22,8 +22,7 @@ | |||
22 | #include <linux/err.h> | 22 | #include <linux/err.h> |
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | 25 | #include <linux/clkdev.h> | |
26 | #include <asm/clkdev.h> | ||
27 | 26 | ||
28 | #include <mach/clock.h> | 27 | #include <mach/clock.h> |
29 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-imx/clock-imx21.c b/arch/arm/mach-imx/clock-imx21.c index cf15ea516a72..bf30a8c7ce6f 100644 --- a/arch/arm/mach-imx/clock-imx21.c +++ b/arch/arm/mach-imx/clock-imx21.c | |||
@@ -21,11 +21,11 @@ | |||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/clkdev.h> | ||
24 | 25 | ||
25 | #include <mach/clock.h> | 26 | #include <mach/clock.h> |
26 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
27 | #include <mach/common.h> | 28 | #include <mach/common.h> |
28 | #include <asm/clkdev.h> | ||
29 | #include <asm/div64.h> | 29 | #include <asm/div64.h> |
30 | 30 | ||
31 | #define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off))) | 31 | #define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off))) |
@@ -1185,7 +1185,7 @@ static struct clk_lookup lookups[] = { | |||
1185 | _REGISTER_CLOCK(NULL, "brom", brom_clk) | 1185 | _REGISTER_CLOCK(NULL, "brom", brom_clk) |
1186 | _REGISTER_CLOCK(NULL, "emma", emma_clk[0]) | 1186 | _REGISTER_CLOCK(NULL, "emma", emma_clk[0]) |
1187 | _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) | 1187 | _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) |
1188 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) | 1188 | _REGISTER_CLOCK("imx2-wdt.0", NULL, wdog_clk) |
1189 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) | 1189 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) |
1190 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) | 1190 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) |
1191 | _REGISTER_CLOCK("mxc-keypad", NULL, kpp_clk) | 1191 | _REGISTER_CLOCK("mxc-keypad", NULL, kpp_clk) |
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-imx/clock-imx25.c index 9e4a5578c2fb..daa0165b6772 100644 --- a/arch/arm/mach-mx25/clock.c +++ b/arch/arm/mach-imx/clock-imx25.c | |||
@@ -21,8 +21,7 @@ | |||
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | #include <linux/clkdev.h> | |
25 | #include <asm/clkdev.h> | ||
26 | 25 | ||
27 | #include <mach/clock.h> | 26 | #include <mach/clock.h> |
28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
@@ -296,7 +295,7 @@ static struct clk_lookup lookups[] = { | |||
296 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | 295 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
297 | _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk) | 296 | _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk) |
298 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) | 297 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) |
299 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdt_clk) | 298 | _REGISTER_CLOCK("imx2-wdt.0", NULL, wdt_clk) |
300 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) | 299 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) |
301 | _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) | 300 | _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) |
302 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) | 301 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) |
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c index 98a25bada783..583f2515c1d5 100644 --- a/arch/arm/mach-imx/clock-imx27.c +++ b/arch/arm/mach-imx/clock-imx27.c | |||
@@ -21,8 +21,8 @@ | |||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/clkdev.h> | ||
24 | 25 | ||
25 | #include <asm/clkdev.h> | ||
26 | #include <asm/div64.h> | 26 | #include <asm/div64.h> |
27 | 27 | ||
28 | #include <mach/clock.h> | 28 | #include <mach/clock.h> |
@@ -125,7 +125,7 @@ static int clk_cpu_set_parent(struct clk *clk, struct clk *parent) | |||
125 | if (clk->parent == parent) | 125 | if (clk->parent == parent) |
126 | return 0; | 126 | return 0; |
127 | 127 | ||
128 | if (mx27_revision() >= CHIP_REV_2_0) { | 128 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
129 | if (parent == &mpll_main1_clk) { | 129 | if (parent == &mpll_main1_clk) { |
130 | cscr |= CCM_CSCR_ARM_SRC; | 130 | cscr |= CCM_CSCR_ARM_SRC; |
131 | } else { | 131 | } else { |
@@ -174,7 +174,7 @@ static int set_rate_cpu(struct clk *clk, unsigned long rate) | |||
174 | div--; | 174 | div--; |
175 | 175 | ||
176 | reg = __raw_readl(CCM_CSCR); | 176 | reg = __raw_readl(CCM_CSCR); |
177 | if (mx27_revision() >= CHIP_REV_2_0) { | 177 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
178 | reg &= ~(3 << 12); | 178 | reg &= ~(3 << 12); |
179 | reg |= div << 12; | 179 | reg |= div << 12; |
180 | reg &= ~(CCM_CSCR_FPM | CCM_CSCR_SPEN); | 180 | reg &= ~(CCM_CSCR_FPM | CCM_CSCR_SPEN); |
@@ -244,7 +244,7 @@ static unsigned long get_rate_ssix(struct clk *clk, unsigned long pdf) | |||
244 | 244 | ||
245 | parent_rate = clk_get_rate(clk->parent); | 245 | parent_rate = clk_get_rate(clk->parent); |
246 | 246 | ||
247 | if (mx27_revision() >= CHIP_REV_2_0) | 247 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
248 | pdf += 4; /* MX27 TO2+ */ | 248 | pdf += 4; /* MX27 TO2+ */ |
249 | else | 249 | else |
250 | pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */ | 250 | pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */ |
@@ -269,7 +269,7 @@ static unsigned long get_rate_nfc(struct clk *clk) | |||
269 | 269 | ||
270 | parent_rate = clk_get_rate(clk->parent); | 270 | parent_rate = clk_get_rate(clk->parent); |
271 | 271 | ||
272 | if (mx27_revision() >= CHIP_REV_2_0) | 272 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
273 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 6) & 0xf; | 273 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 6) & 0xf; |
274 | else | 274 | else |
275 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 12) & 0xf; | 275 | nfc_pdf = (__raw_readl(CCM_PCDR0) >> 12) & 0xf; |
@@ -284,7 +284,7 @@ static unsigned long get_rate_vpu(struct clk *clk) | |||
284 | 284 | ||
285 | parent_rate = clk_get_rate(clk->parent); | 285 | parent_rate = clk_get_rate(clk->parent); |
286 | 286 | ||
287 | if (mx27_revision() >= CHIP_REV_2_0) { | 287 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
288 | vpu_pdf = (__raw_readl(CCM_PCDR0) >> 10) & 0x3f; | 288 | vpu_pdf = (__raw_readl(CCM_PCDR0) >> 10) & 0x3f; |
289 | vpu_pdf += 4; | 289 | vpu_pdf += 4; |
290 | } else { | 290 | } else { |
@@ -347,7 +347,7 @@ static unsigned long get_rate_mpll_main(struct clk *clk) | |||
347 | * clk->id == 0: arm clock source path 1 which is from 2 * MPLL / 2 | 347 | * clk->id == 0: arm clock source path 1 which is from 2 * MPLL / 2 |
348 | * clk->id == 1: arm clock source path 2 which is from 2 * MPLL / 3 | 348 | * clk->id == 1: arm clock source path 2 which is from 2 * MPLL / 3 |
349 | */ | 349 | */ |
350 | if (mx27_revision() >= CHIP_REV_2_0 && clk->id == 1) | 350 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0 && clk->id == 1) |
351 | return 2UL * parent_rate / 3UL; | 351 | return 2UL * parent_rate / 3UL; |
352 | 352 | ||
353 | return parent_rate; | 353 | return parent_rate; |
@@ -365,7 +365,7 @@ static unsigned long get_rate_spll(struct clk *clk) | |||
365 | /* On TO2 we have to write the value back. Otherwise we | 365 | /* On TO2 we have to write the value back. Otherwise we |
366 | * read 0 from this register the next time. | 366 | * read 0 from this register the next time. |
367 | */ | 367 | */ |
368 | if (mx27_revision() >= CHIP_REV_2_0) | 368 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
369 | __raw_writel(reg, CCM_SPCTL0); | 369 | __raw_writel(reg, CCM_SPCTL0); |
370 | 370 | ||
371 | return mxc_decode_pll(reg, rate); | 371 | return mxc_decode_pll(reg, rate); |
@@ -376,7 +376,7 @@ static unsigned long get_rate_cpu(struct clk *clk) | |||
376 | u32 div; | 376 | u32 div; |
377 | unsigned long rate; | 377 | unsigned long rate; |
378 | 378 | ||
379 | if (mx27_revision() >= CHIP_REV_2_0) | 379 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
380 | div = (__raw_readl(CCM_CSCR) >> 12) & 0x3; | 380 | div = (__raw_readl(CCM_CSCR) >> 12) & 0x3; |
381 | else | 381 | else |
382 | div = (__raw_readl(CCM_CSCR) >> 13) & 0x7; | 382 | div = (__raw_readl(CCM_CSCR) >> 13) & 0x7; |
@@ -389,7 +389,7 @@ static unsigned long get_rate_ahb(struct clk *clk) | |||
389 | { | 389 | { |
390 | unsigned long rate, bclk_pdf; | 390 | unsigned long rate, bclk_pdf; |
391 | 391 | ||
392 | if (mx27_revision() >= CHIP_REV_2_0) | 392 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
393 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 8) & 0x3; | 393 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 8) & 0x3; |
394 | else | 394 | else |
395 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 9) & 0xf; | 395 | bclk_pdf = (__raw_readl(CCM_CSCR) >> 9) & 0xf; |
@@ -402,7 +402,7 @@ static unsigned long get_rate_ipg(struct clk *clk) | |||
402 | { | 402 | { |
403 | unsigned long rate, ipg_pdf; | 403 | unsigned long rate, ipg_pdf; |
404 | 404 | ||
405 | if (mx27_revision() >= CHIP_REV_2_0) | 405 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) |
406 | return clk_get_rate(clk->parent); | 406 | return clk_get_rate(clk->parent); |
407 | else | 407 | else |
408 | ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1; | 408 | ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1; |
@@ -667,7 +667,7 @@ static struct clk_lookup lookups[] = { | |||
667 | _REGISTER_CLOCK(NULL, "sahara2", sahara2_clk) | 667 | _REGISTER_CLOCK(NULL, "sahara2", sahara2_clk) |
668 | _REGISTER_CLOCK(NULL, "ata", ata_clk) | 668 | _REGISTER_CLOCK(NULL, "ata", ata_clk) |
669 | _REGISTER_CLOCK(NULL, "mstick", mstick_clk) | 669 | _REGISTER_CLOCK(NULL, "mstick", mstick_clk) |
670 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) | 670 | _REGISTER_CLOCK("imx2-wdt.0", NULL, wdog_clk) |
671 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) | 671 | _REGISTER_CLOCK(NULL, "gpio", gpio_clk) |
672 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) | 672 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) |
673 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) | 673 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) |
@@ -683,7 +683,7 @@ static void __init to2_adjust_clocks(void) | |||
683 | { | 683 | { |
684 | unsigned long cscr = __raw_readl(CCM_CSCR); | 684 | unsigned long cscr = __raw_readl(CCM_CSCR); |
685 | 685 | ||
686 | if (mx27_revision() >= CHIP_REV_2_0) { | 686 | if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { |
687 | if (cscr & CCM_CSCR_ARM_SRC) | 687 | if (cscr & CCM_CSCR_ARM_SRC) |
688 | cpu_clk.parent = &mpll_main1_clk; | 688 | cpu_clk.parent = &mpll_main1_clk; |
689 | 689 | ||
diff --git a/arch/arm/mach-imx/cpu-imx27.c b/arch/arm/mach-imx/cpu-imx27.c index d8d3b2d84dc5..3b117be37bd2 100644 --- a/arch/arm/mach-imx/cpu-imx27.c +++ b/arch/arm/mach-imx/cpu-imx27.c | |||
@@ -42,7 +42,19 @@ static void query_silicon_parameter(void) | |||
42 | val = __raw_readl(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR | 42 | val = __raw_readl(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR |
43 | + SYS_CHIP_ID)); | 43 | + SYS_CHIP_ID)); |
44 | 44 | ||
45 | cpu_silicon_rev = (int)(val >> 28); | 45 | switch (val >> 28) { |
46 | case 0: | ||
47 | cpu_silicon_rev = IMX_CHIP_REVISION_1_0; | ||
48 | break; | ||
49 | case 1: | ||
50 | cpu_silicon_rev = IMX_CHIP_REVISION_2_0; | ||
51 | break; | ||
52 | case 2: | ||
53 | cpu_silicon_rev = IMX_CHIP_REVISION_2_1; | ||
54 | break; | ||
55 | default: | ||
56 | cpu_silicon_rev = IMX_CHIP_REVISION_UNKNOWN; | ||
57 | } | ||
46 | cpu_partnumber = (int)((val >> 12) & 0xFFFF); | 58 | cpu_partnumber = (int)((val >> 12) & 0xFFFF); |
47 | } | 59 | } |
48 | 60 | ||
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h index d189039749b0..16744d2d9b81 100644 --- a/arch/arm/mach-imx/devices-imx21.h +++ b/arch/arm/mach-imx/devices-imx21.h | |||
@@ -9,10 +9,26 @@ | |||
9 | #include <mach/mx21.h> | 9 | #include <mach/mx21.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | extern const struct imx_imx21_hcd_data imx21_imx21_hcd_data __initconst; | ||
13 | #define imx21_add_imx21_hcd(pdata) \ | ||
14 | imx_add_imx21_hcd(&imx21_imx21_hcd_data, pdata) | ||
15 | |||
16 | extern const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst; | ||
17 | #define imx21_add_imx2_wdt(pdata) \ | ||
18 | imx_add_imx2_wdt(&imx21_imx2_wdt_data) | ||
19 | |||
20 | extern const struct imx_imx_fb_data imx21_imx_fb_data __initconst; | ||
21 | #define imx21_add_imx_fb(pdata) \ | ||
22 | imx_add_imx_fb(&imx21_imx_fb_data, pdata) | ||
23 | |||
12 | extern const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst; | 24 | extern const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst; |
13 | #define imx21_add_imx_i2c(pdata) \ | 25 | #define imx21_add_imx_i2c(pdata) \ |
14 | imx_add_imx_i2c(&imx21_imx_i2c_data, pdata) | 26 | imx_add_imx_i2c(&imx21_imx_i2c_data, pdata) |
15 | 27 | ||
28 | extern const struct imx_imx_keypad_data imx21_imx_keypad_data __initconst; | ||
29 | #define imx21_add_imx_keypad(pdata) \ | ||
30 | imx_add_imx_keypad(&imx21_imx_keypad_data, pdata) | ||
31 | |||
16 | extern const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst; | 32 | extern const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst; |
17 | #define imx21_add_imx_ssi(id, pdata) \ | 33 | #define imx21_add_imx_ssi(id, pdata) \ |
18 | imx_add_imx_ssi(&imx21_imx_ssi_data[id], pdata) | 34 | imx_add_imx_ssi(&imx21_imx_ssi_data[id], pdata) |
@@ -25,10 +41,18 @@ extern const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst; | |||
25 | #define imx21_add_imx_uart2(pdata) imx21_add_imx_uart(2, pdata) | 41 | #define imx21_add_imx_uart2(pdata) imx21_add_imx_uart(2, pdata) |
26 | #define imx21_add_imx_uart3(pdata) imx21_add_imx_uart(3, pdata) | 42 | #define imx21_add_imx_uart3(pdata) imx21_add_imx_uart(3, pdata) |
27 | 43 | ||
44 | extern const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst; | ||
45 | #define imx21_add_mxc_mmc(id, pdata) \ | ||
46 | imx_add_mxc_mmc(&imx21_mxc_mmc_data[id], pdata) | ||
47 | |||
28 | extern const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst; | 48 | extern const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst; |
29 | #define imx21_add_mxc_nand(pdata) \ | 49 | #define imx21_add_mxc_nand(pdata) \ |
30 | imx_add_mxc_nand(&imx21_mxc_nand_data, pdata) | 50 | imx_add_mxc_nand(&imx21_mxc_nand_data, pdata) |
31 | 51 | ||
52 | extern const struct imx_mxc_w1_data imx21_mxc_w1_data __initconst; | ||
53 | #define imx21_add_mxc_w1(pdata) \ | ||
54 | imx_add_mxc_w1(&imx21_mxc_w1_data) | ||
55 | |||
32 | extern const struct imx_spi_imx_data imx21_cspi_data[] __initconst; | 56 | extern const struct imx_spi_imx_data imx21_cspi_data[] __initconst; |
33 | #define imx21_add_cspi(id, pdata) \ | 57 | #define imx21_add_cspi(id, pdata) \ |
34 | imx_add_spi_imx(&imx21_cspi_data[id], pdata) | 58 | imx_add_spi_imx(&imx21_cspi_data[id], pdata) |
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h index d94d282fa676..bde33caf1b90 100644 --- a/arch/arm/mach-mx25/devices-imx25.h +++ b/arch/arm/mach-imx/devices-imx25.h | |||
@@ -13,10 +13,27 @@ extern const struct imx_fec_data imx25_fec_data __initconst; | |||
13 | #define imx25_add_fec(pdata) \ | 13 | #define imx25_add_fec(pdata) \ |
14 | imx_add_fec(&imx25_fec_data, pdata) | 14 | imx_add_fec(&imx25_fec_data, pdata) |
15 | 15 | ||
16 | #define imx25_add_flexcan0(pdata) \ | 16 | extern const struct imx_flexcan_data imx25_flexcan_data[] __initconst; |
17 | imx_add_flexcan(0, MX25_CAN1_BASE_ADDR, SZ_16K, MX25_INT_CAN1, pdata) | 17 | #define imx25_add_flexcan(id, pdata) \ |
18 | #define imx25_add_flexcan1(pdata) \ | 18 | imx_add_flexcan(&imx25_flexcan_data[id], pdata) |
19 | imx_add_flexcan(1, MX25_CAN2_BASE_ADDR, SZ_16K, MX25_INT_CAN2, pdata) | 19 | #define imx25_add_flexcan0(pdata) imx25_add_flexcan(0, pdata) |
20 | #define imx25_add_flexcan1(pdata) imx25_add_flexcan(1, pdata) | ||
21 | |||
22 | extern const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst; | ||
23 | #define imx25_add_fsl_usb2_udc(pdata) \ | ||
24 | imx_add_fsl_usb2_udc(&imx25_fsl_usb2_udc_data, pdata) | ||
25 | |||
26 | extern struct imx_imxdi_rtc_data imx25_imxdi_rtc_data __initconst; | ||
27 | #define imx25_add_imxdi_rtc(pdata) \ | ||
28 | imx_add_imxdi_rtc(&imx25_imxdi_rtc_data) | ||
29 | |||
30 | extern const struct imx_imx2_wdt_data imx25_imx2_wdt_data __initconst; | ||
31 | #define imx25_add_imx2_wdt(pdata) \ | ||
32 | imx_add_imx2_wdt(&imx25_imx2_wdt_data) | ||
33 | |||
34 | extern const struct imx_imx_fb_data imx25_imx_fb_data __initconst; | ||
35 | #define imx25_add_imx_fb(pdata) \ | ||
36 | imx_add_imx_fb(&imx25_imx_fb_data, pdata) | ||
20 | 37 | ||
21 | extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst; | 38 | extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst; |
22 | #define imx25_add_imx_i2c(id, pdata) \ | 39 | #define imx25_add_imx_i2c(id, pdata) \ |
@@ -25,6 +42,10 @@ extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst; | |||
25 | #define imx25_add_imx_i2c1(pdata) imx25_add_imx_i2c(1, pdata) | 42 | #define imx25_add_imx_i2c1(pdata) imx25_add_imx_i2c(1, pdata) |
26 | #define imx25_add_imx_i2c2(pdata) imx25_add_imx_i2c(2, pdata) | 43 | #define imx25_add_imx_i2c2(pdata) imx25_add_imx_i2c(2, pdata) |
27 | 44 | ||
45 | extern const struct imx_imx_keypad_data imx25_imx_keypad_data __initconst; | ||
46 | #define imx25_add_imx_keypad(pdata) \ | ||
47 | imx_add_imx_keypad(&imx25_imx_keypad_data, pdata) | ||
48 | |||
28 | extern const struct imx_imx_ssi_data imx25_imx_ssi_data[] __initconst; | 49 | extern const struct imx_imx_ssi_data imx25_imx_ssi_data[] __initconst; |
29 | #define imx25_add_imx_ssi(id, pdata) \ | 50 | #define imx25_add_imx_ssi(id, pdata) \ |
30 | imx_add_imx_ssi(&imx25_imx_ssi_data[id], pdata) | 51 | imx_add_imx_ssi(&imx25_imx_ssi_data[id], pdata) |
@@ -38,17 +59,29 @@ extern const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst; | |||
38 | #define imx25_add_imx_uart3(pdata) imx25_add_imx_uart(3, pdata) | 59 | #define imx25_add_imx_uart3(pdata) imx25_add_imx_uart(3, pdata) |
39 | #define imx25_add_imx_uart4(pdata) imx25_add_imx_uart(4, pdata) | 60 | #define imx25_add_imx_uart4(pdata) imx25_add_imx_uart(4, pdata) |
40 | 61 | ||
62 | extern const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst; | ||
63 | #define imx25_add_mx2_camera(pdata) \ | ||
64 | imx_add_mx2_camera(&imx25_mx2_camera_data, pdata) | ||
65 | |||
66 | extern const struct imx_mxc_ehci_data imx25_mxc_ehci_otg_data __initconst; | ||
67 | #define imx25_add_mxc_ehci_otg(pdata) \ | ||
68 | imx_add_mxc_ehci(&imx25_mxc_ehci_otg_data, pdata) | ||
69 | extern const struct imx_mxc_ehci_data imx25_mxc_ehci_hs_data __initconst; | ||
70 | #define imx25_add_mxc_ehci_hs(pdata) \ | ||
71 | imx_add_mxc_ehci(&imx25_mxc_ehci_hs_data, pdata) | ||
72 | |||
41 | extern const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst; | 73 | extern const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst; |
42 | #define imx25_add_mxc_nand(pdata) \ | 74 | #define imx25_add_mxc_nand(pdata) \ |
43 | imx_add_mxc_nand(&imx25_mxc_nand_data, pdata) | 75 | imx_add_mxc_nand(&imx25_mxc_nand_data, pdata) |
44 | 76 | ||
77 | extern const struct imx_sdhci_esdhc_imx_data | ||
78 | imx25_sdhci_esdhc_imx_data[] __initconst; | ||
79 | #define imx25_add_sdhci_esdhc_imx(id, pdata) \ | ||
80 | imx_add_sdhci_esdhc_imx(&imx25_sdhci_esdhc_imx_data[id], pdata) | ||
81 | |||
45 | extern const struct imx_spi_imx_data imx25_cspi_data[] __initconst; | 82 | extern const struct imx_spi_imx_data imx25_cspi_data[] __initconst; |
46 | #define imx25_add_spi_imx(id, pdata) \ | 83 | #define imx25_add_spi_imx(id, pdata) \ |
47 | imx_add_spi_imx(&imx25_cspi_data[id], pdata) | 84 | imx_add_spi_imx(&imx25_spi_imx_data[id], pdata) |
48 | #define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) | 85 | #define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) |
49 | #define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) | 86 | #define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) |
50 | #define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) | 87 | #define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) |
51 | |||
52 | extern const struct imx_esdhc_imx_data imx25_esdhc_data[] __initconst; | ||
53 | #define imx25_add_esdhc(id, pdata) \ | ||
54 | imx_add_esdhc(&imx25_esdhc_data[id], pdata) | ||
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index 7011690364f2..f1272d4b5a33 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h | |||
@@ -13,10 +13,26 @@ extern const struct imx_fec_data imx27_fec_data __initconst; | |||
13 | #define imx27_add_fec(pdata) \ | 13 | #define imx27_add_fec(pdata) \ |
14 | imx_add_fec(&imx27_fec_data, pdata) | 14 | imx_add_fec(&imx27_fec_data, pdata) |
15 | 15 | ||
16 | extern const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst; | ||
17 | #define imx27_add_fsl_usb2_udc(pdata) \ | ||
18 | imx_add_fsl_usb2_udc(&imx27_fsl_usb2_udc_data, pdata) | ||
19 | |||
20 | extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst; | ||
21 | #define imx27_add_imx2_wdt(pdata) \ | ||
22 | imx_add_imx2_wdt(&imx27_imx2_wdt_data) | ||
23 | |||
24 | extern const struct imx_imx_fb_data imx27_imx_fb_data __initconst; | ||
25 | #define imx27_add_imx_fb(pdata) \ | ||
26 | imx_add_imx_fb(&imx27_imx_fb_data, pdata) | ||
27 | |||
16 | extern const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst; | 28 | extern const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst; |
17 | #define imx27_add_imx_i2c(id, pdata) \ | 29 | #define imx27_add_imx_i2c(id, pdata) \ |
18 | imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata) | 30 | imx_add_imx_i2c(&imx27_imx_i2c_data[id], pdata) |
19 | 31 | ||
32 | extern const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst; | ||
33 | #define imx27_add_imx_keypad(pdata) \ | ||
34 | imx_add_imx_keypad(&imx27_imx_keypad_data, pdata) | ||
35 | |||
20 | extern const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst; | 36 | extern const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst; |
21 | #define imx27_add_imx_ssi(id, pdata) \ | 37 | #define imx27_add_imx_ssi(id, pdata) \ |
22 | imx_add_imx_ssi(&imx27_imx_ssi_data[id], pdata) | 38 | imx_add_imx_ssi(&imx27_imx_ssi_data[id], pdata) |
@@ -31,10 +47,29 @@ extern const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst; | |||
31 | #define imx27_add_imx_uart4(pdata) imx27_add_imx_uart(4, pdata) | 47 | #define imx27_add_imx_uart4(pdata) imx27_add_imx_uart(4, pdata) |
32 | #define imx27_add_imx_uart5(pdata) imx27_add_imx_uart(5, pdata) | 48 | #define imx27_add_imx_uart5(pdata) imx27_add_imx_uart(5, pdata) |
33 | 49 | ||
50 | extern const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst; | ||
51 | #define imx27_add_mx2_camera(pdata) \ | ||
52 | imx_add_mx2_camera(&imx27_mx2_camera_data, pdata) | ||
53 | |||
54 | extern const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst; | ||
55 | #define imx27_add_mxc_ehci_otg(pdata) \ | ||
56 | imx_add_mxc_ehci(&imx27_mxc_ehci_otg_data, pdata) | ||
57 | extern const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst; | ||
58 | #define imx27_add_mxc_ehci_hs(id, pdata) \ | ||
59 | imx_add_mxc_ehci(&imx27_mxc_ehci_hs_data[id - 1], pdata) | ||
60 | |||
61 | extern const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst; | ||
62 | #define imx27_add_mxc_mmc(id, pdata) \ | ||
63 | imx_add_mxc_mmc(&imx27_mxc_mmc_data[id], pdata) | ||
64 | |||
34 | extern const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst; | 65 | extern const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst; |
35 | #define imx27_add_mxc_nand(pdata) \ | 66 | #define imx27_add_mxc_nand(pdata) \ |
36 | imx_add_mxc_nand(&imx27_mxc_nand_data, pdata) | 67 | imx_add_mxc_nand(&imx27_mxc_nand_data, pdata) |
37 | 68 | ||
69 | extern const struct imx_mxc_w1_data imx27_mxc_w1_data __initconst; | ||
70 | #define imx27_add_mxc_w1(pdata) \ | ||
71 | imx_add_mxc_w1(&imx27_mxc_w1_data) | ||
72 | |||
38 | extern const struct imx_spi_imx_data imx27_cspi_data[] __initconst; | 73 | extern const struct imx_spi_imx_data imx27_cspi_data[] __initconst; |
39 | #define imx27_add_cspi(id, pdata) \ | 74 | #define imx27_add_cspi(id, pdata) \ |
40 | imx_add_spi_imx(&imx27_cspi_data[id], pdata) | 75 | imx_add_spi_imx(&imx27_cspi_data[id], pdata) |
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c deleted file mode 100644 index fba5047de8b1..000000000000 --- a/arch/arm/mach-imx/devices.c +++ /dev/null | |||
@@ -1,553 +0,0 @@ | |||
1 | /* | ||
2 | * Author: MontaVista Software, Inc. | ||
3 | * <source@mvista.com> | ||
4 | * | ||
5 | * Based on the OMAP devices.c | ||
6 | * | ||
7 | * 2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
8 | * terms of the GNU General Public License version 2. This program is | ||
9 | * licensed "as is" without any warranty of any kind, whether express | ||
10 | * or implied. | ||
11 | * | ||
12 | * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
13 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
14 | * Copyright 2008 Sascha Hauer, kernel@pengutronix.de | ||
15 | * Copyright (c) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
16 | * Copyright (c) 2008 Darius Augulis <darius.augulis@teltonika.lt> | ||
17 | * | ||
18 | * This program is free software; you can redistribute it and/or | ||
19 | * modify it under the terms of the GNU General Public License | ||
20 | * as published by the Free Software Foundation; either version 2 | ||
21 | * of the License, or (at your option) any later version. | ||
22 | * This program is distributed in the hope that it will be useful, | ||
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
25 | * GNU General Public License for more details. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License | ||
28 | * along with this program; if not, write to the Free Software | ||
29 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
30 | * MA 02110-1301, USA. | ||
31 | */ | ||
32 | #include <linux/module.h> | ||
33 | #include <linux/kernel.h> | ||
34 | #include <linux/init.h> | ||
35 | #include <linux/platform_device.h> | ||
36 | #include <linux/gpio.h> | ||
37 | #include <linux/dma-mapping.h> | ||
38 | #include <linux/serial.h> | ||
39 | |||
40 | #include <mach/irqs.h> | ||
41 | #include <mach/hardware.h> | ||
42 | #include <mach/common.h> | ||
43 | #include <mach/mmc.h> | ||
44 | |||
45 | #include "devices.h" | ||
46 | |||
47 | #if defined(CONFIG_ARCH_MX1) | ||
48 | static struct resource imx1_camera_resources[] = { | ||
49 | { | ||
50 | .start = 0x00224000, | ||
51 | .end = 0x00224010, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, { | ||
54 | .start = MX1_CSI_INT, | ||
55 | .end = MX1_CSI_INT, | ||
56 | .flags = IORESOURCE_IRQ, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static u64 imx1_camera_dmamask = DMA_BIT_MASK(32); | ||
61 | |||
62 | struct platform_device imx1_camera_device = { | ||
63 | .name = "mx1-camera", | ||
64 | .id = 0, /* This is used to put cameras on this interface */ | ||
65 | .dev = { | ||
66 | .dma_mask = &imx1_camera_dmamask, | ||
67 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
68 | }, | ||
69 | .resource = imx1_camera_resources, | ||
70 | .num_resources = ARRAY_SIZE(imx1_camera_resources), | ||
71 | }; | ||
72 | |||
73 | static struct resource imx_rtc_resources[] = { | ||
74 | { | ||
75 | .start = 0x00204000, | ||
76 | .end = 0x00204024, | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, { | ||
79 | .start = MX1_RTC_INT, | ||
80 | .end = MX1_RTC_INT, | ||
81 | .flags = IORESOURCE_IRQ, | ||
82 | }, { | ||
83 | .start = MX1_RTC_SAMINT, | ||
84 | .end = MX1_RTC_SAMINT, | ||
85 | .flags = IORESOURCE_IRQ, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | struct platform_device imx_rtc_device = { | ||
90 | .name = "rtc-imx", | ||
91 | .id = 0, | ||
92 | .resource = imx_rtc_resources, | ||
93 | .num_resources = ARRAY_SIZE(imx_rtc_resources), | ||
94 | }; | ||
95 | |||
96 | static struct resource imx_wdt_resources[] = { | ||
97 | { | ||
98 | .start = 0x00201000, | ||
99 | .end = 0x00201008, | ||
100 | .flags = IORESOURCE_MEM, | ||
101 | }, { | ||
102 | .start = MX1_WDT_INT, | ||
103 | .end = MX1_WDT_INT, | ||
104 | .flags = IORESOURCE_IRQ, | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | struct platform_device imx_wdt_device = { | ||
109 | .name = "imx-wdt", | ||
110 | .id = 0, | ||
111 | .resource = imx_wdt_resources, | ||
112 | .num_resources = ARRAY_SIZE(imx_wdt_resources), | ||
113 | }; | ||
114 | |||
115 | static struct resource imx_usb_resources[] = { | ||
116 | { | ||
117 | .start = 0x00212000, | ||
118 | .end = 0x00212148, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, { | ||
121 | .start = MX1_USBD_INT0, | ||
122 | .end = MX1_USBD_INT0, | ||
123 | .flags = IORESOURCE_IRQ, | ||
124 | }, { | ||
125 | .start = MX1_USBD_INT1, | ||
126 | .end = MX1_USBD_INT1, | ||
127 | .flags = IORESOURCE_IRQ, | ||
128 | }, { | ||
129 | .start = MX1_USBD_INT2, | ||
130 | .end = MX1_USBD_INT2, | ||
131 | .flags = IORESOURCE_IRQ, | ||
132 | }, { | ||
133 | .start = MX1_USBD_INT3, | ||
134 | .end = MX1_USBD_INT3, | ||
135 | .flags = IORESOURCE_IRQ, | ||
136 | }, { | ||
137 | .start = MX1_USBD_INT4, | ||
138 | .end = MX1_USBD_INT4, | ||
139 | .flags = IORESOURCE_IRQ, | ||
140 | }, { | ||
141 | .start = MX1_USBD_INT5, | ||
142 | .end = MX1_USBD_INT5, | ||
143 | .flags = IORESOURCE_IRQ, | ||
144 | }, { | ||
145 | .start = MX1_USBD_INT6, | ||
146 | .end = MX1_USBD_INT6, | ||
147 | .flags = IORESOURCE_IRQ, | ||
148 | }, | ||
149 | }; | ||
150 | |||
151 | struct platform_device imx_usb_device = { | ||
152 | .name = "imx_udc", | ||
153 | .id = 0, | ||
154 | .num_resources = ARRAY_SIZE(imx_usb_resources), | ||
155 | .resource = imx_usb_resources, | ||
156 | }; | ||
157 | |||
158 | /* GPIO port description */ | ||
159 | static struct mxc_gpio_port imx_gpio_ports[] = { | ||
160 | { | ||
161 | .chip.label = "gpio-0", | ||
162 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR), | ||
163 | .irq = MX1_GPIO_INT_PORTA, | ||
164 | .virtual_irq_start = MXC_GPIO_IRQ_START, | ||
165 | }, { | ||
166 | .chip.label = "gpio-1", | ||
167 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x100), | ||
168 | .irq = MX1_GPIO_INT_PORTB, | ||
169 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32, | ||
170 | }, { | ||
171 | .chip.label = "gpio-2", | ||
172 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x200), | ||
173 | .irq = MX1_GPIO_INT_PORTC, | ||
174 | .virtual_irq_start = MXC_GPIO_IRQ_START + 64, | ||
175 | }, { | ||
176 | .chip.label = "gpio-3", | ||
177 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x300), | ||
178 | .irq = MX1_GPIO_INT_PORTD, | ||
179 | .virtual_irq_start = MXC_GPIO_IRQ_START + 96, | ||
180 | } | ||
181 | }; | ||
182 | |||
183 | int __init imx1_register_gpios(void) | ||
184 | { | ||
185 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); | ||
186 | } | ||
187 | #endif | ||
188 | |||
189 | #if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) | ||
190 | |||
191 | #ifdef CONFIG_MACH_MX27 | ||
192 | static struct resource mx27_camera_resources[] = { | ||
193 | { | ||
194 | .start = MX27_CSI_BASE_ADDR, | ||
195 | .end = MX27_CSI_BASE_ADDR + 0x1f, | ||
196 | .flags = IORESOURCE_MEM, | ||
197 | }, { | ||
198 | .start = MX27_EMMA_PRP_BASE_ADDR, | ||
199 | .end = MX27_EMMA_PRP_BASE_ADDR + 0x1f, | ||
200 | .flags = IORESOURCE_MEM, | ||
201 | }, { | ||
202 | .start = MX27_INT_CSI, | ||
203 | .end = MX27_INT_CSI, | ||
204 | .flags = IORESOURCE_IRQ, | ||
205 | },{ | ||
206 | .start = MX27_INT_EMMAPRP, | ||
207 | .end = MX27_INT_EMMAPRP, | ||
208 | .flags = IORESOURCE_IRQ, | ||
209 | }, | ||
210 | }; | ||
211 | struct platform_device mx27_camera_device = { | ||
212 | .name = "mx2-camera", | ||
213 | .id = 0, | ||
214 | .num_resources = ARRAY_SIZE(mx27_camera_resources), | ||
215 | .resource = mx27_camera_resources, | ||
216 | .dev = { | ||
217 | .coherent_dma_mask = 0xffffffff, | ||
218 | }, | ||
219 | }; | ||
220 | #endif | ||
221 | |||
222 | /* | ||
223 | * General Purpose Timer | ||
224 | * - i.MX21: 3 timers | ||
225 | * - i.MX27: 6 timers | ||
226 | */ | ||
227 | #define DEFINE_IMX_GPT_DEVICE(n, baseaddr, irq) \ | ||
228 | static struct resource timer ## n ##_resources[] = { \ | ||
229 | { \ | ||
230 | .start = baseaddr, \ | ||
231 | .end = baseaddr + SZ_4K - 1, \ | ||
232 | .flags = IORESOURCE_MEM, \ | ||
233 | }, { \ | ||
234 | .start = irq, \ | ||
235 | .end = irq, \ | ||
236 | .flags = IORESOURCE_IRQ, \ | ||
237 | } \ | ||
238 | }; \ | ||
239 | \ | ||
240 | struct platform_device mxc_gpt ## n = { \ | ||
241 | .name = "imx_gpt", \ | ||
242 | .id = n, \ | ||
243 | .num_resources = ARRAY_SIZE(timer ## n ## _resources), \ | ||
244 | .resource = timer ## n ## _resources, \ | ||
245 | } | ||
246 | |||
247 | /* We use gpt1 as system timer, so do not add a device for this one */ | ||
248 | DEFINE_IMX_GPT_DEVICE(1, MX2x_GPT2_BASE_ADDR, MX2x_INT_GPT2); | ||
249 | DEFINE_IMX_GPT_DEVICE(2, MX2x_GPT3_BASE_ADDR, MX2x_INT_GPT3); | ||
250 | |||
251 | #ifdef CONFIG_MACH_MX27 | ||
252 | DEFINE_IMX_GPT_DEVICE(3, MX27_GPT4_BASE_ADDR, MX27_INT_GPT4); | ||
253 | DEFINE_IMX_GPT_DEVICE(4, MX27_GPT5_BASE_ADDR, MX27_INT_GPT5); | ||
254 | DEFINE_IMX_GPT_DEVICE(5, MX27_GPT6_BASE_ADDR, MX27_INT_GPT6); | ||
255 | #endif | ||
256 | |||
257 | /* Watchdog: i.MX1 has seperate driver, i.MX21 and i.MX27 are equal */ | ||
258 | static struct resource mxc_wdt_resources[] = { | ||
259 | { | ||
260 | .start = MX2x_WDOG_BASE_ADDR, | ||
261 | .end = MX2x_WDOG_BASE_ADDR + SZ_4K - 1, | ||
262 | .flags = IORESOURCE_MEM, | ||
263 | }, | ||
264 | }; | ||
265 | |||
266 | struct platform_device mxc_wdt = { | ||
267 | .name = "imx2-wdt", | ||
268 | .id = 0, | ||
269 | .num_resources = ARRAY_SIZE(mxc_wdt_resources), | ||
270 | .resource = mxc_wdt_resources, | ||
271 | }; | ||
272 | |||
273 | static struct resource mxc_w1_master_resources[] = { | ||
274 | { | ||
275 | .start = MX2x_OWIRE_BASE_ADDR, | ||
276 | .end = MX2x_OWIRE_BASE_ADDR + SZ_4K - 1, | ||
277 | .flags = IORESOURCE_MEM, | ||
278 | }, | ||
279 | }; | ||
280 | |||
281 | struct platform_device mxc_w1_master_device = { | ||
282 | .name = "mxc_w1", | ||
283 | .id = 0, | ||
284 | .num_resources = ARRAY_SIZE(mxc_w1_master_resources), | ||
285 | .resource = mxc_w1_master_resources, | ||
286 | }; | ||
287 | |||
288 | /* | ||
289 | * lcdc: | ||
290 | * - i.MX1: the basic controller | ||
291 | * - i.MX21: to be checked | ||
292 | * - i.MX27: like i.MX1, with slightly variations | ||
293 | */ | ||
294 | static struct resource mxc_fb[] = { | ||
295 | { | ||
296 | .start = MX2x_LCDC_BASE_ADDR, | ||
297 | .end = MX2x_LCDC_BASE_ADDR + SZ_4K - 1, | ||
298 | .flags = IORESOURCE_MEM, | ||
299 | }, { | ||
300 | .start = MX2x_INT_LCDC, | ||
301 | .end = MX2x_INT_LCDC, | ||
302 | .flags = IORESOURCE_IRQ, | ||
303 | } | ||
304 | }; | ||
305 | |||
306 | /* mxc lcd driver */ | ||
307 | struct platform_device mxc_fb_device = { | ||
308 | .name = "imx-fb", | ||
309 | .id = 0, | ||
310 | .num_resources = ARRAY_SIZE(mxc_fb), | ||
311 | .resource = mxc_fb, | ||
312 | .dev = { | ||
313 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
314 | }, | ||
315 | }; | ||
316 | |||
317 | static struct resource mxc_pwm_resources[] = { | ||
318 | { | ||
319 | .start = MX2x_PWM_BASE_ADDR, | ||
320 | .end = MX2x_PWM_BASE_ADDR + SZ_4K - 1, | ||
321 | .flags = IORESOURCE_MEM, | ||
322 | }, { | ||
323 | .start = MX2x_INT_PWM, | ||
324 | .end = MX2x_INT_PWM, | ||
325 | .flags = IORESOURCE_IRQ, | ||
326 | } | ||
327 | }; | ||
328 | |||
329 | struct platform_device mxc_pwm_device = { | ||
330 | .name = "mxc_pwm", | ||
331 | .id = 0, | ||
332 | .num_resources = ARRAY_SIZE(mxc_pwm_resources), | ||
333 | .resource = mxc_pwm_resources, | ||
334 | }; | ||
335 | |||
336 | #define DEFINE_MXC_MMC_DEVICE(n, baseaddr, irq, dmareq) \ | ||
337 | static struct resource mxc_sdhc_resources ## n[] = { \ | ||
338 | { \ | ||
339 | .start = baseaddr, \ | ||
340 | .end = baseaddr + SZ_4K - 1, \ | ||
341 | .flags = IORESOURCE_MEM, \ | ||
342 | }, { \ | ||
343 | .start = irq, \ | ||
344 | .end = irq, \ | ||
345 | .flags = IORESOURCE_IRQ, \ | ||
346 | }, { \ | ||
347 | .start = dmareq, \ | ||
348 | .end = dmareq, \ | ||
349 | .flags = IORESOURCE_DMA, \ | ||
350 | }, \ | ||
351 | }; \ | ||
352 | \ | ||
353 | static u64 mxc_sdhc ## n ## _dmamask = DMA_BIT_MASK(32); \ | ||
354 | \ | ||
355 | struct platform_device mxc_sdhc_device ## n = { \ | ||
356 | .name = "mxc-mmc", \ | ||
357 | .id = n, \ | ||
358 | .dev = { \ | ||
359 | .dma_mask = &mxc_sdhc ## n ## _dmamask, \ | ||
360 | .coherent_dma_mask = DMA_BIT_MASK(32), \ | ||
361 | }, \ | ||
362 | .num_resources = ARRAY_SIZE(mxc_sdhc_resources ## n), \ | ||
363 | .resource = mxc_sdhc_resources ## n, \ | ||
364 | } | ||
365 | |||
366 | DEFINE_MXC_MMC_DEVICE(0, MX2x_SDHC1_BASE_ADDR, MX2x_INT_SDHC1, MX2x_DMA_REQ_SDHC1); | ||
367 | DEFINE_MXC_MMC_DEVICE(1, MX2x_SDHC2_BASE_ADDR, MX2x_INT_SDHC2, MX2x_DMA_REQ_SDHC2); | ||
368 | |||
369 | #ifdef CONFIG_MACH_MX27 | ||
370 | static struct resource otg_resources[] = { | ||
371 | { | ||
372 | .start = MX27_USBOTG_BASE_ADDR, | ||
373 | .end = MX27_USBOTG_BASE_ADDR + 0x1ff, | ||
374 | .flags = IORESOURCE_MEM, | ||
375 | }, { | ||
376 | .start = MX27_INT_USB3, | ||
377 | .end = MX27_INT_USB3, | ||
378 | .flags = IORESOURCE_IRQ, | ||
379 | }, | ||
380 | }; | ||
381 | |||
382 | static u64 otg_dmamask = DMA_BIT_MASK(32); | ||
383 | |||
384 | /* OTG gadget device */ | ||
385 | struct platform_device mxc_otg_udc_device = { | ||
386 | .name = "fsl-usb2-udc", | ||
387 | .id = -1, | ||
388 | .dev = { | ||
389 | .dma_mask = &otg_dmamask, | ||
390 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
391 | }, | ||
392 | .resource = otg_resources, | ||
393 | .num_resources = ARRAY_SIZE(otg_resources), | ||
394 | }; | ||
395 | |||
396 | /* OTG host */ | ||
397 | struct platform_device mxc_otg_host = { | ||
398 | .name = "mxc-ehci", | ||
399 | .id = 0, | ||
400 | .dev = { | ||
401 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
402 | .dma_mask = &otg_dmamask, | ||
403 | }, | ||
404 | .resource = otg_resources, | ||
405 | .num_resources = ARRAY_SIZE(otg_resources), | ||
406 | }; | ||
407 | |||
408 | /* USB host 1 */ | ||
409 | |||
410 | static u64 usbh1_dmamask = DMA_BIT_MASK(32); | ||
411 | |||
412 | static struct resource mxc_usbh1_resources[] = { | ||
413 | { | ||
414 | .start = MX27_USBOTG_BASE_ADDR + 0x200, | ||
415 | .end = MX27_USBOTG_BASE_ADDR + 0x3ff, | ||
416 | .flags = IORESOURCE_MEM, | ||
417 | }, { | ||
418 | .start = MX27_INT_USB1, | ||
419 | .end = MX27_INT_USB1, | ||
420 | .flags = IORESOURCE_IRQ, | ||
421 | }, | ||
422 | }; | ||
423 | |||
424 | struct platform_device mxc_usbh1 = { | ||
425 | .name = "mxc-ehci", | ||
426 | .id = 1, | ||
427 | .dev = { | ||
428 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
429 | .dma_mask = &usbh1_dmamask, | ||
430 | }, | ||
431 | .resource = mxc_usbh1_resources, | ||
432 | .num_resources = ARRAY_SIZE(mxc_usbh1_resources), | ||
433 | }; | ||
434 | |||
435 | /* USB host 2 */ | ||
436 | static u64 usbh2_dmamask = DMA_BIT_MASK(32); | ||
437 | |||
438 | static struct resource mxc_usbh2_resources[] = { | ||
439 | { | ||
440 | .start = MX27_USBOTG_BASE_ADDR + 0x400, | ||
441 | .end = MX27_USBOTG_BASE_ADDR + 0x5ff, | ||
442 | .flags = IORESOURCE_MEM, | ||
443 | }, { | ||
444 | .start = MX27_INT_USB2, | ||
445 | .end = MX27_INT_USB2, | ||
446 | .flags = IORESOURCE_IRQ, | ||
447 | }, | ||
448 | }; | ||
449 | |||
450 | struct platform_device mxc_usbh2 = { | ||
451 | .name = "mxc-ehci", | ||
452 | .id = 2, | ||
453 | .dev = { | ||
454 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
455 | .dma_mask = &usbh2_dmamask, | ||
456 | }, | ||
457 | .resource = mxc_usbh2_resources, | ||
458 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | ||
459 | }; | ||
460 | #endif | ||
461 | |||
462 | /* GPIO port description */ | ||
463 | #define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \ | ||
464 | { \ | ||
465 | .chip.label = "gpio-" #n, \ | ||
466 | .irq = _irq, \ | ||
467 | .base = SOC ## _IO_ADDRESS(MX2x_GPIO_BASE_ADDR + \ | ||
468 | n * 0x100), \ | ||
469 | .virtual_irq_start = MXC_GPIO_IRQ_START + n * 32, \ | ||
470 | } | ||
471 | |||
472 | #define DEFINE_MXC_GPIO_PORT(SOC, n) \ | ||
473 | { \ | ||
474 | .chip.label = "gpio-" #n, \ | ||
475 | .base = SOC ## _IO_ADDRESS(MX2x_GPIO_BASE_ADDR + \ | ||
476 | n * 0x100), \ | ||
477 | .virtual_irq_start = MXC_GPIO_IRQ_START + n * 32, \ | ||
478 | } | ||
479 | |||
480 | #define DEFINE_MXC_GPIO_PORTS(SOC, pfx) \ | ||
481 | static struct mxc_gpio_port pfx ## _gpio_ports[] = { \ | ||
482 | DEFINE_MXC_GPIO_PORT_IRQ(SOC, 0, SOC ## _INT_GPIO), \ | ||
483 | DEFINE_MXC_GPIO_PORT(SOC, 1), \ | ||
484 | DEFINE_MXC_GPIO_PORT(SOC, 2), \ | ||
485 | DEFINE_MXC_GPIO_PORT(SOC, 3), \ | ||
486 | DEFINE_MXC_GPIO_PORT(SOC, 4), \ | ||
487 | DEFINE_MXC_GPIO_PORT(SOC, 5), \ | ||
488 | } | ||
489 | |||
490 | #ifdef CONFIG_MACH_MX21 | ||
491 | DEFINE_MXC_GPIO_PORTS(MX21, imx21); | ||
492 | |||
493 | int __init imx21_register_gpios(void) | ||
494 | { | ||
495 | return mxc_gpio_init(imx21_gpio_ports, ARRAY_SIZE(imx21_gpio_ports)); | ||
496 | } | ||
497 | #endif | ||
498 | |||
499 | #ifdef CONFIG_MACH_MX27 | ||
500 | DEFINE_MXC_GPIO_PORTS(MX27, imx27); | ||
501 | |||
502 | int __init imx27_register_gpios(void) | ||
503 | { | ||
504 | return mxc_gpio_init(imx27_gpio_ports, ARRAY_SIZE(imx27_gpio_ports)); | ||
505 | } | ||
506 | #endif | ||
507 | |||
508 | #ifdef CONFIG_MACH_MX21 | ||
509 | static struct resource mx21_usbhc_resources[] = { | ||
510 | { | ||
511 | .start = MX21_USBOTG_BASE_ADDR, | ||
512 | .end = MX21_USBOTG_BASE_ADDR + SZ_8K - 1, | ||
513 | .flags = IORESOURCE_MEM, | ||
514 | }, | ||
515 | { | ||
516 | .start = MX21_INT_USBHOST, | ||
517 | .end = MX21_INT_USBHOST, | ||
518 | .flags = IORESOURCE_IRQ, | ||
519 | }, | ||
520 | }; | ||
521 | |||
522 | struct platform_device mx21_usbhc_device = { | ||
523 | .name = "imx21-hcd", | ||
524 | .id = 0, | ||
525 | .dev = { | ||
526 | .dma_mask = &mx21_usbhc_device.dev.coherent_dma_mask, | ||
527 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
528 | }, | ||
529 | .num_resources = ARRAY_SIZE(mx21_usbhc_resources), | ||
530 | .resource = mx21_usbhc_resources, | ||
531 | }; | ||
532 | #endif | ||
533 | |||
534 | static struct resource imx_kpp_resources[] = { | ||
535 | { | ||
536 | .start = MX2x_KPP_BASE_ADDR, | ||
537 | .end = MX2x_KPP_BASE_ADDR + 0xf, | ||
538 | .flags = IORESOURCE_MEM | ||
539 | }, { | ||
540 | .start = MX2x_INT_KPP, | ||
541 | .end = MX2x_INT_KPP, | ||
542 | .flags = IORESOURCE_IRQ, | ||
543 | }, | ||
544 | }; | ||
545 | |||
546 | struct platform_device imx_kpp_device = { | ||
547 | .name = "imx-keypad", | ||
548 | .id = -1, | ||
549 | .num_resources = ARRAY_SIZE(imx_kpp_resources), | ||
550 | .resource = imx_kpp_resources, | ||
551 | }; | ||
552 | |||
553 | #endif | ||
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h deleted file mode 100644 index 807f02a031c9..000000000000 --- a/arch/arm/mach-imx/devices.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | #ifdef CONFIG_ARCH_MX1 | ||
2 | extern struct platform_device imx1_camera_device; | ||
3 | extern struct platform_device imx_rtc_device; | ||
4 | extern struct platform_device imx_wdt_device; | ||
5 | extern struct platform_device imx_usb_device; | ||
6 | #endif | ||
7 | |||
8 | #if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) | ||
9 | extern struct platform_device mxc_gpt1; | ||
10 | extern struct platform_device mxc_gpt2; | ||
11 | #ifdef CONFIG_MACH_MX27 | ||
12 | extern struct platform_device mxc_gpt3; | ||
13 | extern struct platform_device mxc_gpt4; | ||
14 | extern struct platform_device mxc_gpt5; | ||
15 | #endif | ||
16 | extern struct platform_device mxc_wdt; | ||
17 | extern struct platform_device mxc_w1_master_device; | ||
18 | extern struct platform_device mxc_fb_device; | ||
19 | extern struct platform_device mxc_pwm_device; | ||
20 | extern struct platform_device mxc_sdhc_device0; | ||
21 | extern struct platform_device mxc_sdhc_device1; | ||
22 | extern struct platform_device mxc_otg_udc_device; | ||
23 | extern struct platform_device mx27_camera_device; | ||
24 | extern struct platform_device mxc_otg_host; | ||
25 | extern struct platform_device mxc_usbh1; | ||
26 | extern struct platform_device mxc_usbh2; | ||
27 | extern struct platform_device mx21_usbhc_device; | ||
28 | extern struct platform_device imx_kpp_device; | ||
29 | #endif | ||
diff --git a/arch/arm/mach-imx/dma-v1.c b/arch/arm/mach-imx/dma-v1.c index 3e8c47c63bac..e9f1769b49f5 100644 --- a/arch/arm/mach-imx/dma-v1.c +++ b/arch/arm/mach-imx/dma-v1.c | |||
@@ -818,9 +818,11 @@ static int __init imx_dma_init(void) | |||
818 | imx_dmav1_baseaddr = MX27_IO_ADDRESS(MX27_DMA_BASE_ADDR); | 818 | imx_dmav1_baseaddr = MX27_IO_ADDRESS(MX27_DMA_BASE_ADDR); |
819 | else | 819 | else |
820 | #endif | 820 | #endif |
821 | BUG(); | 821 | return 0; |
822 | 822 | ||
823 | dma_clk = clk_get(NULL, "dma"); | 823 | dma_clk = clk_get(NULL, "dma"); |
824 | if (IS_ERR(dma_clk)) | ||
825 | return PTR_ERR(dma_clk); | ||
824 | clk_enable(dma_clk); | 826 | clk_enable(dma_clk); |
825 | 827 | ||
826 | /* reset DMA module */ | 828 | /* reset DMA module */ |
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index 7e1e9dc2c8fc..275c8589d797 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | |||
@@ -26,20 +26,16 @@ | |||
26 | #include <linux/spi/ads7846.h> | 26 | #include <linux/spi/ads7846.h> |
27 | #include <linux/backlight.h> | 27 | #include <linux/backlight.h> |
28 | #include <video/platform_lcd.h> | 28 | #include <video/platform_lcd.h> |
29 | #include <linux/input/matrix_keypad.h> | ||
30 | 29 | ||
31 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
32 | 31 | ||
33 | #include <mach/common.h> | 32 | #include <mach/common.h> |
34 | #include <mach/iomux-mx27.h> | 33 | #include <mach/iomux-mx27.h> |
35 | #include <mach/imxfb.h> | ||
36 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
37 | #include <mach/mmc.h> | ||
38 | #include <mach/spi.h> | 35 | #include <mach/spi.h> |
39 | #include <mach/audmux.h> | 36 | #include <mach/audmux.h> |
40 | 37 | ||
41 | #include "devices-imx27.h" | 38 | #include "devices-imx27.h" |
42 | #include "devices.h" | ||
43 | 39 | ||
44 | static const int eukrea_mbimx27_pins[] __initconst = { | 40 | static const int eukrea_mbimx27_pins[] __initconst = { |
45 | /* UART2 */ | 41 | /* UART2 */ |
@@ -111,7 +107,8 @@ static const uint32_t eukrea_mbimx27_keymap[] = { | |||
111 | KEY(1, 1, KEY_LEFT), | 107 | KEY(1, 1, KEY_LEFT), |
112 | }; | 108 | }; |
113 | 109 | ||
114 | static struct matrix_keymap_data eukrea_mbimx27_keymap_data = { | 110 | static const struct matrix_keymap_data |
111 | eukrea_mbimx27_keymap_data __initconst = { | ||
115 | .keymap = eukrea_mbimx27_keymap, | 112 | .keymap = eukrea_mbimx27_keymap, |
116 | .keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap), | 113 | .keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap), |
117 | }; | 114 | }; |
@@ -196,7 +193,7 @@ static struct imx_fb_videomode eukrea_mbimx27_modes[] = { | |||
196 | }, | 193 | }, |
197 | }; | 194 | }; |
198 | 195 | ||
199 | static struct imx_fb_platform_data eukrea_mbimx27_fb_data = { | 196 | static const struct imx_fb_platform_data eukrea_mbimx27_fb_data __initconst = { |
200 | .mode = eukrea_mbimx27_modes, | 197 | .mode = eukrea_mbimx27_modes, |
201 | .num_modes = ARRAY_SIZE(eukrea_mbimx27_modes), | 198 | .num_modes = ARRAY_SIZE(eukrea_mbimx27_modes), |
202 | 199 | ||
@@ -300,7 +297,7 @@ static struct platform_device *platform_devices[] __initdata = { | |||
300 | &leds_gpio, | 297 | &leds_gpio, |
301 | }; | 298 | }; |
302 | 299 | ||
303 | static struct imxmmc_platform_data sdhc_pdata = { | 300 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { |
304 | .dat3_card_detect = 1, | 301 | .dat3_card_detect = 1, |
305 | }; | 302 | }; |
306 | 303 | ||
@@ -345,8 +342,8 @@ void __init eukrea_mbimx27_baseboard_init(void) | |||
345 | imx27_add_imx_uart3(&uart_pdata); | 342 | imx27_add_imx_uart3(&uart_pdata); |
346 | #endif | 343 | #endif |
347 | 344 | ||
348 | mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data); | 345 | imx27_add_imx_fb(&eukrea_mbimx27_fb_data); |
349 | mxc_register_device(&mxc_sdhc_device0, &sdhc_pdata); | 346 | imx27_add_mxc_mmc(0, &sdhc_pdata); |
350 | 347 | ||
351 | i2c_register_board_info(0, eukrea_mbimx27_i2c_devices, | 348 | i2c_register_board_info(0, eukrea_mbimx27_i2c_devices, |
352 | ARRAY_SIZE(eukrea_mbimx27_i2c_devices)); | 349 | ARRAY_SIZE(eukrea_mbimx27_i2c_devices)); |
@@ -380,7 +377,7 @@ void __init eukrea_mbimx27_baseboard_init(void) | |||
380 | gpio_request(GPIO_PORTA | 25, "lcd_enable"); | 377 | gpio_request(GPIO_PORTA | 25, "lcd_enable"); |
381 | platform_device_register(&eukrea_mbimx27_lcd_powerdev); | 378 | platform_device_register(&eukrea_mbimx27_lcd_powerdev); |
382 | 379 | ||
383 | mxc_register_device(&imx_kpp_device, &eukrea_mbimx27_keymap_data); | 380 | imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data); |
384 | 381 | ||
385 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 382 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
386 | } | 383 | } |
diff --git a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c index e765ac5d9a08..cb705c28de02 100644 --- a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | |||
@@ -33,13 +33,11 @@ | |||
33 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
34 | #include <mach/mx25.h> | 34 | #include <mach/mx25.h> |
35 | #include <mach/imx-uart.h> | 35 | #include <mach/imx-uart.h> |
36 | #include <mach/imxfb.h> | ||
37 | #include <mach/audmux.h> | 36 | #include <mach/audmux.h> |
38 | 37 | ||
39 | #include "devices-imx25.h" | 38 | #include "devices-imx25.h" |
40 | #include "devices.h" | ||
41 | 39 | ||
42 | static struct pad_desc eukrea_mbimxsd_pads[] = { | 40 | static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { |
43 | /* LCD */ | 41 | /* LCD */ |
44 | MX25_PAD_LD0__LD0, | 42 | MX25_PAD_LD0__LD0, |
45 | MX25_PAD_LD1__LD1, | 43 | MX25_PAD_LD1__LD1, |
@@ -151,7 +149,7 @@ static struct imx_fb_videomode eukrea_mximxsd_modes[] = { | |||
151 | }, | 149 | }, |
152 | }; | 150 | }; |
153 | 151 | ||
154 | static struct imx_fb_platform_data eukrea_mximxsd_fb_pdata = { | 152 | static const struct imx_fb_platform_data eukrea_mximxsd_fb_pdata __initconst = { |
155 | .mode = eukrea_mximxsd_modes, | 153 | .mode = eukrea_mximxsd_modes, |
156 | .num_modes = ARRAY_SIZE(eukrea_mximxsd_modes), | 154 | .num_modes = ARRAY_SIZE(eukrea_mximxsd_modes), |
157 | .pwmr = 0x00A903FF, | 155 | .pwmr = 0x00A903FF, |
@@ -273,11 +271,11 @@ void __init eukrea_mbimxsd25_baseboard_init(void) | |||
273 | #endif | 271 | #endif |
274 | 272 | ||
275 | imx25_add_imx_uart1(&uart_pdata); | 273 | imx25_add_imx_uart1(&uart_pdata); |
276 | mxc_register_device(&mx25_fb_device, &eukrea_mximxsd_fb_pdata); | 274 | imx25_add_imx_fb(&eukrea_mximxsd_fb_pdata); |
277 | imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); | 275 | imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); |
278 | 276 | ||
279 | imx25_add_flexcan1(NULL); | 277 | imx25_add_flexcan1(NULL); |
280 | imx25_add_esdhc(0, NULL); | 278 | imx25_add_sdhci_esdhc_imx(0, NULL); |
281 | 279 | ||
282 | gpio_request(GPIO_LED1, "LED1"); | 280 | gpio_request(GPIO_LED1, "LED1"); |
283 | gpio_direction_output(GPIO_LED1, 1); | 281 | gpio_direction_output(GPIO_LED1, 1); |
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index 745ee60fb068..6cf04da2456a 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/serial_8250.h> | 28 | #include <linux/serial_8250.h> |
29 | #include <linux/usb/otg.h> | 29 | #include <linux/usb/otg.h> |
30 | #include <linux/usb/ulpi.h> | 30 | #include <linux/usb/ulpi.h> |
31 | #include <linux/fsl_devices.h> | ||
32 | 31 | ||
33 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
@@ -40,11 +39,9 @@ | |||
40 | #include <mach/hardware.h> | 39 | #include <mach/hardware.h> |
41 | #include <mach/iomux-mx27.h> | 40 | #include <mach/iomux-mx27.h> |
42 | #include <mach/mxc_nand.h> | 41 | #include <mach/mxc_nand.h> |
43 | #include <mach/mxc_ehci.h> | ||
44 | #include <mach/ulpi.h> | 42 | #include <mach/ulpi.h> |
45 | 43 | ||
46 | #include "devices-imx27.h" | 44 | #include "devices-imx27.h" |
47 | #include "devices.h" | ||
48 | 45 | ||
49 | static const int eukrea_cpuimx27_pins[] __initconst = { | 46 | static const int eukrea_cpuimx27_pins[] __initconst = { |
50 | /* UART1 */ | 47 | /* UART1 */ |
@@ -157,8 +154,6 @@ cpuimx27_nand_board_info __initconst = { | |||
157 | 154 | ||
158 | static struct platform_device *platform_devices[] __initdata = { | 155 | static struct platform_device *platform_devices[] __initdata = { |
159 | &eukrea_cpuimx27_nor_mtd_device, | 156 | &eukrea_cpuimx27_nor_mtd_device, |
160 | &mxc_wdt, | ||
161 | &mxc_w1_master_device, | ||
162 | }; | 157 | }; |
163 | 158 | ||
164 | static const struct imxi2c_platform_data cpuimx27_i2c1_data __initconst = { | 159 | static const struct imxi2c_platform_data cpuimx27_i2c1_data __initconst = { |
@@ -215,18 +210,18 @@ static struct platform_device serial_device = { | |||
215 | #endif | 210 | #endif |
216 | 211 | ||
217 | #if defined(CONFIG_USB_ULPI) | 212 | #if defined(CONFIG_USB_ULPI) |
218 | static struct mxc_usbh_platform_data otg_pdata = { | 213 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
219 | .portsc = MXC_EHCI_MODE_ULPI, | 214 | .portsc = MXC_EHCI_MODE_ULPI, |
220 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 215 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
221 | }; | 216 | }; |
222 | 217 | ||
223 | static struct mxc_usbh_platform_data usbh2_pdata = { | 218 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
224 | .portsc = MXC_EHCI_MODE_ULPI, | 219 | .portsc = MXC_EHCI_MODE_ULPI, |
225 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 220 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
226 | }; | 221 | }; |
227 | #endif | 222 | #endif |
228 | 223 | ||
229 | static struct fsl_usb2_platform_data otg_device_pdata = { | 224 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
230 | .operating_mode = FSL_USB2_DR_DEVICE, | 225 | .operating_mode = FSL_USB2_DR_DEVICE, |
231 | .phy_mode = FSL_USB2_PHY_ULPI, | 226 | .phy_mode = FSL_USB2_PHY_ULPI, |
232 | }; | 227 | }; |
@@ -262,10 +257,12 @@ static void __init eukrea_cpuimx27_init(void) | |||
262 | 257 | ||
263 | imx27_add_fec(NULL); | 258 | imx27_add_fec(NULL); |
264 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 259 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
260 | imx27_add_imx2_wdt(NULL); | ||
261 | imx27_add_mxc_w1(NULL); | ||
265 | 262 | ||
266 | #if defined(CONFIG_MACH_EUKREA_CPUIMX27_USESDHC2) | 263 | #if defined(CONFIG_MACH_EUKREA_CPUIMX27_USESDHC2) |
267 | /* SDHC2 can be used for Wifi */ | 264 | /* SDHC2 can be used for Wifi */ |
268 | mxc_register_device(&mxc_sdhc_device1, NULL); | 265 | imx27_add_mxc_mmc(1, NULL); |
269 | #endif | 266 | #endif |
270 | #if defined(MACH_EUKREA_CPUIMX27_USEUART4) | 267 | #if defined(MACH_EUKREA_CPUIMX27_USEUART4) |
271 | /* in which case UART4 is also used for Bluetooth */ | 268 | /* in which case UART4 is also used for Bluetooth */ |
@@ -281,16 +278,16 @@ static void __init eukrea_cpuimx27_init(void) | |||
281 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 278 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
282 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 279 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
283 | 280 | ||
284 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 281 | imx27_add_mxc_ehci_otg(&otg_pdata); |
285 | } | 282 | } |
286 | 283 | ||
287 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 284 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
288 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 285 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
289 | 286 | ||
290 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 287 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
291 | #endif | 288 | #endif |
292 | if (!otg_mode_host) | 289 | if (!otg_mode_host) |
293 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 290 | imx27_add_fsl_usb2_udc(&otg_device_pdata); |
294 | 291 | ||
295 | #ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD | 292 | #ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD |
296 | eukrea_mbimx27_baseboard_init(); | 293 | eukrea_mbimx27_baseboard_init(); |
diff --git a/arch/arm/mach-mx25/mach-cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c index f6f9ad60c25e..eb395aba9237 100644 --- a/arch/arm/mach-mx25/mach-cpuimx25.c +++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/usb/otg.h> | 27 | #include <linux/usb/otg.h> |
28 | #include <linux/usb/ulpi.h> | 28 | #include <linux/usb/ulpi.h> |
29 | #include <linux/fsl_devices.h> | ||
30 | 29 | ||
31 | #include <mach/eukrea-baseboards.h> | 30 | #include <mach/eukrea-baseboards.h> |
32 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
@@ -39,17 +38,15 @@ | |||
39 | #include <mach/mx25.h> | 38 | #include <mach/mx25.h> |
40 | #include <mach/mxc_nand.h> | 39 | #include <mach/mxc_nand.h> |
41 | #include <mach/imxfb.h> | 40 | #include <mach/imxfb.h> |
42 | #include <mach/mxc_ehci.h> | ||
43 | #include <mach/iomux-mx25.h> | 41 | #include <mach/iomux-mx25.h> |
44 | 42 | ||
45 | #include "devices-imx25.h" | 43 | #include "devices-imx25.h" |
46 | #include "devices.h" | ||
47 | 44 | ||
48 | static const struct imxuart_platform_data uart_pdata __initconst = { | 45 | static const struct imxuart_platform_data uart_pdata __initconst = { |
49 | .flags = IMXUART_HAVE_RTSCTS, | 46 | .flags = IMXUART_HAVE_RTSCTS, |
50 | }; | 47 | }; |
51 | 48 | ||
52 | static struct pad_desc eukrea_cpuimx25_pads[] = { | 49 | static iomux_v3_cfg_t eukrea_cpuimx25_pads[] = { |
53 | /* FEC - RMII */ | 50 | /* FEC - RMII */ |
54 | MX25_PAD_FEC_MDC__FEC_MDC, | 51 | MX25_PAD_FEC_MDC__FEC_MDC, |
55 | MX25_PAD_FEC_MDIO__FEC_MDIO, | 52 | MX25_PAD_FEC_MDIO__FEC_MDIO, |
@@ -87,18 +84,18 @@ static struct i2c_board_info eukrea_cpuimx25_i2c_devices[] = { | |||
87 | }, | 84 | }, |
88 | }; | 85 | }; |
89 | 86 | ||
90 | static struct mxc_usbh_platform_data otg_pdata = { | 87 | static const struct mxc_usbh_platform_data otg_pdata __initconst = { |
91 | .portsc = MXC_EHCI_MODE_UTMI, | 88 | .portsc = MXC_EHCI_MODE_UTMI, |
92 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 89 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
93 | }; | 90 | }; |
94 | 91 | ||
95 | static struct mxc_usbh_platform_data usbh2_pdata = { | 92 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { |
96 | .portsc = MXC_EHCI_MODE_SERIAL, | 93 | .portsc = MXC_EHCI_MODE_SERIAL, |
97 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | 94 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | |
98 | MXC_EHCI_IPPUE_DOWN, | 95 | MXC_EHCI_IPPUE_DOWN, |
99 | }; | 96 | }; |
100 | 97 | ||
101 | static struct fsl_usb2_platform_data otg_device_pdata = { | 98 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
102 | .operating_mode = FSL_USB2_DR_DEVICE, | 99 | .operating_mode = FSL_USB2_DR_DEVICE, |
103 | .phy_mode = FSL_USB2_PHY_UTMI, | 100 | .phy_mode = FSL_USB2_PHY_UTMI, |
104 | }; | 101 | }; |
@@ -126,7 +123,7 @@ static void __init eukrea_cpuimx25_init(void) | |||
126 | 123 | ||
127 | imx25_add_imx_uart0(&uart_pdata); | 124 | imx25_add_imx_uart0(&uart_pdata); |
128 | imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info); | 125 | imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info); |
129 | mxc_register_device(&mx25_rtc_device, NULL); | 126 | imx25_add_imxdi_rtc(NULL); |
130 | imx25_add_fec(&mx25_fec_pdata); | 127 | imx25_add_fec(&mx25_fec_pdata); |
131 | 128 | ||
132 | i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices, | 129 | i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices, |
@@ -134,11 +131,11 @@ static void __init eukrea_cpuimx25_init(void) | |||
134 | imx25_add_imx_i2c0(&eukrea_cpuimx25_i2c0_data); | 131 | imx25_add_imx_i2c0(&eukrea_cpuimx25_i2c0_data); |
135 | 132 | ||
136 | if (otg_mode_host) | 133 | if (otg_mode_host) |
137 | mxc_register_device(&mxc_otg, &otg_pdata); | 134 | imx25_add_mxc_ehci_otg(&otg_pdata); |
138 | else | 135 | else |
139 | mxc_register_device(&otg_udc_device, &otg_device_pdata); | 136 | imx25_add_fsl_usb2_udc(&otg_device_pdata); |
140 | 137 | ||
141 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 138 | imx25_add_mxc_ehci_hs(&usbh2_pdata); |
142 | 139 | ||
143 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD | 140 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD |
144 | eukrea_mbimxsd25_baseboard_init(); | 141 | eukrea_mbimxsd25_baseboard_init(); |
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index 59716fab586d..40a3666ea632 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -34,12 +34,9 @@ | |||
34 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
36 | #include <mach/common.h> | 36 | #include <mach/common.h> |
37 | #include <mach/mmc.h> | ||
38 | #include <mach/iomux.h> | 37 | #include <mach/iomux.h> |
39 | #include <mach/mxc_ehci.h> | ||
40 | 38 | ||
41 | #include "devices-imx27.h" | 39 | #include "devices-imx27.h" |
42 | #include "devices.h" | ||
43 | 40 | ||
44 | #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) | 41 | #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) |
45 | #define SDHC1_IRQ IRQ_GPIOB(25) | 42 | #define SDHC1_IRQ IRQ_GPIOB(25) |
@@ -156,7 +153,7 @@ static void visstrim_m10_sdhc1_exit(struct device *dev, void *data) | |||
156 | free_irq(SDHC1_IRQ, data); | 153 | free_irq(SDHC1_IRQ, data); |
157 | } | 154 | } |
158 | 155 | ||
159 | static struct imxmmc_platform_data visstrim_m10_sdhc_pdata = { | 156 | static const struct imxmmc_platform_data visstrim_m10_sdhc_pdata __initconst = { |
160 | .init = visstrim_m10_sdhc1_init, | 157 | .init = visstrim_m10_sdhc1_init, |
161 | .exit = visstrim_m10_sdhc1_exit, | 158 | .exit = visstrim_m10_sdhc1_exit, |
162 | }; | 159 | }; |
@@ -216,7 +213,8 @@ static int otg_phy_init(struct platform_device *pdev) | |||
216 | return 0; | 213 | return 0; |
217 | } | 214 | } |
218 | 215 | ||
219 | static struct mxc_usbh_platform_data visstrim_m10_usbotg_pdata = { | 216 | static const struct mxc_usbh_platform_data |
217 | visstrim_m10_usbotg_pdata __initconst = { | ||
220 | .init = otg_phy_init, | 218 | .init = otg_phy_init, |
221 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 219 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
222 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 220 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
@@ -237,8 +235,8 @@ static void __init visstrim_m10_board_init(void) | |||
237 | ARRAY_SIZE(visstrim_m10_i2c_devices)); | 235 | ARRAY_SIZE(visstrim_m10_i2c_devices)); |
238 | imx27_add_imx_i2c(0, &visstrim_m10_i2c_data); | 236 | imx27_add_imx_i2c(0, &visstrim_m10_i2c_data); |
239 | imx27_add_imx_i2c(1, &visstrim_m10_i2c_data); | 237 | imx27_add_imx_i2c(1, &visstrim_m10_i2c_data); |
240 | mxc_register_device(&mxc_sdhc_device0, &visstrim_m10_sdhc_pdata); | 238 | imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata); |
241 | mxc_register_device(&mxc_otg_host, &visstrim_m10_usbotg_pdata); | 239 | imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata); |
242 | imx27_add_fec(NULL); | 240 | imx27_add_fec(NULL); |
243 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 241 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
244 | } | 242 | } |
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c index bbdbc75127d3..3a1202e47212 100644 --- a/arch/arm/mach-imx/mach-imx27lite.c +++ b/arch/arm/mach-imx/mach-imx27lite.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <mach/iomux-mx27.h> | 25 | #include <mach/iomux-mx27.h> |
26 | 26 | ||
27 | #include "devices-imx27.h" | 27 | #include "devices-imx27.h" |
28 | #include "devices.h" | ||
29 | 28 | ||
30 | static const int mx27lite_pins[] __initconst = { | 29 | static const int mx27lite_pins[] __initconst = { |
31 | /* UART1 */ | 30 | /* UART1 */ |
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c index 6187ce9ba7d5..1f446e5eb636 100644 --- a/arch/arm/mach-imx/mach-mx1ads.c +++ b/arch/arm/mach-imx/mach-mx1ads.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <mach/irqs.h> | 30 | #include <mach/irqs.h> |
31 | 31 | ||
32 | #include "devices-imx1.h" | 32 | #include "devices-imx1.h" |
33 | #include "devices.h" | ||
34 | 33 | ||
35 | static const int mx1ads_pins[] __initconst = { | 34 | static const int mx1ads_pins[] __initconst = { |
36 | /* UART1 */ | 35 | /* UART1 */ |
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c index e1282e9f50ff..0a372577c2ac 100644 --- a/arch/arm/mach-imx/mach-mx21ads.c +++ b/arch/arm/mach-imx/mach-mx21ads.c | |||
@@ -24,13 +24,10 @@ | |||
24 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
25 | #include <asm/mach/time.h> | 25 | #include <asm/mach/time.h> |
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | #include <mach/imxfb.h> | ||
28 | #include <mach/iomux-mx21.h> | 27 | #include <mach/iomux-mx21.h> |
29 | #include <mach/mxc_nand.h> | 28 | #include <mach/mxc_nand.h> |
30 | #include <mach/mmc.h> | ||
31 | 29 | ||
32 | #include "devices-imx21.h" | 30 | #include "devices-imx21.h" |
33 | #include "devices.h" | ||
34 | 31 | ||
35 | /* | 32 | /* |
36 | * Memory-mapped I/O on MX21ADS base board | 33 | * Memory-mapped I/O on MX21ADS base board |
@@ -213,7 +210,7 @@ static struct imx_fb_videomode mx21ads_modes[] = { | |||
213 | }, | 210 | }, |
214 | }; | 211 | }; |
215 | 212 | ||
216 | static struct imx_fb_platform_data mx21ads_fb_data = { | 213 | static const struct imx_fb_platform_data mx21ads_fb_data __initconst = { |
217 | .mode = mx21ads_modes, | 214 | .mode = mx21ads_modes, |
218 | .num_modes = ARRAY_SIZE(mx21ads_modes), | 215 | .num_modes = ARRAY_SIZE(mx21ads_modes), |
219 | 216 | ||
@@ -233,15 +230,8 @@ static int mx21ads_sdhc_get_ro(struct device *dev) | |||
233 | static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq, | 230 | static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq, |
234 | void *data) | 231 | void *data) |
235 | { | 232 | { |
236 | int ret; | 233 | return request_irq(IRQ_GPIOD(25), detect_irq, |
237 | |||
238 | ret = request_irq(IRQ_GPIOD(25), detect_irq, | ||
239 | IRQF_TRIGGER_FALLING, "mmc-detect", data); | 234 | IRQF_TRIGGER_FALLING, "mmc-detect", data); |
240 | if (ret) | ||
241 | goto out; | ||
242 | return 0; | ||
243 | out: | ||
244 | return ret; | ||
245 | } | 235 | } |
246 | 236 | ||
247 | static void mx21ads_sdhc_exit(struct device *dev, void *data) | 237 | static void mx21ads_sdhc_exit(struct device *dev, void *data) |
@@ -249,7 +239,7 @@ static void mx21ads_sdhc_exit(struct device *dev, void *data) | |||
249 | free_irq(IRQ_GPIOD(25), data); | 239 | free_irq(IRQ_GPIOD(25), data); |
250 | } | 240 | } |
251 | 241 | ||
252 | static struct imxmmc_platform_data mx21ads_sdhc_pdata = { | 242 | static const struct imxmmc_platform_data mx21ads_sdhc_pdata __initconst = { |
253 | .ocr_avail = MMC_VDD_29_30 | MMC_VDD_30_31, /* 3.0V */ | 243 | .ocr_avail = MMC_VDD_29_30 | MMC_VDD_30_31, /* 3.0V */ |
254 | .get_ro = mx21ads_sdhc_get_ro, | 244 | .get_ro = mx21ads_sdhc_get_ro, |
255 | .init = mx21ads_sdhc_init, | 245 | .init = mx21ads_sdhc_init, |
@@ -296,8 +286,8 @@ static void __init mx21ads_board_init(void) | |||
296 | imx21_add_imx_uart0(&uart_pdata_rts); | 286 | imx21_add_imx_uart0(&uart_pdata_rts); |
297 | imx21_add_imx_uart2(&uart_pdata_norts); | 287 | imx21_add_imx_uart2(&uart_pdata_norts); |
298 | imx21_add_imx_uart3(&uart_pdata_rts); | 288 | imx21_add_imx_uart3(&uart_pdata_rts); |
299 | mxc_register_device(&mxc_fb_device, &mx21ads_fb_data); | 289 | imx21_add_imx_fb(&mx21ads_fb_data); |
300 | mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata); | 290 | imx21_add_mxc_mmc(0, &mx21ads_sdhc_pdata); |
301 | imx21_add_mxc_nand(&mx21ads_nand_board_info); | 291 | imx21_add_mxc_nand(&mx21ads_nand_board_info); |
302 | 292 | ||
303 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 293 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
diff --git a/arch/arm/mach-mx25/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c index f8be1eb0c062..aa76cfd9f348 100644 --- a/arch/arm/mach-mx25/mach-mx25_3ds.c +++ b/arch/arm/mach-imx/mach-mx25_3ds.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/gpio.h> | 30 | #include <linux/gpio.h> |
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <linux/input/matrix_keypad.h> | 32 | #include <linux/input/matrix_keypad.h> |
33 | #include <linux/usb/otg.h> | ||
33 | 34 | ||
34 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
35 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
@@ -39,17 +40,15 @@ | |||
39 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
40 | #include <mach/common.h> | 41 | #include <mach/common.h> |
41 | #include <mach/mx25.h> | 42 | #include <mach/mx25.h> |
42 | #include <mach/imxfb.h> | ||
43 | #include <mach/iomux-mx25.h> | 43 | #include <mach/iomux-mx25.h> |
44 | 44 | ||
45 | #include "devices-imx25.h" | 45 | #include "devices-imx25.h" |
46 | #include "devices.h" | ||
47 | 46 | ||
48 | static const struct imxuart_platform_data uart_pdata __initconst = { | 47 | static const struct imxuart_platform_data uart_pdata __initconst = { |
49 | .flags = IMXUART_HAVE_RTSCTS, | 48 | .flags = IMXUART_HAVE_RTSCTS, |
50 | }; | 49 | }; |
51 | 50 | ||
52 | static struct pad_desc mx25pdk_pads[] = { | 51 | static iomux_v3_cfg_t mx25pdk_pads[] = { |
53 | MX25_PAD_FEC_MDC__FEC_MDC, | 52 | MX25_PAD_FEC_MDC__FEC_MDC, |
54 | MX25_PAD_FEC_MDIO__FEC_MDIO, | 53 | MX25_PAD_FEC_MDIO__FEC_MDIO, |
55 | MX25_PAD_FEC_TDATA0__FEC_TDATA0, | 54 | MX25_PAD_FEC_TDATA0__FEC_TDATA0, |
@@ -107,7 +106,7 @@ static struct pad_desc mx25pdk_pads[] = { | |||
107 | }; | 106 | }; |
108 | 107 | ||
109 | static const struct fec_platform_data mx25_fec_pdata __initconst = { | 108 | static const struct fec_platform_data mx25_fec_pdata __initconst = { |
110 | .phy = PHY_INTERFACE_MODE_RMII, | 109 | .phy = PHY_INTERFACE_MODE_RMII, |
111 | }; | 110 | }; |
112 | 111 | ||
113 | #define FEC_ENABLE_GPIO 35 | 112 | #define FEC_ENABLE_GPIO 35 |
@@ -154,7 +153,7 @@ static struct imx_fb_videomode mx25pdk_modes[] = { | |||
154 | }, | 153 | }, |
155 | }; | 154 | }; |
156 | 155 | ||
157 | static struct imx_fb_platform_data mx25pdk_fb_pdata = { | 156 | static const struct imx_fb_platform_data mx25pdk_fb_pdata __initconst = { |
158 | .mode = mx25pdk_modes, | 157 | .mode = mx25pdk_modes, |
159 | .num_modes = ARRAY_SIZE(mx25pdk_modes), | 158 | .num_modes = ARRAY_SIZE(mx25pdk_modes), |
160 | .pwmr = 0x00A903FF, | 159 | .pwmr = 0x00A903FF, |
@@ -181,28 +180,39 @@ static const uint32_t mx25pdk_keymap[] = { | |||
181 | KEY(3, 3, KEY_POWER), | 180 | KEY(3, 3, KEY_POWER), |
182 | }; | 181 | }; |
183 | 182 | ||
184 | static struct matrix_keymap_data mx25pdk_keymap_data = { | 183 | static const struct matrix_keymap_data mx25pdk_keymap_data __initdata = { |
185 | .keymap = mx25pdk_keymap, | 184 | .keymap = mx25pdk_keymap, |
186 | .keymap_size = ARRAY_SIZE(mx25pdk_keymap), | 185 | .keymap_size = ARRAY_SIZE(mx25pdk_keymap), |
187 | }; | 186 | }; |
188 | 187 | ||
188 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { | ||
189 | .portsc = MXC_EHCI_MODE_SERIAL, | ||
190 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
191 | }; | ||
192 | |||
193 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | ||
194 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
195 | .phy_mode = FSL_USB2_PHY_UTMI, | ||
196 | }; | ||
197 | |||
189 | static void __init mx25pdk_init(void) | 198 | static void __init mx25pdk_init(void) |
190 | { | 199 | { |
191 | mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, | 200 | mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, |
192 | ARRAY_SIZE(mx25pdk_pads)); | 201 | ARRAY_SIZE(mx25pdk_pads)); |
193 | 202 | ||
194 | imx25_add_imx_uart0(&uart_pdata); | 203 | imx25_add_imx_uart0(&uart_pdata); |
195 | mxc_register_device(&mxc_usbh2, NULL); | 204 | imx25_add_fsl_usb2_udc(&otg_device_pdata); |
205 | imx25_add_mxc_ehci_hs(&usbh2_pdata); | ||
196 | imx25_add_mxc_nand(&mx25pdk_nand_board_info); | 206 | imx25_add_mxc_nand(&mx25pdk_nand_board_info); |
197 | mxc_register_device(&mx25_rtc_device, NULL); | 207 | imx25_add_imxdi_rtc(NULL); |
198 | mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata); | 208 | imx25_add_imx_fb(&mx25pdk_fb_pdata); |
199 | mxc_register_device(&mxc_wdt, NULL); | 209 | imx25_add_imx2_wdt(NULL); |
200 | 210 | ||
201 | mx25pdk_fec_reset(); | 211 | mx25pdk_fec_reset(); |
202 | imx25_add_fec(&mx25_fec_pdata); | 212 | imx25_add_fec(&mx25_fec_pdata); |
203 | mxc_register_device(&mx25_kpp_device, &mx25pdk_keymap_data); | 213 | imx25_add_imx_keypad(&mx25pdk_keymap_data); |
204 | 214 | ||
205 | imx25_add_esdhc(0, NULL); | 215 | imx25_add_sdhci_esdhc_imx(0, NULL); |
206 | } | 216 | } |
207 | 217 | ||
208 | static void __init mx25pdk_timer_init(void) | 218 | static void __init mx25pdk_timer_init(void) |
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index 84a5ba03f1ba..6fd0f8f6deb6 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -22,20 +22,27 @@ | |||
22 | 22 | ||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/input/matrix_keypad.h> | ||
26 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | #include <linux/usb/otg.h> | ||
27 | #include <linux/usb/ulpi.h> | ||
28 | #include <linux/delay.h> | ||
29 | #include <linux/mfd/mc13783.h> | ||
30 | #include <linux/spi/spi.h> | ||
31 | #include <linux/regulator/machine.h> | ||
32 | |||
27 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
28 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
29 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
30 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
31 | #include <mach/common.h> | 37 | #include <mach/common.h> |
32 | #include <mach/iomux-mx27.h> | 38 | #include <mach/iomux-mx27.h> |
33 | #include <mach/mmc.h> | 39 | #include <mach/ulpi.h> |
34 | 40 | ||
35 | #include "devices-imx27.h" | 41 | #include "devices-imx27.h" |
36 | #include "devices.h" | ||
37 | 42 | ||
38 | #define SD1_EN_GPIO (GPIO_PORTB + 25) | 43 | #define SD1_EN_GPIO (GPIO_PORTB + 25) |
44 | #define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23) | ||
45 | #define SPI2_SS0 (GPIO_PORTD + 21) | ||
39 | 46 | ||
40 | static const int mx27pdk_pins[] __initconst = { | 47 | static const int mx27pdk_pins[] __initconst = { |
41 | /* UART1 */ | 48 | /* UART1 */ |
@@ -70,6 +77,24 @@ static const int mx27pdk_pins[] __initconst = { | |||
70 | PE22_PF_SD1_CMD, | 77 | PE22_PF_SD1_CMD, |
71 | PE23_PF_SD1_CLK, | 78 | PE23_PF_SD1_CLK, |
72 | SD1_EN_GPIO | GPIO_GPIO | GPIO_OUT, | 79 | SD1_EN_GPIO | GPIO_GPIO | GPIO_OUT, |
80 | /* OTG */ | ||
81 | OTG_PHY_RESET_GPIO | GPIO_GPIO | GPIO_OUT, | ||
82 | PC7_PF_USBOTG_DATA5, | ||
83 | PC8_PF_USBOTG_DATA6, | ||
84 | PC9_PF_USBOTG_DATA0, | ||
85 | PC10_PF_USBOTG_DATA2, | ||
86 | PC11_PF_USBOTG_DATA1, | ||
87 | PC12_PF_USBOTG_DATA4, | ||
88 | PC13_PF_USBOTG_DATA3, | ||
89 | PE0_PF_USBOTG_NXT, | ||
90 | PE1_PF_USBOTG_STP, | ||
91 | PE2_PF_USBOTG_DIR, | ||
92 | PE24_PF_USBOTG_CLK, | ||
93 | PE25_PF_USBOTG_DATA7, | ||
94 | /* CSPI2 */ | ||
95 | PD22_PF_CSPI2_SCLK, | ||
96 | PD23_PF_CSPI2_MISO, | ||
97 | PD24_PF_CSPI2_MOSI, | ||
73 | }; | 98 | }; |
74 | 99 | ||
75 | static const struct imxuart_platform_data uart_pdata __initconst = { | 100 | static const struct imxuart_platform_data uart_pdata __initconst = { |
@@ -92,7 +117,7 @@ static const uint32_t mx27_3ds_keymap[] = { | |||
92 | KEY(2, 3, KEY_F10), | 117 | KEY(2, 3, KEY_F10), |
93 | }; | 118 | }; |
94 | 119 | ||
95 | static struct matrix_keymap_data mx27_3ds_keymap_data = { | 120 | static const struct matrix_keymap_data mx27_3ds_keymap_data __initconst = { |
96 | .keymap = mx27_3ds_keymap, | 121 | .keymap = mx27_3ds_keymap, |
97 | .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), | 122 | .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), |
98 | }; | 123 | }; |
@@ -109,7 +134,7 @@ static void mx27_3ds_sdhc1_exit(struct device *dev, void *data) | |||
109 | free_irq(IRQ_GPIOB(26), data); | 134 | free_irq(IRQ_GPIOB(26), data); |
110 | } | 135 | } |
111 | 136 | ||
112 | static struct imxmmc_platform_data sdhc1_pdata = { | 137 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { |
113 | .init = mx27_3ds_sdhc1_init, | 138 | .init = mx27_3ds_sdhc1_init, |
114 | .exit = mx27_3ds_sdhc1_exit, | 139 | .exit = mx27_3ds_sdhc1_exit, |
115 | }; | 140 | }; |
@@ -121,6 +146,111 @@ static void mx27_3ds_sdhc1_enable_level_translator(void) | |||
121 | gpio_direction_output(SD1_EN_GPIO, 1); | 146 | gpio_direction_output(SD1_EN_GPIO, 1); |
122 | } | 147 | } |
123 | 148 | ||
149 | |||
150 | static int otg_phy_init(void) | ||
151 | { | ||
152 | gpio_request(OTG_PHY_RESET_GPIO, "usb-otg-reset"); | ||
153 | gpio_direction_output(OTG_PHY_RESET_GPIO, 0); | ||
154 | mdelay(1); | ||
155 | gpio_set_value(OTG_PHY_RESET_GPIO, 1); | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | #if defined(CONFIG_USB_ULPI) | ||
160 | |||
161 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | ||
162 | .portsc = MXC_EHCI_MODE_ULPI, | ||
163 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
164 | }; | ||
165 | #endif | ||
166 | |||
167 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | ||
168 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
169 | .phy_mode = FSL_USB2_PHY_ULPI, | ||
170 | }; | ||
171 | |||
172 | static int otg_mode_host; | ||
173 | |||
174 | static int __init mx27_3ds_otg_mode(char *options) | ||
175 | { | ||
176 | if (!strcmp(options, "host")) | ||
177 | otg_mode_host = 1; | ||
178 | else if (!strcmp(options, "device")) | ||
179 | otg_mode_host = 0; | ||
180 | else | ||
181 | pr_info("otg_mode neither \"host\" nor \"device\". " | ||
182 | "Defaulting to device\n"); | ||
183 | return 0; | ||
184 | } | ||
185 | __setup("otg_mode=", mx27_3ds_otg_mode); | ||
186 | |||
187 | /* Regulators */ | ||
188 | static struct regulator_consumer_supply vmmc1_consumers[] = { | ||
189 | REGULATOR_SUPPLY("lcd_2v8", NULL), | ||
190 | }; | ||
191 | |||
192 | static struct regulator_init_data vmmc1_init = { | ||
193 | .constraints = { | ||
194 | .min_uV = 2800000, | ||
195 | .max_uV = 2800000, | ||
196 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
197 | }, | ||
198 | .num_consumer_supplies = ARRAY_SIZE(vmmc1_consumers), | ||
199 | .consumer_supplies = vmmc1_consumers, | ||
200 | }; | ||
201 | |||
202 | static struct regulator_consumer_supply vgen_consumers[] = { | ||
203 | REGULATOR_SUPPLY("vdd_lcdio", NULL), | ||
204 | }; | ||
205 | |||
206 | static struct regulator_init_data vgen_init = { | ||
207 | .constraints = { | ||
208 | .min_uV = 1800000, | ||
209 | .max_uV = 1800000, | ||
210 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
211 | }, | ||
212 | .num_consumer_supplies = ARRAY_SIZE(vgen_consumers), | ||
213 | .consumer_supplies = vgen_consumers, | ||
214 | }; | ||
215 | |||
216 | static struct mc13783_regulator_init_data mx27_3ds_regulators[] = { | ||
217 | { | ||
218 | .id = MC13783_REGU_VMMC1, | ||
219 | .init_data = &vmmc1_init, | ||
220 | }, { | ||
221 | .id = MC13783_REGU_VGEN, | ||
222 | .init_data = &vgen_init, | ||
223 | }, | ||
224 | }; | ||
225 | |||
226 | /* MC13783 */ | ||
227 | static struct mc13783_platform_data mc13783_pdata __initdata = { | ||
228 | .regulators = mx27_3ds_regulators, | ||
229 | .num_regulators = ARRAY_SIZE(mx27_3ds_regulators), | ||
230 | .flags = MC13783_USE_REGULATOR, | ||
231 | }; | ||
232 | |||
233 | /* SPI */ | ||
234 | static int spi2_internal_chipselect[] = {SPI2_SS0}; | ||
235 | |||
236 | static const struct spi_imx_master spi2_pdata __initconst = { | ||
237 | .chipselect = spi2_internal_chipselect, | ||
238 | .num_chipselect = ARRAY_SIZE(spi2_internal_chipselect), | ||
239 | }; | ||
240 | |||
241 | static struct spi_board_info mx27_3ds_spi_devs[] __initdata = { | ||
242 | { | ||
243 | .modalias = "mc13783", | ||
244 | .max_speed_hz = 1000000, | ||
245 | .bus_num = 1, | ||
246 | .chip_select = 0, /* SS0 */ | ||
247 | .platform_data = &mc13783_pdata, | ||
248 | .irq = IRQ_GPIOC(14), | ||
249 | .mode = SPI_CS_HIGH, | ||
250 | }, | ||
251 | }; | ||
252 | |||
253 | |||
124 | static void __init mx27pdk_init(void) | 254 | static void __init mx27pdk_init(void) |
125 | { | 255 | { |
126 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), | 256 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), |
@@ -128,8 +258,24 @@ static void __init mx27pdk_init(void) | |||
128 | mx27_3ds_sdhc1_enable_level_translator(); | 258 | mx27_3ds_sdhc1_enable_level_translator(); |
129 | imx27_add_imx_uart0(&uart_pdata); | 259 | imx27_add_imx_uart0(&uart_pdata); |
130 | imx27_add_fec(NULL); | 260 | imx27_add_fec(NULL); |
131 | mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); | 261 | imx27_add_imx_keypad(&mx27_3ds_keymap_data); |
132 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); | 262 | imx27_add_mxc_mmc(0, &sdhc1_pdata); |
263 | imx27_add_imx2_wdt(NULL); | ||
264 | otg_phy_init(); | ||
265 | #if defined(CONFIG_USB_ULPI) | ||
266 | if (otg_mode_host) { | ||
267 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
268 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | ||
269 | |||
270 | imx27_add_mxc_ehci_otg(&otg_pdata); | ||
271 | } | ||
272 | #endif | ||
273 | if (!otg_mode_host) | ||
274 | imx27_add_fsl_usb2_udc(&otg_device_pdata); | ||
275 | |||
276 | imx27_add_spi_imx1(&spi2_pdata); | ||
277 | spi_register_board_info(mx27_3ds_spi_devs, | ||
278 | ARRAY_SIZE(mx27_3ds_spi_devs)); | ||
133 | } | 279 | } |
134 | 280 | ||
135 | static void __init mx27pdk_timer_init(void) | 281 | static void __init mx27pdk_timer_init(void) |
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index a1e4bc573afc..b832f960fec4 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c | |||
@@ -30,11 +30,8 @@ | |||
30 | #include <mach/gpio.h> | 30 | #include <mach/gpio.h> |
31 | #include <mach/iomux-mx27.h> | 31 | #include <mach/iomux-mx27.h> |
32 | #include <mach/mxc_nand.h> | 32 | #include <mach/mxc_nand.h> |
33 | #include <mach/imxfb.h> | ||
34 | #include <mach/mmc.h> | ||
35 | 33 | ||
36 | #include "devices-imx27.h" | 34 | #include "devices-imx27.h" |
37 | #include "devices.h" | ||
38 | 35 | ||
39 | /* | 36 | /* |
40 | * Base address of PBC controller, CS4 | 37 | * Base address of PBC controller, CS4 |
@@ -228,7 +225,7 @@ static struct imx_fb_videomode mx27ads_modes[] = { | |||
228 | }, | 225 | }, |
229 | }; | 226 | }; |
230 | 227 | ||
231 | static struct imx_fb_platform_data mx27ads_fb_data = { | 228 | static const struct imx_fb_platform_data mx27ads_fb_data __initconst = { |
232 | .mode = mx27ads_modes, | 229 | .mode = mx27ads_modes, |
233 | .num_modes = ARRAY_SIZE(mx27ads_modes), | 230 | .num_modes = ARRAY_SIZE(mx27ads_modes), |
234 | 231 | ||
@@ -272,19 +269,18 @@ static void mx27ads_sdhc2_exit(struct device *dev, void *data) | |||
272 | free_irq(IRQ_GPIOB(7), data); | 269 | free_irq(IRQ_GPIOB(7), data); |
273 | } | 270 | } |
274 | 271 | ||
275 | static struct imxmmc_platform_data sdhc1_pdata = { | 272 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { |
276 | .init = mx27ads_sdhc1_init, | 273 | .init = mx27ads_sdhc1_init, |
277 | .exit = mx27ads_sdhc1_exit, | 274 | .exit = mx27ads_sdhc1_exit, |
278 | }; | 275 | }; |
279 | 276 | ||
280 | static struct imxmmc_platform_data sdhc2_pdata = { | 277 | static const struct imxmmc_platform_data sdhc2_pdata __initconst = { |
281 | .init = mx27ads_sdhc2_init, | 278 | .init = mx27ads_sdhc2_init, |
282 | .exit = mx27ads_sdhc2_exit, | 279 | .exit = mx27ads_sdhc2_exit, |
283 | }; | 280 | }; |
284 | 281 | ||
285 | static struct platform_device *platform_devices[] __initdata = { | 282 | static struct platform_device *platform_devices[] __initdata = { |
286 | &mx27ads_nor_mtd_device, | 283 | &mx27ads_nor_mtd_device, |
287 | &mxc_w1_master_device, | ||
288 | }; | 284 | }; |
289 | 285 | ||
290 | static const struct imxuart_platform_data uart_pdata __initconst = { | 286 | static const struct imxuart_platform_data uart_pdata __initconst = { |
@@ -308,12 +304,13 @@ static void __init mx27ads_board_init(void) | |||
308 | i2c_register_board_info(1, mx27ads_i2c_devices, | 304 | i2c_register_board_info(1, mx27ads_i2c_devices, |
309 | ARRAY_SIZE(mx27ads_i2c_devices)); | 305 | ARRAY_SIZE(mx27ads_i2c_devices)); |
310 | imx27_add_imx_i2c(1, &mx27ads_i2c1_data); | 306 | imx27_add_imx_i2c(1, &mx27ads_i2c1_data); |
311 | mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); | 307 | imx27_add_imx_fb(&mx27ads_fb_data); |
312 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); | 308 | imx27_add_mxc_mmc(0, &sdhc1_pdata); |
313 | mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata); | 309 | imx27_add_mxc_mmc(1, &sdhc2_pdata); |
314 | 310 | ||
315 | imx27_add_fec(NULL); | 311 | imx27_add_fec(NULL); |
316 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 312 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
313 | imx27_add_mxc_w1(NULL); | ||
317 | } | 314 | } |
318 | 315 | ||
319 | static void __init mx27ads_timer_init(void) | 316 | static void __init mx27ads_timer_init(void) |
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c index 38d3a4ae17c7..4ce71b0401db 100644 --- a/arch/arm/mach-imx/mach-mxt_td60.c +++ b/arch/arm/mach-imx/mach-mxt_td60.c | |||
@@ -31,11 +31,8 @@ | |||
31 | #include <mach/iomux-mx27.h> | 31 | #include <mach/iomux-mx27.h> |
32 | #include <mach/mxc_nand.h> | 32 | #include <mach/mxc_nand.h> |
33 | #include <linux/i2c/pca953x.h> | 33 | #include <linux/i2c/pca953x.h> |
34 | #include <mach/imxfb.h> | ||
35 | #include <mach/mmc.h> | ||
36 | 34 | ||
37 | #include "devices-imx27.h" | 35 | #include "devices-imx27.h" |
38 | #include "devices.h" | ||
39 | 36 | ||
40 | static const int mxt_td60_pins[] __initconst = { | 37 | static const int mxt_td60_pins[] __initconst = { |
41 | /* UART0 */ | 38 | /* UART0 */ |
@@ -196,7 +193,7 @@ static struct imx_fb_videomode mxt_td60_modes[] = { | |||
196 | }, | 193 | }, |
197 | }; | 194 | }; |
198 | 195 | ||
199 | static struct imx_fb_platform_data mxt_td60_fb_data = { | 196 | static const struct imx_fb_platform_data mxt_td60_fb_data __initconst = { |
200 | .mode = mxt_td60_modes, | 197 | .mode = mxt_td60_modes, |
201 | .num_modes = ARRAY_SIZE(mxt_td60_modes), | 198 | .num_modes = ARRAY_SIZE(mxt_td60_modes), |
202 | 199 | ||
@@ -226,7 +223,7 @@ static void mxt_td60_sdhc1_exit(struct device *dev, void *data) | |||
226 | free_irq(IRQ_GPIOF(8), data); | 223 | free_irq(IRQ_GPIOF(8), data); |
227 | } | 224 | } |
228 | 225 | ||
229 | static struct imxmmc_platform_data sdhc1_pdata = { | 226 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { |
230 | .init = mxt_td60_sdhc1_init, | 227 | .init = mxt_td60_sdhc1_init, |
231 | .exit = mxt_td60_sdhc1_exit, | 228 | .exit = mxt_td60_sdhc1_exit, |
232 | }; | 229 | }; |
@@ -253,8 +250,8 @@ static void __init mxt_td60_board_init(void) | |||
253 | 250 | ||
254 | imx27_add_imx_i2c(0, &mxt_td60_i2c0_data); | 251 | imx27_add_imx_i2c(0, &mxt_td60_i2c0_data); |
255 | imx27_add_imx_i2c(1, &mxt_td60_i2c1_data); | 252 | imx27_add_imx_i2c(1, &mxt_td60_i2c1_data); |
256 | mxc_register_device(&mxc_fb_device, &mxt_td60_fb_data); | 253 | imx27_add_imx_fb(&mxt_td60_fb_data); |
257 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); | 254 | imx27_add_mxc_mmc(0, &sdhc1_pdata); |
258 | imx27_add_fec(NULL); | 255 | imx27_add_fec(NULL); |
259 | } | 256 | } |
260 | 257 | ||
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index 8c720d44602a..cccc0a0a9c72 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
30 | #include <linux/usb/otg.h> | 30 | #include <linux/usb/otg.h> |
31 | #include <linux/usb/ulpi.h> | 31 | #include <linux/usb/ulpi.h> |
32 | #include <linux/fsl_devices.h> | ||
33 | 32 | ||
34 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
35 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
@@ -40,13 +39,9 @@ | |||
40 | #include <mach/audmux.h> | 39 | #include <mach/audmux.h> |
41 | #include <mach/mxc_nand.h> | 40 | #include <mach/mxc_nand.h> |
42 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
43 | #include <mach/mmc.h> | ||
44 | #include <mach/mxc_ehci.h> | ||
45 | #include <mach/ulpi.h> | 42 | #include <mach/ulpi.h> |
46 | #include <mach/imxfb.h> | ||
47 | 43 | ||
48 | #include "devices-imx27.h" | 44 | #include "devices-imx27.h" |
49 | #include "devices.h" | ||
50 | 45 | ||
51 | #define OTG_PHY_CS_GPIO (GPIO_PORTB + 23) | 46 | #define OTG_PHY_CS_GPIO (GPIO_PORTB + 23) |
52 | #define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24) | 47 | #define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24) |
@@ -171,11 +166,6 @@ pca100_nand_board_info __initconst = { | |||
171 | .hw_ecc = 1, | 166 | .hw_ecc = 1, |
172 | }; | 167 | }; |
173 | 168 | ||
174 | static struct platform_device *platform_devices[] __initdata = { | ||
175 | &mxc_w1_master_device, | ||
176 | &mxc_wdt, | ||
177 | }; | ||
178 | |||
179 | static const struct imxi2c_platform_data pca100_i2c1_data __initconst = { | 169 | static const struct imxi2c_platform_data pca100_i2c1_data __initconst = { |
180 | .bitrate = 100000, | 170 | .bitrate = 100000, |
181 | }; | 171 | }; |
@@ -274,7 +264,7 @@ static void pca100_sdhc2_exit(struct device *dev, void *data) | |||
274 | free_irq(IRQ_GPIOC(29), data); | 264 | free_irq(IRQ_GPIOC(29), data); |
275 | } | 265 | } |
276 | 266 | ||
277 | static struct imxmmc_platform_data sdhc_pdata = { | 267 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { |
278 | .init = pca100_sdhc2_init, | 268 | .init = pca100_sdhc2_init, |
279 | .exit = pca100_sdhc2_exit, | 269 | .exit = pca100_sdhc2_exit, |
280 | }; | 270 | }; |
@@ -286,7 +276,7 @@ static int otg_phy_init(struct platform_device *pdev) | |||
286 | return 0; | 276 | return 0; |
287 | } | 277 | } |
288 | 278 | ||
289 | static struct mxc_usbh_platform_data otg_pdata = { | 279 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
290 | .init = otg_phy_init, | 280 | .init = otg_phy_init, |
291 | .portsc = MXC_EHCI_MODE_ULPI, | 281 | .portsc = MXC_EHCI_MODE_ULPI, |
292 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 282 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
@@ -298,14 +288,14 @@ static int usbh2_phy_init(struct platform_device *pdev) | |||
298 | return 0; | 288 | return 0; |
299 | } | 289 | } |
300 | 290 | ||
301 | static struct mxc_usbh_platform_data usbh2_pdata = { | 291 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
302 | .init = usbh2_phy_init, | 292 | .init = usbh2_phy_init, |
303 | .portsc = MXC_EHCI_MODE_ULPI, | 293 | .portsc = MXC_EHCI_MODE_ULPI, |
304 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 294 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
305 | }; | 295 | }; |
306 | #endif | 296 | #endif |
307 | 297 | ||
308 | static struct fsl_usb2_platform_data otg_device_pdata = { | 298 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
309 | .operating_mode = FSL_USB2_DR_DEVICE, | 299 | .operating_mode = FSL_USB2_DR_DEVICE, |
310 | .phy_mode = FSL_USB2_PHY_ULPI, | 300 | .phy_mode = FSL_USB2_PHY_ULPI, |
311 | }; | 301 | }; |
@@ -355,7 +345,7 @@ static struct imx_fb_videomode pca100_fb_modes[] = { | |||
355 | }, | 345 | }, |
356 | }; | 346 | }; |
357 | 347 | ||
358 | static struct imx_fb_platform_data pca100_fb_data = { | 348 | static const struct imx_fb_platform_data pca100_fb_data __initconst = { |
359 | .mode = pca100_fb_modes, | 349 | .mode = pca100_fb_modes, |
360 | .num_modes = ARRAY_SIZE(pca100_fb_modes), | 350 | .num_modes = ARRAY_SIZE(pca100_fb_modes), |
361 | 351 | ||
@@ -389,7 +379,7 @@ static void __init pca100_init(void) | |||
389 | 379 | ||
390 | imx27_add_imx_uart0(&uart_pdata); | 380 | imx27_add_imx_uart0(&uart_pdata); |
391 | 381 | ||
392 | mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); | 382 | imx27_add_mxc_mmc(1, &sdhc_pdata); |
393 | 383 | ||
394 | imx27_add_mxc_nand(&pca100_nand_board_info); | 384 | imx27_add_mxc_nand(&pca100_nand_board_info); |
395 | 385 | ||
@@ -417,23 +407,24 @@ static void __init pca100_init(void) | |||
417 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 407 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
418 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 408 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
419 | 409 | ||
420 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 410 | imx27_add_mxc_ehci_otg(&otg_pdata); |
421 | } | 411 | } |
422 | 412 | ||
423 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 413 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
424 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 414 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
425 | 415 | ||
426 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 416 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
427 | #endif | 417 | #endif |
428 | if (!otg_mode_host) { | 418 | if (!otg_mode_host) { |
429 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | 419 | gpio_set_value(OTG_PHY_CS_GPIO, 0); |
430 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 420 | imx27_add_fsl_usb2_udc(&otg_device_pdata); |
431 | } | 421 | } |
432 | 422 | ||
433 | mxc_register_device(&mxc_fb_device, &pca100_fb_data); | 423 | imx27_add_imx_fb(&pca100_fb_data); |
434 | 424 | ||
435 | imx27_add_fec(NULL); | 425 | imx27_add_fec(NULL); |
436 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 426 | imx27_add_imx2_wdt(NULL); |
427 | imx27_add_mxc_w1(NULL); | ||
437 | } | 428 | } |
438 | 429 | ||
439 | static void __init pca100_timer_init(void) | 430 | static void __init pca100_timer_init(void) |
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index 49a97ce07426..f667a262dfc1 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c | |||
@@ -37,11 +37,9 @@ | |||
37 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
38 | #include <mach/iomux-mx27.h> | 38 | #include <mach/iomux-mx27.h> |
39 | #include <mach/mxc_nand.h> | 39 | #include <mach/mxc_nand.h> |
40 | #include <mach/mxc_ehci.h> | ||
41 | #include <mach/ulpi.h> | 40 | #include <mach/ulpi.h> |
42 | 41 | ||
43 | #include "devices-imx27.h" | 42 | #include "devices-imx27.h" |
44 | #include "devices.h" | ||
45 | 43 | ||
46 | static const int pcm038_pins[] __initconst = { | 44 | static const int pcm038_pins[] __initconst = { |
47 | /* UART1 */ | 45 | /* UART1 */ |
@@ -172,9 +170,7 @@ pcm038_nand_board_info __initconst = { | |||
172 | 170 | ||
173 | static struct platform_device *platform_devices[] __initdata = { | 171 | static struct platform_device *platform_devices[] __initdata = { |
174 | &pcm038_nor_mtd_device, | 172 | &pcm038_nor_mtd_device, |
175 | &mxc_w1_master_device, | ||
176 | &pcm038_sram_mtd_device, | 173 | &pcm038_sram_mtd_device, |
177 | &mxc_wdt, | ||
178 | }; | 174 | }; |
179 | 175 | ||
180 | /* On pcm038 there's a sram attached to CS1, we enable the chipselect here and | 176 | /* On pcm038 there's a sram attached to CS1, we enable the chipselect here and |
@@ -214,7 +210,7 @@ static const struct spi_imx_master pcm038_spi0_data __initconst = { | |||
214 | 210 | ||
215 | static struct regulator_consumer_supply sdhc1_consumers[] = { | 211 | static struct regulator_consumer_supply sdhc1_consumers[] = { |
216 | { | 212 | { |
217 | .dev = &mxc_sdhc_device1.dev, | 213 | .dev_name = "mxc-mmc.1", |
218 | .supply = "sdhc_vcc", | 214 | .supply = "sdhc_vcc", |
219 | }, | 215 | }, |
220 | }; | 216 | }; |
@@ -285,7 +281,7 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = { | |||
285 | } | 281 | } |
286 | }; | 282 | }; |
287 | 283 | ||
288 | static struct mxc_usbh_platform_data usbh2_pdata = { | 284 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { |
289 | .portsc = MXC_EHCI_MODE_ULPI, | 285 | .portsc = MXC_EHCI_MODE_ULPI, |
290 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | 286 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, |
291 | }; | 287 | }; |
@@ -322,10 +318,12 @@ static void __init pcm038_init(void) | |||
322 | spi_register_board_info(pcm038_spi_board_info, | 318 | spi_register_board_info(pcm038_spi_board_info, |
323 | ARRAY_SIZE(pcm038_spi_board_info)); | 319 | ARRAY_SIZE(pcm038_spi_board_info)); |
324 | 320 | ||
325 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 321 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
326 | 322 | ||
327 | imx27_add_fec(NULL); | 323 | imx27_add_fec(NULL); |
328 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 324 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
325 | imx27_add_imx2_wdt(NULL); | ||
326 | imx27_add_mxc_w1(NULL); | ||
329 | 327 | ||
330 | #ifdef CONFIG_MACH_PCM970_BASEBOARD | 328 | #ifdef CONFIG_MACH_PCM970_BASEBOARD |
331 | pcm970_baseboard_init(); | 329 | pcm970_baseboard_init(); |
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c index 1fbdd3faa7ab..eae878f306c6 100644 --- a/arch/arm/mach-imx/mach-scb9328.c +++ b/arch/arm/mach-imx/mach-scb9328.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <mach/iomux-mx1.h> | 25 | #include <mach/iomux-mx1.h> |
26 | 26 | ||
27 | #include "devices-imx1.h" | 27 | #include "devices-imx1.h" |
28 | #include "devices.h" | ||
29 | 28 | ||
30 | /* | 29 | /* |
31 | * This scb9328 has a 32MiB flash | 30 | * This scb9328 has a 32MiB flash |
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c index 9be92b96dc89..729ae0915af8 100644 --- a/arch/arm/mach-imx/mm-imx1.c +++ b/arch/arm/mach-imx/mm-imx1.c | |||
@@ -25,12 +25,7 @@ | |||
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | 26 | ||
27 | static struct map_desc imx_io_desc[] __initdata = { | 27 | static struct map_desc imx_io_desc[] __initdata = { |
28 | { | 28 | imx_map_entry(MX1, IO, MT_DEVICE), |
29 | .virtual = MX1_IO_BASE_ADDR_VIRT, | ||
30 | .pfn = __phys_to_pfn(MX1_IO_BASE_ADDR), | ||
31 | .length = MX1_IO_SIZE, | ||
32 | .type = MT_DEVICE | ||
33 | } | ||
34 | }; | 29 | }; |
35 | 30 | ||
36 | void __init mx1_map_io(void) | 31 | void __init mx1_map_io(void) |
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c index 12faeeaa0a97..e728af81d1b1 100644 --- a/arch/arm/mach-imx/mm-imx21.c +++ b/arch/arm/mach-imx/mm-imx21.c | |||
@@ -35,33 +35,18 @@ static struct map_desc imx21_io_desc[] __initdata = { | |||
35 | * - ROM Patch | 35 | * - ROM Patch |
36 | * - and some reserved space | 36 | * - and some reserved space |
37 | */ | 37 | */ |
38 | { | 38 | imx_map_entry(MX21, AIPI, MT_DEVICE), |
39 | .virtual = MX21_AIPI_BASE_ADDR_VIRT, | ||
40 | .pfn = __phys_to_pfn(MX21_AIPI_BASE_ADDR), | ||
41 | .length = MX21_AIPI_SIZE, | ||
42 | .type = MT_DEVICE | ||
43 | }, | ||
44 | /* | 39 | /* |
45 | * this fixed mapping covers: | 40 | * this fixed mapping covers: |
46 | * - CSI | 41 | * - CSI |
47 | * - ATA | 42 | * - ATA |
48 | */ | 43 | */ |
49 | { | 44 | imx_map_entry(MX21, SAHB1, MT_DEVICE), |
50 | .virtual = MX21_SAHB1_BASE_ADDR_VIRT, | ||
51 | .pfn = __phys_to_pfn(MX21_SAHB1_BASE_ADDR), | ||
52 | .length = MX21_SAHB1_SIZE, | ||
53 | .type = MT_DEVICE | ||
54 | }, | ||
55 | /* | 45 | /* |
56 | * this fixed mapping covers: | 46 | * this fixed mapping covers: |
57 | * - EMI | 47 | * - EMI |
58 | */ | 48 | */ |
59 | { | 49 | imx_map_entry(MX21, X_MEMC, MT_DEVICE), |
60 | .virtual = MX21_X_MEMC_BASE_ADDR_VIRT, | ||
61 | .pfn = __phys_to_pfn(MX21_X_MEMC_BASE_ADDR), | ||
62 | .length = MX21_X_MEMC_SIZE, | ||
63 | .type = MT_DEVICE | ||
64 | }, | ||
65 | }; | 50 | }; |
66 | 51 | ||
67 | /* | 52 | /* |
diff --git a/arch/arm/mach-mx25/mm.c b/arch/arm/mach-imx/mm-imx25.c index bb677111fb0f..2edec6ce8fe7 100644 --- a/arch/arm/mach-mx25/mm.c +++ b/arch/arm/mach-imx/mm-imx25.c | |||
@@ -30,25 +30,12 @@ | |||
30 | 30 | ||
31 | /* | 31 | /* |
32 | * This table defines static virtual address mappings for I/O regions. | 32 | * This table defines static virtual address mappings for I/O regions. |
33 | * These are the mappings common across all MX3 boards. | 33 | * These are the mappings common across all MX25 boards. |
34 | */ | 34 | */ |
35 | static struct map_desc mxc_io_desc[] __initdata = { | 35 | static struct map_desc mx25_io_desc[] __initdata = { |
36 | { | 36 | imx_map_entry(MX25, AVIC, MT_DEVICE_NONSHARED), |
37 | .virtual = MX25_AVIC_BASE_ADDR_VIRT, | 37 | imx_map_entry(MX25, AIPS1, MT_DEVICE_NONSHARED), |
38 | .pfn = __phys_to_pfn(MX25_AVIC_BASE_ADDR), | 38 | imx_map_entry(MX25, AIPS2, MT_DEVICE_NONSHARED), |
39 | .length = MX25_AVIC_SIZE, | ||
40 | .type = MT_DEVICE_NONSHARED | ||
41 | }, { | ||
42 | .virtual = MX25_AIPS1_BASE_ADDR_VIRT, | ||
43 | .pfn = __phys_to_pfn(MX25_AIPS1_BASE_ADDR), | ||
44 | .length = MX25_AIPS1_SIZE, | ||
45 | .type = MT_DEVICE_NONSHARED | ||
46 | }, { | ||
47 | .virtual = MX25_AIPS2_BASE_ADDR_VIRT, | ||
48 | .pfn = __phys_to_pfn(MX25_AIPS2_BASE_ADDR), | ||
49 | .length = MX25_AIPS2_SIZE, | ||
50 | .type = MT_DEVICE_NONSHARED | ||
51 | }, | ||
52 | }; | 39 | }; |
53 | 40 | ||
54 | /* | 41 | /* |
@@ -62,14 +49,14 @@ void __init mx25_map_io(void) | |||
62 | mxc_iomux_v3_init(MX25_IO_ADDRESS(MX25_IOMUXC_BASE_ADDR)); | 49 | mxc_iomux_v3_init(MX25_IO_ADDRESS(MX25_IOMUXC_BASE_ADDR)); |
63 | mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR)); | 50 | mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR)); |
64 | 51 | ||
65 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | 52 | iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc)); |
66 | } | 53 | } |
67 | 54 | ||
68 | int imx25_register_gpios(void); | 55 | int imx25_register_gpios(void); |
69 | 56 | ||
70 | void __init mx25_init_irq(void) | 57 | void __init mx25_init_irq(void) |
71 | { | 58 | { |
72 | mxc_init_irq((void __iomem *)MX25_AVIC_BASE_ADDR_VIRT); | 59 | mxc_init_irq(MX25_IO_ADDRESS(MX25_AVIC_BASE_ADDR)); |
73 | imx25_register_gpios(); | 60 | imx25_register_gpios(); |
74 | } | 61 | } |
75 | 62 | ||
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c index a24622957ff2..374e48b7a412 100644 --- a/arch/arm/mach-imx/mm-imx27.c +++ b/arch/arm/mach-imx/mm-imx27.c | |||
@@ -35,33 +35,18 @@ static struct map_desc imx27_io_desc[] __initdata = { | |||
35 | * - ROM Patch | 35 | * - ROM Patch |
36 | * - and some reserved space | 36 | * - and some reserved space |
37 | */ | 37 | */ |
38 | { | 38 | imx_map_entry(MX27, AIPI, MT_DEVICE), |
39 | .virtual = MX27_AIPI_BASE_ADDR_VIRT, | ||
40 | .pfn = __phys_to_pfn(MX27_AIPI_BASE_ADDR), | ||
41 | .length = MX27_AIPI_SIZE, | ||
42 | .type = MT_DEVICE | ||
43 | }, | ||
44 | /* | 39 | /* |
45 | * this fixed mapping covers: | 40 | * this fixed mapping covers: |
46 | * - CSI | 41 | * - CSI |
47 | * - ATA | 42 | * - ATA |
48 | */ | 43 | */ |
49 | { | 44 | imx_map_entry(MX27, SAHB1, MT_DEVICE), |
50 | .virtual = MX27_SAHB1_BASE_ADDR_VIRT, | ||
51 | .pfn = __phys_to_pfn(MX27_SAHB1_BASE_ADDR), | ||
52 | .length = MX27_SAHB1_SIZE, | ||
53 | .type = MT_DEVICE | ||
54 | }, | ||
55 | /* | 45 | /* |
56 | * this fixed mapping covers: | 46 | * this fixed mapping covers: |
57 | * - EMI | 47 | * - EMI |
58 | */ | 48 | */ |
59 | { | 49 | imx_map_entry(MX27, X_MEMC, MT_DEVICE), |
60 | .virtual = MX27_X_MEMC_BASE_ADDR_VIRT, | ||
61 | .pfn = __phys_to_pfn(MX27_X_MEMC_BASE_ADDR), | ||
62 | .length = MX27_X_MEMC_SIZE, | ||
63 | .type = MT_DEVICE | ||
64 | }, | ||
65 | }; | 50 | }; |
66 | 51 | ||
67 | /* | 52 | /* |
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c index 9110d9cca7a2..99afbc3f43a3 100644 --- a/arch/arm/mach-imx/pcm970-baseboard.c +++ b/arch/arm/mach-imx/pcm970-baseboard.c | |||
@@ -25,11 +25,9 @@ | |||
25 | 25 | ||
26 | #include <mach/common.h> | 26 | #include <mach/common.h> |
27 | #include <mach/iomux-mx27.h> | 27 | #include <mach/iomux-mx27.h> |
28 | #include <mach/imxfb.h> | ||
29 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
30 | #include <mach/mmc.h> | ||
31 | 29 | ||
32 | #include "devices.h" | 30 | #include "devices-imx27.h" |
33 | 31 | ||
34 | static const int pcm970_pins[] __initconst = { | 32 | static const int pcm970_pins[] __initconst = { |
35 | /* SDHC */ | 33 | /* SDHC */ |
@@ -119,7 +117,7 @@ static void pcm970_sdhc2_exit(struct device *dev, void *data) | |||
119 | gpio_free(GPIO_PORTC + 28); | 117 | gpio_free(GPIO_PORTC + 28); |
120 | } | 118 | } |
121 | 119 | ||
122 | static struct imxmmc_platform_data sdhc_pdata = { | 120 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { |
123 | .get_ro = pcm970_sdhc2_get_ro, | 121 | .get_ro = pcm970_sdhc2_get_ro, |
124 | .init = pcm970_sdhc2_init, | 122 | .init = pcm970_sdhc2_init, |
125 | .exit = pcm970_sdhc2_exit, | 123 | .exit = pcm970_sdhc2_exit, |
@@ -179,7 +177,7 @@ static struct imx_fb_videomode pcm970_modes[] = { | |||
179 | }, | 177 | }, |
180 | }; | 178 | }; |
181 | 179 | ||
182 | static struct imx_fb_platform_data pcm038_fb_data = { | 180 | static const struct imx_fb_platform_data pcm038_fb_data __initconst = { |
183 | .mode = pcm970_modes, | 181 | .mode = pcm970_modes, |
184 | .num_modes = ARRAY_SIZE(pcm970_modes), | 182 | .num_modes = ARRAY_SIZE(pcm970_modes), |
185 | 183 | ||
@@ -226,8 +224,8 @@ void __init pcm970_baseboard_init(void) | |||
226 | mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins), | 224 | mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins), |
227 | "PCM970"); | 225 | "PCM970"); |
228 | 226 | ||
229 | mxc_register_device(&mxc_fb_device, &pcm038_fb_data); | 227 | imx27_add_imx_fb(&pcm038_fb_data); |
230 | mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN); | 228 | mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN); |
231 | mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); | 229 | imx27_add_mxc_mmc(1, &sdhc_pdata); |
232 | platform_device_register(&pcm970_sja1000); | 230 | platform_device_register(&pcm970_sja1000); |
233 | } | 231 | } |
diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c index afc17ce0bb54..6bf81ceea137 100644 --- a/arch/arm/mach-imx/pm-imx27.c +++ b/arch/arm/mach-imx/pm-imx27.c | |||
@@ -39,6 +39,9 @@ static struct platform_suspend_ops mx27_suspend_ops = { | |||
39 | 39 | ||
40 | static int __init mx27_pm_init(void) | 40 | static int __init mx27_pm_init(void) |
41 | { | 41 | { |
42 | if (!cpu_is_mx27()) | ||
43 | return 0; | ||
44 | |||
42 | suspend_set_ops(&mx27_suspend_ops); | 45 | suspend_set_ops(&mx27_suspend_ops); |
43 | return 0; | 46 | return 0; |
44 | } | 47 | } |
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index 27db275b367c..769b0f10c834 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig | |||
@@ -4,6 +4,7 @@ menu "Integrator Options" | |||
4 | 4 | ||
5 | config ARCH_INTEGRATOR_AP | 5 | config ARCH_INTEGRATOR_AP |
6 | bool "Support Integrator/AP and Integrator/PP2 platforms" | 6 | bool "Support Integrator/AP and Integrator/PP2 platforms" |
7 | select MIGHT_HAVE_PCI | ||
7 | help | 8 | help |
8 | Include support for the ARM(R) Integrator/AP and | 9 | Include support for the ARM(R) Integrator/AP and |
9 | Integrator/PP2 platforms. | 10 | Integrator/PP2 platforms. |
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 8f4fb6d638f7..b8e884b450da 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
@@ -21,9 +21,8 @@ | |||
21 | #include <linux/amba/bus.h> | 21 | #include <linux/amba/bus.h> |
22 | #include <linux/amba/serial.h> | 22 | #include <linux/amba/serial.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/clkdev.h> | ||
24 | 25 | ||
25 | #include <asm/clkdev.h> | ||
26 | #include <mach/clkdev.h> | ||
27 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
28 | #include <mach/platform.h> | 27 | #include <mach/platform.h> |
29 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index fd684bf205e5..5db574f8ae3f 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -22,9 +22,8 @@ | |||
22 | #include <linux/amba/clcd.h> | 22 | #include <linux/amba/clcd.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/clkdev.h> | ||
25 | 26 | ||
26 | #include <asm/clkdev.h> | ||
27 | #include <mach/clkdev.h> | ||
28 | #include <asm/hardware/icst.h> | 27 | #include <asm/hardware/icst.h> |
29 | #include <mach/lm.h> | 28 | #include <mach/lm.h> |
30 | #include <mach/impd1.h> | 29 | #include <mach/impd1.h> |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 548208f11179..2774df8021dc 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -372,7 +372,6 @@ static struct clocksource clocksource_timersp = { | |||
372 | .rating = 200, | 372 | .rating = 200, |
373 | .read = timersp_read, | 373 | .read = timersp_read, |
374 | .mask = CLOCKSOURCE_MASK(16), | 374 | .mask = CLOCKSOURCE_MASK(16), |
375 | .shift = 16, | ||
376 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 375 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
377 | }; | 376 | }; |
378 | 377 | ||
@@ -390,8 +389,7 @@ static void integrator_clocksource_init(u32 khz) | |||
390 | writel(ctrl, base + TIMER_CTRL); | 389 | writel(ctrl, base + TIMER_CTRL); |
391 | writel(0xffff, base + TIMER_LOAD); | 390 | writel(0xffff, base + TIMER_LOAD); |
392 | 391 | ||
393 | cs->mult = clocksource_khz2mult(khz, cs->shift); | 392 | clocksource_register_khz(cs, khz); |
394 | clocksource_register(cs); | ||
395 | } | 393 | } |
396 | 394 | ||
397 | static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; | 395 | static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 6258c90d020c..85e48a5f77b9 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -21,9 +21,8 @@ | |||
21 | #include <linux/amba/mmci.h> | 21 | #include <linux/amba/mmci.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/gfp.h> | 23 | #include <linux/gfp.h> |
24 | #include <linux/clkdev.h> | ||
24 | 25 | ||
25 | #include <asm/clkdev.h> | ||
26 | #include <mach/clkdev.h> | ||
27 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
28 | #include <mach/platform.h> | 27 | #include <mach/platform.h> |
29 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
@@ -41,7 +40,7 @@ | |||
41 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
42 | #include <asm/mach/time.h> | 41 | #include <asm/mach/time.h> |
43 | 42 | ||
44 | #include <plat/timer-sp.h> | 43 | #include <asm/hardware/timer-sp.h> |
45 | 44 | ||
46 | #include "common.h" | 45 | #include "common.h" |
47 | 46 | ||
diff --git a/arch/arm/mach-iop13xx/include/mach/io.h b/arch/arm/mach-iop13xx/include/mach/io.h index a6e0f9e6ddcf..dffb234bb967 100644 --- a/arch/arm/mach-iop13xx/include/mach/io.h +++ b/arch/arm/mach-iop13xx/include/mach/io.h | |||
@@ -35,7 +35,7 @@ extern u32 iop13xx_atux_mem_base; | |||
35 | extern size_t iop13xx_atue_mem_size; | 35 | extern size_t iop13xx_atue_mem_size; |
36 | extern size_t iop13xx_atux_mem_size; | 36 | extern size_t iop13xx_atux_mem_size; |
37 | 37 | ||
38 | #define __arch_ioremap(a, s, f) __iop13xx_ioremap(a, s, f) | 38 | #define __arch_ioremap __iop13xx_ioremap |
39 | #define __arch_iounmap(a) __iop13xx_iounmap(a) | 39 | #define __arch_iounmap __iop13xx_iounmap |
40 | 40 | ||
41 | #endif | 41 | #endif |
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h index 7415e4338651..3ad455318868 100644 --- a/arch/arm/mach-iop13xx/include/mach/memory.h +++ b/arch/arm/mach-iop13xx/include/mach/memory.h | |||
@@ -58,13 +58,13 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x) | |||
58 | __dma; \ | 58 | __dma; \ |
59 | }) | 59 | }) |
60 | 60 | ||
61 | #define __arch_page_to_dma(dev, page) \ | 61 | #define __arch_pfn_to_dma(dev, pfn) \ |
62 | ({ \ | 62 | ({ \ |
63 | /* __is_lbus_virt() can never be true for RAM pages */ \ | 63 | /* __is_lbus_virt() can never be true for RAM pages */ \ |
64 | (dma_addr_t)page_to_phys(page); \ | 64 | (dma_addr_t)__pfn_to_phys(pfn); \ |
65 | }) | 65 | }) |
66 | 66 | ||
67 | #define __arch_dma_to_page(dev, addr) phys_to_page(addr) | 67 | #define __arch_dma_to_pfn(dev, addr) __phys_to_pfn(addr) |
68 | 68 | ||
69 | #endif /* CONFIG_ARCH_IOP13XX */ | 69 | #endif /* CONFIG_ARCH_IOP13XX */ |
70 | #endif /* !ASSEMBLY */ | 70 | #endif /* !ASSEMBLY */ |
diff --git a/arch/arm/mach-iop32x/include/mach/io.h b/arch/arm/mach-iop32x/include/mach/io.h index 339e5854728b..059c783ce0b2 100644 --- a/arch/arm/mach-iop32x/include/mach/io.h +++ b/arch/arm/mach-iop32x/include/mach/io.h | |||
@@ -21,7 +21,7 @@ extern void __iop3xx_iounmap(void __iomem *addr); | |||
21 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) | 21 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) |
22 | #define __mem_pci(a) (a) | 22 | #define __mem_pci(a) (a) |
23 | 23 | ||
24 | #define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f) | 24 | #define __arch_ioremap __iop3xx_ioremap |
25 | #define __arch_iounmap(a) __iop3xx_iounmap(a) | 25 | #define __arch_iounmap __iop3xx_iounmap |
26 | 26 | ||
27 | #endif | 27 | #endif |
diff --git a/arch/arm/mach-iop33x/include/mach/io.h b/arch/arm/mach-iop33x/include/mach/io.h index e99a7ed6d050..39e893e97c21 100644 --- a/arch/arm/mach-iop33x/include/mach/io.h +++ b/arch/arm/mach-iop33x/include/mach/io.h | |||
@@ -21,7 +21,7 @@ extern void __iop3xx_iounmap(void __iomem *addr); | |||
21 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) | 21 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) |
22 | #define __mem_pci(a) (a) | 22 | #define __mem_pci(a) (a) |
23 | 23 | ||
24 | #define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f) | 24 | #define __arch_ioremap __iop3xx_ioremap |
25 | #define __arch_iounmap(a) __iop3xx_iounmap(a) | 25 | #define __arch_iounmap __iop3xx_iounmap |
26 | 26 | ||
27 | #endif | 27 | #endif |
diff --git a/arch/arm/mach-ixp23xx/include/mach/io.h b/arch/arm/mach-ixp23xx/include/mach/io.h index fd9ef8e519f7..a1749d0fd896 100644 --- a/arch/arm/mach-ixp23xx/include/mach/io.h +++ b/arch/arm/mach-ixp23xx/include/mach/io.h | |||
@@ -45,8 +45,8 @@ ixp23xx_iounmap(void __iomem *addr) | |||
45 | __iounmap(addr); | 45 | __iounmap(addr); |
46 | } | 46 | } |
47 | 47 | ||
48 | #define __arch_ioremap(a,s,f) ixp23xx_ioremap(a,s,f) | 48 | #define __arch_ioremap ixp23xx_ioremap |
49 | #define __arch_iounmap(a) ixp23xx_iounmap(a) | 49 | #define __arch_iounmap ixp23xx_iounmap |
50 | 50 | ||
51 | 51 | ||
52 | #endif | 52 | #endif |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 0bce09799d18..4dbfcbb9163c 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
36 | #include <asm/page.h> | 36 | #include <asm/page.h> |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/sched_clock.h> | ||
38 | 39 | ||
39 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
40 | #include <asm/mach/irq.h> | 41 | #include <asm/mach/irq.h> |
@@ -399,6 +400,23 @@ void __init ixp4xx_sys_init(void) | |||
399 | } | 400 | } |
400 | 401 | ||
401 | /* | 402 | /* |
403 | * sched_clock() | ||
404 | */ | ||
405 | static DEFINE_CLOCK_DATA(cd); | ||
406 | |||
407 | unsigned long long notrace sched_clock(void) | ||
408 | { | ||
409 | u32 cyc = *IXP4XX_OSTS; | ||
410 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); | ||
411 | } | ||
412 | |||
413 | static void notrace ixp4xx_update_sched_clock(void) | ||
414 | { | ||
415 | u32 cyc = *IXP4XX_OSTS; | ||
416 | update_sched_clock(&cd, cyc, (u32)~0); | ||
417 | } | ||
418 | |||
419 | /* | ||
402 | * clocksource | 420 | * clocksource |
403 | */ | 421 | */ |
404 | static cycle_t ixp4xx_get_cycles(struct clocksource *cs) | 422 | static cycle_t ixp4xx_get_cycles(struct clocksource *cs) |
@@ -411,7 +429,6 @@ static struct clocksource clocksource_ixp4xx = { | |||
411 | .rating = 200, | 429 | .rating = 200, |
412 | .read = ixp4xx_get_cycles, | 430 | .read = ixp4xx_get_cycles, |
413 | .mask = CLOCKSOURCE_MASK(32), | 431 | .mask = CLOCKSOURCE_MASK(32), |
414 | .shift = 20, | ||
415 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 432 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
416 | }; | 433 | }; |
417 | 434 | ||
@@ -419,21 +436,9 @@ unsigned long ixp4xx_timer_freq = FREQ; | |||
419 | EXPORT_SYMBOL(ixp4xx_timer_freq); | 436 | EXPORT_SYMBOL(ixp4xx_timer_freq); |
420 | static void __init ixp4xx_clocksource_init(void) | 437 | static void __init ixp4xx_clocksource_init(void) |
421 | { | 438 | { |
422 | clocksource_ixp4xx.mult = | 439 | init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq); |
423 | clocksource_hz2mult(ixp4xx_timer_freq, | ||
424 | clocksource_ixp4xx.shift); | ||
425 | clocksource_register(&clocksource_ixp4xx); | ||
426 | } | ||
427 | |||
428 | /* | ||
429 | * sched_clock() | ||
430 | */ | ||
431 | unsigned long long sched_clock(void) | ||
432 | { | ||
433 | cycle_t cyc = ixp4xx_get_cycles(NULL); | ||
434 | struct clocksource *cs = &clocksource_ixp4xx; | ||
435 | 440 | ||
436 | return clocksource_cyc2ns(cyc, cs->mult, cs->shift); | 441 | clocksource_register_hz(&clocksource_ixp4xx, ixp4xx_timer_freq); |
437 | } | 442 | } |
438 | 443 | ||
439 | /* | 444 | /* |
diff --git a/arch/arm/mach-ixp4xx/include/mach/io.h b/arch/arm/mach-ixp4xx/include/mach/io.h index de274a1f19d7..57b5410c31f4 100644 --- a/arch/arm/mach-ixp4xx/include/mach/io.h +++ b/arch/arm/mach-ixp4xx/include/mach/io.h | |||
@@ -74,8 +74,8 @@ static inline void __indirect_iounmap(void __iomem *addr) | |||
74 | __iounmap(addr); | 74 | __iounmap(addr); |
75 | } | 75 | } |
76 | 76 | ||
77 | #define __arch_ioremap(a, s, f) __indirect_ioremap(a, s, f) | 77 | #define __arch_ioremap __indirect_ioremap |
78 | #define __arch_iounmap(a) __indirect_iounmap(a) | 78 | #define __arch_iounmap __indirect_iounmap |
79 | 79 | ||
80 | #define writeb(v, p) __indirect_writeb(v, p) | 80 | #define writeb(v, p) __indirect_writeb(v, p) |
81 | #define writew(v, p) __indirect_writew(v, p) | 81 | #define writew(v, p) __indirect_writew(v, p) |
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 34106335c728..7fc603b46891 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -45,18 +45,18 @@ config MACH_GURUPLUG | |||
45 | Marvell GuruPlug Reference Board. | 45 | Marvell GuruPlug Reference Board. |
46 | 46 | ||
47 | config MACH_TS219 | 47 | config MACH_TS219 |
48 | bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS" | 48 | bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" |
49 | help | 49 | help |
50 | Say 'Y' here if you want your kernel to support the | 50 | Say 'Y' here if you want your kernel to support the |
51 | QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS | 51 | QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and |
52 | devices. | 52 | TS-219P+ Turbo NAS devices. |
53 | 53 | ||
54 | config MACH_TS41X | 54 | config MACH_TS41X |
55 | bool "QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS" | 55 | bool "QNAP TS-410, TS-410U, TS-419P, TS-419P+ and TS-419U Turbo NAS" |
56 | help | 56 | help |
57 | Say 'Y' here if you want your kernel to support the | 57 | Say 'Y' here if you want your kernel to support the |
58 | QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS | 58 | QNAP TS-410, TS-410U, TS-419P, TS-419P+ and TS-419U Turbo |
59 | devices. | 59 | NAS devices. |
60 | 60 | ||
61 | config MACH_DOCKSTAR | 61 | config MACH_DOCKSTAR |
62 | bool "Seagate FreeAgent DockStar" | 62 | bool "Seagate FreeAgent DockStar" |
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h index 44e8be04f259..1aaddc364f2e 100644 --- a/arch/arm/mach-kirkwood/include/mach/io.h +++ b/arch/arm/mach-kirkwood/include/mach/io.h | |||
@@ -42,8 +42,8 @@ __arch_iounmap(void __iomem *addr) | |||
42 | __iounmap(addr); | 42 | __iounmap(addr); |
43 | } | 43 | } |
44 | 44 | ||
45 | #define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m) | 45 | #define __arch_ioremap __arch_ioremap |
46 | #define __arch_iounmap(a) __arch_iounmap(a) | 46 | #define __arch_iounmap __arch_iounmap |
47 | #define __io(a) __io(a) | 47 | #define __io(a) __io(a) |
48 | #define __mem_pci(a) (a) | 48 | #define __mem_pci(a) (a) |
49 | 49 | ||
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c index 6710bd7773b8..dc999c4c5806 100644 --- a/arch/arm/mach-kirkwood/ts219-setup.c +++ b/arch/arm/mach-kirkwood/ts219-setup.c | |||
@@ -80,15 +80,19 @@ static unsigned int qnap_ts219_mpp_config[] __initdata = { | |||
80 | MPP11_UART0_RXD, | 80 | MPP11_UART0_RXD, |
81 | MPP13_UART1_TXD, /* PIC controller */ | 81 | MPP13_UART1_TXD, /* PIC controller */ |
82 | MPP14_UART1_RXD, /* PIC controller */ | 82 | MPP14_UART1_RXD, /* PIC controller */ |
83 | MPP15_GPIO, /* USB Copy button */ | 83 | MPP15_GPIO, /* USB Copy button (on devices with 88F6281) */ |
84 | MPP16_GPIO, /* Reset button */ | 84 | MPP16_GPIO, /* Reset button (on devices with 88F6281) */ |
85 | MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */ | 85 | MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */ |
86 | MPP37_GPIO, /* Reset button (on devices with 88F6282) */ | ||
87 | MPP43_GPIO, /* USB Copy button (on devices with 88F6282) */ | ||
86 | MPP44_GPIO, /* Board ID: 0: TS-11x, 1: TS-21x */ | 88 | MPP44_GPIO, /* Board ID: 0: TS-11x, 1: TS-21x */ |
87 | 0 | 89 | 0 |
88 | }; | 90 | }; |
89 | 91 | ||
90 | static void __init qnap_ts219_init(void) | 92 | static void __init qnap_ts219_init(void) |
91 | { | 93 | { |
94 | u32 dev, rev; | ||
95 | |||
92 | /* | 96 | /* |
93 | * Basic setup. Needs to be called early. | 97 | * Basic setup. Needs to be called early. |
94 | */ | 98 | */ |
@@ -100,6 +104,14 @@ static void __init qnap_ts219_init(void) | |||
100 | qnap_tsx1x_register_flash(); | 104 | qnap_tsx1x_register_flash(); |
101 | kirkwood_i2c_init(); | 105 | kirkwood_i2c_init(); |
102 | i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1); | 106 | i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1); |
107 | |||
108 | kirkwood_pcie_id(&dev, &rev); | ||
109 | if (dev == MV88F6282_DEV_ID) { | ||
110 | qnap_ts219_buttons[0].gpio = 43; /* USB Copy button */ | ||
111 | qnap_ts219_buttons[1].gpio = 37; /* Reset button */ | ||
112 | qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); | ||
113 | } | ||
114 | |||
103 | kirkwood_ge00_init(&qnap_ts219_ge00_data); | 115 | kirkwood_ge00_init(&qnap_ts219_ge00_data); |
104 | kirkwood_sata_init(&qnap_ts219_sata_data); | 116 | kirkwood_sata_init(&qnap_ts219_sata_data); |
105 | kirkwood_ehci_init(); | 117 | kirkwood_ehci_init(); |
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c index 3587a281d993..9a44029915e2 100644 --- a/arch/arm/mach-kirkwood/ts41x-setup.c +++ b/arch/arm/mach-kirkwood/ts41x-setup.c | |||
@@ -119,6 +119,8 @@ static unsigned int qnap_ts41x_mpp_config[] __initdata = { | |||
119 | 119 | ||
120 | static void __init qnap_ts41x_init(void) | 120 | static void __init qnap_ts41x_init(void) |
121 | { | 121 | { |
122 | u32 dev, rev; | ||
123 | |||
122 | /* | 124 | /* |
123 | * Basic setup. Needs to be called early. | 125 | * Basic setup. Needs to be called early. |
124 | */ | 126 | */ |
@@ -130,8 +132,15 @@ static void __init qnap_ts41x_init(void) | |||
130 | qnap_tsx1x_register_flash(); | 132 | qnap_tsx1x_register_flash(); |
131 | kirkwood_i2c_init(); | 133 | kirkwood_i2c_init(); |
132 | i2c_register_board_info(0, &qnap_ts41x_i2c_rtc, 1); | 134 | i2c_register_board_info(0, &qnap_ts41x_i2c_rtc, 1); |
135 | |||
136 | kirkwood_pcie_id(&dev, &rev); | ||
137 | if (dev == MV88F6282_DEV_ID) { | ||
138 | qnap_ts41x_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); | ||
139 | qnap_ts41x_ge01_data.phy_addr = MV643XX_ETH_PHY_ADDR(1); | ||
140 | } | ||
133 | kirkwood_ge00_init(&qnap_ts41x_ge00_data); | 141 | kirkwood_ge00_init(&qnap_ts41x_ge00_data); |
134 | kirkwood_ge01_init(&qnap_ts41x_ge01_data); | 142 | kirkwood_ge01_init(&qnap_ts41x_ge01_data); |
143 | |||
135 | kirkwood_sata_init(&qnap_ts41x_sata_data); | 144 | kirkwood_sata_init(&qnap_ts41x_sata_data); |
136 | kirkwood_ehci_init(); | 145 | kirkwood_ehci_init(); |
137 | platform_device_register(&qnap_ts41x_button_device); | 146 | platform_device_register(&qnap_ts41x_button_device); |
diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig index fe0c82e30b2d..f5c39a8c2b00 100644 --- a/arch/arm/mach-ks8695/Kconfig +++ b/arch/arm/mach-ks8695/Kconfig | |||
@@ -4,6 +4,7 @@ menu "Kendin/Micrel KS8695 Implementations" | |||
4 | 4 | ||
5 | config MACH_KS8695 | 5 | config MACH_KS8695 |
6 | bool "KS8695 development board" | 6 | bool "KS8695 development board" |
7 | select MIGHT_HAVE_PCI | ||
7 | help | 8 | help |
8 | Say 'Y' here if you want your kernel to run on the original | 9 | Say 'Y' here if you want your kernel to run on the original |
9 | Kendin-Micrel KS8695 development board. | 10 | Kendin-Micrel KS8695 development board. |
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h index ffa19aae6e05..bace9a681adc 100644 --- a/arch/arm/mach-ks8695/include/mach/memory.h +++ b/arch/arm/mach-ks8695/include/mach/memory.h | |||
@@ -35,17 +35,17 @@ extern struct bus_type platform_bus_type; | |||
35 | __phys_to_virt(x) : __bus_to_virt(x)); }) | 35 | __phys_to_virt(x) : __bus_to_virt(x)); }) |
36 | #define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \ | 36 | #define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \ |
37 | (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); }) | 37 | (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); }) |
38 | #define __arch_page_to_dma(dev, x) \ | 38 | #define __arch_pfn_to_dma(dev, pfn) \ |
39 | ({ dma_addr_t __dma = page_to_phys(page); \ | 39 | ({ dma_addr_t __dma = __pfn_to_phys(pfn); \ |
40 | if (!is_lbus_device(dev)) \ | 40 | if (!is_lbus_device(dev)) \ |
41 | __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \ | 41 | __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \ |
42 | __dma; }) | 42 | __dma; }) |
43 | 43 | ||
44 | #define __arch_dma_to_page(dev, x) \ | 44 | #define __arch_dma_to_pfn(dev, x) \ |
45 | ({ dma_addr_t __dma = x; \ | 45 | ({ dma_addr_t __dma = x; \ |
46 | if (!is_lbus_device(dev)) \ | 46 | if (!is_lbus_device(dev)) \ |
47 | __dma += PHYS_OFFSET - KS8695_PCIMEM_PA; \ | 47 | __dma += PHYS_OFFSET - KS8695_PCIMEM_PA; \ |
48 | phys_to_page(__dma); \ | 48 | __phys_to_pfn(__dma); \ |
49 | }) | 49 | }) |
50 | 50 | ||
51 | #endif | 51 | #endif |
diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c index 32d63796430a..da0e6498110a 100644 --- a/arch/arm/mach-lpc32xx/clock.c +++ b/arch/arm/mach-lpc32xx/clock.c | |||
@@ -90,10 +90,9 @@ | |||
90 | #include <linux/clk.h> | 90 | #include <linux/clk.h> |
91 | #include <linux/amba/bus.h> | 91 | #include <linux/amba/bus.h> |
92 | #include <linux/amba/clcd.h> | 92 | #include <linux/amba/clcd.h> |
93 | #include <linux/clkdev.h> | ||
93 | 94 | ||
94 | #include <mach/hardware.h> | 95 | #include <mach/hardware.h> |
95 | #include <asm/clkdev.h> | ||
96 | #include <mach/clkdev.h> | ||
97 | #include <mach/platform.h> | 96 | #include <mach/platform.h> |
98 | #include "clock.h" | 97 | #include "clock.h" |
99 | #include "common.h" | 98 | #include "common.h" |
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c index 630dd4a74b26..6162ac308c20 100644 --- a/arch/arm/mach-lpc32xx/timer.c +++ b/arch/arm/mach-lpc32xx/timer.c | |||
@@ -38,7 +38,6 @@ static cycle_t lpc32xx_clksrc_read(struct clocksource *cs) | |||
38 | 38 | ||
39 | static struct clocksource lpc32xx_clksrc = { | 39 | static struct clocksource lpc32xx_clksrc = { |
40 | .name = "lpc32xx_clksrc", | 40 | .name = "lpc32xx_clksrc", |
41 | .shift = 24, | ||
42 | .rating = 300, | 41 | .rating = 300, |
43 | .read = lpc32xx_clksrc_read, | 42 | .read = lpc32xx_clksrc_read, |
44 | .mask = CLOCKSOURCE_MASK(32), | 43 | .mask = CLOCKSOURCE_MASK(32), |
@@ -171,9 +170,7 @@ static void __init lpc32xx_timer_init(void) | |||
171 | __raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE)); | 170 | __raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE)); |
172 | __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN, | 171 | __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN, |
173 | LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE)); | 172 | LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE)); |
174 | lpc32xx_clksrc.mult = clocksource_hz2mult(clkrate, | 173 | clocksource_register_hz(&lpc32xx_clksrc, clkrate); |
175 | lpc32xx_clksrc.shift); | ||
176 | clocksource_register(&lpc32xx_clksrc); | ||
177 | } | 174 | } |
178 | 175 | ||
179 | struct sys_timer lpc32xx_timer = { | 176 | struct sys_timer lpc32xx_timer = { |
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig index 0711d3b620ad..67793a690272 100644 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig | |||
@@ -37,25 +37,38 @@ config MACH_TTC_DKB | |||
37 | Say 'Y' here if you want to support the Marvell PXA910-based | 37 | Say 'Y' here if you want to support the Marvell PXA910-based |
38 | TTC_DKB Development Board. | 38 | TTC_DKB Development Board. |
39 | 39 | ||
40 | config MACH_BROWNSTONE | ||
41 | bool "Marvell's Brownstone Development Platform" | ||
42 | depends on !CPU_MOHAWK | ||
43 | select CPU_MMP2 | ||
44 | help | ||
45 | Say 'Y' here if you want to support the Marvell MMP2-based | ||
46 | Brown Development Platform. | ||
47 | MMP2-based board can't be co-existed with PXA168-based & | ||
48 | PXA910-based development board. Since MMP2 is compatible to | ||
49 | ARMv7 architecture. | ||
50 | |||
40 | config MACH_FLINT | 51 | config MACH_FLINT |
41 | bool "Marvell's Flint Development Platform" | 52 | bool "Marvell's Flint Development Platform" |
53 | depends on !CPU_MOHAWK | ||
42 | select CPU_MMP2 | 54 | select CPU_MMP2 |
43 | help | 55 | help |
44 | Say 'Y' here if you want to support the Marvell MMP2-based | 56 | Say 'Y' here if you want to support the Marvell MMP2-based |
45 | Flint Development Platform. | 57 | Flint Development Platform. |
46 | MMP2-based board can't be co-existed with PXA168-based & | 58 | MMP2-based board can't be co-existed with PXA168-based & |
47 | PXA910-based development board. Since MMP2 is compatible to | 59 | PXA910-based development board. Since MMP2 is compatible to |
48 | ARMv6 architecture. | 60 | ARMv7 architecture. |
49 | 61 | ||
50 | config MACH_MARVELL_JASPER | 62 | config MACH_MARVELL_JASPER |
51 | bool "Marvell's Jasper Development Platform" | 63 | bool "Marvell's Jasper Development Platform" |
64 | depends on !CPU_MOHAWK | ||
52 | select CPU_MMP2 | 65 | select CPU_MMP2 |
53 | help | 66 | help |
54 | Say 'Y' here if you want to support the Marvell MMP2-base | 67 | Say 'Y' here if you want to support the Marvell MMP2-base |
55 | Jasper Development Platform. | 68 | Jasper Development Platform. |
56 | MMP2-based board can't be co-existed with PXA168-based & | 69 | MMP2-based board can't be co-existed with PXA168-based & |
57 | PXA910-based development board. Since MMP2 is compatible to | 70 | PXA910-based development board. Since MMP2 is compatible to |
58 | ARMv6 architecture. | 71 | ARMv7 architecture. |
59 | 72 | ||
60 | config MACH_TETON_BGA | 73 | config MACH_TETON_BGA |
61 | bool "Marvell's PXA168 Teton BGA Development Board" | 74 | bool "Marvell's PXA168 Teton BGA Development Board" |
@@ -80,8 +93,7 @@ config CPU_PXA910 | |||
80 | 93 | ||
81 | config CPU_MMP2 | 94 | config CPU_MMP2 |
82 | bool | 95 | bool |
83 | select CPU_V6 | 96 | select CPU_PJ4 |
84 | select CPU_32v6K | ||
85 | help | 97 | help |
86 | Select code specific to MMP2. MMP2 is ARMv6 compatible. | 98 | Select code specific to MMP2. MMP2 is ARMv7 compatible. |
87 | endif | 99 | endif |
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile index 751cdbf733c8..5c68382141af 100644 --- a/arch/arm/mach-mmp/Makefile +++ b/arch/arm/mach-mmp/Makefile | |||
@@ -15,6 +15,7 @@ obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.o | |||
15 | obj-$(CONFIG_MACH_AVENGERS_LITE)+= avengers_lite.o | 15 | obj-$(CONFIG_MACH_AVENGERS_LITE)+= avengers_lite.o |
16 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o | 16 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o |
17 | obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o | 17 | obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o |
18 | obj-$(CONFIG_MACH_BROWNSTONE) += brownstone.o | ||
18 | obj-$(CONFIG_MACH_FLINT) += flint.o | 19 | obj-$(CONFIG_MACH_FLINT) += flint.o |
19 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o | 20 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o |
20 | obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o | 21 | obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o |
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c new file mode 100644 index 000000000000..7bb78fd5a2a6 --- /dev/null +++ b/arch/arm/mach-mmp/brownstone.c | |||
@@ -0,0 +1,204 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/brownstone.c | ||
3 | * | ||
4 | * Support for the Marvell Brownstone Development Platform. | ||
5 | * | ||
6 | * Copyright (C) 2009-2010 Marvell International Ltd. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * publishhed by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/regulator/machine.h> | ||
19 | #include <linux/regulator/max8649.h> | ||
20 | #include <linux/regulator/fixed.h> | ||
21 | #include <linux/mfd/max8925.h> | ||
22 | |||
23 | #include <asm/mach-types.h> | ||
24 | #include <asm/mach/arch.h> | ||
25 | #include <mach/addr-map.h> | ||
26 | #include <mach/mfp-mmp2.h> | ||
27 | #include <mach/mmp2.h> | ||
28 | #include <mach/irqs.h> | ||
29 | |||
30 | #include "common.h" | ||
31 | |||
32 | #define BROWNSTONE_NR_IRQS (IRQ_BOARD_START + 40) | ||
33 | |||
34 | #define GPIO_5V_ENABLE (89) | ||
35 | |||
36 | static unsigned long brownstone_pin_config[] __initdata = { | ||
37 | /* UART1 */ | ||
38 | GPIO29_UART1_RXD, | ||
39 | GPIO30_UART1_TXD, | ||
40 | |||
41 | /* UART3 */ | ||
42 | GPIO51_UART3_RXD, | ||
43 | GPIO52_UART3_TXD, | ||
44 | |||
45 | /* DFI */ | ||
46 | GPIO168_DFI_D0, | ||
47 | GPIO167_DFI_D1, | ||
48 | GPIO166_DFI_D2, | ||
49 | GPIO165_DFI_D3, | ||
50 | GPIO107_DFI_D4, | ||
51 | GPIO106_DFI_D5, | ||
52 | GPIO105_DFI_D6, | ||
53 | GPIO104_DFI_D7, | ||
54 | GPIO111_DFI_D8, | ||
55 | GPIO164_DFI_D9, | ||
56 | GPIO163_DFI_D10, | ||
57 | GPIO162_DFI_D11, | ||
58 | GPIO161_DFI_D12, | ||
59 | GPIO110_DFI_D13, | ||
60 | GPIO109_DFI_D14, | ||
61 | GPIO108_DFI_D15, | ||
62 | GPIO143_ND_nCS0, | ||
63 | GPIO144_ND_nCS1, | ||
64 | GPIO147_ND_nWE, | ||
65 | GPIO148_ND_nRE, | ||
66 | GPIO150_ND_ALE, | ||
67 | GPIO149_ND_CLE, | ||
68 | GPIO112_ND_RDY0, | ||
69 | GPIO160_ND_RDY1, | ||
70 | |||
71 | /* PMIC */ | ||
72 | PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, | ||
73 | |||
74 | /* MMC0 */ | ||
75 | GPIO131_MMC1_DAT3 | MFP_PULL_HIGH, | ||
76 | GPIO132_MMC1_DAT2 | MFP_PULL_HIGH, | ||
77 | GPIO133_MMC1_DAT1 | MFP_PULL_HIGH, | ||
78 | GPIO134_MMC1_DAT0 | MFP_PULL_HIGH, | ||
79 | GPIO136_MMC1_CMD | MFP_PULL_HIGH, | ||
80 | GPIO139_MMC1_CLK, | ||
81 | GPIO140_MMC1_CD | MFP_PULL_LOW, | ||
82 | GPIO141_MMC1_WP | MFP_PULL_LOW, | ||
83 | |||
84 | /* MMC1 */ | ||
85 | GPIO37_MMC2_DAT3 | MFP_PULL_HIGH, | ||
86 | GPIO38_MMC2_DAT2 | MFP_PULL_HIGH, | ||
87 | GPIO39_MMC2_DAT1 | MFP_PULL_HIGH, | ||
88 | GPIO40_MMC2_DAT0 | MFP_PULL_HIGH, | ||
89 | GPIO41_MMC2_CMD | MFP_PULL_HIGH, | ||
90 | GPIO42_MMC2_CLK, | ||
91 | |||
92 | /* MMC2 */ | ||
93 | GPIO165_MMC3_DAT7 | MFP_PULL_HIGH, | ||
94 | GPIO162_MMC3_DAT6 | MFP_PULL_HIGH, | ||
95 | GPIO166_MMC3_DAT5 | MFP_PULL_HIGH, | ||
96 | GPIO163_MMC3_DAT4 | MFP_PULL_HIGH, | ||
97 | GPIO167_MMC3_DAT3 | MFP_PULL_HIGH, | ||
98 | GPIO164_MMC3_DAT2 | MFP_PULL_HIGH, | ||
99 | GPIO168_MMC3_DAT1 | MFP_PULL_HIGH, | ||
100 | GPIO111_MMC3_DAT0 | MFP_PULL_HIGH, | ||
101 | GPIO112_MMC3_CMD | MFP_PULL_HIGH, | ||
102 | GPIO151_MMC3_CLK, | ||
103 | |||
104 | /* 5V regulator */ | ||
105 | GPIO89_GPIO, | ||
106 | }; | ||
107 | |||
108 | static struct regulator_consumer_supply max8649_supply[] = { | ||
109 | REGULATOR_SUPPLY("vcc_core", NULL), | ||
110 | }; | ||
111 | |||
112 | static struct regulator_init_data max8649_init_data = { | ||
113 | .constraints = { | ||
114 | .name = "vcc_core range", | ||
115 | .min_uV = 1150000, | ||
116 | .max_uV = 1280000, | ||
117 | .always_on = 1, | ||
118 | .boot_on = 1, | ||
119 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
120 | }, | ||
121 | .num_consumer_supplies = 1, | ||
122 | .consumer_supplies = &max8649_supply[0], | ||
123 | }; | ||
124 | |||
125 | static struct max8649_platform_data brownstone_max8649_info = { | ||
126 | .mode = 2, /* VID1 = 1, VID0 = 0 */ | ||
127 | .extclk = 0, | ||
128 | .ramp_timing = MAX8649_RAMP_32MV, | ||
129 | .regulator = &max8649_init_data, | ||
130 | }; | ||
131 | |||
132 | static struct regulator_consumer_supply brownstone_v_5vp_supplies[] = { | ||
133 | REGULATOR_SUPPLY("v_5vp", NULL), | ||
134 | }; | ||
135 | |||
136 | static struct regulator_init_data brownstone_v_5vp_data = { | ||
137 | .constraints = { | ||
138 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
139 | }, | ||
140 | .num_consumer_supplies = ARRAY_SIZE(brownstone_v_5vp_supplies), | ||
141 | .consumer_supplies = brownstone_v_5vp_supplies, | ||
142 | }; | ||
143 | |||
144 | static struct fixed_voltage_config brownstone_v_5vp = { | ||
145 | .supply_name = "v_5vp", | ||
146 | .microvolts = 5000000, | ||
147 | .gpio = GPIO_5V_ENABLE, | ||
148 | .enable_high = 1, | ||
149 | .enabled_at_boot = 1, | ||
150 | .init_data = &brownstone_v_5vp_data, | ||
151 | }; | ||
152 | |||
153 | static struct platform_device brownstone_v_5vp_device = { | ||
154 | .name = "reg-fixed-voltage", | ||
155 | .id = 1, | ||
156 | .dev = { | ||
157 | .platform_data = &brownstone_v_5vp, | ||
158 | }, | ||
159 | }; | ||
160 | |||
161 | static struct max8925_platform_data brownstone_max8925_info = { | ||
162 | .irq_base = IRQ_BOARD_START, | ||
163 | }; | ||
164 | |||
165 | static struct i2c_board_info brownstone_twsi1_info[] = { | ||
166 | [0] = { | ||
167 | .type = "max8649", | ||
168 | .addr = 0x60, | ||
169 | .platform_data = &brownstone_max8649_info, | ||
170 | }, | ||
171 | [1] = { | ||
172 | .type = "max8925", | ||
173 | .addr = 0x3c, | ||
174 | .irq = IRQ_MMP2_PMIC, | ||
175 | .platform_data = &brownstone_max8925_info, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { | ||
180 | .max_speed = 25000000, | ||
181 | }; | ||
182 | |||
183 | static void __init brownstone_init(void) | ||
184 | { | ||
185 | mfp_config(ARRAY_AND_SIZE(brownstone_pin_config)); | ||
186 | |||
187 | /* on-chip devices */ | ||
188 | mmp2_add_uart(1); | ||
189 | mmp2_add_uart(3); | ||
190 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); | ||
191 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ | ||
192 | |||
193 | /* enable 5v regulator */ | ||
194 | platform_device_register(&brownstone_v_5vp_device); | ||
195 | } | ||
196 | |||
197 | MACHINE_START(BROWNSTONE, "Brownstone Development Platform") | ||
198 | /* Maintainer: Haojian Zhuang <haojian.zhuang@marvell.com> */ | ||
199 | .map_io = mmp_map_io, | ||
200 | .nr_irqs = BROWNSTONE_NR_IRQS, | ||
201 | .init_irq = mmp2_init_irq, | ||
202 | .timer = &mmp2_timer, | ||
203 | .init_machine = brownstone_init, | ||
204 | MACHINE_END | ||
diff --git a/arch/arm/mach-mmp/clock.h b/arch/arm/mach-mmp/clock.h index 016ae94691c0..9b027d7491f5 100644 --- a/arch/arm/mach-mmp/clock.h +++ b/arch/arm/mach-mmp/clock.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <asm/clkdev.h> | 9 | #include <linux/clkdev.h> |
10 | 10 | ||
11 | struct clkops { | 11 | struct clkops { |
12 | void (*enable)(struct clk *); | 12 | void (*enable)(struct clk *); |
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c index bdeb6db4d49a..c4fd806b15b4 100644 --- a/arch/arm/mach-mmp/flint.c +++ b/arch/arm/mach-mmp/flint.c | |||
@@ -47,7 +47,7 @@ static unsigned long flint_pin_config[] __initdata = { | |||
47 | GPIO113_SMC_RDY, | 47 | GPIO113_SMC_RDY, |
48 | 48 | ||
49 | /*Ethernet*/ | 49 | /*Ethernet*/ |
50 | GPIO155_GPIO155, | 50 | GPIO155_GPIO, |
51 | 51 | ||
52 | /* DFI */ | 52 | /* DFI */ |
53 | GPIO168_DFI_D0, | 53 | GPIO168_DFI_D0, |
diff --git a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h index 761c2dacc079..117e30366087 100644 --- a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h | |||
@@ -9,175 +9,175 @@ | |||
9 | #define MFP_DRIVE_FAST (0x8 << 13) | 9 | #define MFP_DRIVE_FAST (0x8 << 13) |
10 | 10 | ||
11 | /* GPIO */ | 11 | /* GPIO */ |
12 | #define GPIO0_GPIO0 MFP_CFG(GPIO0, AF0) | 12 | #define GPIO0_GPIO MFP_CFG(GPIO0, AF0) |
13 | #define GPIO1_GPIO1 MFP_CFG(GPIO1, AF0) | 13 | #define GPIO1_GPIO MFP_CFG(GPIO1, AF0) |
14 | #define GPIO2_GPIO2 MFP_CFG(GPIO2, AF0) | 14 | #define GPIO2_GPIO MFP_CFG(GPIO2, AF0) |
15 | #define GPIO3_GPIO3 MFP_CFG(GPIO3, AF0) | 15 | #define GPIO3_GPIO MFP_CFG(GPIO3, AF0) |
16 | #define GPIO4_GPIO4 MFP_CFG(GPIO4, AF0) | 16 | #define GPIO4_GPIO MFP_CFG(GPIO4, AF0) |
17 | #define GPIO5_GPIO5 MFP_CFG(GPIO5, AF0) | 17 | #define GPIO5_GPIO MFP_CFG(GPIO5, AF0) |
18 | #define GPIO6_GPIO6 MFP_CFG(GPIO6, AF0) | 18 | #define GPIO6_GPIO MFP_CFG(GPIO6, AF0) |
19 | #define GPIO7_GPIO7 MFP_CFG(GPIO7, AF0) | 19 | #define GPIO7_GPIO MFP_CFG(GPIO7, AF0) |
20 | #define GPIO8_GPIO8 MFP_CFG(GPIO8, AF0) | 20 | #define GPIO8_GPIO MFP_CFG(GPIO8, AF0) |
21 | #define GPIO9_GPIO9 MFP_CFG(GPIO9, AF0) | 21 | #define GPIO9_GPIO MFP_CFG(GPIO9, AF0) |
22 | #define GPIO10_GPIO10 MFP_CFG(GPIO10, AF0) | 22 | #define GPIO10_GPIO MFP_CFG(GPIO10, AF0) |
23 | #define GPIO11_GPIO11 MFP_CFG(GPIO11, AF0) | 23 | #define GPIO11_GPIO MFP_CFG(GPIO11, AF0) |
24 | #define GPIO12_GPIO12 MFP_CFG(GPIO12, AF0) | 24 | #define GPIO12_GPIO MFP_CFG(GPIO12, AF0) |
25 | #define GPIO13_GPIO13 MFP_CFG(GPIO13, AF0) | 25 | #define GPIO13_GPIO MFP_CFG(GPIO13, AF0) |
26 | #define GPIO14_GPIO14 MFP_CFG(GPIO14, AF0) | 26 | #define GPIO14_GPIO MFP_CFG(GPIO14, AF0) |
27 | #define GPIO15_GPIO15 MFP_CFG(GPIO15, AF0) | 27 | #define GPIO15_GPIO MFP_CFG(GPIO15, AF0) |
28 | #define GPIO16_GPIO16 MFP_CFG(GPIO16, AF0) | 28 | #define GPIO16_GPIO MFP_CFG(GPIO16, AF0) |
29 | #define GPIO17_GPIO17 MFP_CFG(GPIO17, AF0) | 29 | #define GPIO17_GPIO MFP_CFG(GPIO17, AF0) |
30 | #define GPIO18_GPIO18 MFP_CFG(GPIO18, AF0) | 30 | #define GPIO18_GPIO MFP_CFG(GPIO18, AF0) |
31 | #define GPIO19_GPIO19 MFP_CFG(GPIO19, AF0) | 31 | #define GPIO19_GPIO MFP_CFG(GPIO19, AF0) |
32 | #define GPIO20_GPIO20 MFP_CFG(GPIO20, AF0) | 32 | #define GPIO20_GPIO MFP_CFG(GPIO20, AF0) |
33 | #define GPIO21_GPIO21 MFP_CFG(GPIO21, AF0) | 33 | #define GPIO21_GPIO MFP_CFG(GPIO21, AF0) |
34 | #define GPIO22_GPIO22 MFP_CFG(GPIO22, AF0) | 34 | #define GPIO22_GPIO MFP_CFG(GPIO22, AF0) |
35 | #define GPIO23_GPIO23 MFP_CFG(GPIO23, AF0) | 35 | #define GPIO23_GPIO MFP_CFG(GPIO23, AF0) |
36 | #define GPIO24_GPIO24 MFP_CFG(GPIO24, AF0) | 36 | #define GPIO24_GPIO MFP_CFG(GPIO24, AF0) |
37 | #define GPIO25_GPIO25 MFP_CFG(GPIO25, AF0) | 37 | #define GPIO25_GPIO MFP_CFG(GPIO25, AF0) |
38 | #define GPIO26_GPIO26 MFP_CFG(GPIO26, AF0) | 38 | #define GPIO26_GPIO MFP_CFG(GPIO26, AF0) |
39 | #define GPIO27_GPIO27 MFP_CFG(GPIO27, AF0) | 39 | #define GPIO27_GPIO MFP_CFG(GPIO27, AF0) |
40 | #define GPIO28_GPIO28 MFP_CFG(GPIO28, AF0) | 40 | #define GPIO28_GPIO MFP_CFG(GPIO28, AF0) |
41 | #define GPIO29_GPIO29 MFP_CFG(GPIO29, AF0) | 41 | #define GPIO29_GPIO MFP_CFG(GPIO29, AF0) |
42 | #define GPIO30_GPIO30 MFP_CFG(GPIO30, AF0) | 42 | #define GPIO30_GPIO MFP_CFG(GPIO30, AF0) |
43 | #define GPIO31_GPIO31 MFP_CFG(GPIO31, AF0) | 43 | #define GPIO31_GPIO MFP_CFG(GPIO31, AF0) |
44 | #define GPIO32_GPIO32 MFP_CFG(GPIO32, AF0) | 44 | #define GPIO32_GPIO MFP_CFG(GPIO32, AF0) |
45 | #define GPIO33_GPIO33 MFP_CFG(GPIO33, AF0) | 45 | #define GPIO33_GPIO MFP_CFG(GPIO33, AF0) |
46 | #define GPIO34_GPIO34 MFP_CFG(GPIO34, AF0) | 46 | #define GPIO34_GPIO MFP_CFG(GPIO34, AF0) |
47 | #define GPIO35_GPIO35 MFP_CFG(GPIO35, AF0) | 47 | #define GPIO35_GPIO MFP_CFG(GPIO35, AF0) |
48 | #define GPIO36_GPIO36 MFP_CFG(GPIO36, AF0) | 48 | #define GPIO36_GPIO MFP_CFG(GPIO36, AF0) |
49 | #define GPIO37_GPIO37 MFP_CFG(GPIO37, AF0) | 49 | #define GPIO37_GPIO MFP_CFG(GPIO37, AF0) |
50 | #define GPIO38_GPIO38 MFP_CFG(GPIO38, AF0) | 50 | #define GPIO38_GPIO MFP_CFG(GPIO38, AF0) |
51 | #define GPIO39_GPIO39 MFP_CFG(GPIO39, AF0) | 51 | #define GPIO39_GPIO MFP_CFG(GPIO39, AF0) |
52 | #define GPIO40_GPIO40 MFP_CFG(GPIO40, AF0) | 52 | #define GPIO40_GPIO MFP_CFG(GPIO40, AF0) |
53 | #define GPIO41_GPIO41 MFP_CFG(GPIO41, AF0) | 53 | #define GPIO41_GPIO MFP_CFG(GPIO41, AF0) |
54 | #define GPIO42_GPIO42 MFP_CFG(GPIO42, AF0) | 54 | #define GPIO42_GPIO MFP_CFG(GPIO42, AF0) |
55 | #define GPIO43_GPIO43 MFP_CFG(GPIO43, AF0) | 55 | #define GPIO43_GPIO MFP_CFG(GPIO43, AF0) |
56 | #define GPIO44_GPIO44 MFP_CFG(GPIO44, AF0) | 56 | #define GPIO44_GPIO MFP_CFG(GPIO44, AF0) |
57 | #define GPIO45_GPIO45 MFP_CFG(GPIO45, AF0) | 57 | #define GPIO45_GPIO MFP_CFG(GPIO45, AF0) |
58 | #define GPIO46_GPIO46 MFP_CFG(GPIO46, AF0) | 58 | #define GPIO46_GPIO MFP_CFG(GPIO46, AF0) |
59 | #define GPIO47_GPIO47 MFP_CFG(GPIO47, AF0) | 59 | #define GPIO47_GPIO MFP_CFG(GPIO47, AF0) |
60 | #define GPIO48_GPIO48 MFP_CFG(GPIO48, AF0) | 60 | #define GPIO48_GPIO MFP_CFG(GPIO48, AF0) |
61 | #define GPIO49_GPIO49 MFP_CFG(GPIO49, AF0) | 61 | #define GPIO49_GPIO MFP_CFG(GPIO49, AF0) |
62 | #define GPIO50_GPIO50 MFP_CFG(GPIO50, AF0) | 62 | #define GPIO50_GPIO MFP_CFG(GPIO50, AF0) |
63 | #define GPIO51_GPIO51 MFP_CFG(GPIO51, AF0) | 63 | #define GPIO51_GPIO MFP_CFG(GPIO51, AF0) |
64 | #define GPIO52_GPIO52 MFP_CFG(GPIO52, AF0) | 64 | #define GPIO52_GPIO MFP_CFG(GPIO52, AF0) |
65 | #define GPIO53_GPIO53 MFP_CFG(GPIO53, AF0) | 65 | #define GPIO53_GPIO MFP_CFG(GPIO53, AF0) |
66 | #define GPIO54_GPIO54 MFP_CFG(GPIO54, AF0) | 66 | #define GPIO54_GPIO MFP_CFG(GPIO54, AF0) |
67 | #define GPIO55_GPIO55 MFP_CFG(GPIO55, AF0) | 67 | #define GPIO55_GPIO MFP_CFG(GPIO55, AF0) |
68 | #define GPIO56_GPIO56 MFP_CFG(GPIO56, AF0) | 68 | #define GPIO56_GPIO MFP_CFG(GPIO56, AF0) |
69 | #define GPIO57_GPIO57 MFP_CFG(GPIO57, AF0) | 69 | #define GPIO57_GPIO MFP_CFG(GPIO57, AF0) |
70 | #define GPIO58_GPIO58 MFP_CFG(GPIO58, AF0) | 70 | #define GPIO58_GPIO MFP_CFG(GPIO58, AF0) |
71 | #define GPIO59_GPIO59 MFP_CFG(GPIO59, AF0) | 71 | #define GPIO59_GPIO MFP_CFG(GPIO59, AF0) |
72 | #define GPIO60_GPIO60 MFP_CFG(GPIO60, AF0) | 72 | #define GPIO60_GPIO MFP_CFG(GPIO60, AF0) |
73 | #define GPIO61_GPIO61 MFP_CFG(GPIO61, AF0) | 73 | #define GPIO61_GPIO MFP_CFG(GPIO61, AF0) |
74 | #define GPIO62_GPIO62 MFP_CFG(GPIO62, AF0) | 74 | #define GPIO62_GPIO MFP_CFG(GPIO62, AF0) |
75 | #define GPIO63_GPIO63 MFP_CFG(GPIO63, AF0) | 75 | #define GPIO63_GPIO MFP_CFG(GPIO63, AF0) |
76 | #define GPIO64_GPIO64 MFP_CFG(GPIO64, AF0) | 76 | #define GPIO64_GPIO MFP_CFG(GPIO64, AF0) |
77 | #define GPIO65_GPIO65 MFP_CFG(GPIO65, AF0) | 77 | #define GPIO65_GPIO MFP_CFG(GPIO65, AF0) |
78 | #define GPIO66_GPIO66 MFP_CFG(GPIO66, AF0) | 78 | #define GPIO66_GPIO MFP_CFG(GPIO66, AF0) |
79 | #define GPIO67_GPIO67 MFP_CFG(GPIO67, AF0) | 79 | #define GPIO67_GPIO MFP_CFG(GPIO67, AF0) |
80 | #define GPIO68_GPIO68 MFP_CFG(GPIO68, AF0) | 80 | #define GPIO68_GPIO MFP_CFG(GPIO68, AF0) |
81 | #define GPIO69_GPIO69 MFP_CFG(GPIO69, AF0) | 81 | #define GPIO69_GPIO MFP_CFG(GPIO69, AF0) |
82 | #define GPIO70_GPIO70 MFP_CFG(GPIO70, AF0) | 82 | #define GPIO70_GPIO MFP_CFG(GPIO70, AF0) |
83 | #define GPIO71_GPIO71 MFP_CFG(GPIO71, AF0) | 83 | #define GPIO71_GPIO MFP_CFG(GPIO71, AF0) |
84 | #define GPIO72_GPIO72 MFP_CFG(GPIO72, AF0) | 84 | #define GPIO72_GPIO MFP_CFG(GPIO72, AF0) |
85 | #define GPIO73_GPIO73 MFP_CFG(GPIO73, AF0) | 85 | #define GPIO73_GPIO MFP_CFG(GPIO73, AF0) |
86 | #define GPIO74_GPIO74 MFP_CFG(GPIO74, AF0) | 86 | #define GPIO74_GPIO MFP_CFG(GPIO74, AF0) |
87 | #define GPIO75_GPIO75 MFP_CFG(GPIO75, AF0) | 87 | #define GPIO75_GPIO MFP_CFG(GPIO75, AF0) |
88 | #define GPIO76_GPIO76 MFP_CFG(GPIO76, AF0) | 88 | #define GPIO76_GPIO MFP_CFG(GPIO76, AF0) |
89 | #define GPIO77_GPIO77 MFP_CFG(GPIO77, AF0) | 89 | #define GPIO77_GPIO MFP_CFG(GPIO77, AF0) |
90 | #define GPIO78_GPIO78 MFP_CFG(GPIO78, AF0) | 90 | #define GPIO78_GPIO MFP_CFG(GPIO78, AF0) |
91 | #define GPIO79_GPIO79 MFP_CFG(GPIO79, AF0) | 91 | #define GPIO79_GPIO MFP_CFG(GPIO79, AF0) |
92 | #define GPIO80_GPIO80 MFP_CFG(GPIO80, AF0) | 92 | #define GPIO80_GPIO MFP_CFG(GPIO80, AF0) |
93 | #define GPIO81_GPIO81 MFP_CFG(GPIO81, AF0) | 93 | #define GPIO81_GPIO MFP_CFG(GPIO81, AF0) |
94 | #define GPIO82_GPIO82 MFP_CFG(GPIO82, AF0) | 94 | #define GPIO82_GPIO MFP_CFG(GPIO82, AF0) |
95 | #define GPIO83_GPIO83 MFP_CFG(GPIO83, AF0) | 95 | #define GPIO83_GPIO MFP_CFG(GPIO83, AF0) |
96 | #define GPIO84_GPIO84 MFP_CFG(GPIO84, AF0) | 96 | #define GPIO84_GPIO MFP_CFG(GPIO84, AF0) |
97 | #define GPIO85_GPIO85 MFP_CFG(GPIO85, AF0) | 97 | #define GPIO85_GPIO MFP_CFG(GPIO85, AF0) |
98 | #define GPIO86_GPIO86 MFP_CFG(GPIO86, AF0) | 98 | #define GPIO86_GPIO MFP_CFG(GPIO86, AF0) |
99 | #define GPIO87_GPIO87 MFP_CFG(GPIO87, AF0) | 99 | #define GPIO87_GPIO MFP_CFG(GPIO87, AF0) |
100 | #define GPIO88_GPIO88 MFP_CFG(GPIO88, AF0) | 100 | #define GPIO88_GPIO MFP_CFG(GPIO88, AF0) |
101 | #define GPIO89_GPIO89 MFP_CFG(GPIO89, AF0) | 101 | #define GPIO89_GPIO MFP_CFG(GPIO89, AF0) |
102 | #define GPIO90_GPIO90 MFP_CFG(GPIO90, AF0) | 102 | #define GPIO90_GPIO MFP_CFG(GPIO90, AF0) |
103 | #define GPIO91_GPIO91 MFP_CFG(GPIO91, AF0) | 103 | #define GPIO91_GPIO MFP_CFG(GPIO91, AF0) |
104 | #define GPIO92_GPIO92 MFP_CFG(GPIO92, AF0) | 104 | #define GPIO92_GPIO MFP_CFG(GPIO92, AF0) |
105 | #define GPIO93_GPIO93 MFP_CFG(GPIO93, AF0) | 105 | #define GPIO93_GPIO MFP_CFG(GPIO93, AF0) |
106 | #define GPIO94_GPIO94 MFP_CFG(GPIO94, AF0) | 106 | #define GPIO94_GPIO MFP_CFG(GPIO94, AF0) |
107 | #define GPIO95_GPIO95 MFP_CFG(GPIO95, AF0) | 107 | #define GPIO95_GPIO MFP_CFG(GPIO95, AF0) |
108 | #define GPIO96_GPIO96 MFP_CFG(GPIO96, AF0) | 108 | #define GPIO96_GPIO MFP_CFG(GPIO96, AF0) |
109 | #define GPIO97_GPIO97 MFP_CFG(GPIO97, AF0) | 109 | #define GPIO97_GPIO MFP_CFG(GPIO97, AF0) |
110 | #define GPIO98_GPIO98 MFP_CFG(GPIO98, AF0) | 110 | #define GPIO98_GPIO MFP_CFG(GPIO98, AF0) |
111 | #define GPIO99_GPIO99 MFP_CFG(GPIO99, AF0) | 111 | #define GPIO99_GPIO MFP_CFG(GPIO99, AF0) |
112 | #define GPIO100_GPIO100 MFP_CFG(GPIO100, AF0) | 112 | #define GPIO100_GPIO MFP_CFG(GPIO100, AF0) |
113 | #define GPIO101_GPIO101 MFP_CFG(GPIO101, AF0) | 113 | #define GPIO101_GPIO MFP_CFG(GPIO101, AF0) |
114 | #define GPIO102_GPIO102 MFP_CFG(GPIO102, AF1) | 114 | #define GPIO102_GPIO MFP_CFG(GPIO102, AF1) |
115 | #define GPIO103_GPIO103 MFP_CFG(GPIO103, AF1) | 115 | #define GPIO103_GPIO MFP_CFG(GPIO103, AF1) |
116 | #define GPIO104_GPIO104 MFP_CFG(GPIO104, AF1) | 116 | #define GPIO104_GPIO MFP_CFG(GPIO104, AF1) |
117 | #define GPIO105_GPIO105 MFP_CFG(GPIO105, AF1) | 117 | #define GPIO105_GPIO MFP_CFG(GPIO105, AF1) |
118 | #define GPIO106_GPIO106 MFP_CFG(GPIO106, AF1) | 118 | #define GPIO106_GPIO MFP_CFG(GPIO106, AF1) |
119 | #define GPIO107_GPIO107 MFP_CFG(GPIO107, AF1) | 119 | #define GPIO107_GPIO MFP_CFG(GPIO107, AF1) |
120 | #define GPIO108_GPIO108 MFP_CFG(GPIO108, AF1) | 120 | #define GPIO108_GPIO MFP_CFG(GPIO108, AF1) |
121 | #define GPIO109_GPIO109 MFP_CFG(GPIO109, AF1) | 121 | #define GPIO109_GPIO MFP_CFG(GPIO109, AF1) |
122 | #define GPIO110_GPIO110 MFP_CFG(GPIO110, AF1) | 122 | #define GPIO110_GPIO MFP_CFG(GPIO110, AF1) |
123 | #define GPIO111_GPIO111 MFP_CFG(GPIO111, AF1) | 123 | #define GPIO111_GPIO MFP_CFG(GPIO111, AF1) |
124 | #define GPIO112_GPIO112 MFP_CFG(GPIO112, AF1) | 124 | #define GPIO112_GPIO MFP_CFG(GPIO112, AF1) |
125 | #define GPIO113_GPIO113 MFP_CFG(GPIO113, AF1) | 125 | #define GPIO113_GPIO MFP_CFG(GPIO113, AF1) |
126 | #define GPIO114_GPIO114 MFP_CFG(GPIO114, AF0) | 126 | #define GPIO114_GPIO MFP_CFG(GPIO114, AF0) |
127 | #define GPIO115_GPIO115 MFP_CFG(GPIO115, AF0) | 127 | #define GPIO115_GPIO MFP_CFG(GPIO115, AF0) |
128 | #define GPIO116_GPIO116 MFP_CFG(GPIO116, AF0) | 128 | #define GPIO116_GPIO MFP_CFG(GPIO116, AF0) |
129 | #define GPIO117_GPIO117 MFP_CFG(GPIO117, AF0) | 129 | #define GPIO117_GPIO MFP_CFG(GPIO117, AF0) |
130 | #define GPIO118_GPIO118 MFP_CFG(GPIO118, AF0) | 130 | #define GPIO118_GPIO MFP_CFG(GPIO118, AF0) |
131 | #define GPIO119_GPIO119 MFP_CFG(GPIO119, AF0) | 131 | #define GPIO119_GPIO MFP_CFG(GPIO119, AF0) |
132 | #define GPIO120_GPIO120 MFP_CFG(GPIO120, AF0) | 132 | #define GPIO120_GPIO MFP_CFG(GPIO120, AF0) |
133 | #define GPIO121_GPIO121 MFP_CFG(GPIO121, AF0) | 133 | #define GPIO121_GPIO MFP_CFG(GPIO121, AF0) |
134 | #define GPIO122_GPIO122 MFP_CFG(GPIO122, AF0) | 134 | #define GPIO122_GPIO MFP_CFG(GPIO122, AF0) |
135 | #define GPIO123_GPIO123 MFP_CFG(GPIO123, AF0) | 135 | #define GPIO123_GPIO MFP_CFG(GPIO123, AF0) |
136 | #define GPIO124_GPIO124 MFP_CFG(GPIO124, AF0) | 136 | #define GPIO124_GPIO MFP_CFG(GPIO124, AF0) |
137 | #define GPIO125_GPIO125 MFP_CFG(GPIO125, AF0) | 137 | #define GPIO125_GPIO MFP_CFG(GPIO125, AF0) |
138 | #define GPIO126_GPIO126 MFP_CFG(GPIO126, AF0) | 138 | #define GPIO126_GPIO MFP_CFG(GPIO126, AF0) |
139 | #define GPIO127_GPIO127 MFP_CFG(GPIO127, AF0) | 139 | #define GPIO127_GPIO MFP_CFG(GPIO127, AF0) |
140 | #define GPIO128_GPIO128 MFP_CFG(GPIO128, AF0) | 140 | #define GPIO128_GPIO MFP_CFG(GPIO128, AF0) |
141 | #define GPIO129_GPIO129 MFP_CFG(GPIO129, AF0) | 141 | #define GPIO129_GPIO MFP_CFG(GPIO129, AF0) |
142 | #define GPIO130_GPIO130 MFP_CFG(GPIO130, AF0) | 142 | #define GPIO130_GPIO MFP_CFG(GPIO130, AF0) |
143 | #define GPIO131_GPIO131 MFP_CFG(GPIO131, AF0) | 143 | #define GPIO131_GPIO MFP_CFG(GPIO131, AF0) |
144 | #define GPIO132_GPIO132 MFP_CFG(GPIO132, AF0) | 144 | #define GPIO132_GPIO MFP_CFG(GPIO132, AF0) |
145 | #define GPIO133_GPIO133 MFP_CFG(GPIO133, AF0) | 145 | #define GPIO133_GPIO MFP_CFG(GPIO133, AF0) |
146 | #define GPIO134_GPIO134 MFP_CFG(GPIO134, AF0) | 146 | #define GPIO134_GPIO MFP_CFG(GPIO134, AF0) |
147 | #define GPIO135_GPIO135 MFP_CFG(GPIO135, AF0) | 147 | #define GPIO135_GPIO MFP_CFG(GPIO135, AF0) |
148 | #define GPIO136_GPIO136 MFP_CFG(GPIO136, AF0) | 148 | #define GPIO136_GPIO MFP_CFG(GPIO136, AF0) |
149 | #define GPIO137_GPIO137 MFP_CFG(GPIO137, AF0) | 149 | #define GPIO137_GPIO MFP_CFG(GPIO137, AF0) |
150 | #define GPIO138_GPIO138 MFP_CFG(GPIO138, AF0) | 150 | #define GPIO138_GPIO MFP_CFG(GPIO138, AF0) |
151 | #define GPIO139_GPIO139 MFP_CFG(GPIO139, AF0) | 151 | #define GPIO139_GPIO MFP_CFG(GPIO139, AF0) |
152 | #define GPIO140_GPIO140 MFP_CFG(GPIO140, AF0) | 152 | #define GPIO140_GPIO MFP_CFG(GPIO140, AF0) |
153 | #define GPIO141_GPIO141 MFP_CFG(GPIO141, AF0) | 153 | #define GPIO141_GPIO MFP_CFG(GPIO141, AF0) |
154 | #define GPIO142_GPIO142 MFP_CFG(GPIO142, AF1) | 154 | #define GPIO142_GPIO MFP_CFG(GPIO142, AF1) |
155 | #define GPIO143_GPIO143 MFP_CFG(GPIO143, AF1) | 155 | #define GPIO143_GPIO MFP_CFG(GPIO143, AF1) |
156 | #define GPIO144_GPIO144 MFP_CFG(GPIO144, AF1) | 156 | #define GPIO144_GPIO MFP_CFG(GPIO144, AF1) |
157 | #define GPIO145_GPIO145 MFP_CFG(GPIO145, AF1) | 157 | #define GPIO145_GPIO MFP_CFG(GPIO145, AF1) |
158 | #define GPIO146_GPIO146 MFP_CFG(GPIO146, AF1) | 158 | #define GPIO146_GPIO MFP_CFG(GPIO146, AF1) |
159 | #define GPIO147_GPIO147 MFP_CFG(GPIO147, AF1) | 159 | #define GPIO147_GPIO MFP_CFG(GPIO147, AF1) |
160 | #define GPIO148_GPIO148 MFP_CFG(GPIO148, AF1) | 160 | #define GPIO148_GPIO MFP_CFG(GPIO148, AF1) |
161 | #define GPIO149_GPIO149 MFP_CFG(GPIO149, AF1) | 161 | #define GPIO149_GPIO MFP_CFG(GPIO149, AF1) |
162 | #define GPIO150_GPIO150 MFP_CFG(GPIO150, AF1) | 162 | #define GPIO150_GPIO MFP_CFG(GPIO150, AF1) |
163 | #define GPIO151_GPIO151 MFP_CFG(GPIO151, AF1) | 163 | #define GPIO151_GPIO MFP_CFG(GPIO151, AF1) |
164 | #define GPIO152_GPIO152 MFP_CFG(GPIO152, AF1) | 164 | #define GPIO152_GPIO MFP_CFG(GPIO152, AF1) |
165 | #define GPIO153_GPIO153 MFP_CFG(GPIO153, AF1) | 165 | #define GPIO153_GPIO MFP_CFG(GPIO153, AF1) |
166 | #define GPIO154_GPIO154 MFP_CFG(GPIO154, AF1) | 166 | #define GPIO154_GPIO MFP_CFG(GPIO154, AF1) |
167 | #define GPIO155_GPIO155 MFP_CFG(GPIO155, AF1) | 167 | #define GPIO155_GPIO MFP_CFG(GPIO155, AF1) |
168 | #define GPIO156_GPIO156 MFP_CFG(GPIO156, AF1) | 168 | #define GPIO156_GPIO MFP_CFG(GPIO156, AF1) |
169 | #define GPIO157_GPIO157 MFP_CFG(GPIO157, AF1) | 169 | #define GPIO157_GPIO MFP_CFG(GPIO157, AF1) |
170 | #define GPIO158_GPIO158 MFP_CFG(GPIO158, AF1) | 170 | #define GPIO158_GPIO MFP_CFG(GPIO158, AF1) |
171 | #define GPIO159_GPIO159 MFP_CFG(GPIO159, AF1) | 171 | #define GPIO159_GPIO MFP_CFG(GPIO159, AF1) |
172 | #define GPIO160_GPIO160 MFP_CFG(GPIO160, AF1) | 172 | #define GPIO160_GPIO MFP_CFG(GPIO160, AF1) |
173 | #define GPIO161_GPIO161 MFP_CFG(GPIO161, AF1) | 173 | #define GPIO161_GPIO MFP_CFG(GPIO161, AF1) |
174 | #define GPIO162_GPIO162 MFP_CFG(GPIO162, AF1) | 174 | #define GPIO162_GPIO MFP_CFG(GPIO162, AF1) |
175 | #define GPIO163_GPIO163 MFP_CFG(GPIO163, AF1) | 175 | #define GPIO163_GPIO MFP_CFG(GPIO163, AF1) |
176 | #define GPIO164_GPIO164 MFP_CFG(GPIO164, AF1) | 176 | #define GPIO164_GPIO MFP_CFG(GPIO164, AF1) |
177 | #define GPIO165_GPIO165 MFP_CFG(GPIO165, AF1) | 177 | #define GPIO165_GPIO MFP_CFG(GPIO165, AF1) |
178 | #define GPIO166_GPIO166 MFP_CFG(GPIO166, AF1) | 178 | #define GPIO166_GPIO MFP_CFG(GPIO166, AF1) |
179 | #define GPIO167_GPIO167 MFP_CFG(GPIO167, AF1) | 179 | #define GPIO167_GPIO MFP_CFG(GPIO167, AF1) |
180 | #define GPIO168_GPIO168 MFP_CFG(GPIO168, AF1) | 180 | #define GPIO168_GPIO MFP_CFG(GPIO168, AF1) |
181 | 181 | ||
182 | /* DFI */ | 182 | /* DFI */ |
183 | #define GPIO108_DFI_D15 MFP_CFG(GPIO108, AF0) | 183 | #define GPIO108_DFI_D15 MFP_CFG(GPIO108, AF0) |
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h index dbba6e8a60c4..4aec493640b4 100644 --- a/arch/arm/mach-mmp/include/mach/mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mmp2.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_MACH_MMP2_H | 1 | #ifndef __ASM_MACH_MMP2_H |
2 | #define __ASM_MACH_MMP2_H | 2 | #define __ASM_MACH_MMP2_H |
3 | 3 | ||
4 | #include <plat/sdhci.h> | ||
5 | |||
4 | struct sys_timer; | 6 | struct sys_timer; |
5 | 7 | ||
6 | extern struct sys_timer mmp2_timer; | 8 | extern struct sys_timer mmp2_timer; |
@@ -22,6 +24,10 @@ extern struct pxa_device_desc mmp2_device_twsi3; | |||
22 | extern struct pxa_device_desc mmp2_device_twsi4; | 24 | extern struct pxa_device_desc mmp2_device_twsi4; |
23 | extern struct pxa_device_desc mmp2_device_twsi5; | 25 | extern struct pxa_device_desc mmp2_device_twsi5; |
24 | extern struct pxa_device_desc mmp2_device_twsi6; | 26 | extern struct pxa_device_desc mmp2_device_twsi6; |
27 | extern struct pxa_device_desc mmp2_device_sdh0; | ||
28 | extern struct pxa_device_desc mmp2_device_sdh1; | ||
29 | extern struct pxa_device_desc mmp2_device_sdh2; | ||
30 | extern struct pxa_device_desc mmp2_device_sdh3; | ||
25 | 31 | ||
26 | static inline int mmp2_add_uart(int id) | 32 | static inline int mmp2_add_uart(int id) |
27 | { | 33 | { |
@@ -63,5 +69,21 @@ static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data, | |||
63 | return pxa_register_device(d, data, sizeof(*data)); | 69 | return pxa_register_device(d, data, sizeof(*data)); |
64 | } | 70 | } |
65 | 71 | ||
72 | static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data) | ||
73 | { | ||
74 | struct pxa_device_desc *d = NULL; | ||
75 | |||
76 | switch (id) { | ||
77 | case 0: d = &mmp2_device_sdh0; break; | ||
78 | case 1: d = &mmp2_device_sdh1; break; | ||
79 | case 2: d = &mmp2_device_sdh2; break; | ||
80 | case 3: d = &mmp2_device_sdh3; break; | ||
81 | default: | ||
82 | return -EINVAL; | ||
83 | } | ||
84 | |||
85 | return pxa_register_device(d, data, sizeof(*data)); | ||
86 | } | ||
87 | |||
66 | #endif /* __ASM_MACH_MMP2_H */ | 88 | #endif /* __ASM_MACH_MMP2_H */ |
67 | 89 | ||
diff --git a/arch/arm/mach-mmp/include/mach/regs-apmu.h b/arch/arm/mach-mmp/include/mach/regs-apmu.h index ac4702357a6e..f7011ef70bf5 100644 --- a/arch/arm/mach-mmp/include/mach/regs-apmu.h +++ b/arch/arm/mach-mmp/include/mach/regs-apmu.h | |||
@@ -27,6 +27,8 @@ | |||
27 | #define APMU_DMA APMU_REG(0x064) | 27 | #define APMU_DMA APMU_REG(0x064) |
28 | #define APMU_GEU APMU_REG(0x068) | 28 | #define APMU_GEU APMU_REG(0x068) |
29 | #define APMU_BUS APMU_REG(0x06c) | 29 | #define APMU_BUS APMU_REG(0x06c) |
30 | #define APMU_SDH2 APMU_REG(0x0e8) | ||
31 | #define APMU_SDH3 APMU_REG(0x0ec) | ||
30 | 32 | ||
31 | #define APMU_FNCLK_EN (1 << 4) | 33 | #define APMU_FNCLK_EN (1 << 4) |
32 | #define APMU_AXICLK_EN (1 << 3) | 34 | #define APMU_AXICLK_EN (1 << 3) |
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index 2a684fa50773..24172a0aad59 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c | |||
@@ -67,6 +67,36 @@ static unsigned long jasper_pin_config[] __initdata = { | |||
67 | 67 | ||
68 | /* PMIC */ | 68 | /* PMIC */ |
69 | PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, | 69 | PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, |
70 | |||
71 | /* MMC1 */ | ||
72 | GPIO131_MMC1_DAT3, | ||
73 | GPIO132_MMC1_DAT2, | ||
74 | GPIO133_MMC1_DAT1, | ||
75 | GPIO134_MMC1_DAT0, | ||
76 | GPIO136_MMC1_CMD, | ||
77 | GPIO139_MMC1_CLK, | ||
78 | GPIO140_MMC1_CD, | ||
79 | GPIO141_MMC1_WP, | ||
80 | |||
81 | /* MMC2 */ | ||
82 | GPIO37_MMC2_DAT3, | ||
83 | GPIO38_MMC2_DAT2, | ||
84 | GPIO39_MMC2_DAT1, | ||
85 | GPIO40_MMC2_DAT0, | ||
86 | GPIO41_MMC2_CMD, | ||
87 | GPIO42_MMC2_CLK, | ||
88 | |||
89 | /* MMC3 */ | ||
90 | GPIO165_MMC3_DAT7, | ||
91 | GPIO162_MMC3_DAT6, | ||
92 | GPIO166_MMC3_DAT5, | ||
93 | GPIO163_MMC3_DAT4, | ||
94 | GPIO167_MMC3_DAT3, | ||
95 | GPIO164_MMC3_DAT2, | ||
96 | GPIO168_MMC3_DAT1, | ||
97 | GPIO111_MMC3_DAT0, | ||
98 | GPIO112_MMC3_CMD, | ||
99 | GPIO151_MMC3_CLK, | ||
70 | }; | 100 | }; |
71 | 101 | ||
72 | static struct regulator_consumer_supply max8649_supply[] = { | 102 | static struct regulator_consumer_supply max8649_supply[] = { |
@@ -123,6 +153,10 @@ static struct i2c_board_info jasper_twsi1_info[] = { | |||
123 | }, | 153 | }, |
124 | }; | 154 | }; |
125 | 155 | ||
156 | static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { | ||
157 | .max_speed = 25000000, | ||
158 | }; | ||
159 | |||
126 | static void __init jasper_init(void) | 160 | static void __init jasper_init(void) |
127 | { | 161 | { |
128 | mfp_config(ARRAY_AND_SIZE(jasper_pin_config)); | 162 | mfp_config(ARRAY_AND_SIZE(jasper_pin_config)); |
@@ -131,6 +165,7 @@ static void __init jasper_init(void) | |||
131 | mmp2_add_uart(1); | 165 | mmp2_add_uart(1); |
132 | mmp2_add_uart(3); | 166 | mmp2_add_uart(3); |
133 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); | 167 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); |
168 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ | ||
134 | 169 | ||
135 | regulator_has_full_constraints(); | 170 | regulator_has_full_constraints(); |
136 | } | 171 | } |
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index 2e3dd08ccc3f..8e6c3ac7f7c1 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -115,6 +115,29 @@ void __init mmp2_init_irq(void) | |||
115 | mmp2_init_gpio(); | 115 | mmp2_init_gpio(); |
116 | } | 116 | } |
117 | 117 | ||
118 | static void sdhc_clk_enable(struct clk *clk) | ||
119 | { | ||
120 | uint32_t clk_rst; | ||
121 | |||
122 | clk_rst = __raw_readl(clk->clk_rst); | ||
123 | clk_rst |= clk->enable_val; | ||
124 | __raw_writel(clk_rst, clk->clk_rst); | ||
125 | } | ||
126 | |||
127 | static void sdhc_clk_disable(struct clk *clk) | ||
128 | { | ||
129 | uint32_t clk_rst; | ||
130 | |||
131 | clk_rst = __raw_readl(clk->clk_rst); | ||
132 | clk_rst &= ~clk->enable_val; | ||
133 | __raw_writel(clk_rst, clk->clk_rst); | ||
134 | } | ||
135 | |||
136 | struct clkops sdhc_clk_ops = { | ||
137 | .enable = sdhc_clk_enable, | ||
138 | .disable = sdhc_clk_disable, | ||
139 | }; | ||
140 | |||
118 | /* APB peripheral clocks */ | 141 | /* APB peripheral clocks */ |
119 | static APBC_CLK(uart1, MMP2_UART1, 1, 26000000); | 142 | static APBC_CLK(uart1, MMP2_UART1, 1, 26000000); |
120 | static APBC_CLK(uart2, MMP2_UART2, 1, 26000000); | 143 | static APBC_CLK(uart2, MMP2_UART2, 1, 26000000); |
@@ -128,6 +151,10 @@ static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000); | |||
128 | static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); | 151 | static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); |
129 | 152 | ||
130 | static APMU_CLK(nand, NAND, 0xbf, 100000000); | 153 | static APMU_CLK(nand, NAND, 0xbf, 100000000); |
154 | static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops); | ||
155 | static APMU_CLK_OPS(sdh1, SDH1, 0x1b, 200000000, &sdhc_clk_ops); | ||
156 | static APMU_CLK_OPS(sdh2, SDH2, 0x1b, 200000000, &sdhc_clk_ops); | ||
157 | static APMU_CLK_OPS(sdh3, SDH3, 0x1b, 200000000, &sdhc_clk_ops); | ||
131 | 158 | ||
132 | static struct clk_lookup mmp2_clkregs[] = { | 159 | static struct clk_lookup mmp2_clkregs[] = { |
133 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | 160 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), |
@@ -141,6 +168,10 @@ static struct clk_lookup mmp2_clkregs[] = { | |||
141 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), | 168 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), |
142 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), | 169 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), |
143 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 170 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
171 | INIT_CLKREG(&clk_sdh0, "sdhci-pxa.0", "PXA-SDHCLK"), | ||
172 | INIT_CLKREG(&clk_sdh1, "sdhci-pxa.1", "PXA-SDHCLK"), | ||
173 | INIT_CLKREG(&clk_sdh2, "sdhci-pxa.2", "PXA-SDHCLK"), | ||
174 | INIT_CLKREG(&clk_sdh3, "sdhci-pxa.3", "PXA-SDHCLK"), | ||
144 | }; | 175 | }; |
145 | 176 | ||
146 | static int __init mmp2_init(void) | 177 | static int __init mmp2_init(void) |
@@ -191,4 +222,8 @@ MMP2_DEVICE(twsi4, "pxa2xx-i2c", 3, TWSI4, 0xd4033000, 0x70); | |||
191 | MMP2_DEVICE(twsi5, "pxa2xx-i2c", 4, TWSI5, 0xd4033800, 0x70); | 222 | MMP2_DEVICE(twsi5, "pxa2xx-i2c", 4, TWSI5, 0xd4033800, 0x70); |
192 | MMP2_DEVICE(twsi6, "pxa2xx-i2c", 5, TWSI6, 0xd4034000, 0x70); | 223 | MMP2_DEVICE(twsi6, "pxa2xx-i2c", 5, TWSI6, 0xd4034000, 0x70); |
193 | MMP2_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x100, 28, 29); | 224 | MMP2_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x100, 28, 29); |
225 | MMP2_DEVICE(sdh0, "sdhci-pxa", 0, MMC, 0xd4280000, 0x120); | ||
226 | MMP2_DEVICE(sdh1, "sdhci-pxa", 1, MMC2, 0xd4280800, 0x120); | ||
227 | MMP2_DEVICE(sdh2, "sdhci-pxa", 2, MMC3, 0xd4281000, 0x120); | ||
228 | MMP2_DEVICE(sdh3, "sdhci-pxa", 3, MMC4, 0xd4281800, 0x120); | ||
194 | 229 | ||
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 46f2d69bef3c..8f92ccd26edf 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -111,6 +111,7 @@ static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); | |||
111 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); | 111 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); |
112 | 112 | ||
113 | static APMU_CLK(nand, NAND, 0x01db, 208000000); | 113 | static APMU_CLK(nand, NAND, 0x01db, 208000000); |
114 | static APMU_CLK(u2o, USB, 0x1b, 480000000); | ||
114 | 115 | ||
115 | /* device and clock bindings */ | 116 | /* device and clock bindings */ |
116 | static struct clk_lookup pxa910_clkregs[] = { | 117 | static struct clk_lookup pxa910_clkregs[] = { |
@@ -123,6 +124,7 @@ static struct clk_lookup pxa910_clkregs[] = { | |||
123 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), | 124 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), |
124 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), | 125 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), |
125 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 126 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
127 | INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), | ||
126 | }; | 128 | }; |
127 | 129 | ||
128 | static int __init pxa910_init(void) | 130 | static int __init pxa910_init(void) |
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index 66528193f939..aeb9ae23e6ce 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c | |||
@@ -26,8 +26,8 @@ | |||
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/irq.h> | 27 | #include <linux/irq.h> |
28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
29 | #include <linux/cnt32_to_63.h> | ||
30 | 29 | ||
30 | #include <asm/sched_clock.h> | ||
31 | #include <mach/addr-map.h> | 31 | #include <mach/addr-map.h> |
32 | #include <mach/regs-timers.h> | 32 | #include <mach/regs-timers.h> |
33 | #include <mach/regs-apbc.h> | 33 | #include <mach/regs-apbc.h> |
@@ -42,23 +42,7 @@ | |||
42 | #define MAX_DELTA (0xfffffffe) | 42 | #define MAX_DELTA (0xfffffffe) |
43 | #define MIN_DELTA (16) | 43 | #define MIN_DELTA (16) |
44 | 44 | ||
45 | #define TCR2NS_SCALE_FACTOR 10 | 45 | static DEFINE_CLOCK_DATA(cd); |
46 | |||
47 | static unsigned long tcr2ns_scale; | ||
48 | |||
49 | static void __init set_tcr2ns_scale(unsigned long tcr_rate) | ||
50 | { | ||
51 | unsigned long long v = 1000000000ULL << TCR2NS_SCALE_FACTOR; | ||
52 | do_div(v, tcr_rate); | ||
53 | tcr2ns_scale = v; | ||
54 | /* | ||
55 | * We want an even value to automatically clear the top bit | ||
56 | * returned by cnt32_to_63() without an additional run time | ||
57 | * instruction. So if the LSB is 1 then round it up. | ||
58 | */ | ||
59 | if (tcr2ns_scale & 1) | ||
60 | tcr2ns_scale++; | ||
61 | } | ||
62 | 46 | ||
63 | /* | 47 | /* |
64 | * FIXME: the timer needs some delay to stablize the counter capture | 48 | * FIXME: the timer needs some delay to stablize the counter capture |
@@ -75,10 +59,16 @@ static inline uint32_t timer_read(void) | |||
75 | return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(0)); | 59 | return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(0)); |
76 | } | 60 | } |
77 | 61 | ||
78 | unsigned long long sched_clock(void) | 62 | unsigned long long notrace sched_clock(void) |
79 | { | 63 | { |
80 | unsigned long long v = cnt32_to_63(timer_read()); | 64 | u32 cyc = timer_read(); |
81 | return (v * tcr2ns_scale) >> TCR2NS_SCALE_FACTOR; | 65 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
66 | } | ||
67 | |||
68 | static void notrace mmp_update_sched_clock(void) | ||
69 | { | ||
70 | u32 cyc = timer_read(); | ||
71 | update_sched_clock(&cd, cyc, (u32)~0); | ||
82 | } | 72 | } |
83 | 73 | ||
84 | static irqreturn_t timer_interrupt(int irq, void *dev_id) | 74 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
@@ -146,7 +136,6 @@ static cycle_t clksrc_read(struct clocksource *cs) | |||
146 | 136 | ||
147 | static struct clocksource cksrc = { | 137 | static struct clocksource cksrc = { |
148 | .name = "clocksource", | 138 | .name = "clocksource", |
149 | .shift = 20, | ||
150 | .rating = 200, | 139 | .rating = 200, |
151 | .read = clksrc_read, | 140 | .read = clksrc_read, |
152 | .mask = CLOCKSOURCE_MASK(32), | 141 | .mask = CLOCKSOURCE_MASK(32), |
@@ -186,17 +175,15 @@ void __init timer_init(int irq) | |||
186 | { | 175 | { |
187 | timer_config(); | 176 | timer_config(); |
188 | 177 | ||
189 | set_tcr2ns_scale(CLOCK_TICK_RATE); | 178 | init_sched_clock(&cd, mmp_update_sched_clock, 32, CLOCK_TICK_RATE); |
190 | 179 | ||
191 | ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift); | 180 | ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift); |
192 | ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt); | 181 | ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt); |
193 | ckevt.min_delta_ns = clockevent_delta2ns(MIN_DELTA, &ckevt); | 182 | ckevt.min_delta_ns = clockevent_delta2ns(MIN_DELTA, &ckevt); |
194 | ckevt.cpumask = cpumask_of(0); | 183 | ckevt.cpumask = cpumask_of(0); |
195 | 184 | ||
196 | cksrc.mult = clocksource_hz2mult(CLOCK_TICK_RATE, cksrc.shift); | ||
197 | |||
198 | setup_irq(irq, &timer_irq); | 185 | setup_irq(irq, &timer_irq); |
199 | 186 | ||
200 | clocksource_register(&cksrc); | 187 | clocksource_register_hz(&cksrc, CLOCK_TICK_RATE); |
201 | clockevents_register_device(&ckevt); | 188 | clockevents_register_device(&ckevt); |
202 | } | 189 | } |
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig index 1a11f1ed216d..fae931ac2e56 100644 --- a/arch/arm/mach-msm/Kconfig +++ b/arch/arm/mach-msm/Kconfig | |||
@@ -50,6 +50,8 @@ endchoice | |||
50 | 50 | ||
51 | config MSM_SOC_REV_A | 51 | config MSM_SOC_REV_A |
52 | bool | 52 | bool |
53 | config ARCH_MSM_SCORPIONMP | ||
54 | bool | ||
53 | 55 | ||
54 | config ARCH_MSM_ARM11 | 56 | config ARCH_MSM_ARM11 |
55 | bool | 57 | bool |
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c index 7486a681cc71..9b5eb2b4ae1b 100644 --- a/arch/arm/mach-msm/board-msm8x60.c +++ b/arch/arm/mach-msm/board-msm8x60.c | |||
@@ -28,8 +28,6 @@ | |||
28 | #include <mach/board.h> | 28 | #include <mach/board.h> |
29 | #include <mach/msm_iomap.h> | 29 | #include <mach/msm_iomap.h> |
30 | 30 | ||
31 | void __iomem *gic_cpu_base_addr; | ||
32 | |||
33 | unsigned long clk_get_max_axi_khz(void) | 31 | unsigned long clk_get_max_axi_khz(void) |
34 | { | 32 | { |
35 | return 0; | 33 | return 0; |
@@ -44,9 +42,8 @@ static void __init msm8x60_init_irq(void) | |||
44 | { | 42 | { |
45 | unsigned int i; | 43 | unsigned int i; |
46 | 44 | ||
47 | gic_dist_init(0, MSM_QGIC_DIST_BASE, GIC_PPI_START); | 45 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
48 | gic_cpu_base_addr = (void *)MSM_QGIC_CPU_BASE; | 46 | (void *)MSM_QGIC_CPU_BASE); |
49 | gic_cpu_init(0, MSM_QGIC_CPU_BASE); | ||
50 | 47 | ||
51 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ | 48 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
52 | writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); | 49 | writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
diff --git a/arch/arm/mach-msm/include/mach/smp.h b/arch/arm/mach-msm/include/mach/smp.h index 3ff7bf5e679e..a95f7b9efe31 100644 --- a/arch/arm/mach-msm/include/mach/smp.h +++ b/arch/arm/mach-msm/include/mach/smp.h | |||
@@ -31,9 +31,9 @@ | |||
31 | 31 | ||
32 | #include <asm/hardware/gic.h> | 32 | #include <asm/hardware/gic.h> |
33 | 33 | ||
34 | static inline void smp_cross_call(const struct cpumask *mask) | 34 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
35 | { | 35 | { |
36 | gic_raise_softirq(mask, 1); | 36 | gic_raise_softirq(mask, ipi); |
37 | } | 37 | } |
38 | 38 | ||
39 | #endif | 39 | #endif |
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 950100f19d07..595be7fea31a 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -137,7 +137,6 @@ static struct msm_clock msm_clocks[] = { | |||
137 | .rating = 200, | 137 | .rating = 200, |
138 | .read = msm_gpt_read, | 138 | .read = msm_gpt_read, |
139 | .mask = CLOCKSOURCE_MASK(32), | 139 | .mask = CLOCKSOURCE_MASK(32), |
140 | .shift = 17, | ||
141 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 140 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
142 | }, | 141 | }, |
143 | .irq = { | 142 | .irq = { |
@@ -164,7 +163,6 @@ static struct msm_clock msm_clocks[] = { | |||
164 | .rating = 300, | 163 | .rating = 300, |
165 | .read = msm_dgt_read, | 164 | .read = msm_dgt_read, |
166 | .mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)), | 165 | .mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)), |
167 | .shift = 24 - MSM_DGT_SHIFT, | ||
168 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 166 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
169 | }, | 167 | }, |
170 | .irq = { | 168 | .irq = { |
@@ -205,8 +203,7 @@ static void __init msm_timer_init(void) | |||
205 | ce->min_delta_ns = clockevent_delta2ns(4, ce); | 203 | ce->min_delta_ns = clockevent_delta2ns(4, ce); |
206 | ce->cpumask = cpumask_of(0); | 204 | ce->cpumask = cpumask_of(0); |
207 | 205 | ||
208 | cs->mult = clocksource_hz2mult(clock->freq, cs->shift); | 206 | res = clocksource_register_hz(cs, clock->freq); |
209 | res = clocksource_register(cs); | ||
210 | if (res) | 207 | if (res) |
211 | printk(KERN_ERR "msm_timer_init: clocksource_register " | 208 | printk(KERN_ERR "msm_timer_init: clocksource_register " |
212 | "failed for %s\n", cs->name); | 209 | "failed for %s\n", cs->name); |
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h index 788bdace1304..3eff39921d4d 100644 --- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h +++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h | |||
@@ -65,7 +65,7 @@ | |||
65 | */ | 65 | */ |
66 | #define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) | 66 | #define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) |
67 | #define DDR_WINDOW_CPU0_BASE (DDR_VIRT_BASE | 0x1500) | 67 | #define DDR_WINDOW_CPU0_BASE (DDR_VIRT_BASE | 0x1500) |
68 | #define DDR_WINDOW_CPU1_BASE (DDR_VIRT_BASE | 0x1700) | 68 | #define DDR_WINDOW_CPU1_BASE (DDR_VIRT_BASE | 0x1570) |
69 | 69 | ||
70 | #define DEV_BUS_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x10000) | 70 | #define DEV_BUS_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0x10000) |
71 | #define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000) | 71 | #define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000) |
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig deleted file mode 100644 index 38ca09a5df9d..000000000000 --- a/arch/arm/mach-mx25/Kconfig +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | if ARCH_MX25 | ||
2 | |||
3 | comment "MX25 platforms:" | ||
4 | |||
5 | config MACH_MX25_3DS | ||
6 | bool "Support MX25PDK (3DS) Platform" | ||
7 | select IMX_HAVE_PLATFORM_IMX_UART | ||
8 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
9 | select IMX_HAVE_PLATFORM_ESDHC | ||
10 | |||
11 | config MACH_EUKREA_CPUIMX25 | ||
12 | bool "Support Eukrea CPUIMX25 Platform" | ||
13 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
14 | select IMX_HAVE_PLATFORM_IMX_UART | ||
15 | select IMX_HAVE_PLATFORM_MXC_NAND | ||
16 | select IMX_HAVE_PLATFORM_FLEXCAN | ||
17 | select IMX_HAVE_PLATFORM_ESDHC | ||
18 | select MXC_ULPI if USB_ULPI | ||
19 | |||
20 | choice | ||
21 | prompt "Baseboard" | ||
22 | depends on MACH_EUKREA_CPUIMX25 | ||
23 | default MACH_EUKREA_MBIMXSD25_BASEBOARD | ||
24 | |||
25 | config MACH_EUKREA_MBIMXSD25_BASEBOARD | ||
26 | bool "Eukrea MBIMXSD development board" | ||
27 | select IMX_HAVE_PLATFORM_IMX_SSI | ||
28 | help | ||
29 | This adds board specific devices that can be found on Eukrea's | ||
30 | MBIMXSD evaluation board. | ||
31 | |||
32 | endchoice | ||
33 | |||
34 | endif | ||
diff --git a/arch/arm/mach-mx25/Makefile b/arch/arm/mach-mx25/Makefile deleted file mode 100644 index d9e46ce00a4e..000000000000 --- a/arch/arm/mach-mx25/Makefile +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | obj-y := mm.o devices.o | ||
2 | obj-$(CONFIG_ARCH_MX25) += clock.o | ||
3 | obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o | ||
4 | obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-cpuimx25.o | ||
5 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd-baseboard.o | ||
diff --git a/arch/arm/mach-mx25/Makefile.boot b/arch/arm/mach-mx25/Makefile.boot deleted file mode 100644 index e1dd366f836b..000000000000 --- a/arch/arm/mach-mx25/Makefile.boot +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | zreladdr-y := 0x80008000 | ||
2 | params_phys-y := 0x80000100 | ||
3 | initrd_phys-y := 0x80800000 | ||
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c deleted file mode 100644 index 1d0eb3e85941..000000000000 --- a/arch/arm/mach-mx25/devices.c +++ /dev/null | |||
@@ -1,308 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2009 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, | ||
16 | * Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/dma-mapping.h> | ||
21 | #include <linux/gpio.h> | ||
22 | #include <mach/mx25.h> | ||
23 | #include <mach/irqs.h> | ||
24 | |||
25 | static u64 otg_dmamask = DMA_BIT_MASK(32); | ||
26 | |||
27 | static struct resource mxc_otg_resources[] = { | ||
28 | { | ||
29 | .start = MX25_OTG_BASE_ADDR, | ||
30 | .end = MX25_OTG_BASE_ADDR + 0x1ff, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }, { | ||
33 | .start = 37, | ||
34 | .end = 37, | ||
35 | .flags = IORESOURCE_IRQ, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | struct platform_device mxc_otg = { | ||
40 | .name = "mxc-ehci", | ||
41 | .id = 0, | ||
42 | .dev = { | ||
43 | .coherent_dma_mask = 0xffffffff, | ||
44 | .dma_mask = &otg_dmamask, | ||
45 | }, | ||
46 | .resource = mxc_otg_resources, | ||
47 | .num_resources = ARRAY_SIZE(mxc_otg_resources), | ||
48 | }; | ||
49 | |||
50 | /* OTG gadget device */ | ||
51 | struct platform_device otg_udc_device = { | ||
52 | .name = "fsl-usb2-udc", | ||
53 | .id = -1, | ||
54 | .dev = { | ||
55 | .dma_mask = &otg_dmamask, | ||
56 | .coherent_dma_mask = 0xffffffff, | ||
57 | }, | ||
58 | .resource = mxc_otg_resources, | ||
59 | .num_resources = ARRAY_SIZE(mxc_otg_resources), | ||
60 | }; | ||
61 | |||
62 | static u64 usbh2_dmamask = DMA_BIT_MASK(32); | ||
63 | |||
64 | static struct resource mxc_usbh2_resources[] = { | ||
65 | { | ||
66 | .start = MX25_OTG_BASE_ADDR + 0x400, | ||
67 | .end = MX25_OTG_BASE_ADDR + 0x5ff, | ||
68 | .flags = IORESOURCE_MEM, | ||
69 | }, { | ||
70 | .start = 35, | ||
71 | .end = 35, | ||
72 | .flags = IORESOURCE_IRQ, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | struct platform_device mxc_usbh2 = { | ||
77 | .name = "mxc-ehci", | ||
78 | .id = 1, | ||
79 | .dev = { | ||
80 | .coherent_dma_mask = 0xffffffff, | ||
81 | .dma_mask = &usbh2_dmamask, | ||
82 | }, | ||
83 | .resource = mxc_usbh2_resources, | ||
84 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | ||
85 | }; | ||
86 | |||
87 | static struct resource mxc_pwm_resources0[] = { | ||
88 | { | ||
89 | .start = 0x53fe0000, | ||
90 | .end = 0x53fe3fff, | ||
91 | .flags = IORESOURCE_MEM, | ||
92 | }, { | ||
93 | .start = 26, | ||
94 | .end = 26, | ||
95 | .flags = IORESOURCE_IRQ, | ||
96 | } | ||
97 | }; | ||
98 | |||
99 | struct platform_device mxc_pwm_device0 = { | ||
100 | .name = "mxc_pwm", | ||
101 | .id = 0, | ||
102 | .num_resources = ARRAY_SIZE(mxc_pwm_resources0), | ||
103 | .resource = mxc_pwm_resources0, | ||
104 | }; | ||
105 | |||
106 | static struct resource mxc_pwm_resources1[] = { | ||
107 | { | ||
108 | .start = 0x53fa0000, | ||
109 | .end = 0x53fa3fff, | ||
110 | .flags = IORESOURCE_MEM, | ||
111 | }, { | ||
112 | .start = 36, | ||
113 | .end = 36, | ||
114 | .flags = IORESOURCE_IRQ, | ||
115 | } | ||
116 | }; | ||
117 | |||
118 | struct platform_device mxc_pwm_device1 = { | ||
119 | .name = "mxc_pwm", | ||
120 | .id = 1, | ||
121 | .num_resources = ARRAY_SIZE(mxc_pwm_resources1), | ||
122 | .resource = mxc_pwm_resources1, | ||
123 | }; | ||
124 | |||
125 | static struct resource mxc_pwm_resources2[] = { | ||
126 | { | ||
127 | .start = 0x53fa8000, | ||
128 | .end = 0x53fabfff, | ||
129 | .flags = IORESOURCE_MEM, | ||
130 | }, { | ||
131 | .start = 41, | ||
132 | .end = 41, | ||
133 | .flags = IORESOURCE_IRQ, | ||
134 | } | ||
135 | }; | ||
136 | |||
137 | struct platform_device mxc_pwm_device2 = { | ||
138 | .name = "mxc_pwm", | ||
139 | .id = 2, | ||
140 | .num_resources = ARRAY_SIZE(mxc_pwm_resources2), | ||
141 | .resource = mxc_pwm_resources2, | ||
142 | }; | ||
143 | |||
144 | static struct resource mxc_keypad_resources[] = { | ||
145 | { | ||
146 | .start = 0x43fa8000, | ||
147 | .end = 0x43fabfff, | ||
148 | .flags = IORESOURCE_MEM, | ||
149 | }, { | ||
150 | .start = 24, | ||
151 | .end = 24, | ||
152 | .flags = IORESOURCE_IRQ, | ||
153 | } | ||
154 | }; | ||
155 | |||
156 | struct platform_device mxc_keypad_device = { | ||
157 | .name = "mxc-keypad", | ||
158 | .id = -1, | ||
159 | .num_resources = ARRAY_SIZE(mxc_keypad_resources), | ||
160 | .resource = mxc_keypad_resources, | ||
161 | }; | ||
162 | |||
163 | static struct resource mxc_pwm_resources3[] = { | ||
164 | { | ||
165 | .start = 0x53fc8000, | ||
166 | .end = 0x53fcbfff, | ||
167 | .flags = IORESOURCE_MEM, | ||
168 | }, { | ||
169 | .start = 42, | ||
170 | .end = 42, | ||
171 | .flags = IORESOURCE_IRQ, | ||
172 | } | ||
173 | }; | ||
174 | |||
175 | struct platform_device mxc_pwm_device3 = { | ||
176 | .name = "mxc_pwm", | ||
177 | .id = 3, | ||
178 | .num_resources = ARRAY_SIZE(mxc_pwm_resources3), | ||
179 | .resource = mxc_pwm_resources3, | ||
180 | }; | ||
181 | |||
182 | static struct mxc_gpio_port imx_gpio_ports[] = { | ||
183 | { | ||
184 | .chip.label = "gpio-0", | ||
185 | .base = (void __iomem *)MX25_GPIO1_BASE_ADDR_VIRT, | ||
186 | .irq = 52, | ||
187 | .virtual_irq_start = MXC_GPIO_IRQ_START, | ||
188 | }, { | ||
189 | .chip.label = "gpio-1", | ||
190 | .base = (void __iomem *)MX25_GPIO2_BASE_ADDR_VIRT, | ||
191 | .irq = 51, | ||
192 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32, | ||
193 | }, { | ||
194 | .chip.label = "gpio-2", | ||
195 | .base = (void __iomem *)MX25_GPIO3_BASE_ADDR_VIRT, | ||
196 | .irq = 16, | ||
197 | .virtual_irq_start = MXC_GPIO_IRQ_START + 64, | ||
198 | }, { | ||
199 | .chip.label = "gpio-3", | ||
200 | .base = (void __iomem *)MX25_GPIO4_BASE_ADDR_VIRT, | ||
201 | .irq = 23, | ||
202 | .virtual_irq_start = MXC_GPIO_IRQ_START + 96, | ||
203 | } | ||
204 | }; | ||
205 | |||
206 | int __init imx25_register_gpios(void) | ||
207 | { | ||
208 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); | ||
209 | } | ||
210 | |||
211 | static struct resource mx25_rtc_resources[] = { | ||
212 | { | ||
213 | .start = MX25_DRYICE_BASE_ADDR, | ||
214 | .end = MX25_DRYICE_BASE_ADDR + 0x40, | ||
215 | .flags = IORESOURCE_MEM, | ||
216 | }, | ||
217 | { | ||
218 | .start = MX25_INT_DRYICE, | ||
219 | .flags = IORESOURCE_IRQ | ||
220 | }, | ||
221 | }; | ||
222 | |||
223 | struct platform_device mx25_rtc_device = { | ||
224 | .name = "imxdi_rtc", | ||
225 | .id = 0, | ||
226 | .num_resources = ARRAY_SIZE(mx25_rtc_resources), | ||
227 | .resource = mx25_rtc_resources, | ||
228 | }; | ||
229 | |||
230 | static struct resource mx25_fb_resources[] = { | ||
231 | { | ||
232 | .start = MX25_LCDC_BASE_ADDR, | ||
233 | .end = MX25_LCDC_BASE_ADDR + 0xfff, | ||
234 | .flags = IORESOURCE_MEM, | ||
235 | }, | ||
236 | { | ||
237 | .start = MX25_INT_LCDC, | ||
238 | .end = MX25_INT_LCDC, | ||
239 | .flags = IORESOURCE_IRQ, | ||
240 | }, | ||
241 | }; | ||
242 | |||
243 | struct platform_device mx25_fb_device = { | ||
244 | .name = "imx-fb", | ||
245 | .id = 0, | ||
246 | .resource = mx25_fb_resources, | ||
247 | .num_resources = ARRAY_SIZE(mx25_fb_resources), | ||
248 | .dev = { | ||
249 | .coherent_dma_mask = 0xFFFFFFFF, | ||
250 | }, | ||
251 | }; | ||
252 | |||
253 | static struct resource mxc_wdt_resources[] = { | ||
254 | { | ||
255 | .start = MX25_WDOG_BASE_ADDR, | ||
256 | .end = MX25_WDOG_BASE_ADDR + SZ_16K - 1, | ||
257 | .flags = IORESOURCE_MEM, | ||
258 | }, | ||
259 | }; | ||
260 | |||
261 | struct platform_device mxc_wdt = { | ||
262 | .name = "imx2-wdt", | ||
263 | .id = 0, | ||
264 | .num_resources = ARRAY_SIZE(mxc_wdt_resources), | ||
265 | .resource = mxc_wdt_resources, | ||
266 | }; | ||
267 | |||
268 | static struct resource mx25_kpp_resources[] = { | ||
269 | { | ||
270 | .start = MX25_KPP_BASE_ADDR, | ||
271 | .end = MX25_KPP_BASE_ADDR + 0xf, | ||
272 | .flags = IORESOURCE_MEM, | ||
273 | }, | ||
274 | { | ||
275 | .start = MX25_INT_KPP, | ||
276 | .end = MX25_INT_KPP, | ||
277 | .flags = IORESOURCE_IRQ, | ||
278 | }, | ||
279 | }; | ||
280 | |||
281 | struct platform_device mx25_kpp_device = { | ||
282 | .name = "imx-keypad", | ||
283 | .id = -1, | ||
284 | .num_resources = ARRAY_SIZE(mx25_kpp_resources), | ||
285 | .resource = mx25_kpp_resources, | ||
286 | }; | ||
287 | |||
288 | static struct resource mx25_csi_resources[] = { | ||
289 | { | ||
290 | .start = MX25_CSI_BASE_ADDR, | ||
291 | .end = MX25_CSI_BASE_ADDR + 0xfff, | ||
292 | .flags = IORESOURCE_MEM, | ||
293 | }, | ||
294 | { | ||
295 | .start = MX25_INT_CSI, | ||
296 | .flags = IORESOURCE_IRQ | ||
297 | }, | ||
298 | }; | ||
299 | |||
300 | struct platform_device mx25_csi_device = { | ||
301 | .name = "mx2-camera", | ||
302 | .id = 0, | ||
303 | .num_resources = ARRAY_SIZE(mx25_csi_resources), | ||
304 | .resource = mx25_csi_resources, | ||
305 | .dev = { | ||
306 | .coherent_dma_mask = 0xffffffff, | ||
307 | }, | ||
308 | }; | ||
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h deleted file mode 100644 index 7b70a43c3a4b..000000000000 --- a/arch/arm/mach-mx25/devices.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | extern struct platform_device mxc_otg; | ||
2 | extern struct platform_device otg_udc_device; | ||
3 | extern struct platform_device mxc_usbh2; | ||
4 | extern struct platform_device mxc_pwm_device0; | ||
5 | extern struct platform_device mxc_pwm_device1; | ||
6 | extern struct platform_device mxc_pwm_device2; | ||
7 | extern struct platform_device mxc_pwm_device3; | ||
8 | extern struct platform_device mxc_keypad_device; | ||
9 | extern struct platform_device mx25_rtc_device; | ||
10 | extern struct platform_device mx25_fb_device; | ||
11 | extern struct platform_device mxc_wdt; | ||
12 | extern struct platform_device mx25_kpp_device; | ||
13 | extern struct platform_device mx25_csi_device; | ||
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index 5000ac1f93e3..0717f887cba0 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -1,21 +1,35 @@ | |||
1 | if ARCH_MX3 | 1 | if ARCH_MX3 |
2 | 2 | ||
3 | # ARCH_MX31 and ARCH_MX35 are left for compatibility | ||
4 | # Some usages assume that having one of them implies not having (e.g.) ARCH_MX2. | ||
5 | # To easily distinguish good and reviewed from unreviewed usages new (and IMHO | ||
6 | # more sensible) names are used: SOC_IMX31 and SOC_IMX35 | ||
3 | config ARCH_MX31 | 7 | config ARCH_MX31 |
4 | select ARCH_HAS_RNGA | ||
5 | select ARCH_MXC_AUDMUX_V2 | ||
6 | bool | 8 | bool |
7 | 9 | ||
8 | config ARCH_MX35 | 10 | config ARCH_MX35 |
9 | bool | 11 | bool |
12 | |||
13 | config SOC_IMX31 | ||
14 | bool | ||
15 | select IMX_HAVE_PLATFORM_MXC_RNGA | ||
16 | select ARCH_MXC_AUDMUX_V2 | ||
17 | select ARCH_MX31 | ||
18 | select MXC_AVIC | ||
19 | |||
20 | config SOC_IMX35 | ||
21 | bool | ||
10 | select ARCH_MXC_IOMUX_V3 | 22 | select ARCH_MXC_IOMUX_V3 |
11 | select ARCH_MXC_AUDMUX_V2 | 23 | select ARCH_MXC_AUDMUX_V2 |
12 | select HAVE_EPIT | 24 | select HAVE_EPIT |
25 | select ARCH_MX35 | ||
26 | select MXC_AVIC | ||
13 | 27 | ||
14 | comment "MX3 platforms:" | 28 | comment "MX3 platforms:" |
15 | 29 | ||
16 | config MACH_MX31ADS | 30 | config MACH_MX31ADS |
17 | bool "Support MX31ADS platforms" | 31 | bool "Support MX31ADS platforms" |
18 | select ARCH_MX31 | 32 | select SOC_IMX31 |
19 | select IMX_HAVE_PLATFORM_IMX_I2C | 33 | select IMX_HAVE_PLATFORM_IMX_I2C |
20 | select IMX_HAVE_PLATFORM_IMX_SSI | 34 | select IMX_HAVE_PLATFORM_IMX_SSI |
21 | select IMX_HAVE_PLATFORM_IMX_UART | 35 | select IMX_HAVE_PLATFORM_IMX_UART |
@@ -37,10 +51,15 @@ config MACH_MX31ADS_WM1133_EV1 | |||
37 | 51 | ||
38 | config MACH_PCM037 | 52 | config MACH_PCM037 |
39 | bool "Support Phytec pcm037 (i.MX31) platforms" | 53 | bool "Support Phytec pcm037 (i.MX31) platforms" |
40 | select ARCH_MX31 | 54 | select SOC_IMX31 |
55 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
56 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
41 | select IMX_HAVE_PLATFORM_IMX_I2C | 57 | select IMX_HAVE_PLATFORM_IMX_I2C |
42 | select IMX_HAVE_PLATFORM_IMX_UART | 58 | select IMX_HAVE_PLATFORM_IMX_UART |
59 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
60 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
43 | select IMX_HAVE_PLATFORM_MXC_NAND | 61 | select IMX_HAVE_PLATFORM_MXC_NAND |
62 | select IMX_HAVE_PLATFORM_MXC_W1 | ||
44 | select MXC_ULPI if USB_ULPI | 63 | select MXC_ULPI if USB_ULPI |
45 | help | 64 | help |
46 | Include support for Phytec pcm037 platform. This includes | 65 | Include support for Phytec pcm037 platform. This includes |
@@ -57,9 +76,12 @@ config MACH_PCM037_EET | |||
57 | 76 | ||
58 | config MACH_MX31LITE | 77 | config MACH_MX31LITE |
59 | bool "Support MX31 LITEKIT (LogicPD)" | 78 | bool "Support MX31 LITEKIT (LogicPD)" |
60 | select ARCH_MX31 | 79 | select SOC_IMX31 |
61 | select MXC_ULPI if USB_ULPI | 80 | select MXC_ULPI if USB_ULPI |
81 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
62 | select IMX_HAVE_PLATFORM_IMX_UART | 82 | select IMX_HAVE_PLATFORM_IMX_UART |
83 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
84 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
63 | select IMX_HAVE_PLATFORM_MXC_NAND | 85 | select IMX_HAVE_PLATFORM_MXC_NAND |
64 | select IMX_HAVE_PLATFORM_SPI_IMX | 86 | select IMX_HAVE_PLATFORM_SPI_IMX |
65 | help | 87 | help |
@@ -68,11 +90,16 @@ config MACH_MX31LITE | |||
68 | 90 | ||
69 | config MACH_MX31_3DS | 91 | config MACH_MX31_3DS |
70 | bool "Support MX31PDK (3DS)" | 92 | bool "Support MX31PDK (3DS)" |
71 | select ARCH_MX31 | 93 | select SOC_IMX31 |
72 | select MXC_DEBUG_BOARD | 94 | select MXC_DEBUG_BOARD |
95 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
96 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
97 | select IMX_HAVE_PLATFORM_IMX_KEYPAD | ||
73 | select IMX_HAVE_PLATFORM_IMX_UART | 98 | select IMX_HAVE_PLATFORM_IMX_UART |
99 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
74 | select IMX_HAVE_PLATFORM_MXC_NAND | 100 | select IMX_HAVE_PLATFORM_MXC_NAND |
75 | select IMX_HAVE_PLATFORM_SPI_IMX | 101 | select IMX_HAVE_PLATFORM_SPI_IMX |
102 | select MXC_ULPI if USB_ULPI | ||
76 | help | 103 | help |
77 | Include support for MX31PDK (3DS) platform. This includes specific | 104 | Include support for MX31PDK (3DS) platform. This includes specific |
78 | configurations for the board and its peripherals. | 105 | configurations for the board and its peripherals. |
@@ -88,9 +115,12 @@ config MACH_MX31_3DS_MXC_NAND_USE_BBT | |||
88 | 115 | ||
89 | config MACH_MX31MOBOARD | 116 | config MACH_MX31MOBOARD |
90 | bool "Support mx31moboard platforms (EPFL Mobots group)" | 117 | bool "Support mx31moboard platforms (EPFL Mobots group)" |
91 | select ARCH_MX31 | 118 | select SOC_IMX31 |
119 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
92 | select IMX_HAVE_PLATFORM_IMX_I2C | 120 | select IMX_HAVE_PLATFORM_IMX_I2C |
93 | select IMX_HAVE_PLATFORM_IMX_UART | 121 | select IMX_HAVE_PLATFORM_IMX_UART |
122 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
123 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
94 | select IMX_HAVE_PLATFORM_SPI_IMX | 124 | select IMX_HAVE_PLATFORM_SPI_IMX |
95 | select MXC_ULPI if USB_ULPI | 125 | select MXC_ULPI if USB_ULPI |
96 | help | 126 | help |
@@ -99,8 +129,10 @@ config MACH_MX31MOBOARD | |||
99 | 129 | ||
100 | config MACH_MX31LILLY | 130 | config MACH_MX31LILLY |
101 | bool "Support MX31 LILLY-1131 platforms (INCO startec)" | 131 | bool "Support MX31 LILLY-1131 platforms (INCO startec)" |
102 | select ARCH_MX31 | 132 | select SOC_IMX31 |
103 | select IMX_HAVE_PLATFORM_IMX_UART | 133 | select IMX_HAVE_PLATFORM_IMX_UART |
134 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
135 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
104 | select IMX_HAVE_PLATFORM_SPI_IMX | 136 | select IMX_HAVE_PLATFORM_SPI_IMX |
105 | select MXC_ULPI if USB_ULPI | 137 | select MXC_ULPI if USB_ULPI |
106 | help | 138 | help |
@@ -109,7 +141,7 @@ config MACH_MX31LILLY | |||
109 | 141 | ||
110 | config MACH_QONG | 142 | config MACH_QONG |
111 | bool "Support Dave/DENX QongEVB-LITE platform" | 143 | bool "Support Dave/DENX QongEVB-LITE platform" |
112 | select ARCH_MX31 | 144 | select SOC_IMX31 |
113 | select IMX_HAVE_PLATFORM_IMX_UART | 145 | select IMX_HAVE_PLATFORM_IMX_UART |
114 | help | 146 | help |
115 | Include support for Dave/DENX QongEVB-LITE platform. This includes | 147 | Include support for Dave/DENX QongEVB-LITE platform. This includes |
@@ -117,13 +149,16 @@ config MACH_QONG | |||
117 | 149 | ||
118 | config MACH_PCM043 | 150 | config MACH_PCM043 |
119 | bool "Support Phytec pcm043 (i.MX35) platforms" | 151 | bool "Support Phytec pcm043 (i.MX35) platforms" |
120 | select ARCH_MX35 | 152 | select SOC_IMX35 |
153 | select IMX_HAVE_PLATFORM_FLEXCAN | ||
154 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
155 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
121 | select IMX_HAVE_PLATFORM_IMX_I2C | 156 | select IMX_HAVE_PLATFORM_IMX_I2C |
122 | select IMX_HAVE_PLATFORM_IMX_SSI | 157 | select IMX_HAVE_PLATFORM_IMX_SSI |
123 | select IMX_HAVE_PLATFORM_IMX_UART | 158 | select IMX_HAVE_PLATFORM_IMX_UART |
159 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
124 | select IMX_HAVE_PLATFORM_MXC_NAND | 160 | select IMX_HAVE_PLATFORM_MXC_NAND |
125 | select IMX_HAVE_PLATFORM_FLEXCAN | 161 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX |
126 | select IMX_HAVE_PLATFORM_ESDHC | ||
127 | select MXC_ULPI if USB_ULPI | 162 | select MXC_ULPI if USB_ULPI |
128 | help | 163 | help |
129 | Include support for Phytec pcm043 platform. This includes | 164 | Include support for Phytec pcm043 platform. This includes |
@@ -131,9 +166,11 @@ config MACH_PCM043 | |||
131 | 166 | ||
132 | config MACH_ARMADILLO5X0 | 167 | config MACH_ARMADILLO5X0 |
133 | bool "Support Atmark Armadillo-500 Development Base Board" | 168 | bool "Support Atmark Armadillo-500 Development Base Board" |
134 | select ARCH_MX31 | 169 | select SOC_IMX31 |
135 | select IMX_HAVE_PLATFORM_IMX_I2C | 170 | select IMX_HAVE_PLATFORM_IMX_I2C |
136 | select IMX_HAVE_PLATFORM_IMX_UART | 171 | select IMX_HAVE_PLATFORM_IMX_UART |
172 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
173 | select IMX_HAVE_PLATFORM_MXC_MMC | ||
137 | select IMX_HAVE_PLATFORM_MXC_NAND | 174 | select IMX_HAVE_PLATFORM_MXC_NAND |
138 | select MXC_ULPI if USB_ULPI | 175 | select MXC_ULPI if USB_ULPI |
139 | help | 176 | help |
@@ -142,19 +179,21 @@ config MACH_ARMADILLO5X0 | |||
142 | 179 | ||
143 | config MACH_MX35_3DS | 180 | config MACH_MX35_3DS |
144 | bool "Support MX35PDK platform" | 181 | bool "Support MX35PDK platform" |
145 | select ARCH_MX35 | 182 | select SOC_IMX35 |
146 | select MXC_DEBUG_BOARD | 183 | select MXC_DEBUG_BOARD |
184 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
185 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
147 | select IMX_HAVE_PLATFORM_IMX_UART | 186 | select IMX_HAVE_PLATFORM_IMX_UART |
187 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
148 | select IMX_HAVE_PLATFORM_MXC_NAND | 188 | select IMX_HAVE_PLATFORM_MXC_NAND |
149 | select IMX_HAVE_PLATFORM_ESDHC | 189 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX |
150 | default n | ||
151 | help | 190 | help |
152 | Include support for MX35PDK platform. This includes specific | 191 | Include support for MX35PDK platform. This includes specific |
153 | configurations for the board and its peripherals. | 192 | configurations for the board and its peripherals. |
154 | 193 | ||
155 | config MACH_KZM_ARM11_01 | 194 | config MACH_KZM_ARM11_01 |
156 | bool "Support KZM-ARM11-01(Kyoto Microcomputer)" | 195 | bool "Support KZM-ARM11-01(Kyoto Microcomputer)" |
157 | select ARCH_MX31 | 196 | select SOC_IMX31 |
158 | select IMX_HAVE_PLATFORM_IMX_UART | 197 | select IMX_HAVE_PLATFORM_IMX_UART |
159 | help | 198 | help |
160 | Include support for KZM-ARM11-01. This includes specific | 199 | Include support for KZM-ARM11-01. This includes specific |
@@ -162,12 +201,15 @@ config MACH_KZM_ARM11_01 | |||
162 | 201 | ||
163 | config MACH_EUKREA_CPUIMX35 | 202 | config MACH_EUKREA_CPUIMX35 |
164 | bool "Support Eukrea CPUIMX35 Platform" | 203 | bool "Support Eukrea CPUIMX35 Platform" |
165 | select ARCH_MX35 | 204 | select SOC_IMX35 |
166 | select IMX_HAVE_PLATFORM_IMX_UART | 205 | select IMX_HAVE_PLATFORM_FLEXCAN |
206 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
207 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
167 | select IMX_HAVE_PLATFORM_IMX_I2C | 208 | select IMX_HAVE_PLATFORM_IMX_I2C |
209 | select IMX_HAVE_PLATFORM_IMX_UART | ||
210 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
168 | select IMX_HAVE_PLATFORM_MXC_NAND | 211 | select IMX_HAVE_PLATFORM_MXC_NAND |
169 | select IMX_HAVE_PLATFORM_FLEXCAN | 212 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX |
170 | select IMX_HAVE_PLATFORM_ESDHC | ||
171 | select MXC_ULPI if USB_ULPI | 213 | select MXC_ULPI if USB_ULPI |
172 | help | 214 | help |
173 | Include support for Eukrea CPUIMX35 platform. This includes | 215 | Include support for Eukrea CPUIMX35 platform. This includes |
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile index 8a182d0a3fcf..8db13294ad27 100644 --- a/arch/arm/mach-mx3/Makefile +++ b/arch/arm/mach-mx3/Makefile | |||
@@ -5,17 +5,14 @@ | |||
5 | # Object file lists. | 5 | # Object file lists. |
6 | 6 | ||
7 | obj-y := mm.o devices.o cpu.o | 7 | obj-y := mm.o devices.o cpu.o |
8 | CFLAGS_mm.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS | 8 | obj-$(CONFIG_SOC_IMX31) += clock-imx31.o iomux-imx31.o |
9 | CFLAGS_devices.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS | 9 | obj-$(CONFIG_SOC_IMX35) += clock-imx35.o |
10 | obj-$(CONFIG_ARCH_MX31) += clock-imx31.o iomux-imx31.o | ||
11 | obj-$(CONFIG_ARCH_MX35) += clock-imx35.o | ||
12 | obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o | 10 | obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o |
13 | obj-$(CONFIG_MACH_MX31LILLY) += mach-mx31lilly.o mx31lilly-db.o | 11 | obj-$(CONFIG_MACH_MX31LILLY) += mach-mx31lilly.o mx31lilly-db.o |
14 | obj-$(CONFIG_MACH_MX31LITE) += mach-mx31lite.o mx31lite-db.o | 12 | obj-$(CONFIG_MACH_MX31LITE) += mach-mx31lite.o mx31lite-db.o |
15 | obj-$(CONFIG_MACH_PCM037) += mach-pcm037.o | 13 | obj-$(CONFIG_MACH_PCM037) += mach-pcm037.o |
16 | obj-$(CONFIG_MACH_PCM037_EET) += mach-pcm037_eet.o | 14 | obj-$(CONFIG_MACH_PCM037_EET) += mach-pcm037_eet.o |
17 | obj-$(CONFIG_MACH_MX31_3DS) += mach-mx31_3ds.o | 15 | obj-$(CONFIG_MACH_MX31_3DS) += mach-mx31_3ds.o |
18 | CFLAGS_mach-mx31_3ds.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS | ||
19 | obj-$(CONFIG_MACH_MX31MOBOARD) += mach-mx31moboard.o mx31moboard-devboard.o \ | 16 | obj-$(CONFIG_MACH_MX31MOBOARD) += mach-mx31moboard.o mx31moboard-devboard.o \ |
20 | mx31moboard-marxbot.o mx31moboard-smartbot.o | 17 | mx31moboard-marxbot.o mx31moboard-smartbot.o |
21 | obj-$(CONFIG_MACH_QONG) += mach-qong.o | 18 | obj-$(CONFIG_MACH_QONG) += mach-qong.o |
diff --git a/arch/arm/mach-mx3/clock-imx31.c b/arch/arm/mach-mx3/clock-imx31.c index 109e98f323e0..d423cac8cab7 100644 --- a/arch/arm/mach-mx3/clock-imx31.c +++ b/arch/arm/mach-mx3/clock-imx31.c | |||
@@ -23,8 +23,8 @@ | |||
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 | #include <linux/clkdev.h> | ||
26 | 27 | ||
27 | #include <asm/clkdev.h> | ||
28 | #include <asm/div64.h> | 28 | #include <asm/div64.h> |
29 | 29 | ||
30 | #include <mach/clock.h> | 30 | #include <mach/clock.h> |
@@ -530,7 +530,7 @@ static struct clk_lookup lookups[] = { | |||
530 | _REGISTER_CLOCK("imx31-cspi.2", NULL, cspi3_clk) | 530 | _REGISTER_CLOCK("imx31-cspi.2", NULL, cspi3_clk) |
531 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) | 531 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) |
532 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | 532 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) |
533 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) | 533 | _REGISTER_CLOCK("imx2-wdt.0", NULL, wdog_clk) |
534 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) | 534 | _REGISTER_CLOCK(NULL, "rtc", rtc_clk) |
535 | _REGISTER_CLOCK(NULL, "epit", epit1_clk) | 535 | _REGISTER_CLOCK(NULL, "epit", epit1_clk) |
536 | _REGISTER_CLOCK(NULL, "epit", epit2_clk) | 536 | _REGISTER_CLOCK(NULL, "epit", epit2_clk) |
@@ -615,7 +615,7 @@ int __init mx31_clocks_init(unsigned long fref) | |||
615 | 615 | ||
616 | mx31_read_cpu_rev(); | 616 | mx31_read_cpu_rev(); |
617 | 617 | ||
618 | if (mx31_revision() >= MX31_CHIP_REV_2_0) { | 618 | if (mx31_revision() >= IMX_CHIP_REVISION_2_0) { |
619 | reg = __raw_readl(MXC_CCM_PMCR1); | 619 | reg = __raw_readl(MXC_CCM_PMCR1); |
620 | /* No PLL restart on DVFS switch; enable auto EMI handshake */ | 620 | /* No PLL restart on DVFS switch; enable auto EMI handshake */ |
621 | reg |= MXC_CCM_PMCR1_PLLRDIS | MXC_CCM_PMCR1_EMIRQ_EN; | 621 | reg |= MXC_CCM_PMCR1_PLLRDIS | MXC_CCM_PMCR1_EMIRQ_EN; |
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index 61e4a318980a..448a038cd1ec 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
@@ -21,8 +21,7 @@ | |||
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | #include <linux/clkdev.h> | |
25 | #include <asm/clkdev.h> | ||
26 | 25 | ||
27 | #include <mach/clock.h> | 26 | #include <mach/clock.h> |
28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
@@ -495,7 +494,7 @@ static struct clk_lookup lookups[] = { | |||
495 | _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk) | 494 | _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk) |
496 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) | 495 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) |
497 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usbahb_clk) | 496 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usbahb_clk) |
498 | _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) | 497 | _REGISTER_CLOCK("imx2-wdt.0", NULL, wdog_clk) |
499 | _REGISTER_CLOCK(NULL, "max", max_clk) | 498 | _REGISTER_CLOCK(NULL, "max", max_clk) |
500 | _REGISTER_CLOCK(NULL, "audmux", audmux_clk) | 499 | _REGISTER_CLOCK(NULL, "audmux", audmux_clk) |
501 | _REGISTER_CLOCK(NULL, "csi", csi_clk) | 500 | _REGISTER_CLOCK(NULL, "csi", csi_clk) |
diff --git a/arch/arm/mach-mx3/cpu.c b/arch/arm/mach-mx3/cpu.c index d00a75457812..d1d339576fdf 100644 --- a/arch/arm/mach-mx3/cpu.c +++ b/arch/arm/mach-mx3/cpu.c | |||
@@ -25,15 +25,15 @@ struct mx3_cpu_type { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | static struct mx3_cpu_type mx31_cpu_type[] __initdata = { | 27 | static struct mx3_cpu_type mx31_cpu_type[] __initdata = { |
28 | { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = MX3x_CHIP_REV_1_0 }, | 28 | { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = IMX_CHIP_REVISION_1_0 }, |
29 | { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = MX3x_CHIP_REV_1_1 }, | 29 | { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = IMX_CHIP_REVISION_1_1 }, |
30 | { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = MX3x_CHIP_REV_1_1 }, | 30 | { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = IMX_CHIP_REVISION_1_1 }, |
31 | { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = MX3x_CHIP_REV_1_1 }, | 31 | { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = IMX_CHIP_REVISION_1_1 }, |
32 | { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = MX3x_CHIP_REV_1_1 }, | 32 | { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = IMX_CHIP_REVISION_1_1 }, |
33 | { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = MX3x_CHIP_REV_1_2 }, | 33 | { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = IMX_CHIP_REVISION_1_2 }, |
34 | { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = MX3x_CHIP_REV_1_2 }, | 34 | { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = IMX_CHIP_REVISION_1_2 }, |
35 | { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = MX3x_CHIP_REV_2_0 }, | 35 | { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = IMX_CHIP_REVISION_2_0 }, |
36 | { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = MX3x_CHIP_REV_2_0 }, | 36 | { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = IMX_CHIP_REVISION_2_0 }, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | void __init mx31_read_cpu_rev(void) | 39 | void __init mx31_read_cpu_rev(void) |
@@ -53,6 +53,8 @@ void __init mx31_read_cpu_rev(void) | |||
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | 55 | ||
56 | mx31_cpu_rev = IMX_CHIP_REVISION_UNKNOWN; | ||
57 | |||
56 | printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev); | 58 | printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev); |
57 | } | 59 | } |
58 | 60 | ||
@@ -62,22 +64,25 @@ EXPORT_SYMBOL(mx35_cpu_rev); | |||
62 | void __init mx35_read_cpu_rev(void) | 64 | void __init mx35_read_cpu_rev(void) |
63 | { | 65 | { |
64 | u32 rev; | 66 | u32 rev; |
65 | char *srev = "unknown"; | 67 | char *srev; |
66 | 68 | ||
67 | rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV)); | 69 | rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV)); |
68 | switch (rev) { | 70 | switch (rev) { |
69 | case 0x00: | 71 | case 0x00: |
70 | mx35_cpu_rev = MX3x_CHIP_REV_1_0; | 72 | mx35_cpu_rev = IMX_CHIP_REVISION_1_0; |
71 | srev = "1.0"; | 73 | srev = "1.0"; |
72 | break; | 74 | break; |
73 | case 0x10: | 75 | case 0x10: |
74 | mx35_cpu_rev = MX3x_CHIP_REV_2_0; | 76 | mx35_cpu_rev = IMX_CHIP_REVISION_2_0; |
75 | srev = "2.0"; | 77 | srev = "2.0"; |
76 | break; | 78 | break; |
77 | case 0x11: | 79 | case 0x11: |
78 | mx35_cpu_rev = MX3x_CHIP_REV_2_1; | 80 | mx35_cpu_rev = IMX_CHIP_REVISION_2_1; |
79 | srev = "2.1"; | 81 | srev = "2.1"; |
80 | break; | 82 | break; |
83 | default: | ||
84 | mx35_cpu_rev = IMX_CHIP_REVISION_UNKNOWN; | ||
85 | srev = "unknown"; | ||
81 | } | 86 | } |
82 | 87 | ||
83 | printk(KERN_INFO "CPU identified as i.MX35, silicon rev %s\n", srev); | 88 | printk(KERN_INFO "CPU identified as i.MX35, silicon rev %s\n", srev); |
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h index de9598590eba..40f4e848a671 100644 --- a/arch/arm/mach-mx3/devices-imx31.h +++ b/arch/arm/mach-mx3/devices-imx31.h | |||
@@ -9,6 +9,14 @@ | |||
9 | #include <mach/mx31.h> | 9 | #include <mach/mx31.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | extern const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst; | ||
13 | #define imx31_add_fsl_usb2_udc(pdata) \ | ||
14 | imx_add_fsl_usb2_udc(&imx31_fsl_usb2_udc_data, pdata) | ||
15 | |||
16 | extern const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst; | ||
17 | #define imx31_add_imx2_wdt(pdata) \ | ||
18 | imx_add_imx2_wdt(&imx31_imx2_wdt_data) | ||
19 | |||
12 | extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst; | 20 | extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst; |
13 | #define imx31_add_imx_i2c(id, pdata) \ | 21 | #define imx31_add_imx_i2c(id, pdata) \ |
14 | imx_add_imx_i2c(&imx31_imx_i2c_data[id], pdata) | 22 | imx_add_imx_i2c(&imx31_imx_i2c_data[id], pdata) |
@@ -16,6 +24,10 @@ extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst; | |||
16 | #define imx31_add_imx_i2c1(pdata) imx31_add_imx_i2c(1, pdata) | 24 | #define imx31_add_imx_i2c1(pdata) imx31_add_imx_i2c(1, pdata) |
17 | #define imx31_add_imx_i2c2(pdata) imx31_add_imx_i2c(2, pdata) | 25 | #define imx31_add_imx_i2c2(pdata) imx31_add_imx_i2c(2, pdata) |
18 | 26 | ||
27 | extern const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst; | ||
28 | #define imx31_add_imx_keypad(pdata) \ | ||
29 | imx_add_imx_keypad(&imx31_imx_keypad_data, pdata) | ||
30 | |||
19 | extern const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst; | 31 | extern const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst; |
20 | #define imx31_add_imx_ssi(id, pdata) \ | 32 | #define imx31_add_imx_ssi(id, pdata) \ |
21 | imx_add_imx_ssi(&imx31_imx_ssi_data[id], pdata) | 33 | imx_add_imx_ssi(&imx31_imx_ssi_data[id], pdata) |
@@ -29,10 +41,25 @@ extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst; | |||
29 | #define imx31_add_imx_uart3(pdata) imx31_add_imx_uart(3, pdata) | 41 | #define imx31_add_imx_uart3(pdata) imx31_add_imx_uart(3, pdata) |
30 | #define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata) | 42 | #define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata) |
31 | 43 | ||
44 | extern const struct imx_mxc_ehci_data imx31_mxc_ehci_otg_data __initconst; | ||
45 | #define imx31_add_mxc_ehci_otg(pdata) \ | ||
46 | imx_add_mxc_ehci(&imx31_mxc_ehci_otg_data, pdata) | ||
47 | extern const struct imx_mxc_ehci_data imx31_mxc_ehci_hs_data[] __initconst; | ||
48 | #define imx31_add_mxc_ehci_hs(id, pdata) \ | ||
49 | imx_add_mxc_ehci(&imx31_mxc_ehci_hs_data[id - 1], pdata) | ||
50 | |||
51 | extern const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst; | ||
52 | #define imx31_add_mxc_mmc(id, pdata) \ | ||
53 | imx_add_mxc_mmc(&imx31_mxc_mmc_data[id], pdata) | ||
54 | |||
32 | extern const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst; | 55 | extern const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst; |
33 | #define imx31_add_mxc_nand(pdata) \ | 56 | #define imx31_add_mxc_nand(pdata) \ |
34 | imx_add_mxc_nand(&imx31_mxc_nand_data, pdata) | 57 | imx_add_mxc_nand(&imx31_mxc_nand_data, pdata) |
35 | 58 | ||
59 | extern const struct imx_mxc_w1_data imx31_mxc_w1_data __initconst; | ||
60 | #define imx31_add_mxc_w1(pdata) \ | ||
61 | imx_add_mxc_w1(&imx31_mxc_w1_data) | ||
62 | |||
36 | extern const struct imx_spi_imx_data imx31_cspi_data[] __initconst; | 63 | extern const struct imx_spi_imx_data imx31_cspi_data[] __initconst; |
37 | #define imx31_add_cspi(id, pdata) \ | 64 | #define imx31_add_cspi(id, pdata) \ |
38 | imx_add_spi_imx(&imx31_cspi_data[id], pdata) | 65 | imx_add_spi_imx(&imx31_cspi_data[id], pdata) |
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h index 5eb917b638d0..677b18aa7ae6 100644 --- a/arch/arm/mach-mx3/devices-imx35.h +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -13,10 +13,19 @@ extern const struct imx_fec_data imx35_fec_data __initconst; | |||
13 | #define imx35_add_fec(pdata) \ | 13 | #define imx35_add_fec(pdata) \ |
14 | imx_add_fec(&imx35_fec_data, pdata) | 14 | imx_add_fec(&imx35_fec_data, pdata) |
15 | 15 | ||
16 | #define imx35_add_flexcan0(pdata) \ | 16 | extern const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst; |
17 | imx_add_flexcan(0, MX35_CAN1_BASE_ADDR, SZ_16K, MX35_INT_CAN1, pdata) | 17 | #define imx35_add_fsl_usb2_udc(pdata) \ |
18 | #define imx35_add_flexcan1(pdata) \ | 18 | imx_add_fsl_usb2_udc(&imx35_fsl_usb2_udc_data, pdata) |
19 | imx_add_flexcan(1, MX35_CAN2_BASE_ADDR, SZ_16K, MX35_INT_CAN2, pdata) | 19 | |
20 | extern const struct imx_flexcan_data imx35_flexcan_data[] __initconst; | ||
21 | #define imx35_add_flexcan(id, pdata) \ | ||
22 | imx_add_flexcan(&imx35_flexcan_data[id], pdata) | ||
23 | #define imx35_add_flexcan0(pdata) imx35_add_flexcan(0, pdata) | ||
24 | #define imx35_add_flexcan1(pdata) imx35_add_flexcan(1, pdata) | ||
25 | |||
26 | extern const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst; | ||
27 | #define imx35_add_imx2_wdt(pdata) \ | ||
28 | imx_add_imx2_wdt(&imx35_imx2_wdt_data) | ||
20 | 29 | ||
21 | extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst; | 30 | extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst; |
22 | #define imx35_add_imx_i2c(id, pdata) \ | 31 | #define imx35_add_imx_i2c(id, pdata) \ |
@@ -25,6 +34,10 @@ extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst; | |||
25 | #define imx35_add_imx_i2c1(pdata) imx35_add_imx_i2c(1, pdata) | 34 | #define imx35_add_imx_i2c1(pdata) imx35_add_imx_i2c(1, pdata) |
26 | #define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2, pdata) | 35 | #define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2, pdata) |
27 | 36 | ||
37 | extern const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst; | ||
38 | #define imx31_add_imx_keypad(pdata) \ | ||
39 | imx_add_imx_keypad(&imx35_imx_keypad_data, pdata) | ||
40 | |||
28 | extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst; | 41 | extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst; |
29 | #define imx35_add_imx_ssi(id, pdata) \ | 42 | #define imx35_add_imx_ssi(id, pdata) \ |
30 | imx_add_imx_ssi(&imx35_imx_ssi_data[id], pdata) | 43 | imx_add_imx_ssi(&imx35_imx_ssi_data[id], pdata) |
@@ -36,16 +49,28 @@ extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst; | |||
36 | #define imx35_add_imx_uart1(pdata) imx35_add_imx_uart(1, pdata) | 49 | #define imx35_add_imx_uart1(pdata) imx35_add_imx_uart(1, pdata) |
37 | #define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) | 50 | #define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) |
38 | 51 | ||
52 | extern const struct imx_mxc_ehci_data imx35_mxc_ehci_otg_data __initconst; | ||
53 | #define imx35_add_mxc_ehci_otg(pdata) \ | ||
54 | imx_add_mxc_ehci(&imx35_mxc_ehci_otg_data, pdata) | ||
55 | extern const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst; | ||
56 | #define imx35_add_mxc_ehci_hs(pdata) \ | ||
57 | imx_add_mxc_ehci(&imx35_mxc_ehci_hs_data, pdata) | ||
58 | |||
39 | extern const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst; | 59 | extern const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst; |
40 | #define imx35_add_mxc_nand(pdata) \ | 60 | #define imx35_add_mxc_nand(pdata) \ |
41 | imx_add_mxc_nand(&imx35_mxc_nand_data, pdata) | 61 | imx_add_mxc_nand(&imx35_mxc_nand_data, pdata) |
42 | 62 | ||
63 | extern const struct imx_mxc_w1_data imx35_mxc_w1_data __initconst; | ||
64 | #define imx35_add_mxc_w1(pdata) \ | ||
65 | imx_add_mxc_w1(&imx35_mxc_w1_data) | ||
66 | |||
67 | extern const struct imx_sdhci_esdhc_imx_data | ||
68 | imx35_sdhci_esdhc_imx_data[] __initconst; | ||
69 | #define imx35_add_sdhci_esdhc_imx(id, pdata) \ | ||
70 | imx_add_sdhci_esdhc_imx(&imx35_sdhci_esdhc_imx_data[id], pdata) | ||
71 | |||
43 | extern const struct imx_spi_imx_data imx35_cspi_data[] __initconst; | 72 | extern const struct imx_spi_imx_data imx35_cspi_data[] __initconst; |
44 | #define imx35_add_cspi(id, pdata) \ | 73 | #define imx35_add_cspi(id, pdata) \ |
45 | imx_add_spi_imx(&imx35_cspi_data[id], pdata) | 74 | imx_add_spi_imx(&imx35_cspi_data[id], pdata) |
46 | #define imx35_add_spi_imx0(pdata) imx35_add_cspi(0, pdata) | 75 | #define imx35_add_spi_imx0(pdata) imx35_add_cspi(0, pdata) |
47 | #define imx35_add_spi_imx1(pdata) imx35_add_cspi(1, pdata) | 76 | #define imx35_add_spi_imx1(pdata) imx35_add_cspi(1, pdata) |
48 | |||
49 | extern const struct imx_esdhc_imx_data imx35_esdhc_data[] __initconst; | ||
50 | #define imx35_add_esdhc(id, pdata) \ | ||
51 | imx_add_esdhc(&imx35_esdhc_data[id], pdata) | ||
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index d4da9496089a..b6672db788fb 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -29,120 +29,25 @@ | |||
29 | 29 | ||
30 | #include "devices.h" | 30 | #include "devices.h" |
31 | 31 | ||
32 | /* GPIO port description */ | ||
33 | static struct mxc_gpio_port imx_gpio_ports[] = { | ||
34 | { | ||
35 | .chip.label = "gpio-0", | ||
36 | .base = IO_ADDRESS(GPIO1_BASE_ADDR), | ||
37 | .irq = MXC_INT_GPIO1, | ||
38 | .virtual_irq_start = MXC_GPIO_IRQ_START, | ||
39 | }, { | ||
40 | .chip.label = "gpio-1", | ||
41 | .base = IO_ADDRESS(GPIO2_BASE_ADDR), | ||
42 | .irq = MXC_INT_GPIO2, | ||
43 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32, | ||
44 | }, { | ||
45 | .chip.label = "gpio-2", | ||
46 | .base = IO_ADDRESS(GPIO3_BASE_ADDR), | ||
47 | .irq = MXC_INT_GPIO3, | ||
48 | .virtual_irq_start = MXC_GPIO_IRQ_START + 64, | ||
49 | } | ||
50 | }; | ||
51 | |||
52 | int __init imx3x_register_gpios(void) | ||
53 | { | ||
54 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); | ||
55 | } | ||
56 | |||
57 | static struct resource mxc_w1_master_resources[] = { | ||
58 | { | ||
59 | .start = OWIRE_BASE_ADDR, | ||
60 | .end = OWIRE_BASE_ADDR + SZ_4K - 1, | ||
61 | .flags = IORESOURCE_MEM, | ||
62 | }, | ||
63 | }; | ||
64 | |||
65 | struct platform_device mxc_w1_master_device = { | ||
66 | .name = "mxc_w1", | ||
67 | .id = 0, | ||
68 | .num_resources = ARRAY_SIZE(mxc_w1_master_resources), | ||
69 | .resource = mxc_w1_master_resources, | ||
70 | }; | ||
71 | |||
72 | #ifdef CONFIG_ARCH_MX31 | ||
73 | static struct resource mxcsdhc0_resources[] = { | ||
74 | { | ||
75 | .start = MX31_MMC_SDHC1_BASE_ADDR, | ||
76 | .end = MX31_MMC_SDHC1_BASE_ADDR + SZ_16K - 1, | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, { | ||
79 | .start = MX31_INT_MMC_SDHC1, | ||
80 | .end = MX31_INT_MMC_SDHC1, | ||
81 | .flags = IORESOURCE_IRQ, | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | static struct resource mxcsdhc1_resources[] = { | ||
86 | { | ||
87 | .start = MX31_MMC_SDHC2_BASE_ADDR, | ||
88 | .end = MX31_MMC_SDHC2_BASE_ADDR + SZ_16K - 1, | ||
89 | .flags = IORESOURCE_MEM, | ||
90 | }, { | ||
91 | .start = MX31_INT_MMC_SDHC2, | ||
92 | .end = MX31_INT_MMC_SDHC2, | ||
93 | .flags = IORESOURCE_IRQ, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | struct platform_device mxcsdhc_device0 = { | ||
98 | .name = "mxc-mmc", | ||
99 | .id = 0, | ||
100 | .num_resources = ARRAY_SIZE(mxcsdhc0_resources), | ||
101 | .resource = mxcsdhc0_resources, | ||
102 | }; | ||
103 | |||
104 | struct platform_device mxcsdhc_device1 = { | ||
105 | .name = "mxc-mmc", | ||
106 | .id = 1, | ||
107 | .num_resources = ARRAY_SIZE(mxcsdhc1_resources), | ||
108 | .resource = mxcsdhc1_resources, | ||
109 | }; | ||
110 | |||
111 | static struct resource rnga_resources[] = { | ||
112 | { | ||
113 | .start = RNGA_BASE_ADDR, | ||
114 | .end = RNGA_BASE_ADDR + 0x28, | ||
115 | .flags = IORESOURCE_MEM, | ||
116 | }, | ||
117 | }; | ||
118 | |||
119 | struct platform_device mxc_rnga_device = { | ||
120 | .name = "mxc_rnga", | ||
121 | .id = -1, | ||
122 | .num_resources = 1, | ||
123 | .resource = rnga_resources, | ||
124 | }; | ||
125 | #endif /* CONFIG_ARCH_MX31 */ | ||
126 | |||
127 | /* i.MX31 Image Processing Unit */ | 32 | /* i.MX31 Image Processing Unit */ |
128 | 33 | ||
129 | /* The resource order is important! */ | 34 | /* The resource order is important! */ |
130 | static struct resource mx3_ipu_rsrc[] = { | 35 | static struct resource mx3_ipu_rsrc[] = { |
131 | { | 36 | { |
132 | .start = IPU_CTRL_BASE_ADDR, | 37 | .start = MX3x_IPU_CTRL_BASE_ADDR, |
133 | .end = IPU_CTRL_BASE_ADDR + 0x5F, | 38 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0x5F, |
134 | .flags = IORESOURCE_MEM, | 39 | .flags = IORESOURCE_MEM, |
135 | }, { | 40 | }, { |
136 | .start = IPU_CTRL_BASE_ADDR + 0x88, | 41 | .start = MX3x_IPU_CTRL_BASE_ADDR + 0x88, |
137 | .end = IPU_CTRL_BASE_ADDR + 0xB3, | 42 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0xB3, |
138 | .flags = IORESOURCE_MEM, | 43 | .flags = IORESOURCE_MEM, |
139 | }, { | 44 | }, { |
140 | .start = MXC_INT_IPU_SYN, | 45 | .start = MX3x_INT_IPU_SYN, |
141 | .end = MXC_INT_IPU_SYN, | 46 | .end = MX3x_INT_IPU_SYN, |
142 | .flags = IORESOURCE_IRQ, | 47 | .flags = IORESOURCE_IRQ, |
143 | }, { | 48 | }, { |
144 | .start = MXC_INT_IPU_ERR, | 49 | .start = MX3x_INT_IPU_ERR, |
145 | .end = MXC_INT_IPU_ERR, | 50 | .end = MX3x_INT_IPU_ERR, |
146 | .flags = IORESOURCE_IRQ, | 51 | .flags = IORESOURCE_IRQ, |
147 | }, | 52 | }, |
148 | }; | 53 | }; |
@@ -156,8 +61,8 @@ struct platform_device mx3_ipu = { | |||
156 | 61 | ||
157 | static struct resource fb_resources[] = { | 62 | static struct resource fb_resources[] = { |
158 | { | 63 | { |
159 | .start = IPU_CTRL_BASE_ADDR + 0xB4, | 64 | .start = MX3x_IPU_CTRL_BASE_ADDR + 0xB4, |
160 | .end = IPU_CTRL_BASE_ADDR + 0x1BF, | 65 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0x1BF, |
161 | .flags = IORESOURCE_MEM, | 66 | .flags = IORESOURCE_MEM, |
162 | }, | 67 | }, |
163 | }; | 68 | }; |
@@ -174,8 +79,8 @@ struct platform_device mx3_fb = { | |||
174 | 79 | ||
175 | static struct resource camera_resources[] = { | 80 | static struct resource camera_resources[] = { |
176 | { | 81 | { |
177 | .start = IPU_CTRL_BASE_ADDR + 0x60, | 82 | .start = MX3x_IPU_CTRL_BASE_ADDR + 0x60, |
178 | .end = IPU_CTRL_BASE_ADDR + 0x87, | 83 | .end = MX3x_IPU_CTRL_BASE_ADDR + 0x87, |
179 | .flags = IORESOURCE_MEM, | 84 | .flags = IORESOURCE_MEM, |
180 | }, | 85 | }, |
181 | }; | 86 | }; |
@@ -190,110 +95,6 @@ struct platform_device mx3_camera = { | |||
190 | }, | 95 | }, |
191 | }; | 96 | }; |
192 | 97 | ||
193 | static struct resource otg_resources[] = { | ||
194 | { | ||
195 | .start = MX31_OTG_BASE_ADDR, | ||
196 | .end = MX31_OTG_BASE_ADDR + 0x1ff, | ||
197 | .flags = IORESOURCE_MEM, | ||
198 | }, { | ||
199 | .start = MXC_INT_USB3, | ||
200 | .end = MXC_INT_USB3, | ||
201 | .flags = IORESOURCE_IRQ, | ||
202 | }, | ||
203 | }; | ||
204 | |||
205 | static u64 otg_dmamask = DMA_BIT_MASK(32); | ||
206 | |||
207 | /* OTG gadget device */ | ||
208 | struct platform_device mxc_otg_udc_device = { | ||
209 | .name = "fsl-usb2-udc", | ||
210 | .id = -1, | ||
211 | .dev = { | ||
212 | .dma_mask = &otg_dmamask, | ||
213 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
214 | }, | ||
215 | .resource = otg_resources, | ||
216 | .num_resources = ARRAY_SIZE(otg_resources), | ||
217 | }; | ||
218 | |||
219 | /* OTG host */ | ||
220 | struct platform_device mxc_otg_host = { | ||
221 | .name = "mxc-ehci", | ||
222 | .id = 0, | ||
223 | .dev = { | ||
224 | .coherent_dma_mask = 0xffffffff, | ||
225 | .dma_mask = &otg_dmamask, | ||
226 | }, | ||
227 | .resource = otg_resources, | ||
228 | .num_resources = ARRAY_SIZE(otg_resources), | ||
229 | }; | ||
230 | |||
231 | /* USB host 1 */ | ||
232 | |||
233 | static u64 usbh1_dmamask = ~(u32)0; | ||
234 | |||
235 | static struct resource mxc_usbh1_resources[] = { | ||
236 | { | ||
237 | .start = MX31_OTG_BASE_ADDR + 0x200, | ||
238 | .end = MX31_OTG_BASE_ADDR + 0x3ff, | ||
239 | .flags = IORESOURCE_MEM, | ||
240 | }, { | ||
241 | .start = MXC_INT_USB1, | ||
242 | .end = MXC_INT_USB1, | ||
243 | .flags = IORESOURCE_IRQ, | ||
244 | }, | ||
245 | }; | ||
246 | |||
247 | struct platform_device mxc_usbh1 = { | ||
248 | .name = "mxc-ehci", | ||
249 | .id = 1, | ||
250 | .dev = { | ||
251 | .coherent_dma_mask = 0xffffffff, | ||
252 | .dma_mask = &usbh1_dmamask, | ||
253 | }, | ||
254 | .resource = mxc_usbh1_resources, | ||
255 | .num_resources = ARRAY_SIZE(mxc_usbh1_resources), | ||
256 | }; | ||
257 | |||
258 | /* USB host 2 */ | ||
259 | static u64 usbh2_dmamask = ~(u32)0; | ||
260 | |||
261 | static struct resource mxc_usbh2_resources[] = { | ||
262 | { | ||
263 | .start = MX31_OTG_BASE_ADDR + 0x400, | ||
264 | .end = MX31_OTG_BASE_ADDR + 0x5ff, | ||
265 | .flags = IORESOURCE_MEM, | ||
266 | }, { | ||
267 | .start = MXC_INT_USB2, | ||
268 | .end = MXC_INT_USB2, | ||
269 | .flags = IORESOURCE_IRQ, | ||
270 | }, | ||
271 | }; | ||
272 | |||
273 | struct platform_device mxc_usbh2 = { | ||
274 | .name = "mxc-ehci", | ||
275 | .id = 2, | ||
276 | .dev = { | ||
277 | .coherent_dma_mask = 0xffffffff, | ||
278 | .dma_mask = &usbh2_dmamask, | ||
279 | }, | ||
280 | .resource = mxc_usbh2_resources, | ||
281 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | ||
282 | }; | ||
283 | |||
284 | static struct resource imx_wdt_resources[] = { | ||
285 | { | ||
286 | .flags = IORESOURCE_MEM, | ||
287 | }, | ||
288 | }; | ||
289 | |||
290 | struct platform_device imx_wdt_device0 = { | ||
291 | .name = "imx2-wdt", | ||
292 | .id = 0, | ||
293 | .num_resources = ARRAY_SIZE(imx_wdt_resources), | ||
294 | .resource = imx_wdt_resources, | ||
295 | }; | ||
296 | |||
297 | static struct resource imx_rtc_resources[] = { | 98 | static struct resource imx_rtc_resources[] = { |
298 | { | 99 | { |
299 | .start = MX31_RTC_BASE_ADDR, | 100 | .start = MX31_RTC_BASE_ADDR, |
@@ -312,51 +113,3 @@ struct platform_device imx_rtc_device0 = { | |||
312 | .num_resources = ARRAY_SIZE(imx_rtc_resources), | 113 | .num_resources = ARRAY_SIZE(imx_rtc_resources), |
313 | .resource = imx_rtc_resources, | 114 | .resource = imx_rtc_resources, |
314 | }; | 115 | }; |
315 | |||
316 | static struct resource imx_kpp_resources[] = { | ||
317 | { | ||
318 | .start = MX3x_KPP_BASE_ADDR, | ||
319 | .end = MX3x_KPP_BASE_ADDR + 0xf, | ||
320 | .flags = IORESOURCE_MEM | ||
321 | }, { | ||
322 | .start = MX3x_INT_KPP, | ||
323 | .end = MX3x_INT_KPP, | ||
324 | .flags = IORESOURCE_IRQ, | ||
325 | }, | ||
326 | }; | ||
327 | |||
328 | struct platform_device imx_kpp_device = { | ||
329 | .name = "imx-keypad", | ||
330 | .id = -1, | ||
331 | .num_resources = ARRAY_SIZE(imx_kpp_resources), | ||
332 | .resource = imx_kpp_resources, | ||
333 | }; | ||
334 | |||
335 | static int __init mx3_devices_init(void) | ||
336 | { | ||
337 | #if defined(CONFIG_ARCH_MX31) | ||
338 | if (cpu_is_mx31()) { | ||
339 | imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR; | ||
340 | imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff; | ||
341 | mxc_register_device(&mxc_rnga_device, NULL); | ||
342 | } | ||
343 | #endif | ||
344 | #if defined(CONFIG_ARCH_MX35) | ||
345 | if (cpu_is_mx35()) { | ||
346 | otg_resources[0].start = MX35_OTG_BASE_ADDR; | ||
347 | otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff; | ||
348 | otg_resources[1].start = MXC_INT_USBOTG; | ||
349 | otg_resources[1].end = MXC_INT_USBOTG; | ||
350 | mxc_usbh1_resources[0].start = MX35_OTG_BASE_ADDR + 0x400; | ||
351 | mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff; | ||
352 | mxc_usbh1_resources[1].start = MXC_INT_USBHS; | ||
353 | mxc_usbh1_resources[1].end = MXC_INT_USBHS; | ||
354 | imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; | ||
355 | imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; | ||
356 | } | ||
357 | #endif | ||
358 | |||
359 | return 0; | ||
360 | } | ||
361 | |||
362 | subsys_initcall(mx3_devices_init); | ||
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h index 585f814473d5..121962c568d1 100644 --- a/arch/arm/mach-mx3/devices.h +++ b/arch/arm/mach-mx3/devices.h | |||
@@ -1,14 +1,4 @@ | |||
1 | extern struct platform_device mxc_w1_master_device; | ||
2 | extern struct platform_device mx3_ipu; | 1 | extern struct platform_device mx3_ipu; |
3 | extern struct platform_device mx3_fb; | 2 | extern struct platform_device mx3_fb; |
4 | extern struct platform_device mx3_camera; | 3 | extern struct platform_device mx3_camera; |
5 | extern struct platform_device mxcsdhc_device0; | ||
6 | extern struct platform_device mxcsdhc_device1; | ||
7 | extern struct platform_device mxc_otg_udc_device; | ||
8 | extern struct platform_device mxc_otg_host; | ||
9 | extern struct platform_device mxc_usbh1; | ||
10 | extern struct platform_device mxc_usbh2; | ||
11 | extern struct platform_device mxc_rnga_device; | ||
12 | extern struct platform_device imx_wdt_device0; | ||
13 | extern struct platform_device imx_rtc_device0; | 4 | extern struct platform_device imx_rtc_device0; |
14 | extern struct platform_device imx_kpp_device; | ||
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c index 1abc10d52922..14a5ffc939ad 100644 --- a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c | |||
@@ -111,7 +111,7 @@ static struct mx3fb_platform_data mx3fb_pdata = { | |||
111 | .num_modes = ARRAY_SIZE(fb_modedb), | 111 | .num_modes = ARRAY_SIZE(fb_modedb), |
112 | }; | 112 | }; |
113 | 113 | ||
114 | static struct pad_desc eukrea_mbimxsd_pads[] = { | 114 | static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { |
115 | /* LCD */ | 115 | /* LCD */ |
116 | MX35_PAD_LD0__IPU_DISPB_DAT_0, | 116 | MX35_PAD_LD0__IPU_DISPB_DAT_0, |
117 | MX35_PAD_LD1__IPU_DISPB_DAT_1, | 117 | MX35_PAD_LD1__IPU_DISPB_DAT_1, |
@@ -289,7 +289,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void) | |||
289 | imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); | 289 | imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); |
290 | 290 | ||
291 | imx35_add_flexcan1(NULL); | 291 | imx35_add_flexcan1(NULL); |
292 | imx35_add_esdhc(0, NULL); | 292 | imx35_add_sdhci_esdhc_imx(0, NULL); |
293 | 293 | ||
294 | gpio_request(GPIO_LED1, "LED1"); | 294 | gpio_request(GPIO_LED1, "LED1"); |
295 | gpio_direction_output(GPIO_LED1, 1); | 295 | gpio_direction_output(GPIO_LED1, 1); |
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c index aaa30fe18f85..28b6f414b5d5 100644 --- a/arch/arm/mach-mx3/mach-armadillo5x0.c +++ b/arch/arm/mach-mx3/mach-armadillo5x0.c | |||
@@ -49,10 +49,8 @@ | |||
49 | 49 | ||
50 | #include <mach/common.h> | 50 | #include <mach/common.h> |
51 | #include <mach/iomux-mx3.h> | 51 | #include <mach/iomux-mx3.h> |
52 | #include <mach/mmc.h> | ||
53 | #include <mach/ipu.h> | 52 | #include <mach/ipu.h> |
54 | #include <mach/mx3fb.h> | 53 | #include <mach/mx3fb.h> |
55 | #include <mach/mxc_ehci.h> | ||
56 | #include <mach/ulpi.h> | 54 | #include <mach/ulpi.h> |
57 | 55 | ||
58 | #include "devices-imx31.h" | 56 | #include "devices-imx31.h" |
@@ -245,13 +243,13 @@ h2_free_cs: | |||
245 | return err; | 243 | return err; |
246 | } | 244 | } |
247 | 245 | ||
248 | static struct mxc_usbh_platform_data usbotg_pdata = { | 246 | static struct mxc_usbh_platform_data usbotg_pdata __initdata = { |
249 | .init = usbotg_init, | 247 | .init = usbotg_init, |
250 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 248 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
251 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | 249 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, |
252 | }; | 250 | }; |
253 | 251 | ||
254 | static struct mxc_usbh_platform_data usbh2_pdata = { | 252 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
255 | .init = usbh2_init, | 253 | .init = usbh2_init, |
256 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 254 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
257 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | 255 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, |
@@ -453,7 +451,7 @@ static void armadillo5x0_sdhc1_exit(struct device *dev, void *data) | |||
453 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B)); | 451 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B)); |
454 | } | 452 | } |
455 | 453 | ||
456 | static struct imxmmc_platform_data sdhc_pdata = { | 454 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { |
457 | .get_ro = armadillo5x0_sdhc1_get_ro, | 455 | .get_ro = armadillo5x0_sdhc1_get_ro, |
458 | .init = armadillo5x0_sdhc1_init, | 456 | .init = armadillo5x0_sdhc1_init, |
459 | .exit = armadillo5x0_sdhc1_exit, | 457 | .exit = armadillo5x0_sdhc1_exit, |
@@ -520,7 +518,7 @@ static void __init armadillo5x0_init(void) | |||
520 | gpio_direction_input(MX31_PIN_GPIO1_0); | 518 | gpio_direction_input(MX31_PIN_GPIO1_0); |
521 | 519 | ||
522 | /* Register SDHC */ | 520 | /* Register SDHC */ |
523 | mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); | 521 | imx31_add_mxc_mmc(0, &sdhc_pdata); |
524 | 522 | ||
525 | /* Register FB */ | 523 | /* Register FB */ |
526 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 524 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
@@ -555,8 +553,8 @@ static void __init armadillo5x0_init(void) | |||
555 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 553 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
556 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 554 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
557 | 555 | ||
558 | mxc_register_device(&mxc_otg_host, &usbotg_pdata); | 556 | imx31_add_mxc_ehci_otg(&usbotg_pdata); |
559 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 557 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
560 | #endif | 558 | #endif |
561 | } | 559 | } |
562 | 560 | ||
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c index 9fde873f5889..26ae90f02582 100644 --- a/arch/arm/mach-mx3/mach-cpuimx35.c +++ b/arch/arm/mach-mx3/mach-cpuimx35.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/i2c/tsc2007.h> | 30 | #include <linux/i2c/tsc2007.h> |
31 | #include <linux/usb/otg.h> | 31 | #include <linux/usb/otg.h> |
32 | #include <linux/usb/ulpi.h> | 32 | #include <linux/usb/ulpi.h> |
33 | #include <linux/fsl_devices.h> | ||
34 | #include <linux/i2c-gpio.h> | 33 | #include <linux/i2c-gpio.h> |
35 | 34 | ||
36 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
@@ -43,7 +42,6 @@ | |||
43 | #include <mach/common.h> | 42 | #include <mach/common.h> |
44 | #include <mach/iomux-mx35.h> | 43 | #include <mach/iomux-mx35.h> |
45 | #include <mach/mxc_nand.h> | 44 | #include <mach/mxc_nand.h> |
46 | #include <mach/mxc_ehci.h> | ||
47 | 45 | ||
48 | #include "devices-imx35.h" | 46 | #include "devices-imx35.h" |
49 | #include "devices.h" | 47 | #include "devices.h" |
@@ -74,11 +72,7 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | |||
74 | }, | 72 | }, |
75 | }; | 73 | }; |
76 | 74 | ||
77 | static struct platform_device *devices[] __initdata = { | 75 | static iomux_v3_cfg_t eukrea_cpuimx35_pads[] = { |
78 | &imx_wdt_device0, | ||
79 | }; | ||
80 | |||
81 | static struct pad_desc eukrea_cpuimx35_pads[] = { | ||
82 | /* UART1 */ | 76 | /* UART1 */ |
83 | MX35_PAD_CTS1__UART1_CTS, | 77 | MX35_PAD_CTS1__UART1_CTS, |
84 | MX35_PAD_RTS1__UART1_RTS, | 78 | MX35_PAD_RTS1__UART1_RTS, |
@@ -117,18 +111,18 @@ static const struct mxc_nand_platform_data | |||
117 | .flash_bbt = 1, | 111 | .flash_bbt = 1, |
118 | }; | 112 | }; |
119 | 113 | ||
120 | static struct mxc_usbh_platform_data __maybe_unused otg_pdata = { | 114 | static const struct mxc_usbh_platform_data otg_pdata __initconst = { |
121 | .portsc = MXC_EHCI_MODE_UTMI, | 115 | .portsc = MXC_EHCI_MODE_UTMI, |
122 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 116 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
123 | }; | 117 | }; |
124 | 118 | ||
125 | static struct mxc_usbh_platform_data __maybe_unused usbh1_pdata = { | 119 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
126 | .portsc = MXC_EHCI_MODE_SERIAL, | 120 | .portsc = MXC_EHCI_MODE_SERIAL, |
127 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | 121 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | |
128 | MXC_EHCI_IPPUE_DOWN, | 122 | MXC_EHCI_IPPUE_DOWN, |
129 | }; | 123 | }; |
130 | 124 | ||
131 | static struct fsl_usb2_platform_data otg_device_pdata = { | 125 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
132 | .operating_mode = FSL_USB2_DR_DEVICE, | 126 | .operating_mode = FSL_USB2_DR_DEVICE, |
133 | .phy_mode = FSL_USB2_PHY_UTMI, | 127 | .phy_mode = FSL_USB2_PHY_UTMI, |
134 | .workaround = FLS_USB2_WORKAROUND_ENGCM09152, | 128 | .workaround = FLS_USB2_WORKAROUND_ENGCM09152, |
@@ -158,7 +152,7 @@ static void __init mxc_board_init(void) | |||
158 | ARRAY_SIZE(eukrea_cpuimx35_pads)); | 152 | ARRAY_SIZE(eukrea_cpuimx35_pads)); |
159 | 153 | ||
160 | imx35_add_fec(NULL); | 154 | imx35_add_fec(NULL); |
161 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 155 | imx35_add_imx2_wdt(NULL); |
162 | 156 | ||
163 | imx35_add_imx_uart0(&uart_pdata); | 157 | imx35_add_imx_uart0(&uart_pdata); |
164 | imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info); | 158 | imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info); |
@@ -168,11 +162,11 @@ static void __init mxc_board_init(void) | |||
168 | imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); | 162 | imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); |
169 | 163 | ||
170 | if (otg_mode_host) | 164 | if (otg_mode_host) |
171 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 165 | imx35_add_mxc_ehci_otg(&otg_pdata); |
172 | else | 166 | else |
173 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 167 | imx35_add_fsl_usb2_udc(&otg_device_pdata); |
174 | 168 | ||
175 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 169 | imx35_add_mxc_ehci_hs(&usbh1_pdata); |
176 | 170 | ||
177 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD | 171 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD |
178 | eukrea_mbimxsd35_baseboard_init(); | 172 | eukrea_mbimxsd35_baseboard_init(); |
diff --git a/arch/arm/mach-mx3/mach-kzm_arm11_01.c b/arch/arm/mach-mx3/mach-kzm_arm11_01.c index 042cd5655e17..a5f3eb24e4d5 100644 --- a/arch/arm/mach-mx3/mach-kzm_arm11_01.c +++ b/arch/arm/mach-mx3/mach-kzm_arm11_01.c | |||
@@ -41,9 +41,9 @@ | |||
41 | #include "devices-imx31.h" | 41 | #include "devices-imx31.h" |
42 | #include "devices.h" | 42 | #include "devices.h" |
43 | 43 | ||
44 | #define KZM_ARM11_IO_ADDRESS(x) ( \ | 44 | #define KZM_ARM11_IO_ADDRESS(x) (IOMEM( \ |
45 | IMX_IO_ADDRESS(x, MX31_CS4) ?: \ | 45 | IMX_IO_P2V_MODULE(x, MX31_CS4) ?: \ |
46 | IMX_IO_ADDRESS(x, MX31_CS5) ?: \ | 46 | IMX_IO_P2V_MODULE(x, MX31_CS5)) ?: \ |
47 | MX31_IO_ADDRESS(x)) | 47 | MX31_IO_ADDRESS(x)) |
48 | 48 | ||
49 | /* | 49 | /* |
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c index 0ad9e7821082..4e516b49a901 100644 --- a/arch/arm/mach-mx3/mach-mx31_3ds.c +++ b/arch/arm/mach-mx3/mach-mx31_3ds.c | |||
@@ -22,8 +22,8 @@ | |||
22 | #include <linux/mfd/mc13783.h> | 22 | #include <linux/mfd/mc13783.h> |
23 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/fsl_devices.h> | 25 | #include <linux/usb/otg.h> |
26 | #include <linux/input/matrix_keypad.h> | 26 | #include <linux/usb/ulpi.h> |
27 | 27 | ||
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
@@ -34,6 +34,7 @@ | |||
34 | #include <mach/common.h> | 34 | #include <mach/common.h> |
35 | #include <mach/iomux-mx3.h> | 35 | #include <mach/iomux-mx3.h> |
36 | #include <mach/3ds_debugboard.h> | 36 | #include <mach/3ds_debugboard.h> |
37 | #include <mach/ulpi.h> | ||
37 | 38 | ||
38 | #include "devices-imx31.h" | 39 | #include "devices-imx31.h" |
39 | #include "devices.h" | 40 | #include "devices.h" |
@@ -84,6 +85,21 @@ static int mx31_3ds_pins[] = { | |||
84 | MX31_PIN_KEY_COL1_KEY_COL1, | 85 | MX31_PIN_KEY_COL1_KEY_COL1, |
85 | MX31_PIN_KEY_COL2_KEY_COL2, | 86 | MX31_PIN_KEY_COL2_KEY_COL2, |
86 | MX31_PIN_KEY_COL3_KEY_COL3, | 87 | MX31_PIN_KEY_COL3_KEY_COL3, |
88 | /* USB Host 2 */ | ||
89 | IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC), | ||
90 | IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC), | ||
91 | IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC), | ||
92 | IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC), | ||
93 | IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC), | ||
94 | IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC), | ||
95 | IOMUX_MODE(MX31_PIN_PC_VS2, IOMUX_CONFIG_ALT1), | ||
96 | IOMUX_MODE(MX31_PIN_PC_BVD1, IOMUX_CONFIG_ALT1), | ||
97 | IOMUX_MODE(MX31_PIN_PC_BVD2, IOMUX_CONFIG_ALT1), | ||
98 | IOMUX_MODE(MX31_PIN_PC_RST, IOMUX_CONFIG_ALT1), | ||
99 | IOMUX_MODE(MX31_PIN_IOIS16, IOMUX_CONFIG_ALT1), | ||
100 | IOMUX_MODE(MX31_PIN_PC_RW_B, IOMUX_CONFIG_ALT1), | ||
101 | /* USB Host2 reset */ | ||
102 | IOMUX_MODE(MX31_PIN_USB_BYP, IOMUX_CONFIG_GPIO), | ||
87 | }; | 103 | }; |
88 | 104 | ||
89 | /* | 105 | /* |
@@ -102,7 +118,7 @@ static const uint32_t mx31_3ds_keymap[] = { | |||
102 | KEY(2, 3, KEY_F10), | 118 | KEY(2, 3, KEY_F10), |
103 | }; | 119 | }; |
104 | 120 | ||
105 | static struct matrix_keymap_data mx31_3ds_keymap_data = { | 121 | static const struct matrix_keymap_data mx31_3ds_keymap_data __initconst = { |
106 | .keymap = mx31_3ds_keymap, | 122 | .keymap = mx31_3ds_keymap, |
107 | .keymap_size = ARRAY_SIZE(mx31_3ds_keymap), | 123 | .keymap_size = ARRAY_SIZE(mx31_3ds_keymap), |
108 | }; | 124 | }; |
@@ -115,6 +131,13 @@ static struct regulator_init_data pwgtx_init = { | |||
115 | }, | 131 | }, |
116 | }; | 132 | }; |
117 | 133 | ||
134 | static struct regulator_init_data gpo_init = { | ||
135 | .constraints = { | ||
136 | .boot_on = 1, | ||
137 | .always_on = 1, | ||
138 | } | ||
139 | }; | ||
140 | |||
118 | static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { | 141 | static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { |
119 | { | 142 | { |
120 | .id = MC13783_REGU_PWGT1SPI, /* Power Gate for ARM core. */ | 143 | .id = MC13783_REGU_PWGT1SPI, /* Power Gate for ARM core. */ |
@@ -122,6 +145,13 @@ static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { | |||
122 | }, { | 145 | }, { |
123 | .id = MC13783_REGU_PWGT2SPI, /* Power Gate for L2 Cache. */ | 146 | .id = MC13783_REGU_PWGT2SPI, /* Power Gate for L2 Cache. */ |
124 | .init_data = &pwgtx_init, | 147 | .init_data = &pwgtx_init, |
148 | }, { | ||
149 | |||
150 | .id = MC13783_REGU_GPO1, /* Turn on 1.8V */ | ||
151 | .init_data = &gpo_init, | ||
152 | }, { | ||
153 | .id = MC13783_REGU_GPO3, /* Turn on 3.3V */ | ||
154 | .init_data = &gpo_init, | ||
125 | }, | 155 | }, |
126 | }; | 156 | }; |
127 | 157 | ||
@@ -129,7 +159,7 @@ static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { | |||
129 | static struct mc13783_platform_data mc13783_pdata __initdata = { | 159 | static struct mc13783_platform_data mc13783_pdata __initdata = { |
130 | .regulators = mx31_3ds_regulators, | 160 | .regulators = mx31_3ds_regulators, |
131 | .num_regulators = ARRAY_SIZE(mx31_3ds_regulators), | 161 | .num_regulators = ARRAY_SIZE(mx31_3ds_regulators), |
132 | .flags = MC13783_USE_REGULATOR, | 162 | .flags = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN, |
133 | }; | 163 | }; |
134 | 164 | ||
135 | /* SPI */ | 165 | /* SPI */ |
@@ -175,6 +205,7 @@ mx31_3ds_nand_board_info __initconst = { | |||
175 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | 205 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) |
176 | 206 | ||
177 | #define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR) | 207 | #define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR) |
208 | #define USBH2_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_BYP) | ||
178 | 209 | ||
179 | static int mx31_3ds_usbotg_init(void) | 210 | static int mx31_3ds_usbotg_init(void) |
180 | { | 211 | { |
@@ -214,11 +245,77 @@ usbotg_free_reset: | |||
214 | return err; | 245 | return err; |
215 | } | 246 | } |
216 | 247 | ||
217 | static struct fsl_usb2_platform_data usbotg_pdata = { | 248 | static int mx31_3ds_host2_init(struct platform_device *pdev) |
249 | { | ||
250 | int err; | ||
251 | |||
252 | mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG); | ||
253 | mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG); | ||
254 | mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG); | ||
255 | mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG); | ||
256 | mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG); | ||
257 | mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG); | ||
258 | mxc_iomux_set_pad(MX31_PIN_PC_VS2, USB_PAD_CFG); | ||
259 | mxc_iomux_set_pad(MX31_PIN_PC_BVD1, USB_PAD_CFG); | ||
260 | mxc_iomux_set_pad(MX31_PIN_PC_BVD2, USB_PAD_CFG); | ||
261 | mxc_iomux_set_pad(MX31_PIN_PC_RST, USB_PAD_CFG); | ||
262 | mxc_iomux_set_pad(MX31_PIN_IOIS16, USB_PAD_CFG); | ||
263 | mxc_iomux_set_pad(MX31_PIN_PC_RW_B, USB_PAD_CFG); | ||
264 | |||
265 | err = gpio_request(USBH2_RST_B, "usbh2-reset"); | ||
266 | if (err) { | ||
267 | pr_err("Failed to request the USB Host 2 reset gpio\n"); | ||
268 | return err; | ||
269 | } | ||
270 | |||
271 | err = gpio_direction_output(USBH2_RST_B, 0); | ||
272 | if (err) { | ||
273 | pr_err("Failed to drive the USB Host 2 reset gpio\n"); | ||
274 | goto usbotg_free_reset; | ||
275 | } | ||
276 | |||
277 | mdelay(1); | ||
278 | gpio_set_value(USBH2_RST_B, 1); | ||
279 | return 0; | ||
280 | |||
281 | usbotg_free_reset: | ||
282 | gpio_free(USBH2_RST_B); | ||
283 | return err; | ||
284 | } | ||
285 | |||
286 | #if defined(CONFIG_USB_ULPI) | ||
287 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | ||
288 | .portsc = MXC_EHCI_MODE_ULPI, | ||
289 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
290 | }; | ||
291 | |||
292 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | ||
293 | .init = mx31_3ds_host2_init, | ||
294 | .portsc = MXC_EHCI_MODE_ULPI, | ||
295 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
296 | }; | ||
297 | #endif | ||
298 | |||
299 | static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { | ||
218 | .operating_mode = FSL_USB2_DR_DEVICE, | 300 | .operating_mode = FSL_USB2_DR_DEVICE, |
219 | .phy_mode = FSL_USB2_PHY_ULPI, | 301 | .phy_mode = FSL_USB2_PHY_ULPI, |
220 | }; | 302 | }; |
221 | 303 | ||
304 | static int otg_mode_host; | ||
305 | |||
306 | static int __init mx31_3ds_otg_mode(char *options) | ||
307 | { | ||
308 | if (!strcmp(options, "host")) | ||
309 | otg_mode_host = 1; | ||
310 | else if (!strcmp(options, "device")) | ||
311 | otg_mode_host = 0; | ||
312 | else | ||
313 | pr_info("otg_mode neither \"host\" nor \"device\". " | ||
314 | "Defaulting to device\n"); | ||
315 | return 0; | ||
316 | } | ||
317 | __setup("otg_mode=", mx31_3ds_otg_mode); | ||
318 | |||
222 | static const struct imxuart_platform_data uart_pdata __initconst = { | 319 | static const struct imxuart_platform_data uart_pdata __initconst = { |
223 | .flags = IMXUART_HAVE_RTSCTS, | 320 | .flags = IMXUART_HAVE_RTSCTS, |
224 | }; | 321 | }; |
@@ -246,14 +343,27 @@ static void __init mxc_board_init(void) | |||
246 | spi_register_board_info(mx31_3ds_spi_devs, | 343 | spi_register_board_info(mx31_3ds_spi_devs, |
247 | ARRAY_SIZE(mx31_3ds_spi_devs)); | 344 | ARRAY_SIZE(mx31_3ds_spi_devs)); |
248 | 345 | ||
249 | mxc_register_device(&imx_kpp_device, &mx31_3ds_keymap_data); | 346 | imx31_add_imx_keypad(&mx31_3ds_keymap_data); |
250 | 347 | ||
251 | mx31_3ds_usbotg_init(); | 348 | mx31_3ds_usbotg_init(); |
252 | mxc_register_device(&mxc_otg_udc_device, &usbotg_pdata); | 349 | #if defined(CONFIG_USB_ULPI) |
350 | if (otg_mode_host) { | ||
351 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
352 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | ||
353 | |||
354 | imx31_add_mxc_ehci_otg(&otg_pdata); | ||
355 | } | ||
356 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | ||
357 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | ||
358 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | ||
359 | #endif | ||
360 | if (!otg_mode_host) | ||
361 | imx31_add_fsl_usb2_udc(&usbotg_pdata); | ||
253 | 362 | ||
254 | if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 363 | if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT)) |
255 | printk(KERN_WARNING "Init of the debug board failed, all " | 364 | printk(KERN_WARNING "Init of the debug board failed, all " |
256 | "devices on the debug board are unusable.\n"); | 365 | "devices on the debug board are unusable.\n"); |
366 | imx31_add_imx2_wdt(NULL); | ||
257 | } | 367 | } |
258 | 368 | ||
259 | static void __init mx31_3ds_timer_init(void) | 369 | static void __init mx31_3ds_timer_init(void) |
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c index 42f47faa6fd6..2c595483f356 100644 --- a/arch/arm/mach-mx3/mach-mx31lilly.c +++ b/arch/arm/mach-mx3/mach-mx31lilly.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <mach/common.h> | 42 | #include <mach/common.h> |
43 | #include <mach/iomux-mx3.h> | 43 | #include <mach/iomux-mx3.h> |
44 | #include <mach/board-mx31lilly.h> | 44 | #include <mach/board-mx31lilly.h> |
45 | #include <mach/mxc_ehci.h> | ||
46 | #include <mach/ulpi.h> | 45 | #include <mach/ulpi.h> |
47 | 46 | ||
48 | #include "devices-imx31.h" | 47 | #include "devices-imx31.h" |
@@ -230,13 +229,13 @@ static struct mxc_usbh_platform_data usbotg_pdata = { | |||
230 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 229 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
231 | }; | 230 | }; |
232 | 231 | ||
233 | static struct mxc_usbh_platform_data usbh1_pdata = { | 232 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
234 | .init = usbh1_init, | 233 | .init = usbh1_init, |
235 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 234 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
236 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | 235 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, |
237 | }; | 236 | }; |
238 | 237 | ||
239 | static struct mxc_usbh_platform_data usbh2_pdata = { | 238 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
240 | .init = usbh2_init, | 239 | .init = usbh2_init, |
241 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 240 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
242 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 241 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
@@ -249,8 +248,8 @@ static void lilly1131_usb_init(void) | |||
249 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 248 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
250 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 249 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
251 | 250 | ||
252 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 251 | imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
253 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 252 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
254 | } | 253 | } |
255 | 254 | ||
256 | #else | 255 | #else |
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c index b93895814cdf..9e64c66396e0 100644 --- a/arch/arm/mach-mx3/mach-mx31lite.c +++ b/arch/arm/mach-mx3/mach-mx31lite.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <mach/board-mx31lite.h> | 40 | #include <mach/board-mx31lite.h> |
41 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
42 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
43 | #include <mach/mxc_ehci.h> | ||
44 | #include <mach/ulpi.h> | 43 | #include <mach/ulpi.h> |
45 | 44 | ||
46 | #include "devices-imx31.h" | 45 | #include "devices-imx31.h" |
@@ -171,7 +170,7 @@ static int usbh2_init(struct platform_device *pdev) | |||
171 | return 0; | 170 | return 0; |
172 | } | 171 | } |
173 | 172 | ||
174 | static struct mxc_usbh_platform_data usbh2_pdata = { | 173 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
175 | .init = usbh2_init, | 174 | .init = usbh2_init, |
176 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 175 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
177 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 176 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
@@ -258,7 +257,7 @@ static void __init mxc_board_init(void) | |||
258 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 257 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
259 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 258 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
260 | 259 | ||
261 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 260 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
262 | #endif | 261 | #endif |
263 | 262 | ||
264 | /* SMSC9117 IRQ pin */ | 263 | /* SMSC9117 IRQ pin */ |
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c index eb5f426df224..203d21a510aa 100644 --- a/arch/arm/mach-mx3/mach-mx31moboard.c +++ b/arch/arm/mach-mx3/mach-mx31moboard.c | |||
@@ -40,8 +40,6 @@ | |||
40 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
41 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
42 | #include <mach/ipu.h> | 42 | #include <mach/ipu.h> |
43 | #include <mach/mmc.h> | ||
44 | #include <mach/mxc_ehci.h> | ||
45 | #include <mach/mx3_camera.h> | 43 | #include <mach/mx3_camera.h> |
46 | #include <mach/spi.h> | 44 | #include <mach/spi.h> |
47 | #include <mach/ulpi.h> | 45 | #include <mach/ulpi.h> |
@@ -170,11 +168,11 @@ static const struct spi_imx_master moboard_spi1_pdata __initconst = { | |||
170 | 168 | ||
171 | static struct regulator_consumer_supply sdhc_consumers[] = { | 169 | static struct regulator_consumer_supply sdhc_consumers[] = { |
172 | { | 170 | { |
173 | .dev = &mxcsdhc_device0.dev, | 171 | .dev_name = "mxc-mmc.0", |
174 | .supply = "sdhc0_vcc", | 172 | .supply = "sdhc0_vcc", |
175 | }, | 173 | }, |
176 | { | 174 | { |
177 | .dev = &mxcsdhc_device1.dev, | 175 | .dev_name = "mxc-mmc.1", |
178 | .supply = "sdhc1_vcc", | 176 | .supply = "sdhc1_vcc", |
179 | }, | 177 | }, |
180 | }; | 178 | }; |
@@ -345,7 +343,7 @@ static void moboard_sdhc1_exit(struct device *dev, void *data) | |||
345 | gpio_free(SDHC1_CD); | 343 | gpio_free(SDHC1_CD); |
346 | } | 344 | } |
347 | 345 | ||
348 | static struct imxmmc_platform_data sdhc1_pdata = { | 346 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { |
349 | .get_ro = moboard_sdhc1_get_ro, | 347 | .get_ro = moboard_sdhc1_get_ro, |
350 | .init = moboard_sdhc1_init, | 348 | .init = moboard_sdhc1_init, |
351 | .exit = moboard_sdhc1_exit, | 349 | .exit = moboard_sdhc1_exit, |
@@ -404,17 +402,23 @@ static void usb_xcvr_reset(void) | |||
404 | 402 | ||
405 | #if defined(CONFIG_USB_ULPI) | 403 | #if defined(CONFIG_USB_ULPI) |
406 | 404 | ||
407 | static struct mxc_usbh_platform_data usbh2_pdata = { | 405 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
408 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 406 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
409 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 407 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
410 | }; | 408 | }; |
411 | 409 | ||
412 | static int __init moboard_usbh2_init(void) | 410 | static int __init moboard_usbh2_init(void) |
413 | { | 411 | { |
412 | struct platform_device *pdev; | ||
413 | |||
414 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 414 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
415 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 415 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
416 | 416 | ||
417 | return mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 417 | pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
418 | if (IS_ERR(pdev)) | ||
419 | return PTR_ERR(pdev); | ||
420 | |||
421 | return 0; | ||
418 | } | 422 | } |
419 | #else | 423 | #else |
420 | static inline int moboard_usbh2_init(void) { return 0; } | 424 | static inline int moboard_usbh2_init(void) { return 0; } |
@@ -520,7 +524,7 @@ static void __init mxc_board_init(void) | |||
520 | spi_register_board_info(moboard_spi_board_info, | 524 | spi_register_board_info(moboard_spi_board_info, |
521 | ARRAY_SIZE(moboard_spi_board_info)); | 525 | ARRAY_SIZE(moboard_spi_board_info)); |
522 | 526 | ||
523 | mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata); | 527 | imx31_add_mxc_mmc(0, &sdhc1_pdata); |
524 | 528 | ||
525 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 529 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
526 | if (!mx31moboard_cam_alloc_dma(CAMERA_BUF_SIZE)) | 530 | if (!mx31moboard_cam_alloc_dma(CAMERA_BUF_SIZE)) |
diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c index b66a75aa2e88..b1963f257c20 100644 --- a/arch/arm/mach-mx3/mach-mx35_3ds.c +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/memory.h> | 27 | #include <linux/memory.h> |
28 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
29 | #include <linux/fsl_devices.h> | 29 | #include <linux/usb/otg.h> |
30 | 30 | ||
31 | #include <linux/mtd/physmap.h> | 31 | #include <linux/mtd/physmap.h> |
32 | 32 | ||
@@ -40,7 +40,6 @@ | |||
40 | #include <mach/iomux-mx35.h> | 40 | #include <mach/iomux-mx35.h> |
41 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
42 | #include <mach/3ds_debugboard.h> | 42 | #include <mach/3ds_debugboard.h> |
43 | #include <mach/mxc_ehci.h> | ||
44 | 43 | ||
45 | #include "devices-imx35.h" | 44 | #include "devices-imx35.h" |
46 | #include "devices.h" | 45 | #include "devices.h" |
@@ -81,7 +80,7 @@ static struct platform_device *devices[] __initdata = { | |||
81 | &mx35pdk_flash, | 80 | &mx35pdk_flash, |
82 | }; | 81 | }; |
83 | 82 | ||
84 | static struct pad_desc mx35pdk_pads[] = { | 83 | static iomux_v3_cfg_t mx35pdk_pads[] = { |
85 | /* UART1 */ | 84 | /* UART1 */ |
86 | MX35_PAD_CTS1__UART1_CTS, | 85 | MX35_PAD_CTS1__UART1_CTS, |
87 | MX35_PAD_RTS1__UART1_RTS, | 86 | MX35_PAD_RTS1__UART1_RTS, |
@@ -122,18 +121,38 @@ static struct pad_desc mx35pdk_pads[] = { | |||
122 | }; | 121 | }; |
123 | 122 | ||
124 | /* OTG config */ | 123 | /* OTG config */ |
125 | static struct fsl_usb2_platform_data usb_otg_pdata = { | 124 | static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = { |
126 | .operating_mode = FSL_USB2_DR_DEVICE, | 125 | .operating_mode = FSL_USB2_DR_DEVICE, |
127 | .phy_mode = FSL_USB2_PHY_UTMI_WIDE, | 126 | .phy_mode = FSL_USB2_PHY_UTMI_WIDE, |
128 | }; | 127 | }; |
129 | 128 | ||
129 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | ||
130 | .portsc = MXC_EHCI_MODE_UTMI, | ||
131 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
132 | }; | ||
133 | |||
130 | /* USB HOST config */ | 134 | /* USB HOST config */ |
131 | static struct mxc_usbh_platform_data usb_host_pdata = { | 135 | static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { |
132 | .portsc = MXC_EHCI_MODE_SERIAL, | 136 | .portsc = MXC_EHCI_MODE_SERIAL, |
133 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | | 137 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | |
134 | MXC_EHCI_INTERNAL_PHY, | 138 | MXC_EHCI_INTERNAL_PHY, |
135 | }; | 139 | }; |
136 | 140 | ||
141 | static int otg_mode_host; | ||
142 | |||
143 | static int __init mx35_3ds_otg_mode(char *options) | ||
144 | { | ||
145 | if (!strcmp(options, "host")) | ||
146 | otg_mode_host = 1; | ||
147 | else if (!strcmp(options, "device")) | ||
148 | otg_mode_host = 0; | ||
149 | else | ||
150 | pr_info("otg_mode neither \"host\" nor \"device\". " | ||
151 | "Defaulting to device\n"); | ||
152 | return 0; | ||
153 | } | ||
154 | __setup("otg_mode=", mx35_3ds_otg_mode); | ||
155 | |||
137 | /* | 156 | /* |
138 | * Board specific initialization. | 157 | * Board specific initialization. |
139 | */ | 158 | */ |
@@ -142,16 +161,21 @@ static void __init mxc_board_init(void) | |||
142 | mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); | 161 | mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); |
143 | 162 | ||
144 | imx35_add_fec(NULL); | 163 | imx35_add_fec(NULL); |
164 | imx35_add_imx2_wdt(NULL); | ||
145 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 165 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
146 | 166 | ||
147 | imx35_add_imx_uart0(&uart_pdata); | 167 | imx35_add_imx_uart0(&uart_pdata); |
148 | 168 | ||
149 | mxc_register_device(&mxc_otg_udc_device, &usb_otg_pdata); | 169 | if (otg_mode_host) |
170 | imx35_add_mxc_ehci_otg(&otg_pdata); | ||
171 | |||
172 | imx35_add_mxc_ehci_hs(&usb_host_pdata); | ||
150 | 173 | ||
151 | mxc_register_device(&mxc_usbh1, &usb_host_pdata); | 174 | if (!otg_mode_host) |
175 | imx35_add_fsl_usb2_udc(&usb_otg_pdata); | ||
152 | 176 | ||
153 | imx35_add_mxc_nand(&mx35pdk_nand_board_info); | 177 | imx35_add_mxc_nand(&mx35pdk_nand_board_info); |
154 | imx35_add_esdhc(0, NULL); | 178 | imx35_add_sdhci_esdhc_imx(0, NULL); |
155 | 179 | ||
156 | if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 180 | if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT)) |
157 | pr_warn("Init of the debugboard failed, all " | 181 | pr_warn("Init of the debugboard failed, all " |
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c index 2ff3f661a48e..b752f6bc20a2 100644 --- a/arch/arm/mach-mx3/mach-pcm037.c +++ b/arch/arm/mach-mx3/mach-pcm037.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
29 | #include <linux/irq.h> | 29 | #include <linux/irq.h> |
30 | #include <linux/fsl_devices.h> | ||
31 | #include <linux/can/platform/sja1000.h> | 30 | #include <linux/can/platform/sja1000.h> |
32 | #include <linux/usb/otg.h> | 31 | #include <linux/usb/otg.h> |
33 | #include <linux/usb/ulpi.h> | 32 | #include <linux/usb/ulpi.h> |
@@ -43,10 +42,8 @@ | |||
43 | #include <mach/hardware.h> | 42 | #include <mach/hardware.h> |
44 | #include <mach/iomux-mx3.h> | 43 | #include <mach/iomux-mx3.h> |
45 | #include <mach/ipu.h> | 44 | #include <mach/ipu.h> |
46 | #include <mach/mmc.h> | ||
47 | #include <mach/mx3_camera.h> | 45 | #include <mach/mx3_camera.h> |
48 | #include <mach/mx3fb.h> | 46 | #include <mach/mx3fb.h> |
49 | #include <mach/mxc_ehci.h> | ||
50 | #include <mach/ulpi.h> | 47 | #include <mach/ulpi.h> |
51 | 48 | ||
52 | #include "devices-imx31.h" | 49 | #include "devices-imx31.h" |
@@ -399,7 +396,7 @@ static void pcm970_sdhc1_exit(struct device *dev, void *data) | |||
399 | gpio_free(SDHC1_GPIO_WP); | 396 | gpio_free(SDHC1_GPIO_WP); |
400 | } | 397 | } |
401 | 398 | ||
402 | static struct imxmmc_platform_data sdhc_pdata = { | 399 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { |
403 | #ifdef PCM970_SDHC_RW_SWITCH | 400 | #ifdef PCM970_SDHC_RW_SWITCH |
404 | .get_ro = pcm970_sdhc1_get_ro, | 401 | .get_ro = pcm970_sdhc1_get_ro, |
405 | #endif | 402 | #endif |
@@ -441,7 +438,6 @@ static int __init pcm037_camera_alloc_dma(const size_t buf_size) | |||
441 | static struct platform_device *devices[] __initdata = { | 438 | static struct platform_device *devices[] __initdata = { |
442 | &pcm037_flash, | 439 | &pcm037_flash, |
443 | &pcm037_sram_device, | 440 | &pcm037_sram_device, |
444 | &imx_wdt_device0, | ||
445 | &pcm037_mt9t031, | 441 | &pcm037_mt9t031, |
446 | &pcm037_mt9v022, | 442 | &pcm037_mt9v022, |
447 | }; | 443 | }; |
@@ -538,18 +534,18 @@ static struct platform_device pcm970_sja1000 = { | |||
538 | }; | 534 | }; |
539 | 535 | ||
540 | #if defined(CONFIG_USB_ULPI) | 536 | #if defined(CONFIG_USB_ULPI) |
541 | static struct mxc_usbh_platform_data otg_pdata = { | 537 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
542 | .portsc = MXC_EHCI_MODE_ULPI, | 538 | .portsc = MXC_EHCI_MODE_ULPI, |
543 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 539 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
544 | }; | 540 | }; |
545 | 541 | ||
546 | static struct mxc_usbh_platform_data usbh2_pdata = { | 542 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
547 | .portsc = MXC_EHCI_MODE_ULPI, | 543 | .portsc = MXC_EHCI_MODE_ULPI, |
548 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 544 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
549 | }; | 545 | }; |
550 | #endif | 546 | #endif |
551 | 547 | ||
552 | static struct fsl_usb2_platform_data otg_device_pdata = { | 548 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
553 | .operating_mode = FSL_USB2_DR_DEVICE, | 549 | .operating_mode = FSL_USB2_DR_DEVICE, |
554 | .phy_mode = FSL_USB2_PHY_ULPI, | 550 | .phy_mode = FSL_USB2_PHY_ULPI, |
555 | }; | 551 | }; |
@@ -607,12 +603,13 @@ static void __init mxc_board_init(void) | |||
607 | 603 | ||
608 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 604 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
609 | 605 | ||
606 | imx31_add_imx2_wdt(NULL); | ||
610 | imx31_add_imx_uart0(&uart_pdata); | 607 | imx31_add_imx_uart0(&uart_pdata); |
611 | /* XXX: should't this have .flags = 0 (i.e. no RTSCTS) on PCM037_EET? */ | 608 | /* XXX: should't this have .flags = 0 (i.e. no RTSCTS) on PCM037_EET? */ |
612 | imx31_add_imx_uart1(&uart_pdata); | 609 | imx31_add_imx_uart1(&uart_pdata); |
613 | imx31_add_imx_uart2(&uart_pdata); | 610 | imx31_add_imx_uart2(&uart_pdata); |
614 | 611 | ||
615 | mxc_register_device(&mxc_w1_master_device, NULL); | 612 | imx31_add_mxc_w1(NULL); |
616 | 613 | ||
617 | /* LAN9217 IRQ pin */ | 614 | /* LAN9217 IRQ pin */ |
618 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq"); | 615 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq"); |
@@ -632,7 +629,7 @@ static void __init mxc_board_init(void) | |||
632 | imx31_add_imx_i2c2(&pcm037_i2c2_data); | 629 | imx31_add_imx_i2c2(&pcm037_i2c2_data); |
633 | 630 | ||
634 | imx31_add_mxc_nand(&pcm037_nand_board_info); | 631 | imx31_add_mxc_nand(&pcm037_nand_board_info); |
635 | mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); | 632 | imx31_add_mxc_mmc(0, &sdhc_pdata); |
636 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); | 633 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
637 | mxc_register_device(&mx3_fb, &mx3fb_pdata); | 634 | mxc_register_device(&mx3_fb, &mx3fb_pdata); |
638 | 635 | ||
@@ -654,16 +651,16 @@ static void __init mxc_board_init(void) | |||
654 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 651 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
655 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 652 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
656 | 653 | ||
657 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 654 | imx31_add_mxc_ehci_otg(&otg_pdata); |
658 | } | 655 | } |
659 | 656 | ||
660 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 657 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
661 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 658 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
662 | 659 | ||
663 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 660 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
664 | #endif | 661 | #endif |
665 | if (!otg_mode_host) | 662 | if (!otg_mode_host) |
666 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 663 | imx31_add_fsl_usb2_udc(&otg_device_pdata); |
667 | 664 | ||
668 | } | 665 | } |
669 | 666 | ||
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index 4e1de87995d4..bcf83fc7e701 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/i2c/at24.h> | 27 | #include <linux/i2c/at24.h> |
28 | #include <linux/usb/otg.h> | 28 | #include <linux/usb/otg.h> |
29 | #include <linux/usb/ulpi.h> | 29 | #include <linux/usb/ulpi.h> |
30 | #include <linux/fsl_devices.h> | ||
31 | 30 | ||
32 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
33 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
@@ -39,7 +38,6 @@ | |||
39 | #include <mach/iomux-mx35.h> | 38 | #include <mach/iomux-mx35.h> |
40 | #include <mach/ipu.h> | 39 | #include <mach/ipu.h> |
41 | #include <mach/mx3fb.h> | 40 | #include <mach/mx3fb.h> |
42 | #include <mach/mxc_ehci.h> | ||
43 | #include <mach/ulpi.h> | 41 | #include <mach/ulpi.h> |
44 | #include <mach/audmux.h> | 42 | #include <mach/audmux.h> |
45 | 43 | ||
@@ -140,10 +138,9 @@ static struct i2c_board_info pcm043_i2c_devices[] = { | |||
140 | 138 | ||
141 | static struct platform_device *devices[] __initdata = { | 139 | static struct platform_device *devices[] __initdata = { |
142 | &pcm043_flash, | 140 | &pcm043_flash, |
143 | &imx_wdt_device0, | ||
144 | }; | 141 | }; |
145 | 142 | ||
146 | static struct pad_desc pcm043_pads[] = { | 143 | static iomux_v3_cfg_t pcm043_pads[] = { |
147 | /* UART1 */ | 144 | /* UART1 */ |
148 | MX35_PAD_CTS1__UART1_CTS, | 145 | MX35_PAD_CTS1__UART1_CTS, |
149 | MX35_PAD_RTS1__UART1_RTS, | 146 | MX35_PAD_RTS1__UART1_RTS, |
@@ -230,8 +227,8 @@ static struct pad_desc pcm043_pads[] = { | |||
230 | 227 | ||
231 | static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) | 228 | static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) |
232 | { | 229 | { |
233 | struct pad_desc txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; | 230 | iomux_v3_cfg_t txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; |
234 | struct pad_desc txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; | 231 | iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; |
235 | int ret; | 232 | int ret; |
236 | 233 | ||
237 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); | 234 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); |
@@ -240,7 +237,7 @@ static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) | |||
240 | return; | 237 | return; |
241 | } | 238 | } |
242 | 239 | ||
243 | mxc_iomux_v3_setup_pad(&txfs_gpio); | 240 | mxc_iomux_v3_setup_pad(txfs_gpio); |
244 | 241 | ||
245 | /* warm reset */ | 242 | /* warm reset */ |
246 | gpio_direction_output(AC97_GPIO_TXFS, 1); | 243 | gpio_direction_output(AC97_GPIO_TXFS, 1); |
@@ -248,16 +245,16 @@ static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) | |||
248 | gpio_set_value(AC97_GPIO_TXFS, 0); | 245 | gpio_set_value(AC97_GPIO_TXFS, 0); |
249 | 246 | ||
250 | gpio_free(AC97_GPIO_TXFS); | 247 | gpio_free(AC97_GPIO_TXFS); |
251 | mxc_iomux_v3_setup_pad(&txfs); | 248 | mxc_iomux_v3_setup_pad(txfs); |
252 | } | 249 | } |
253 | 250 | ||
254 | static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) | 251 | static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) |
255 | { | 252 | { |
256 | struct pad_desc txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; | 253 | iomux_v3_cfg_t txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; |
257 | struct pad_desc txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; | 254 | iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; |
258 | struct pad_desc txd_gpio = MX35_PAD_STXD4__GPIO2_28; | 255 | iomux_v3_cfg_t txd_gpio = MX35_PAD_STXD4__GPIO2_28; |
259 | struct pad_desc txd = MX35_PAD_STXD4__AUDMUX_AUD4_TXD; | 256 | iomux_v3_cfg_t txd = MX35_PAD_STXD4__AUDMUX_AUD4_TXD; |
260 | struct pad_desc reset_gpio = MX35_PAD_SD2_CMD__GPIO2_0; | 257 | iomux_v3_cfg_t reset_gpio = MX35_PAD_SD2_CMD__GPIO2_0; |
261 | int ret; | 258 | int ret; |
262 | 259 | ||
263 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); | 260 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); |
@@ -272,9 +269,9 @@ static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) | |||
272 | if (ret) | 269 | if (ret) |
273 | goto err3; | 270 | goto err3; |
274 | 271 | ||
275 | mxc_iomux_v3_setup_pad(&txfs_gpio); | 272 | mxc_iomux_v3_setup_pad(txfs_gpio); |
276 | mxc_iomux_v3_setup_pad(&txd_gpio); | 273 | mxc_iomux_v3_setup_pad(txd_gpio); |
277 | mxc_iomux_v3_setup_pad(&reset_gpio); | 274 | mxc_iomux_v3_setup_pad(reset_gpio); |
278 | 275 | ||
279 | gpio_direction_output(AC97_GPIO_TXFS, 0); | 276 | gpio_direction_output(AC97_GPIO_TXFS, 0); |
280 | gpio_direction_output(AC97_GPIO_TXD, 0); | 277 | gpio_direction_output(AC97_GPIO_TXD, 0); |
@@ -284,8 +281,8 @@ static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) | |||
284 | udelay(10); | 281 | udelay(10); |
285 | gpio_direction_output(AC97_GPIO_RESET, 1); | 282 | gpio_direction_output(AC97_GPIO_RESET, 1); |
286 | 283 | ||
287 | mxc_iomux_v3_setup_pad(&txd); | 284 | mxc_iomux_v3_setup_pad(txd); |
288 | mxc_iomux_v3_setup_pad(&txfs); | 285 | mxc_iomux_v3_setup_pad(txfs); |
289 | 286 | ||
290 | gpio_free(AC97_GPIO_RESET); | 287 | gpio_free(AC97_GPIO_RESET); |
291 | err3: | 288 | err3: |
@@ -311,19 +308,19 @@ pcm037_nand_board_info __initconst = { | |||
311 | }; | 308 | }; |
312 | 309 | ||
313 | #if defined(CONFIG_USB_ULPI) | 310 | #if defined(CONFIG_USB_ULPI) |
314 | static struct mxc_usbh_platform_data otg_pdata = { | 311 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
315 | .portsc = MXC_EHCI_MODE_UTMI, | 312 | .portsc = MXC_EHCI_MODE_UTMI, |
316 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 313 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
317 | }; | 314 | }; |
318 | 315 | ||
319 | static struct mxc_usbh_platform_data usbh1_pdata = { | 316 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
320 | .portsc = MXC_EHCI_MODE_SERIAL, | 317 | .portsc = MXC_EHCI_MODE_SERIAL, |
321 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | 318 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | |
322 | MXC_EHCI_IPPUE_DOWN, | 319 | MXC_EHCI_IPPUE_DOWN, |
323 | }; | 320 | }; |
324 | #endif | 321 | #endif |
325 | 322 | ||
326 | static struct fsl_usb2_platform_data otg_device_pdata = { | 323 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
327 | .operating_mode = FSL_USB2_DR_DEVICE, | 324 | .operating_mode = FSL_USB2_DR_DEVICE, |
328 | .phy_mode = FSL_USB2_PHY_UTMI, | 325 | .phy_mode = FSL_USB2_PHY_UTMI, |
329 | }; | 326 | }; |
@@ -364,6 +361,7 @@ static void __init mxc_board_init(void) | |||
364 | 361 | ||
365 | imx35_add_fec(NULL); | 362 | imx35_add_fec(NULL); |
366 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 363 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
364 | imx35_add_imx2_wdt(NULL); | ||
367 | 365 | ||
368 | imx35_add_imx_uart0(&uart_pdata); | 366 | imx35_add_imx_uart0(&uart_pdata); |
369 | imx35_add_mxc_nand(&pcm037_nand_board_info); | 367 | imx35_add_mxc_nand(&pcm037_nand_board_info); |
@@ -386,16 +384,16 @@ static void __init mxc_board_init(void) | |||
386 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 384 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
387 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 385 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
388 | 386 | ||
389 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 387 | imx35_add_mxc_ehci_otg(&otg_pdata); |
390 | } | 388 | } |
391 | 389 | ||
392 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 390 | imx35_add_mxc_ehci_hs(&usbh1_pdata); |
393 | #endif | 391 | #endif |
394 | if (!otg_mode_host) | 392 | if (!otg_mode_host) |
395 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 393 | imx35_add_fsl_usb2_udc(&otg_device_pdata); |
396 | 394 | ||
397 | imx35_add_flexcan1(NULL); | 395 | imx35_add_flexcan1(NULL); |
398 | imx35_add_esdhc(0, NULL); | 396 | imx35_add_sdhci_esdhc_imx(0, NULL); |
399 | } | 397 | } |
400 | 398 | ||
401 | static void __init pcm043_timer_init(void) | 399 | static void __init pcm043_timer_init(void) |
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c index b4ffc531a82c..47118f760244 100644 --- a/arch/arm/mach-mx3/mm.c +++ b/arch/arm/mach-mx3/mm.c | |||
@@ -36,40 +36,16 @@ | |||
36 | * @ingroup Memory | 36 | * @ingroup Memory |
37 | */ | 37 | */ |
38 | 38 | ||
39 | /*! | 39 | #ifdef CONFIG_SOC_IMX31 |
40 | * This table defines static virtual address mappings for I/O regions. | 40 | static struct map_desc mx31_io_desc[] __initdata = { |
41 | * These are the mappings common across all MX3 boards. | 41 | imx_map_entry(MX31, X_MEMC, MT_DEVICE), |
42 | */ | 42 | imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED), |
43 | static struct map_desc mxc_io_desc[] __initdata = { | 43 | imx_map_entry(MX31, AIPS1, MT_DEVICE_NONSHARED), |
44 | { | 44 | imx_map_entry(MX31, AIPS2, MT_DEVICE_NONSHARED), |
45 | .virtual = X_MEMC_BASE_ADDR_VIRT, | 45 | imx_map_entry(MX31, SPBA0, MT_DEVICE_NONSHARED), |
46 | .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), | ||
47 | .length = X_MEMC_SIZE, | ||
48 | .type = MT_DEVICE | ||
49 | }, { | ||
50 | .virtual = AVIC_BASE_ADDR_VIRT, | ||
51 | .pfn = __phys_to_pfn(AVIC_BASE_ADDR), | ||
52 | .length = AVIC_SIZE, | ||
53 | .type = MT_DEVICE_NONSHARED | ||
54 | }, { | ||
55 | .virtual = AIPS1_BASE_ADDR_VIRT, | ||
56 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | ||
57 | .length = AIPS1_SIZE, | ||
58 | .type = MT_DEVICE_NONSHARED | ||
59 | }, { | ||
60 | .virtual = AIPS2_BASE_ADDR_VIRT, | ||
61 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | ||
62 | .length = AIPS2_SIZE, | ||
63 | .type = MT_DEVICE_NONSHARED | ||
64 | }, { | ||
65 | .virtual = SPBA0_BASE_ADDR_VIRT, | ||
66 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), | ||
67 | .length = SPBA0_SIZE, | ||
68 | .type = MT_DEVICE_NONSHARED | ||
69 | }, | ||
70 | }; | 46 | }; |
71 | 47 | ||
72 | /*! | 48 | /* |
73 | * This function initializes the memory map. It is called during the | 49 | * This function initializes the memory map. It is called during the |
74 | * system startup to create static physical to virtual memory mappings | 50 | * system startup to create static physical to virtual memory mappings |
75 | * for the IO modules. | 51 | * for the IO modules. |
@@ -77,34 +53,44 @@ static struct map_desc mxc_io_desc[] __initdata = { | |||
77 | void __init mx31_map_io(void) | 53 | void __init mx31_map_io(void) |
78 | { | 54 | { |
79 | mxc_set_cpu_type(MXC_CPU_MX31); | 55 | mxc_set_cpu_type(MXC_CPU_MX31); |
80 | mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR)); | 56 | mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); |
81 | 57 | ||
82 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | 58 | iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc)); |
83 | } | 59 | } |
84 | 60 | ||
85 | #ifdef CONFIG_ARCH_MX35 | 61 | int imx31_register_gpios(void); |
86 | void __init mx35_map_io(void) | 62 | void __init mx31_init_irq(void) |
87 | { | 63 | { |
88 | mxc_set_cpu_type(MXC_CPU_MX35); | 64 | mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR)); |
89 | mxc_iomux_v3_init(IO_ADDRESS(IOMUXC_BASE_ADDR)); | 65 | imx31_register_gpios(); |
90 | mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR)); | ||
91 | |||
92 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | ||
93 | } | 66 | } |
94 | #endif | 67 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
95 | 68 | ||
96 | int imx3x_register_gpios(void); | 69 | #ifdef CONFIG_SOC_IMX35 |
70 | static struct map_desc mx35_io_desc[] __initdata = { | ||
71 | imx_map_entry(MX35, X_MEMC, MT_DEVICE), | ||
72 | imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED), | ||
73 | imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED), | ||
74 | imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED), | ||
75 | imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED), | ||
76 | }; | ||
97 | 77 | ||
98 | void __init mx31_init_irq(void) | 78 | void __init mx35_map_io(void) |
99 | { | 79 | { |
100 | mxc_init_irq(IO_ADDRESS(AVIC_BASE_ADDR)); | 80 | mxc_set_cpu_type(MXC_CPU_MX35); |
101 | imx3x_register_gpios(); | 81 | mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR)); |
82 | mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR)); | ||
83 | |||
84 | iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc)); | ||
102 | } | 85 | } |
103 | 86 | ||
87 | int imx35_register_gpios(void); | ||
104 | void __init mx35_init_irq(void) | 88 | void __init mx35_init_irq(void) |
105 | { | 89 | { |
106 | mx31_init_irq(); | 90 | mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR)); |
91 | imx35_register_gpios(); | ||
107 | } | 92 | } |
93 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
108 | 94 | ||
109 | #ifdef CONFIG_CACHE_L2X0 | 95 | #ifdef CONFIG_CACHE_L2X0 |
110 | static int mxc_init_l2x0(void) | 96 | static int mxc_init_l2x0(void) |
@@ -129,7 +115,7 @@ static int mxc_init_l2x0(void) | |||
129 | pr_err("L2 cache: Cannot fix timing. Trying to continue without\n"); | 115 | pr_err("L2 cache: Cannot fix timing. Trying to continue without\n"); |
130 | } | 116 | } |
131 | 117 | ||
132 | l2x0_base = ioremap(L2CC_BASE_ADDR, 4096); | 118 | l2x0_base = ioremap(MX3x_L2CC_BASE_ADDR, 4096); |
133 | if (IS_ERR(l2x0_base)) { | 119 | if (IS_ERR(l2x0_base)) { |
134 | printk(KERN_ERR "remapping L2 cache area failed with %ld\n", | 120 | printk(KERN_ERR "remapping L2 cache area failed with %ld\n", |
135 | PTR_ERR(l2x0_base)); | 121 | PTR_ERR(l2x0_base)); |
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c index 827fd3c80201..8f1a38ebf5c8 100644 --- a/arch/arm/mach-mx3/mx31lilly-db.c +++ b/arch/arm/mach-mx3/mx31lilly-db.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <mach/common.h> | 34 | #include <mach/common.h> |
35 | #include <mach/iomux-mx3.h> | 35 | #include <mach/iomux-mx3.h> |
36 | #include <mach/board-mx31lilly.h> | 36 | #include <mach/board-mx31lilly.h> |
37 | #include <mach/mmc.h> | ||
38 | #include <mach/mx3fb.h> | 37 | #include <mach/mx3fb.h> |
39 | #include <mach/ipu.h> | 38 | #include <mach/ipu.h> |
40 | 39 | ||
@@ -158,7 +157,7 @@ static void mxc_mmc1_exit(struct device *dev, void *data) | |||
158 | free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data); | 157 | free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data); |
159 | } | 158 | } |
160 | 159 | ||
161 | static struct imxmmc_platform_data mmc_pdata = { | 160 | static const struct imxmmc_platform_data mmc_pdata __initconst = { |
162 | .get_ro = mxc_mmc1_get_ro, | 161 | .get_ro = mxc_mmc1_get_ro, |
163 | .init = mxc_mmc1_init, | 162 | .init = mxc_mmc1_init, |
164 | .exit = mxc_mmc1_exit, | 163 | .exit = mxc_mmc1_exit, |
@@ -216,7 +215,7 @@ void __init mx31lilly_db_init(void) | |||
216 | imx31_add_imx_uart0(&uart_pdata); | 215 | imx31_add_imx_uart0(&uart_pdata); |
217 | imx31_add_imx_uart1(&uart_pdata); | 216 | imx31_add_imx_uart1(&uart_pdata); |
218 | imx31_add_imx_uart2(&uart_pdata); | 217 | imx31_add_imx_uart2(&uart_pdata); |
219 | mxc_register_device(&mxcsdhc_device0, &mmc_pdata); | 218 | imx31_add_mxc_mmc(0, &mmc_pdata); |
220 | mx31lilly_init_fb(); | 219 | mx31lilly_init_fb(); |
221 | } | 220 | } |
222 | 221 | ||
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c index 7b0e74e275ba..3124ea837ac7 100644 --- a/arch/arm/mach-mx3/mx31lite-db.c +++ b/arch/arm/mach-mx3/mx31lite-db.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <mach/common.h> | 35 | #include <mach/common.h> |
36 | #include <mach/iomux-mx3.h> | 36 | #include <mach/iomux-mx3.h> |
37 | #include <mach/board-mx31lite.h> | 37 | #include <mach/board-mx31lite.h> |
38 | #include <mach/mmc.h> | ||
39 | 38 | ||
40 | #include "devices-imx31.h" | 39 | #include "devices-imx31.h" |
41 | #include "devices.h" | 40 | #include "devices.h" |
@@ -142,7 +141,7 @@ static void mxc_mmc1_exit(struct device *dev, void *data) | |||
142 | free_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), data); | 141 | free_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), data); |
143 | } | 142 | } |
144 | 143 | ||
145 | static struct imxmmc_platform_data mmc_pdata = { | 144 | static const struct imxmmc_platform_data mmc_pdata __initconst = { |
146 | .get_ro = mxc_mmc1_get_ro, | 145 | .get_ro = mxc_mmc1_get_ro, |
147 | .init = mxc_mmc1_init, | 146 | .init = mxc_mmc1_init, |
148 | .exit = mxc_mmc1_exit, | 147 | .exit = mxc_mmc1_exit, |
@@ -197,10 +196,9 @@ void __init mx31lite_db_init(void) | |||
197 | ARRAY_SIZE(litekit_db_board_pins), | 196 | ARRAY_SIZE(litekit_db_board_pins), |
198 | "development board pins"); | 197 | "development board pins"); |
199 | imx31_add_imx_uart0(&uart_pdata); | 198 | imx31_add_imx_uart0(&uart_pdata); |
200 | mxc_register_device(&mxcsdhc_device0, &mmc_pdata); | 199 | imx31_add_mxc_mmc(0, &mmc_pdata); |
201 | imx31_add_spi_imx0(&spi0_pdata); | 200 | imx31_add_spi_imx0(&spi0_pdata); |
202 | platform_device_register(&litekit_led_device); | 201 | platform_device_register(&litekit_led_device); |
203 | mxc_register_device(&imx_wdt_device0, NULL); | 202 | imx31_add_imx2_wdt(NULL); |
204 | mxc_register_device(&imx_rtc_device0, NULL); | 203 | mxc_register_device(&imx_rtc_device0, NULL); |
205 | } | 204 | } |
206 | |||
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c index fc395a7a8599..94a0b9e4b7f3 100644 --- a/arch/arm/mach-mx3/mx31moboard-devboard.c +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -18,15 +18,12 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/fsl_devices.h> | ||
22 | 21 | ||
23 | #include <linux/usb/otg.h> | 22 | #include <linux/usb/otg.h> |
24 | 23 | ||
25 | #include <mach/common.h> | 24 | #include <mach/common.h> |
26 | #include <mach/iomux-mx3.h> | 25 | #include <mach/iomux-mx3.h> |
27 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
28 | #include <mach/mmc.h> | ||
29 | #include <mach/mxc_ehci.h> | ||
30 | #include <mach/ulpi.h> | 27 | #include <mach/ulpi.h> |
31 | 28 | ||
32 | #include "devices-imx31.h" | 29 | #include "devices-imx31.h" |
@@ -103,7 +100,7 @@ static void devboard_sdhc2_exit(struct device *dev, void *data) | |||
103 | gpio_free(SDHC2_CD); | 100 | gpio_free(SDHC2_CD); |
104 | } | 101 | } |
105 | 102 | ||
106 | static struct imxmmc_platform_data sdhc2_pdata = { | 103 | static const struct imxmmc_platform_data sdhc2_pdata __initconst = { |
107 | .get_ro = devboard_sdhc2_get_ro, | 104 | .get_ro = devboard_sdhc2_get_ro, |
108 | .init = devboard_sdhc2_init, | 105 | .init = devboard_sdhc2_init, |
109 | .exit = devboard_sdhc2_exit, | 106 | .exit = devboard_sdhc2_exit, |
@@ -187,7 +184,7 @@ static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on) | |||
187 | return 0; | 184 | return 0; |
188 | } | 185 | } |
189 | 186 | ||
190 | static struct mxc_usbh_platform_data usbh1_pdata = { | 187 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { |
191 | .init = devboard_usbh1_hw_init, | 188 | .init = devboard_usbh1_hw_init, |
192 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 189 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
193 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | 190 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, |
@@ -196,6 +193,7 @@ static struct mxc_usbh_platform_data usbh1_pdata = { | |||
196 | static int __init devboard_usbh1_init(void) | 193 | static int __init devboard_usbh1_init(void) |
197 | { | 194 | { |
198 | struct otg_transceiver *otg; | 195 | struct otg_transceiver *otg; |
196 | struct platform_device *pdev; | ||
199 | 197 | ||
200 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); | 198 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); |
201 | if (!otg) | 199 | if (!otg) |
@@ -207,11 +205,15 @@ static int __init devboard_usbh1_init(void) | |||
207 | 205 | ||
208 | usbh1_pdata.otg = otg; | 206 | usbh1_pdata.otg = otg; |
209 | 207 | ||
210 | return mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 208 | pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
209 | if (IS_ERR(pdev)) | ||
210 | return PTR_ERR(pdev); | ||
211 | |||
212 | return 0; | ||
211 | } | 213 | } |
212 | 214 | ||
213 | 215 | ||
214 | static struct fsl_usb2_platform_data usb_pdata = { | 216 | static const struct fsl_usb2_platform_data usb_pdata __initconst = { |
215 | .operating_mode = FSL_USB2_DR_DEVICE, | 217 | .operating_mode = FSL_USB2_DR_DEVICE, |
216 | .phy_mode = FSL_USB2_PHY_ULPI, | 218 | .phy_mode = FSL_USB2_PHY_ULPI, |
217 | }; | 219 | }; |
@@ -228,11 +230,11 @@ void __init mx31moboard_devboard_init(void) | |||
228 | 230 | ||
229 | imx31_add_imx_uart1(&uart_pdata); | 231 | imx31_add_imx_uart1(&uart_pdata); |
230 | 232 | ||
231 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); | 233 | imx31_add_mxc_mmc(1, &sdhc2_pdata); |
232 | 234 | ||
233 | devboard_init_sel_gpios(); | 235 | devboard_init_sel_gpios(); |
234 | 236 | ||
235 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | 237 | imx31_add_fsl_usb2_udc(&usb_pdata); |
236 | 238 | ||
237 | devboard_usbh1_init(); | 239 | devboard_usbh1_init(); |
238 | } | 240 | } |
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index 18069cb7d068..f449a97ae1a2 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/fsl_devices.h> | ||
25 | 24 | ||
26 | #include <linux/usb/otg.h> | 25 | #include <linux/usb/otg.h> |
27 | 26 | ||
@@ -29,12 +28,11 @@ | |||
29 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
30 | #include <mach/imx-uart.h> | 29 | #include <mach/imx-uart.h> |
31 | #include <mach/iomux-mx3.h> | 30 | #include <mach/iomux-mx3.h> |
32 | #include <mach/mmc.h> | ||
33 | #include <mach/mxc_ehci.h> | ||
34 | #include <mach/ulpi.h> | 31 | #include <mach/ulpi.h> |
35 | 32 | ||
36 | #include <media/soc_camera.h> | 33 | #include <media/soc_camera.h> |
37 | 34 | ||
35 | #include "devices-imx31.h" | ||
38 | #include "devices.h" | 36 | #include "devices.h" |
39 | 37 | ||
40 | static unsigned int marxbot_pins[] = { | 38 | static unsigned int marxbot_pins[] = { |
@@ -116,7 +114,7 @@ static void marxbot_sdhc2_exit(struct device *dev, void *data) | |||
116 | gpio_free(SDHC2_CD); | 114 | gpio_free(SDHC2_CD); |
117 | } | 115 | } |
118 | 116 | ||
119 | static struct imxmmc_platform_data sdhc2_pdata = { | 117 | static const struct imxmmc_platform_data sdhc2_pdata __initconst = { |
120 | .get_ro = marxbot_sdhc2_get_ro, | 118 | .get_ro = marxbot_sdhc2_get_ro, |
121 | .init = marxbot_sdhc2_init, | 119 | .init = marxbot_sdhc2_init, |
122 | .exit = marxbot_sdhc2_exit, | 120 | .exit = marxbot_sdhc2_exit, |
@@ -302,7 +300,7 @@ static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on) | |||
302 | return 0; | 300 | return 0; |
303 | } | 301 | } |
304 | 302 | ||
305 | static struct mxc_usbh_platform_data usbh1_pdata = { | 303 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { |
306 | .init = marxbot_usbh1_hw_init, | 304 | .init = marxbot_usbh1_hw_init, |
307 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 305 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
308 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | 306 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, |
@@ -311,6 +309,7 @@ static struct mxc_usbh_platform_data usbh1_pdata = { | |||
311 | static int __init marxbot_usbh1_init(void) | 309 | static int __init marxbot_usbh1_init(void) |
312 | { | 310 | { |
313 | struct otg_transceiver *otg; | 311 | struct otg_transceiver *otg; |
312 | struct platform_device *pdev; | ||
314 | 313 | ||
315 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); | 314 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); |
316 | if (!otg) | 315 | if (!otg) |
@@ -322,10 +321,14 @@ static int __init marxbot_usbh1_init(void) | |||
322 | 321 | ||
323 | usbh1_pdata.otg = otg; | 322 | usbh1_pdata.otg = otg; |
324 | 323 | ||
325 | return mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 324 | pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
325 | if (IS_ERR(pdev)) | ||
326 | return PTR_ERR(pdev); | ||
327 | |||
328 | return 0; | ||
326 | } | 329 | } |
327 | 330 | ||
328 | static struct fsl_usb2_platform_data usb_pdata = { | 331 | static const struct fsl_usb2_platform_data usb_pdata __initconst = { |
329 | .operating_mode = FSL_USB2_DR_DEVICE, | 332 | .operating_mode = FSL_USB2_DR_DEVICE, |
330 | .phy_mode = FSL_USB2_PHY_ULPI, | 333 | .phy_mode = FSL_USB2_PHY_ULPI, |
331 | }; | 334 | }; |
@@ -344,7 +347,7 @@ void __init mx31moboard_marxbot_init(void) | |||
344 | 347 | ||
345 | dspics_resets_init(); | 348 | dspics_resets_init(); |
346 | 349 | ||
347 | mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); | 350 | imx31_add_mxc_mmc(1, &sdhc2_pdata); |
348 | 351 | ||
349 | spi_register_board_info(marxbot_spi_board_info, | 352 | spi_register_board_info(marxbot_spi_board_info, |
350 | ARRAY_SIZE(marxbot_spi_board_info)); | 353 | ARRAY_SIZE(marxbot_spi_board_info)); |
@@ -357,7 +360,7 @@ void __init mx31moboard_marxbot_init(void) | |||
357 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0)); | 360 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0)); |
358 | gpio_export(IOMUX_TO_GPIO(MX31_PIN_LCS0), false); | 361 | gpio_export(IOMUX_TO_GPIO(MX31_PIN_LCS0), false); |
359 | 362 | ||
360 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | 363 | imx31_add_fsl_usb2_udc(&usb_pdata); |
361 | 364 | ||
362 | marxbot_usbh1_init(); | 365 | marxbot_usbh1_init(); |
363 | } | 366 | } |
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c index 04760a53005a..bbec3c82264a 100644 --- a/arch/arm/mach-mx3/mx31moboard-smartbot.c +++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/fsl_devices.h> | ||
23 | 22 | ||
24 | #include <linux/usb/otg.h> | 23 | #include <linux/usb/otg.h> |
25 | #include <linux/usb/ulpi.h> | 24 | #include <linux/usb/ulpi.h> |
@@ -28,7 +27,6 @@ | |||
28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
29 | #include <mach/iomux-mx3.h> | 28 | #include <mach/iomux-mx3.h> |
30 | #include <mach/board-mx31moboard.h> | 29 | #include <mach/board-mx31moboard.h> |
31 | #include <mach/mxc_ehci.h> | ||
32 | #include <mach/ulpi.h> | 30 | #include <mach/ulpi.h> |
33 | 31 | ||
34 | #include <media/soc_camera.h> | 32 | #include <media/soc_camera.h> |
@@ -118,24 +116,30 @@ static int __init smartbot_cam_init(void) | |||
118 | return 0; | 116 | return 0; |
119 | } | 117 | } |
120 | 118 | ||
121 | static struct fsl_usb2_platform_data usb_pdata = { | 119 | static const struct fsl_usb2_platform_data usb_pdata __initconst = { |
122 | .operating_mode = FSL_USB2_DR_DEVICE, | 120 | .operating_mode = FSL_USB2_DR_DEVICE, |
123 | .phy_mode = FSL_USB2_PHY_ULPI, | 121 | .phy_mode = FSL_USB2_PHY_ULPI, |
124 | }; | 122 | }; |
125 | 123 | ||
126 | #if defined(CONFIG_USB_ULPI) | 124 | #if defined(CONFIG_USB_ULPI) |
127 | 125 | ||
128 | static struct mxc_usbh_platform_data otg_host_pdata = { | 126 | static struct mxc_usbh_platform_data otg_host_pdata __initdata = { |
129 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 127 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
130 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 128 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
131 | }; | 129 | }; |
132 | 130 | ||
133 | static int __init smartbot_otg_host_init(void) | 131 | static int __init smartbot_otg_host_init(void) |
134 | { | 132 | { |
133 | struct platform_device *pdev; | ||
134 | |||
135 | otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 135 | otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
136 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 136 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
137 | 137 | ||
138 | return mxc_register_device(&mxc_otg_host, &otg_host_pdata); | 138 | pdev = imx31_add_mxc_ehci_otg(&otg_host_pdata); |
139 | if (IS_ERR(pdev)) | ||
140 | return PTR_ERR(pdev); | ||
141 | |||
142 | return 0; | ||
139 | } | 143 | } |
140 | #else | 144 | #else |
141 | static inline int smartbot_otg_host_init(void) { return 0; } | 145 | static inline int smartbot_otg_host_init(void) { return 0; } |
@@ -182,7 +186,7 @@ void __init mx31moboard_smartbot_init(int board) | |||
182 | 186 | ||
183 | switch (board) { | 187 | switch (board) { |
184 | case MX31SMARTBOT: | 188 | case MX31SMARTBOT: |
185 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); | 189 | imx31_add_fsl_usb2_udc(&usb_pdata); |
186 | break; | 190 | break; |
187 | case MX31EYEBOT: | 191 | case MX31EYEBOT: |
188 | smartbot_otg_host_init(); | 192 | smartbot_otg_host_init(); |
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index 3ec910a7a182..55254b6e9460 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig | |||
@@ -1,20 +1,47 @@ | |||
1 | if ARCH_MX5 | 1 | if ARCH_MX5 |
2 | # ARCH_MX51 and ARCH_MX50 are left for compatibility | ||
3 | |||
4 | config ARCH_MX50 | ||
5 | bool | ||
2 | 6 | ||
3 | config ARCH_MX51 | 7 | config ARCH_MX51 |
4 | bool | 8 | bool |
5 | default y | 9 | |
10 | config ARCH_MX53 | ||
11 | bool | ||
12 | |||
13 | config SOC_IMX50 | ||
14 | bool | ||
15 | select MXC_TZIC | ||
16 | select ARCH_MXC_IOMUX_V3 | ||
17 | select ARCH_MXC_AUDMUX_V2 | ||
18 | select ARCH_HAS_CPUFREQ | ||
19 | select ARCH_MX50 | ||
20 | |||
21 | config SOC_IMX51 | ||
22 | bool | ||
6 | select MXC_TZIC | 23 | select MXC_TZIC |
7 | select ARCH_MXC_IOMUX_V3 | 24 | select ARCH_MXC_IOMUX_V3 |
8 | select ARCH_MXC_AUDMUX_V2 | 25 | select ARCH_MXC_AUDMUX_V2 |
9 | select ARCH_HAS_CPUFREQ | 26 | select ARCH_HAS_CPUFREQ |
27 | select ARCH_MX51 | ||
28 | |||
29 | config SOC_IMX53 | ||
30 | bool | ||
31 | select MXC_TZIC | ||
32 | select ARCH_MXC_IOMUX_V3 | ||
33 | select ARCH_MX53 | ||
10 | 34 | ||
11 | comment "MX5 platforms:" | 35 | comment "MX5 platforms:" |
12 | 36 | ||
13 | config MACH_MX51_BABBAGE | 37 | config MACH_MX51_BABBAGE |
14 | bool "Support MX51 BABBAGE platforms" | 38 | bool "Support MX51 BABBAGE platforms" |
39 | select SOC_IMX51 | ||
40 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
15 | select IMX_HAVE_PLATFORM_IMX_I2C | 41 | select IMX_HAVE_PLATFORM_IMX_I2C |
16 | select IMX_HAVE_PLATFORM_IMX_UART | 42 | select IMX_HAVE_PLATFORM_IMX_UART |
17 | select IMX_HAVE_PLATFORM_ESDHC | 43 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX |
44 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
18 | help | 45 | help |
19 | Include support for MX51 Babbage platform, also known as MX51EVK in | 46 | Include support for MX51 Babbage platform, also known as MX51EVK in |
20 | u-boot. This includes specific configurations for the board and its | 47 | u-boot. This includes specific configurations for the board and its |
@@ -22,7 +49,9 @@ config MACH_MX51_BABBAGE | |||
22 | 49 | ||
23 | config MACH_MX51_3DS | 50 | config MACH_MX51_3DS |
24 | bool "Support MX51PDK (3DS)" | 51 | bool "Support MX51PDK (3DS)" |
52 | select SOC_IMX51 | ||
25 | select IMX_HAVE_PLATFORM_IMX_UART | 53 | select IMX_HAVE_PLATFORM_IMX_UART |
54 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | ||
26 | select IMX_HAVE_PLATFORM_SPI_IMX | 55 | select IMX_HAVE_PLATFORM_SPI_IMX |
27 | select MXC_DEBUG_BOARD | 56 | select MXC_DEBUG_BOARD |
28 | help | 57 | help |
@@ -31,6 +60,7 @@ config MACH_MX51_3DS | |||
31 | 60 | ||
32 | config MACH_EUKREA_CPUIMX51 | 61 | config MACH_EUKREA_CPUIMX51 |
33 | bool "Support Eukrea CPUIMX51 module" | 62 | bool "Support Eukrea CPUIMX51 module" |
63 | select SOC_IMX51 | ||
34 | select IMX_HAVE_PLATFORM_IMX_I2C | 64 | select IMX_HAVE_PLATFORM_IMX_I2C |
35 | select IMX_HAVE_PLATFORM_IMX_UART | 65 | select IMX_HAVE_PLATFORM_IMX_UART |
36 | select IMX_HAVE_PLATFORM_MXC_NAND | 66 | select IMX_HAVE_PLATFORM_MXC_NAND |
@@ -47,7 +77,7 @@ choice | |||
47 | config MACH_EUKREA_MBIMX51_BASEBOARD | 77 | config MACH_EUKREA_MBIMX51_BASEBOARD |
48 | prompt "Eukrea MBIMX51 development board" | 78 | prompt "Eukrea MBIMX51 development board" |
49 | bool | 79 | bool |
50 | select IMX_HAVE_PLATFORM_ESDHC | 80 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX |
51 | help | 81 | help |
52 | This adds board specific devices that can be found on Eukrea's | 82 | This adds board specific devices that can be found on Eukrea's |
53 | MBIMX51 evaluation board. | 83 | MBIMX51 evaluation board. |
@@ -56,6 +86,7 @@ endchoice | |||
56 | 86 | ||
57 | config MACH_EUKREA_CPUIMX51SD | 87 | config MACH_EUKREA_CPUIMX51SD |
58 | bool "Support Eukrea CPUIMX51SD module" | 88 | bool "Support Eukrea CPUIMX51SD module" |
89 | select SOC_IMX51 | ||
59 | select IMX_HAVE_PLATFORM_IMX_I2C | 90 | select IMX_HAVE_PLATFORM_IMX_I2C |
60 | select IMX_HAVE_PLATFORM_SPI_IMX | 91 | select IMX_HAVE_PLATFORM_SPI_IMX |
61 | select IMX_HAVE_PLATFORM_IMX_UART | 92 | select IMX_HAVE_PLATFORM_IMX_UART |
@@ -72,7 +103,7 @@ choice | |||
72 | config MACH_EUKREA_MBIMXSD51_BASEBOARD | 103 | config MACH_EUKREA_MBIMXSD51_BASEBOARD |
73 | prompt "Eukrea MBIMXSD development board" | 104 | prompt "Eukrea MBIMXSD development board" |
74 | bool | 105 | bool |
75 | select IMX_HAVE_PLATFORM_ESDHC | 106 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX |
76 | help | 107 | help |
77 | This adds board specific devices that can be found on Eukrea's | 108 | This adds board specific devices that can be found on Eukrea's |
78 | MBIMXSD evaluation board. | 109 | MBIMXSD evaluation board. |
@@ -81,9 +112,33 @@ endchoice | |||
81 | 112 | ||
82 | config MACH_MX51_EFIKAMX | 113 | config MACH_MX51_EFIKAMX |
83 | bool "Support MX51 Genesi Efika MX nettop" | 114 | bool "Support MX51 Genesi Efika MX nettop" |
115 | select SOC_IMX51 | ||
84 | select IMX_HAVE_PLATFORM_IMX_UART | 116 | select IMX_HAVE_PLATFORM_IMX_UART |
117 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | ||
118 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
85 | help | 119 | help |
86 | Include support for Genesi Efika MX nettop. This includes specific | 120 | Include support for Genesi Efika MX nettop. This includes specific |
87 | configurations for the board and its peripherals. | 121 | configurations for the board and its peripherals. |
88 | 122 | ||
123 | config MACH_MX53_EVK | ||
124 | bool "Support MX53 EVK platforms" | ||
125 | select SOC_IMX53 | ||
126 | select IMX_HAVE_PLATFORM_IMX_UART | ||
127 | help | ||
128 | Include support for MX53 EVK platform. This includes specific | ||
129 | configurations for the board and its peripherals. | ||
130 | |||
131 | |||
132 | config MACH_MX50_RDP | ||
133 | bool "Support MX50 reference design platform" | ||
134 | depends on BROKEN | ||
135 | select SOC_IMX50 | ||
136 | select IMX_HAVE_PLATFORM_IMX_I2C | ||
137 | select IMX_HAVE_PLATFORM_IMX_UART | ||
138 | select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | ||
139 | select IMX_HAVE_PLATFORM_SPI_IMX | ||
140 | help | ||
141 | Include support for MX50 reference design platform (RDP) board. This | ||
142 | includes specific configurations for the board and its peripherals. | ||
143 | |||
89 | endif | 144 | endif |
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile index 462f177eddfe..0c398baf11fe 100644 --- a/arch/arm/mach-mx5/Makefile +++ b/arch/arm/mach-mx5/Makefile | |||
@@ -3,13 +3,16 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Object file lists. | 5 | # Object file lists. |
6 | obj-y := cpu.o mm.o clock-mx51.o devices.o | 6 | obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o |
7 | obj-$(CONFIG_SOC_IMX50) += mm-mx50.o | ||
7 | 8 | ||
8 | obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o | 9 | obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o |
9 | obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o | 10 | obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o |
10 | obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o | 11 | obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o |
12 | obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o | ||
11 | obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o | 13 | obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o |
12 | obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o | 14 | obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o |
13 | obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o | 15 | obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o |
14 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o | 16 | obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o |
15 | obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o | 17 | obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o |
18 | obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o | ||
diff --git a/arch/arm/mach-mx5/Makefile.boot b/arch/arm/mach-mx5/Makefile.boot index 9939a19d99a1..e928be1b6757 100644 --- a/arch/arm/mach-mx5/Makefile.boot +++ b/arch/arm/mach-mx5/Makefile.boot | |||
@@ -1,3 +1,9 @@ | |||
1 | zreladdr-y := 0x90008000 | 1 | zreladdr-$(CONFIG_ARCH_MX50) := 0x70008000 |
2 | params_phys-y := 0x90000100 | 2 | params_phys-$(CONFIG_ARCH_MX50) := 0x70000100 |
3 | initrd_phys-y := 0x90800000 | 3 | initrd_phys-$(CONFIG_ARCH_MX50) := 0x70800000 |
4 | zreladdr-$(CONFIG_ARCH_MX51) := 0x90008000 | ||
5 | params_phys-$(CONFIG_ARCH_MX51) := 0x90000100 | ||
6 | initrd_phys-$(CONFIG_ARCH_MX51) := 0x90800000 | ||
7 | zreladdr-$(CONFIG_ARCH_MX53) := 0x70008000 | ||
8 | params_phys-$(CONFIG_ARCH_MX53) := 0x70000100 | ||
9 | initrd_phys-$(CONFIG_ARCH_MX53) := 0x70800000 | ||
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c index 6a9792fd0a76..f8652ef25f85 100644 --- a/arch/arm/mach-mx5/board-cpuimx51.c +++ b/arch/arm/mach-mx5/board-cpuimx51.c | |||
@@ -40,11 +40,11 @@ | |||
40 | #include "devices-imx51.h" | 40 | #include "devices-imx51.h" |
41 | #include "devices.h" | 41 | #include "devices.h" |
42 | 42 | ||
43 | #define CPUIMX51_USBH1_STP (0*32 + 27) | 43 | #define CPUIMX51_USBH1_STP IMX_GPIO_NR(1, 27) |
44 | #define CPUIMX51_QUARTA_GPIO (2*32 + 28) | 44 | #define CPUIMX51_QUARTA_GPIO IMX_GPIO_NR(3, 28) |
45 | #define CPUIMX51_QUARTB_GPIO (2*32 + 25) | 45 | #define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25) |
46 | #define CPUIMX51_QUARTC_GPIO (2*32 + 26) | 46 | #define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26) |
47 | #define CPUIMX51_QUARTD_GPIO (2*32 + 27) | 47 | #define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27) |
48 | #define CPUIMX51_QUARTA_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO) | 48 | #define CPUIMX51_QUARTA_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO) |
49 | #define CPUIMX51_QUARTB_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO) | 49 | #define CPUIMX51_QUARTB_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO) |
50 | #define CPUIMX51_QUARTC_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO) | 50 | #define CPUIMX51_QUARTC_IRQ (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO) |
@@ -113,7 +113,7 @@ static struct platform_device *devices[] __initdata = { | |||
113 | #endif | 113 | #endif |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static struct pad_desc eukrea_cpuimx51_pads[] = { | 116 | static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = { |
117 | /* UART1 */ | 117 | /* UART1 */ |
118 | MX51_PAD_UART1_RXD__UART1_RXD, | 118 | MX51_PAD_UART1_RXD__UART1_RXD, |
119 | MX51_PAD_UART1_TXD__UART1_TXD, | 119 | MX51_PAD_UART1_TXD__UART1_TXD, |
@@ -121,15 +121,15 @@ static struct pad_desc eukrea_cpuimx51_pads[] = { | |||
121 | MX51_PAD_UART1_CTS__UART1_CTS, | 121 | MX51_PAD_UART1_CTS__UART1_CTS, |
122 | 122 | ||
123 | /* I2C2 */ | 123 | /* I2C2 */ |
124 | MX51_PAD_GPIO_1_2__I2C2_SCL, | 124 | MX51_PAD_GPIO1_2__I2C2_SCL, |
125 | MX51_PAD_GPIO_1_3__I2C2_SDA, | 125 | MX51_PAD_GPIO1_3__I2C2_SDA, |
126 | MX51_PAD_NANDF_D10__GPIO_3_30, | 126 | MX51_PAD_NANDF_D10__GPIO3_30, |
127 | 127 | ||
128 | /* QUART IRQ */ | 128 | /* QUART IRQ */ |
129 | MX51_PAD_NANDF_D15__GPIO_3_25, | 129 | MX51_PAD_NANDF_D15__GPIO3_25, |
130 | MX51_PAD_NANDF_D14__GPIO_3_26, | 130 | MX51_PAD_NANDF_D14__GPIO3_26, |
131 | MX51_PAD_NANDF_D13__GPIO_3_27, | 131 | MX51_PAD_NANDF_D13__GPIO3_27, |
132 | MX51_PAD_NANDF_D12__GPIO_3_28, | 132 | MX51_PAD_NANDF_D12__GPIO3_28, |
133 | 133 | ||
134 | /* USB HOST1 */ | 134 | /* USB HOST1 */ |
135 | MX51_PAD_USBH1_CLK__USBH1_CLK, | 135 | MX51_PAD_USBH1_CLK__USBH1_CLK, |
@@ -178,6 +178,8 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
178 | void __iomem *usbother_base; | 178 | void __iomem *usbother_base; |
179 | 179 | ||
180 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 180 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
181 | if (!usb_base) | ||
182 | return -ENOMEM; | ||
181 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 183 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
182 | 184 | ||
183 | /* Set the PHY clock to 19.2MHz */ | 185 | /* Set the PHY clock to 19.2MHz */ |
@@ -196,6 +198,8 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
196 | void __iomem *usbother_base; | 198 | void __iomem *usbother_base; |
197 | 199 | ||
198 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 200 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
201 | if (!usb_base) | ||
202 | return -ENOMEM; | ||
199 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 203 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
200 | 204 | ||
201 | /* The clock for the USBH1 ULPI port will come externally from the PHY. */ | 205 | /* The clock for the USBH1 ULPI port will come externally from the PHY. */ |
@@ -292,7 +296,7 @@ static struct sys_timer mxc_timer = { | |||
292 | 296 | ||
293 | MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module") | 297 | MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module") |
294 | /* Maintainer: Eric Bénard <eric@eukrea.com> */ | 298 | /* Maintainer: Eric Bénard <eric@eukrea.com> */ |
295 | .boot_params = PHYS_OFFSET + 0x100, | 299 | .boot_params = MX51_PHYS_OFFSET + 0x100, |
296 | .map_io = mx51_map_io, | 300 | .map_io = mx51_map_io, |
297 | .init_irq = mx51_init_irq, | 301 | .init_irq = mx51_init_irq, |
298 | .init_machine = eukrea_cpuimx51_init, | 302 | .init_machine = eukrea_cpuimx51_init, |
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c index 4b3a6119c5fb..ad931895d8b6 100644 --- a/arch/arm/mach-mx5/board-cpuimx51sd.c +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c | |||
@@ -43,19 +43,19 @@ | |||
43 | #include "devices-imx51.h" | 43 | #include "devices-imx51.h" |
44 | #include "devices.h" | 44 | #include "devices.h" |
45 | 45 | ||
46 | #define USBH1_RST (1*32 + 28) | 46 | #define USBH1_RST IMX_GPIO_NR(2, 28) |
47 | #define ETH_RST (1*32 + 31) | 47 | #define ETH_RST IMX_GPIO_NR(2, 31) |
48 | #define TSC2007_IRQGPIO (2*32 + 12) | 48 | #define TSC2007_IRQGPIO IMX_GPIO_NR(3, 12) |
49 | #define CAN_IRQGPIO (0*32 + 1) | 49 | #define CAN_IRQGPIO IMX_GPIO_NR(1, 1) |
50 | #define CAN_RST (3*32 + 15) | 50 | #define CAN_RST IMX_GPIO_NR(4, 15) |
51 | #define CAN_NCS (3*32 + 24) | 51 | #define CAN_NCS IMX_GPIO_NR(4, 24) |
52 | #define CAN_RXOBF (0*32 + 4) | 52 | #define CAN_RXOBF IMX_GPIO_NR(1, 4) |
53 | #define CAN_RX1BF (0*32 + 6) | 53 | #define CAN_RX1BF IMX_GPIO_NR(1, 6) |
54 | #define CAN_TXORTS (0*32 + 7) | 54 | #define CAN_TXORTS IMX_GPIO_NR(1, 7) |
55 | #define CAN_TX1RTS (0*32 + 8) | 55 | #define CAN_TX1RTS IMX_GPIO_NR(1, 8) |
56 | #define CAN_TX2RTS (0*32 + 9) | 56 | #define CAN_TX2RTS IMX_GPIO_NR(1, 9) |
57 | #define I2C_SCL (3*32 + 16) | 57 | #define I2C_SCL IMX_GPIO_NR(4, 16) |
58 | #define I2C_SDA (3*32 + 17) | 58 | #define I2C_SDA IMX_GPIO_NR(4, 17) |
59 | 59 | ||
60 | /* USB_CTRL_1 */ | 60 | /* USB_CTRL_1 */ |
61 | #define MX51_USB_CTRL_1_OFFSET 0x10 | 61 | #define MX51_USB_CTRL_1_OFFSET 0x10 |
@@ -65,10 +65,7 @@ | |||
65 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 | 65 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 |
66 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 | 66 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 |
67 | 67 | ||
68 | #define CPUIMX51SD_GPIO_3_12 IOMUX_PAD(0x57C, 0x194, 3, 0x0, 0, \ | 68 | static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = { |
69 | MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) | ||
70 | |||
71 | static struct pad_desc eukrea_cpuimx51sd_pads[] = { | ||
72 | /* UART1 */ | 69 | /* UART1 */ |
73 | MX51_PAD_UART1_RXD__UART1_RXD, | 70 | MX51_PAD_UART1_RXD__UART1_RXD, |
74 | MX51_PAD_UART1_TXD__UART1_TXD, | 71 | MX51_PAD_UART1_TXD__UART1_TXD, |
@@ -88,30 +85,33 @@ static struct pad_desc eukrea_cpuimx51sd_pads[] = { | |||
88 | MX51_PAD_USBH1_DATA6__USBH1_DATA6, | 85 | MX51_PAD_USBH1_DATA6__USBH1_DATA6, |
89 | MX51_PAD_USBH1_DATA7__USBH1_DATA7, | 86 | MX51_PAD_USBH1_DATA7__USBH1_DATA7, |
90 | MX51_PAD_USBH1_STP__USBH1_STP, | 87 | MX51_PAD_USBH1_STP__USBH1_STP, |
91 | MX51_PAD_EIM_CS3__GPIO_2_28, /* PHY nRESET */ | 88 | MX51_PAD_EIM_CS3__GPIO2_28, /* PHY nRESET */ |
92 | 89 | ||
93 | /* FEC */ | 90 | /* FEC */ |
94 | MX51_PAD_EIM_DTACK__GPIO_2_31, /* PHY nRESET */ | 91 | MX51_PAD_EIM_DTACK__GPIO2_31, /* PHY nRESET */ |
95 | 92 | ||
96 | /* HSI2C */ | 93 | /* HSI2C */ |
97 | MX51_PAD_I2C1_CLK__GPIO_4_16, | 94 | MX51_PAD_I2C1_CLK__GPIO4_16, |
98 | MX51_PAD_I2C1_DAT__GPIO_4_17, | 95 | MX51_PAD_I2C1_DAT__GPIO4_17, |
99 | 96 | ||
100 | /* CAN */ | 97 | /* CAN */ |
101 | MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, | 98 | MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, |
102 | MX51_PAD_CSPI1_MISO__ECSPI1_MISO, | 99 | MX51_PAD_CSPI1_MISO__ECSPI1_MISO, |
103 | MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, | 100 | MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, |
104 | MX51_PAD_CSPI1_SS0__GPIO_4_24, /* nCS */ | 101 | MX51_PAD_CSPI1_SS0__GPIO4_24, /* nCS */ |
105 | MX51_PAD_CSI2_PIXCLK__GPIO_4_15, /* nReset */ | 102 | MX51_PAD_CSI2_PIXCLK__GPIO4_15, /* nReset */ |
106 | MX51_PAD_GPIO_1_1__GPIO_1_1, /* IRQ */ | 103 | MX51_PAD_GPIO1_1__GPIO1_1, /* IRQ */ |
107 | MX51_PAD_GPIO_1_4__GPIO_1_4, /* Control signals */ | 104 | MX51_PAD_GPIO1_4__GPIO1_4, /* Control signals */ |
108 | MX51_PAD_GPIO_1_6__GPIO_1_6, | 105 | MX51_PAD_GPIO1_6__GPIO1_6, |
109 | MX51_PAD_GPIO_1_7__GPIO_1_7, | 106 | MX51_PAD_GPIO1_7__GPIO1_7, |
110 | MX51_PAD_GPIO_1_8__GPIO_1_8, | 107 | MX51_PAD_GPIO1_8__GPIO1_8, |
111 | MX51_PAD_GPIO_1_9__GPIO_1_9, | 108 | MX51_PAD_GPIO1_9__GPIO1_9, |
112 | 109 | ||
113 | /* Touchscreen */ | 110 | /* Touchscreen */ |
114 | CPUIMX51SD_GPIO_3_12, /* IRQ */ | 111 | /* IRQ */ |
112 | _MX51_PAD_CSI1_D8__GPIO3_12 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | | ||
113 | PAD_CTL_PKE | PAD_CTL_SRE_FAST | | ||
114 | PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), | ||
115 | }; | 115 | }; |
116 | 116 | ||
117 | static const struct imxuart_platform_data uart_pdata __initconst = { | 117 | static const struct imxuart_platform_data uart_pdata __initconst = { |
@@ -157,6 +157,8 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
157 | void __iomem *usbother_base; | 157 | void __iomem *usbother_base; |
158 | 158 | ||
159 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 159 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
160 | if (!usb_base) | ||
161 | return -ENOMEM; | ||
160 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 162 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
161 | 163 | ||
162 | /* Set the PHY clock to 19.2MHz */ | 164 | /* Set the PHY clock to 19.2MHz */ |
@@ -175,6 +177,8 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
175 | void __iomem *usbother_base; | 177 | void __iomem *usbother_base; |
176 | 178 | ||
177 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 179 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
180 | if (!usb_base) | ||
181 | return -ENOMEM; | ||
178 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 182 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
179 | 183 | ||
180 | /* The clock for the USBH1 ULPI port will come from the PHY. */ | 184 | /* The clock for the USBH1 ULPI port will come from the PHY. */ |
@@ -243,7 +247,7 @@ static struct spi_board_info cpuimx51sd_spi_device[] = { | |||
243 | .mode = SPI_MODE_0, | 247 | .mode = SPI_MODE_0, |
244 | .chip_select = 0, | 248 | .chip_select = 0, |
245 | .platform_data = &mcp251x_info, | 249 | .platform_data = &mcp251x_info, |
246 | .irq = gpio_to_irq(0 * 32 + 1) | 250 | .irq = gpio_to_irq(CAN_IRQGPIO) |
247 | }, | 251 | }, |
248 | }; | 252 | }; |
249 | 253 | ||
@@ -323,7 +327,7 @@ static struct sys_timer mxc_timer = { | |||
323 | 327 | ||
324 | MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD") | 328 | MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD") |
325 | /* Maintainer: Eric Bénard <eric@eukrea.com> */ | 329 | /* Maintainer: Eric Bénard <eric@eukrea.com> */ |
326 | .boot_params = PHYS_OFFSET + 0x100, | 330 | .boot_params = MX51_PHYS_OFFSET + 0x100, |
327 | .map_io = mx51_map_io, | 331 | .map_io = mx51_map_io, |
328 | .init_irq = mx51_init_irq, | 332 | .init_irq = mx51_init_irq, |
329 | .init_machine = eukrea_cpuimx51sd_init, | 333 | .init_machine = eukrea_cpuimx51sd_init, |
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c new file mode 100644 index 000000000000..fd32e4c450e8 --- /dev/null +++ b/arch/arm/mach-mx5/board-mx50_rdp.c | |||
@@ -0,0 +1,197 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | |||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | |||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/init.h> | ||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/gpio.h> | ||
24 | #include <linux/delay.h> | ||
25 | #include <linux/io.h> | ||
26 | #include <linux/fsl_devices.h> | ||
27 | |||
28 | #include <mach/common.h> | ||
29 | #include <mach/hardware.h> | ||
30 | #include <mach/iomux-mx50.h> | ||
31 | |||
32 | #include <asm/irq.h> | ||
33 | #include <asm/setup.h> | ||
34 | #include <asm/mach-types.h> | ||
35 | #include <asm/mach/arch.h> | ||
36 | #include <asm/mach/time.h> | ||
37 | |||
38 | #include "devices-mx50.h" | ||
39 | |||
40 | static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = { | ||
41 | /* SD1 */ | ||
42 | MX50_PAD_ECSPI2_SS0__GPIO_4_19, | ||
43 | MX50_PAD_EIM_CRE__GPIO_1_27, | ||
44 | MX50_PAD_SD1_CMD__SD1_CMD, | ||
45 | |||
46 | MX50_PAD_SD1_CLK__SD1_CLK, | ||
47 | MX50_PAD_SD1_D0__SD1_D0, | ||
48 | MX50_PAD_SD1_D1__SD1_D1, | ||
49 | MX50_PAD_SD1_D2__SD1_D2, | ||
50 | MX50_PAD_SD1_D3__SD1_D3, | ||
51 | |||
52 | /* SD2 */ | ||
53 | MX50_PAD_SD2_CD__GPIO_5_17, | ||
54 | MX50_PAD_SD2_WP__GPIO_5_16, | ||
55 | MX50_PAD_SD2_CMD__SD2_CMD, | ||
56 | MX50_PAD_SD2_CLK__SD2_CLK, | ||
57 | MX50_PAD_SD2_D0__SD2_D0, | ||
58 | MX50_PAD_SD2_D1__SD2_D1, | ||
59 | MX50_PAD_SD2_D2__SD2_D2, | ||
60 | MX50_PAD_SD2_D3__SD2_D3, | ||
61 | MX50_PAD_SD2_D4__SD2_D4, | ||
62 | MX50_PAD_SD2_D5__SD2_D5, | ||
63 | MX50_PAD_SD2_D6__SD2_D6, | ||
64 | MX50_PAD_SD2_D7__SD2_D7, | ||
65 | |||
66 | /* SD3 */ | ||
67 | MX50_PAD_SD3_CMD__SD3_CMD, | ||
68 | MX50_PAD_SD3_CLK__SD3_CLK, | ||
69 | MX50_PAD_SD3_D0__SD3_D0, | ||
70 | MX50_PAD_SD3_D1__SD3_D1, | ||
71 | MX50_PAD_SD3_D2__SD3_D2, | ||
72 | MX50_PAD_SD3_D3__SD3_D3, | ||
73 | MX50_PAD_SD3_D4__SD3_D4, | ||
74 | MX50_PAD_SD3_D5__SD3_D5, | ||
75 | MX50_PAD_SD3_D6__SD3_D6, | ||
76 | MX50_PAD_SD3_D7__SD3_D7, | ||
77 | |||
78 | /* PWR_INT */ | ||
79 | MX50_PAD_ECSPI2_MISO__GPIO_4_18, | ||
80 | |||
81 | /* UART pad setting */ | ||
82 | MX50_PAD_UART1_TXD__UART1_TXD, | ||
83 | MX50_PAD_UART1_RXD__UART1_RXD, | ||
84 | MX50_PAD_UART1_RTS__UART1_RTS, | ||
85 | MX50_PAD_UART2_TXD__UART2_TXD, | ||
86 | MX50_PAD_UART2_RXD__UART2_RXD, | ||
87 | MX50_PAD_UART2_CTS__UART2_CTS, | ||
88 | MX50_PAD_UART2_RTS__UART2_RTS, | ||
89 | |||
90 | MX50_PAD_I2C1_SCL__I2C1_SCL, | ||
91 | MX50_PAD_I2C1_SDA__I2C1_SDA, | ||
92 | MX50_PAD_I2C2_SCL__I2C2_SCL, | ||
93 | MX50_PAD_I2C2_SDA__I2C2_SDA, | ||
94 | |||
95 | MX50_PAD_EPITO__USBH1_PWR, | ||
96 | /* Need to comment below line if | ||
97 | * one needs to debug owire. | ||
98 | */ | ||
99 | MX50_PAD_OWIRE__USBH1_OC, | ||
100 | /* using gpio to control otg pwr */ | ||
101 | MX50_PAD_PWM2__GPIO_6_25, | ||
102 | MX50_PAD_I2C3_SCL__USBOTG_OC, | ||
103 | |||
104 | MX50_PAD_SSI_RXC__FEC_MDIO, | ||
105 | MX50_PAD_SSI_RXC__FEC_MDIO, | ||
106 | MX50_PAD_DISP_D0__FEC_TXCLK, | ||
107 | MX50_PAD_DISP_D1__FEC_RX_ER, | ||
108 | MX50_PAD_DISP_D2__FEC_RX_DV, | ||
109 | MX50_PAD_DISP_D3__FEC_RXD1, | ||
110 | MX50_PAD_DISP_D4__FEC_RXD0, | ||
111 | MX50_PAD_DISP_D5__FEC_TX_EN, | ||
112 | MX50_PAD_DISP_D6__FEC_TXD1, | ||
113 | MX50_PAD_DISP_D7__FEC_TXD0, | ||
114 | MX50_PAD_SSI_RXFS__FEC_MDC, | ||
115 | MX50_PAD_I2C3_SDA__GPIO_6_23, | ||
116 | MX50_PAD_ECSPI1_SCLK__GPIO_4_12, | ||
117 | |||
118 | MX50_PAD_CSPI_SS0__CSPI_SS0, | ||
119 | MX50_PAD_ECSPI1_MOSI__CSPI_SS1, | ||
120 | MX50_PAD_CSPI_MOSI__CSPI_MOSI, | ||
121 | MX50_PAD_CSPI_MISO__CSPI_MISO, | ||
122 | |||
123 | /* SGTL500_OSC_EN */ | ||
124 | MX50_PAD_UART1_CTS__GPIO_6_8, | ||
125 | |||
126 | /* SGTL_AMP_SHDN */ | ||
127 | MX50_PAD_UART3_RXD__GPIO_6_15, | ||
128 | |||
129 | /* Keypad */ | ||
130 | MX50_PAD_KEY_COL0__KEY_COL0, | ||
131 | MX50_PAD_KEY_ROW0__KEY_ROW0, | ||
132 | MX50_PAD_KEY_COL1__KEY_COL1, | ||
133 | MX50_PAD_KEY_ROW1__KEY_ROW1, | ||
134 | MX50_PAD_KEY_COL2__KEY_COL2, | ||
135 | MX50_PAD_KEY_ROW2__KEY_ROW2, | ||
136 | MX50_PAD_KEY_COL3__KEY_COL3, | ||
137 | MX50_PAD_KEY_ROW3__KEY_ROW3, | ||
138 | MX50_PAD_EIM_DA0__KEY_COL4, | ||
139 | MX50_PAD_EIM_DA1__KEY_ROW4, | ||
140 | MX50_PAD_EIM_DA2__KEY_COL5, | ||
141 | MX50_PAD_EIM_DA3__KEY_ROW5, | ||
142 | MX50_PAD_EIM_DA4__KEY_COL6, | ||
143 | MX50_PAD_EIM_DA5__KEY_ROW6, | ||
144 | MX50_PAD_EIM_DA6__KEY_COL7, | ||
145 | MX50_PAD_EIM_DA7__KEY_ROW7, | ||
146 | /*EIM pads */ | ||
147 | MX50_PAD_EIM_DA8__GPIO_1_8, | ||
148 | MX50_PAD_EIM_DA9__GPIO_1_9, | ||
149 | MX50_PAD_EIM_DA10__GPIO_1_10, | ||
150 | MX50_PAD_EIM_DA11__GPIO_1_11, | ||
151 | MX50_PAD_EIM_DA12__GPIO_1_12, | ||
152 | MX50_PAD_EIM_DA13__GPIO_1_13, | ||
153 | MX50_PAD_EIM_DA14__GPIO_1_14, | ||
154 | MX50_PAD_EIM_DA15__GPIO_1_15, | ||
155 | MX50_PAD_EIM_CS2__GPIO_1_16, | ||
156 | MX50_PAD_EIM_CS1__GPIO_1_17, | ||
157 | MX50_PAD_EIM_CS0__GPIO_1_18, | ||
158 | MX50_PAD_EIM_EB0__GPIO_1_19, | ||
159 | MX50_PAD_EIM_EB1__GPIO_1_20, | ||
160 | MX50_PAD_EIM_WAIT__GPIO_1_21, | ||
161 | MX50_PAD_EIM_BCLK__GPIO_1_22, | ||
162 | MX50_PAD_EIM_RDY__GPIO_1_23, | ||
163 | MX50_PAD_EIM_OE__GPIO_1_24, | ||
164 | }; | ||
165 | |||
166 | /* Serial ports */ | ||
167 | static const struct imxuart_platform_data uart_pdata __initconst = { | ||
168 | .flags = IMXUART_HAVE_RTSCTS, | ||
169 | }; | ||
170 | |||
171 | /* | ||
172 | * Board specific initialization. | ||
173 | */ | ||
174 | static void __init mx50_rdp_board_init(void) | ||
175 | { | ||
176 | mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads, | ||
177 | ARRAY_SIZE(mx50_rdp_pads)); | ||
178 | |||
179 | imx50_add_imx_uart(0, &uart_pdata); | ||
180 | imx50_add_imx_uart(1, &uart_pdata); | ||
181 | } | ||
182 | |||
183 | static void __init mx50_rdp_timer_init(void) | ||
184 | { | ||
185 | mx50_clocks_init(32768, 24000000, 22579200); | ||
186 | } | ||
187 | |||
188 | static struct sys_timer mx50_rdp_timer = { | ||
189 | .init = mx50_rdp_timer_init, | ||
190 | }; | ||
191 | |||
192 | MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform") | ||
193 | .map_io = mx50_map_io, | ||
194 | .init_irq = mx50_init_irq, | ||
195 | .init_machine = mx50_rdp_board_init, | ||
196 | .timer = &mx50_rdp_timer, | ||
197 | MACHINE_END | ||
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c index 79ce8dcf3cda..e42bd2eb034e 100644 --- a/arch/arm/mach-mx5/board-mx51_3ds.c +++ b/arch/arm/mach-mx5/board-mx51_3ds.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) | 30 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) |
31 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) | 31 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) |
32 | 32 | ||
33 | static struct pad_desc mx51_3ds_pads[] = { | 33 | static iomux_v3_cfg_t mx51_3ds_pads[] = { |
34 | /* UART1 */ | 34 | /* UART1 */ |
35 | MX51_PAD_UART1_RXD__UART1_RXD, | 35 | MX51_PAD_UART1_RXD__UART1_RXD, |
36 | MX51_PAD_UART1_TXD__UART1_TXD, | 36 | MX51_PAD_UART1_TXD__UART1_TXD, |
@@ -50,7 +50,7 @@ static struct pad_desc mx51_3ds_pads[] = { | |||
50 | MX51_PAD_EIM_D27__UART3_RTS, | 50 | MX51_PAD_EIM_D27__UART3_RTS, |
51 | 51 | ||
52 | /* CPLD PARENT IRQ PIN */ | 52 | /* CPLD PARENT IRQ PIN */ |
53 | MX51_PAD_GPIO_1_6__GPIO_1_6, | 53 | MX51_PAD_GPIO1_6__GPIO1_6, |
54 | 54 | ||
55 | /* KPP */ | 55 | /* KPP */ |
56 | MX51_PAD_KEY_ROW0__KEY_ROW0, | 56 | MX51_PAD_KEY_ROW0__KEY_ROW0, |
@@ -68,7 +68,7 @@ static struct pad_desc mx51_3ds_pads[] = { | |||
68 | MX51_PAD_NANDF_RB2__ECSPI2_SCLK, | 68 | MX51_PAD_NANDF_RB2__ECSPI2_SCLK, |
69 | MX51_PAD_NANDF_RB3__ECSPI2_MISO, | 69 | MX51_PAD_NANDF_RB3__ECSPI2_MISO, |
70 | MX51_PAD_NANDF_D15__ECSPI2_MOSI, | 70 | MX51_PAD_NANDF_D15__ECSPI2_MOSI, |
71 | MX51_PAD_NANDF_D12__GPIO_3_28, | 71 | MX51_PAD_NANDF_D12__GPIO3_28, |
72 | }; | 72 | }; |
73 | 73 | ||
74 | /* Serial ports */ | 74 | /* Serial ports */ |
@@ -172,6 +172,7 @@ static void __init mxc_board_init(void) | |||
172 | printk(KERN_WARNING "Init of the debugboard failed, all " | 172 | printk(KERN_WARNING "Init of the debugboard failed, all " |
173 | "devices on the board are unusable.\n"); | 173 | "devices on the board are unusable.\n"); |
174 | 174 | ||
175 | imx51_add_sdhci_esdhc_imx(0, NULL); | ||
175 | mxc_init_keypad(); | 176 | mxc_init_keypad(); |
176 | } | 177 | } |
177 | 178 | ||
@@ -186,7 +187,7 @@ static struct sys_timer mxc_timer = { | |||
186 | 187 | ||
187 | MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") | 188 | MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") |
188 | /* Maintainer: Freescale Semiconductor, Inc. */ | 189 | /* Maintainer: Freescale Semiconductor, Inc. */ |
189 | .boot_params = PHYS_OFFSET + 0x100, | 190 | .boot_params = MX51_PHYS_OFFSET + 0x100, |
190 | .map_io = mx51_map_io, | 191 | .map_io = mx51_map_io, |
191 | .init_irq = mx51_init_irq, | 192 | .init_irq = mx51_init_irq, |
192 | .init_machine = mxc_board_init, | 193 | .init_machine = mxc_board_init, |
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index acbe30df2e69..1d231e84107c 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/fec.h> | 20 | #include <linux/fec.h> |
21 | #include <linux/gpio_keys.h> | 21 | #include <linux/gpio_keys.h> |
22 | #include <linux/input.h> | 22 | #include <linux/input.h> |
23 | #include <linux/spi/flash.h> | ||
24 | #include <linux/spi/spi.h> | ||
23 | 25 | ||
24 | #include <mach/common.h> | 26 | #include <mach/common.h> |
25 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
@@ -36,11 +38,13 @@ | |||
36 | #include "devices.h" | 38 | #include "devices.h" |
37 | #include "cpu_op-mx51.h" | 39 | #include "cpu_op-mx51.h" |
38 | 40 | ||
39 | #define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ | 41 | #define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7) |
40 | #define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ | 42 | #define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27) |
41 | #define BABBAGE_PHY_RESET (1*32 + 5) /* GPIO_2_5 */ | 43 | #define BABBAGE_PHY_RESET IMX_GPIO_NR(2, 5) |
42 | #define BABBAGE_FEC_PHY_RESET (1*32 + 14) /* GPIO_2_14 */ | 44 | #define BABBAGE_FEC_PHY_RESET IMX_GPIO_NR(2, 14) |
43 | #define BABBAGE_POWER_KEY (1*32 + 21) /* GPIO_2_21 */ | 45 | #define BABBAGE_POWER_KEY IMX_GPIO_NR(2, 21) |
46 | #define BABBAGE_ECSPI1_CS0 IMX_GPIO_NR(4, 24) | ||
47 | #define BABBAGE_ECSPI1_CS1 IMX_GPIO_NR(4, 25) | ||
44 | 48 | ||
45 | /* USB_CTRL_1 */ | 49 | /* USB_CTRL_1 */ |
46 | #define MX51_USB_CTRL_1_OFFSET 0x10 | 50 | #define MX51_USB_CTRL_1_OFFSET 0x10 |
@@ -65,7 +69,7 @@ static const struct gpio_keys_platform_data imx_button_data __initconst = { | |||
65 | .nbuttons = ARRAY_SIZE(babbage_buttons), | 69 | .nbuttons = ARRAY_SIZE(babbage_buttons), |
66 | }; | 70 | }; |
67 | 71 | ||
68 | static struct pad_desc mx51babbage_pads[] = { | 72 | static iomux_v3_cfg_t mx51babbage_pads[] = { |
69 | /* UART1 */ | 73 | /* UART1 */ |
70 | MX51_PAD_UART1_RXD__UART1_RXD, | 74 | MX51_PAD_UART1_RXD__UART1_RXD, |
71 | MX51_PAD_UART1_TXD__UART1_TXD, | 75 | MX51_PAD_UART1_TXD__UART1_TXD, |
@@ -91,8 +95,8 @@ static struct pad_desc mx51babbage_pads[] = { | |||
91 | MX51_PAD_KEY_COL5__I2C2_SDA, | 95 | MX51_PAD_KEY_COL5__I2C2_SDA, |
92 | 96 | ||
93 | /* HSI2C */ | 97 | /* HSI2C */ |
94 | MX51_PAD_I2C1_CLK__HSI2C_CLK, | 98 | MX51_PAD_I2C1_CLK__I2C1_CLK, |
95 | MX51_PAD_I2C1_DAT__HSI2C_DAT, | 99 | MX51_PAD_I2C1_DAT__I2C1_DAT, |
96 | 100 | ||
97 | /* USB HOST1 */ | 101 | /* USB HOST1 */ |
98 | MX51_PAD_USBH1_CLK__USBH1_CLK, | 102 | MX51_PAD_USBH1_CLK__USBH1_CLK, |
@@ -108,29 +112,29 @@ static struct pad_desc mx51babbage_pads[] = { | |||
108 | MX51_PAD_USBH1_DATA7__USBH1_DATA7, | 112 | MX51_PAD_USBH1_DATA7__USBH1_DATA7, |
109 | 113 | ||
110 | /* USB HUB reset line*/ | 114 | /* USB HUB reset line*/ |
111 | MX51_PAD_GPIO_1_7__GPIO_1_7, | 115 | MX51_PAD_GPIO1_7__GPIO1_7, |
112 | 116 | ||
113 | /* FEC */ | 117 | /* FEC */ |
114 | MX51_PAD_EIM_EB2__FEC_MDIO, | 118 | MX51_PAD_EIM_EB2__FEC_MDIO, |
115 | MX51_PAD_EIM_EB3__FEC_RDAT1, | 119 | MX51_PAD_EIM_EB3__FEC_RDATA1, |
116 | MX51_PAD_EIM_CS2__FEC_RDAT2, | 120 | MX51_PAD_EIM_CS2__FEC_RDATA2, |
117 | MX51_PAD_EIM_CS3__FEC_RDAT3, | 121 | MX51_PAD_EIM_CS3__FEC_RDATA3, |
118 | MX51_PAD_EIM_CS4__FEC_RX_ER, | 122 | MX51_PAD_EIM_CS4__FEC_RX_ER, |
119 | MX51_PAD_EIM_CS5__FEC_CRS, | 123 | MX51_PAD_EIM_CS5__FEC_CRS, |
120 | MX51_PAD_NANDF_RB2__FEC_COL, | 124 | MX51_PAD_NANDF_RB2__FEC_COL, |
121 | MX51_PAD_NANDF_RB3__FEC_RXCLK, | 125 | MX51_PAD_NANDF_RB3__FEC_RX_CLK, |
122 | MX51_PAD_NANDF_RB6__FEC_RDAT0, | 126 | MX51_PAD_NANDF_D9__FEC_RDATA0, |
123 | MX51_PAD_NANDF_RB7__FEC_TDAT0, | 127 | MX51_PAD_NANDF_D8__FEC_TDATA0, |
124 | MX51_PAD_NANDF_CS2__FEC_TX_ER, | 128 | MX51_PAD_NANDF_CS2__FEC_TX_ER, |
125 | MX51_PAD_NANDF_CS3__FEC_MDC, | 129 | MX51_PAD_NANDF_CS3__FEC_MDC, |
126 | MX51_PAD_NANDF_CS4__FEC_TDAT1, | 130 | MX51_PAD_NANDF_CS4__FEC_TDATA1, |
127 | MX51_PAD_NANDF_CS5__FEC_TDAT2, | 131 | MX51_PAD_NANDF_CS5__FEC_TDATA2, |
128 | MX51_PAD_NANDF_CS6__FEC_TDAT3, | 132 | MX51_PAD_NANDF_CS6__FEC_TDATA3, |
129 | MX51_PAD_NANDF_CS7__FEC_TX_EN, | 133 | MX51_PAD_NANDF_CS7__FEC_TX_EN, |
130 | MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK, | 134 | MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK, |
131 | 135 | ||
132 | /* FEC PHY reset line */ | 136 | /* FEC PHY reset line */ |
133 | MX51_PAD_EIM_A20__GPIO_2_14, | 137 | MX51_PAD_EIM_A20__GPIO2_14, |
134 | 138 | ||
135 | /* SD 1 */ | 139 | /* SD 1 */ |
136 | MX51_PAD_SD1_CMD__SD1_CMD, | 140 | MX51_PAD_SD1_CMD__SD1_CMD, |
@@ -147,6 +151,13 @@ static struct pad_desc mx51babbage_pads[] = { | |||
147 | MX51_PAD_SD2_DATA1__SD2_DATA1, | 151 | MX51_PAD_SD2_DATA1__SD2_DATA1, |
148 | MX51_PAD_SD2_DATA2__SD2_DATA2, | 152 | MX51_PAD_SD2_DATA2__SD2_DATA2, |
149 | MX51_PAD_SD2_DATA3__SD2_DATA3, | 153 | MX51_PAD_SD2_DATA3__SD2_DATA3, |
154 | |||
155 | /* eCSPI1 */ | ||
156 | MX51_PAD_CSPI1_MISO__ECSPI1_MISO, | ||
157 | MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, | ||
158 | MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, | ||
159 | MX51_PAD_CSPI1_SS0__GPIO4_24, | ||
160 | MX51_PAD_CSPI1_SS1__GPIO4_25, | ||
150 | }; | 161 | }; |
151 | 162 | ||
152 | /* Serial ports */ | 163 | /* Serial ports */ |
@@ -177,12 +188,12 @@ static struct imxi2c_platform_data babbage_hsi2c_data = { | |||
177 | 188 | ||
178 | static int gpio_usbh1_active(void) | 189 | static int gpio_usbh1_active(void) |
179 | { | 190 | { |
180 | struct pad_desc usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO_1_27; | 191 | iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27; |
181 | struct pad_desc phyreset_gpio = MX51_PAD_EIM_D21__GPIO_2_5; | 192 | iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO2_5; |
182 | int ret; | 193 | int ret; |
183 | 194 | ||
184 | /* Set USBH1_STP to GPIO and toggle it */ | 195 | /* Set USBH1_STP to GPIO and toggle it */ |
185 | mxc_iomux_v3_setup_pad(&usbh1stp_gpio); | 196 | mxc_iomux_v3_setup_pad(usbh1stp_gpio); |
186 | ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); | 197 | ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp"); |
187 | 198 | ||
188 | if (ret) { | 199 | if (ret) { |
@@ -195,7 +206,7 @@ static int gpio_usbh1_active(void) | |||
195 | gpio_free(BABBAGE_USBH1_STP); | 206 | gpio_free(BABBAGE_USBH1_STP); |
196 | 207 | ||
197 | /* De-assert USB PHY RESETB */ | 208 | /* De-assert USB PHY RESETB */ |
198 | mxc_iomux_v3_setup_pad(&phyreset_gpio); | 209 | mxc_iomux_v3_setup_pad(phyreset_gpio); |
199 | ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset"); | 210 | ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset"); |
200 | 211 | ||
201 | if (ret) { | 212 | if (ret) { |
@@ -251,6 +262,8 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
251 | void __iomem *usbother_base; | 262 | void __iomem *usbother_base; |
252 | 263 | ||
253 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 264 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
265 | if (!usb_base) | ||
266 | return -ENOMEM; | ||
254 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 267 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
255 | 268 | ||
256 | /* Set the PHY clock to 19.2MHz */ | 269 | /* Set the PHY clock to 19.2MHz */ |
@@ -269,6 +282,8 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
269 | void __iomem *usbother_base; | 282 | void __iomem *usbother_base; |
270 | 283 | ||
271 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 284 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
285 | if (!usb_base) | ||
286 | return -ENOMEM; | ||
272 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 287 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
273 | 288 | ||
274 | /* The clock for the USBH1 ULPI port will come externally from the PHY. */ | 289 | /* The clock for the USBH1 ULPI port will come externally from the PHY. */ |
@@ -310,13 +325,35 @@ static int __init babbage_otg_mode(char *options) | |||
310 | } | 325 | } |
311 | __setup("otg_mode=", babbage_otg_mode); | 326 | __setup("otg_mode=", babbage_otg_mode); |
312 | 327 | ||
328 | static struct spi_board_info mx51_babbage_spi_board_info[] __initdata = { | ||
329 | { | ||
330 | .modalias = "mtd_dataflash", | ||
331 | .max_speed_hz = 25000000, | ||
332 | .bus_num = 0, | ||
333 | .chip_select = 1, | ||
334 | .mode = SPI_MODE_0, | ||
335 | .platform_data = NULL, | ||
336 | }, | ||
337 | }; | ||
338 | |||
339 | static int mx51_babbage_spi_cs[] = { | ||
340 | BABBAGE_ECSPI1_CS0, | ||
341 | BABBAGE_ECSPI1_CS1, | ||
342 | }; | ||
343 | |||
344 | static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = { | ||
345 | .chipselect = mx51_babbage_spi_cs, | ||
346 | .num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs), | ||
347 | }; | ||
348 | |||
313 | /* | 349 | /* |
314 | * Board specific initialization. | 350 | * Board specific initialization. |
315 | */ | 351 | */ |
316 | static void __init mxc_board_init(void) | 352 | static void __init mxc_board_init(void) |
317 | { | 353 | { |
318 | struct pad_desc usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; | 354 | iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; |
319 | struct pad_desc power_key = MX51_PAD_EIM_A27__GPIO_2_21; | 355 | iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 | |
356 | MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP); | ||
320 | 357 | ||
321 | #if defined(CONFIG_CPU_FREQ_IMX) | 358 | #if defined(CONFIG_CPU_FREQ_IMX) |
322 | get_cpu_op = mx51_get_cpu_op; | 359 | get_cpu_op = mx51_get_cpu_op; |
@@ -328,8 +365,7 @@ static void __init mxc_board_init(void) | |||
328 | imx51_add_fec(NULL); | 365 | imx51_add_fec(NULL); |
329 | 366 | ||
330 | /* Set the PAD settings for the pwr key. */ | 367 | /* Set the PAD settings for the pwr key. */ |
331 | power_key.pad_ctrl = MX51_GPIO_PAD_CTRL_2; | 368 | mxc_iomux_v3_setup_pad(power_key); |
332 | mxc_iomux_v3_setup_pad(&power_key); | ||
333 | imx51_add_gpio_keys(&imx_button_data); | 369 | imx51_add_gpio_keys(&imx_button_data); |
334 | 370 | ||
335 | imx51_add_imx_i2c(0, &babbage_i2c_data); | 371 | imx51_add_imx_i2c(0, &babbage_i2c_data); |
@@ -346,11 +382,16 @@ static void __init mxc_board_init(void) | |||
346 | gpio_usbh1_active(); | 382 | gpio_usbh1_active(); |
347 | mxc_register_device(&mxc_usbh1_device, &usbh1_config); | 383 | mxc_register_device(&mxc_usbh1_device, &usbh1_config); |
348 | /* setback USBH1_STP to be function */ | 384 | /* setback USBH1_STP to be function */ |
349 | mxc_iomux_v3_setup_pad(&usbh1stp); | 385 | mxc_iomux_v3_setup_pad(usbh1stp); |
350 | babbage_usbhub_reset(); | 386 | babbage_usbhub_reset(); |
351 | 387 | ||
352 | imx51_add_esdhc(0, NULL); | 388 | imx51_add_sdhci_esdhc_imx(0, NULL); |
353 | imx51_add_esdhc(1, NULL); | 389 | imx51_add_sdhci_esdhc_imx(1, NULL); |
390 | |||
391 | spi_register_board_info(mx51_babbage_spi_board_info, | ||
392 | ARRAY_SIZE(mx51_babbage_spi_board_info)); | ||
393 | imx51_add_ecspi(0, &mx51_babbage_spi_pdata); | ||
394 | imx51_add_imx2_wdt(0, NULL); | ||
354 | } | 395 | } |
355 | 396 | ||
356 | static void __init mx51_babbage_timer_init(void) | 397 | static void __init mx51_babbage_timer_init(void) |
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index 6e623bda3ee7..b7946f8e8d40 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
@@ -18,9 +18,13 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/leds.h> | ||
22 | #include <linux/input.h> | ||
21 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
22 | #include <linux/io.h> | 24 | #include <linux/io.h> |
23 | #include <linux/fsl_devices.h> | 25 | #include <linux/fsl_devices.h> |
26 | #include <linux/spi/flash.h> | ||
27 | #include <linux/spi/spi.h> | ||
24 | 28 | ||
25 | #include <mach/common.h> | 29 | #include <mach/common.h> |
26 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
@@ -39,12 +43,81 @@ | |||
39 | 43 | ||
40 | #define MX51_USB_PLL_DIV_24_MHZ 0x01 | 44 | #define MX51_USB_PLL_DIV_24_MHZ 0x01 |
41 | 45 | ||
42 | static struct pad_desc mx51efikamx_pads[] = { | 46 | #define EFIKAMX_PCBID0 IMX_GPIO_NR(3, 16) |
47 | #define EFIKAMX_PCBID1 IMX_GPIO_NR(3, 17) | ||
48 | #define EFIKAMX_PCBID2 IMX_GPIO_NR(3, 11) | ||
49 | |||
50 | #define EFIKAMX_BLUE_LED IMX_GPIO_NR(3, 13) | ||
51 | #define EFIKAMX_GREEN_LED IMX_GPIO_NR(3, 14) | ||
52 | #define EFIKAMX_RED_LED IMX_GPIO_NR(3, 15) | ||
53 | |||
54 | #define EFIKAMX_POWER_KEY IMX_GPIO_NR(2, 31) | ||
55 | |||
56 | #define EFIKAMX_SPI_CS0 IMX_GPIO_NR(4, 24) | ||
57 | #define EFIKAMX_SPI_CS1 IMX_GPIO_NR(4, 25) | ||
58 | |||
59 | /* board 1.1 doesn't have same reset gpio */ | ||
60 | #define EFIKAMX_RESET1_1 IMX_GPIO_NR(3, 2) | ||
61 | #define EFIKAMX_RESET IMX_GPIO_NR(1, 4) | ||
62 | |||
63 | /* the pci ids pin have pull up. they're driven low according to board id */ | ||
64 | #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | ||
65 | #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | ||
66 | #define MX51_PAD_PCBID2 IOMUX_PAD(0x504, 0x128, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | ||
67 | #define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE) | ||
68 | |||
69 | static iomux_v3_cfg_t mx51efikamx_pads[] = { | ||
43 | /* UART1 */ | 70 | /* UART1 */ |
44 | MX51_PAD_UART1_RXD__UART1_RXD, | 71 | MX51_PAD_UART1_RXD__UART1_RXD, |
45 | MX51_PAD_UART1_TXD__UART1_TXD, | 72 | MX51_PAD_UART1_TXD__UART1_TXD, |
46 | MX51_PAD_UART1_RTS__UART1_RTS, | 73 | MX51_PAD_UART1_RTS__UART1_RTS, |
47 | MX51_PAD_UART1_CTS__UART1_CTS, | 74 | MX51_PAD_UART1_CTS__UART1_CTS, |
75 | /* board id */ | ||
76 | MX51_PAD_PCBID0, | ||
77 | MX51_PAD_PCBID1, | ||
78 | MX51_PAD_PCBID2, | ||
79 | |||
80 | /* SD 1 */ | ||
81 | MX51_PAD_SD1_CMD__SD1_CMD, | ||
82 | MX51_PAD_SD1_CLK__SD1_CLK, | ||
83 | MX51_PAD_SD1_DATA0__SD1_DATA0, | ||
84 | MX51_PAD_SD1_DATA1__SD1_DATA1, | ||
85 | MX51_PAD_SD1_DATA2__SD1_DATA2, | ||
86 | MX51_PAD_SD1_DATA3__SD1_DATA3, | ||
87 | |||
88 | /* SD 2 */ | ||
89 | MX51_PAD_SD2_CMD__SD2_CMD, | ||
90 | MX51_PAD_SD2_CLK__SD2_CLK, | ||
91 | MX51_PAD_SD2_DATA0__SD2_DATA0, | ||
92 | MX51_PAD_SD2_DATA1__SD2_DATA1, | ||
93 | MX51_PAD_SD2_DATA2__SD2_DATA2, | ||
94 | MX51_PAD_SD2_DATA3__SD2_DATA3, | ||
95 | |||
96 | /* SD/MMC WP/CD */ | ||
97 | MX51_PAD_GPIO1_0__SD1_CD, | ||
98 | MX51_PAD_GPIO1_1__SD1_WP, | ||
99 | MX51_PAD_GPIO1_7__SD2_WP, | ||
100 | MX51_PAD_GPIO1_8__SD2_CD, | ||
101 | |||
102 | /* leds */ | ||
103 | MX51_PAD_CSI1_D9__GPIO3_13, | ||
104 | MX51_PAD_CSI1_VSYNC__GPIO3_14, | ||
105 | MX51_PAD_CSI1_HSYNC__GPIO3_15, | ||
106 | |||
107 | /* power key */ | ||
108 | MX51_PAD_PWRKEY, | ||
109 | |||
110 | /* spi */ | ||
111 | MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, | ||
112 | MX51_PAD_CSPI1_MISO__ECSPI1_MISO, | ||
113 | MX51_PAD_CSPI1_SS0__GPIO4_24, | ||
114 | MX51_PAD_CSPI1_SS1__GPIO4_25, | ||
115 | MX51_PAD_CSPI1_RDY__ECSPI1_RDY, | ||
116 | MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK, | ||
117 | |||
118 | /* reset */ | ||
119 | MX51_PAD_DI1_PIN13__GPIO3_2, | ||
120 | MX51_PAD_GPIO1_4__GPIO1_4, | ||
48 | }; | 121 | }; |
49 | 122 | ||
50 | /* Serial ports */ | 123 | /* Serial ports */ |
@@ -75,6 +148,8 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
75 | void __iomem *usb_base; | 148 | void __iomem *usb_base; |
76 | void __iomem *usbother_base; | 149 | void __iomem *usbother_base; |
77 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 150 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
151 | if (!usb_base) | ||
152 | return -ENOMEM; | ||
78 | usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET); | 153 | usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET); |
79 | 154 | ||
80 | /* Set the PHY clock to 19.2MHz */ | 155 | /* Set the PHY clock to 19.2MHz */ |
@@ -92,12 +167,182 @@ static struct mxc_usbh_platform_data dr_utmi_config = { | |||
92 | .flags = MXC_EHCI_INTERNAL_PHY, | 167 | .flags = MXC_EHCI_INTERNAL_PHY, |
93 | }; | 168 | }; |
94 | 169 | ||
170 | /* PCBID2 PCBID1 PCBID0 STATE | ||
171 | 1 1 1 ER1:rev1.1 | ||
172 | 1 1 0 ER2:rev1.2 | ||
173 | 1 0 1 ER3:rev1.3 | ||
174 | 1 0 0 ER4:rev1.4 | ||
175 | */ | ||
176 | static void __init mx51_efikamx_board_id(void) | ||
177 | { | ||
178 | int id; | ||
179 | |||
180 | /* things are taking time to settle */ | ||
181 | msleep(150); | ||
182 | |||
183 | gpio_request(EFIKAMX_PCBID0, "pcbid0"); | ||
184 | gpio_direction_input(EFIKAMX_PCBID0); | ||
185 | gpio_request(EFIKAMX_PCBID1, "pcbid1"); | ||
186 | gpio_direction_input(EFIKAMX_PCBID1); | ||
187 | gpio_request(EFIKAMX_PCBID2, "pcbid2"); | ||
188 | gpio_direction_input(EFIKAMX_PCBID2); | ||
189 | |||
190 | id = gpio_get_value(EFIKAMX_PCBID0); | ||
191 | id |= gpio_get_value(EFIKAMX_PCBID1) << 1; | ||
192 | id |= gpio_get_value(EFIKAMX_PCBID2) << 2; | ||
193 | |||
194 | switch (id) { | ||
195 | case 7: | ||
196 | system_rev = 0x11; | ||
197 | break; | ||
198 | case 6: | ||
199 | system_rev = 0x12; | ||
200 | break; | ||
201 | case 5: | ||
202 | system_rev = 0x13; | ||
203 | break; | ||
204 | case 4: | ||
205 | system_rev = 0x14; | ||
206 | break; | ||
207 | default: | ||
208 | system_rev = 0x10; | ||
209 | break; | ||
210 | } | ||
211 | |||
212 | if ((system_rev == 0x10) | ||
213 | || (system_rev == 0x12) | ||
214 | || (system_rev == 0x14)) { | ||
215 | printk(KERN_WARNING | ||
216 | "EfikaMX: Unsupported board revision 1.%u!\n", | ||
217 | system_rev & 0xf); | ||
218 | } | ||
219 | } | ||
220 | |||
221 | static struct gpio_led mx51_efikamx_leds[] = { | ||
222 | { | ||
223 | .name = "efikamx:green", | ||
224 | .default_trigger = "default-on", | ||
225 | .gpio = EFIKAMX_GREEN_LED, | ||
226 | }, | ||
227 | { | ||
228 | .name = "efikamx:red", | ||
229 | .default_trigger = "ide-disk", | ||
230 | .gpio = EFIKAMX_RED_LED, | ||
231 | }, | ||
232 | { | ||
233 | .name = "efikamx:blue", | ||
234 | .default_trigger = "mmc0", | ||
235 | .gpio = EFIKAMX_BLUE_LED, | ||
236 | }, | ||
237 | }; | ||
238 | |||
239 | static struct gpio_led_platform_data mx51_efikamx_leds_data = { | ||
240 | .leds = mx51_efikamx_leds, | ||
241 | .num_leds = ARRAY_SIZE(mx51_efikamx_leds), | ||
242 | }; | ||
243 | |||
244 | static struct platform_device mx51_efikamx_leds_device = { | ||
245 | .name = "leds-gpio", | ||
246 | .id = -1, | ||
247 | .dev = { | ||
248 | .platform_data = &mx51_efikamx_leds_data, | ||
249 | }, | ||
250 | }; | ||
251 | |||
252 | static struct gpio_keys_button mx51_efikamx_powerkey[] = { | ||
253 | { | ||
254 | .code = KEY_POWER, | ||
255 | .gpio = EFIKAMX_POWER_KEY, | ||
256 | .type = EV_PWR, | ||
257 | .desc = "Power Button (CM)", | ||
258 | .wakeup = 1, | ||
259 | .debounce_interval = 10, /* ms */ | ||
260 | }, | ||
261 | }; | ||
262 | |||
263 | static const struct gpio_keys_platform_data mx51_efikamx_powerkey_data __initconst = { | ||
264 | .buttons = mx51_efikamx_powerkey, | ||
265 | .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey), | ||
266 | }; | ||
267 | |||
268 | static struct mtd_partition mx51_efikamx_spi_nor_partitions[] = { | ||
269 | { | ||
270 | .name = "u-boot", | ||
271 | .offset = 0, | ||
272 | .size = SZ_256K, | ||
273 | }, | ||
274 | { | ||
275 | .name = "config", | ||
276 | .offset = MTDPART_OFS_APPEND, | ||
277 | .size = SZ_64K, | ||
278 | }, | ||
279 | }; | ||
280 | |||
281 | static struct flash_platform_data mx51_efikamx_spi_flash_data = { | ||
282 | .name = "spi_flash", | ||
283 | .parts = mx51_efikamx_spi_nor_partitions, | ||
284 | .nr_parts = ARRAY_SIZE(mx51_efikamx_spi_nor_partitions), | ||
285 | .type = "sst25vf032b", | ||
286 | }; | ||
287 | |||
288 | static struct spi_board_info mx51_efikamx_spi_board_info[] __initdata = { | ||
289 | { | ||
290 | .modalias = "m25p80", | ||
291 | .max_speed_hz = 25000000, | ||
292 | .bus_num = 0, | ||
293 | .chip_select = 1, | ||
294 | .platform_data = &mx51_efikamx_spi_flash_data, | ||
295 | .irq = -1, | ||
296 | }, | ||
297 | }; | ||
298 | |||
299 | static int mx51_efikamx_spi_cs[] = { | ||
300 | EFIKAMX_SPI_CS0, | ||
301 | EFIKAMX_SPI_CS1, | ||
302 | }; | ||
303 | |||
304 | static const struct spi_imx_master mx51_efikamx_spi_pdata __initconst = { | ||
305 | .chipselect = mx51_efikamx_spi_cs, | ||
306 | .num_chipselect = ARRAY_SIZE(mx51_efikamx_spi_cs), | ||
307 | }; | ||
308 | |||
309 | void mx51_efikamx_reset(void) | ||
310 | { | ||
311 | if (system_rev == 0x11) | ||
312 | gpio_direction_output(EFIKAMX_RESET1_1, 0); | ||
313 | else | ||
314 | gpio_direction_output(EFIKAMX_RESET, 0); | ||
315 | } | ||
316 | |||
95 | static void __init mxc_board_init(void) | 317 | static void __init mxc_board_init(void) |
96 | { | 318 | { |
97 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, | 319 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, |
98 | ARRAY_SIZE(mx51efikamx_pads)); | 320 | ARRAY_SIZE(mx51efikamx_pads)); |
321 | mx51_efikamx_board_id(); | ||
99 | mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); | 322 | mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); |
100 | mxc_init_imx_uart(); | 323 | mxc_init_imx_uart(); |
324 | imx51_add_sdhci_esdhc_imx(0, NULL); | ||
325 | |||
326 | /* on < 1.2 boards both SD controllers are used */ | ||
327 | if (system_rev < 0x12) { | ||
328 | imx51_add_sdhci_esdhc_imx(1, NULL); | ||
329 | mx51_efikamx_leds[2].default_trigger = "mmc1"; | ||
330 | } | ||
331 | |||
332 | platform_device_register(&mx51_efikamx_leds_device); | ||
333 | imx51_add_gpio_keys(&mx51_efikamx_powerkey_data); | ||
334 | |||
335 | spi_register_board_info(mx51_efikamx_spi_board_info, | ||
336 | ARRAY_SIZE(mx51_efikamx_spi_board_info)); | ||
337 | imx51_add_ecspi(0, &mx51_efikamx_spi_pdata); | ||
338 | |||
339 | if (system_rev == 0x11) { | ||
340 | gpio_request(EFIKAMX_RESET1_1, "reset"); | ||
341 | gpio_direction_output(EFIKAMX_RESET1_1, 1); | ||
342 | } else { | ||
343 | gpio_request(EFIKAMX_RESET, "reset"); | ||
344 | gpio_direction_output(EFIKAMX_RESET, 1); | ||
345 | } | ||
101 | } | 346 | } |
102 | 347 | ||
103 | static void __init mx51_efikamx_timer_init(void) | 348 | static void __init mx51_efikamx_timer_init(void) |
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c new file mode 100644 index 000000000000..fa97d0d5dd05 --- /dev/null +++ b/arch/arm/mach-mx5/board-mx53_evk.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org> | ||
4 | */ | ||
5 | |||
6 | /* | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | |||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | |||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
20 | */ | ||
21 | |||
22 | #include <linux/init.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <mach/common.h> | ||
25 | #include <mach/hardware.h> | ||
26 | #include <asm/mach-types.h> | ||
27 | #include <asm/mach/arch.h> | ||
28 | #include <asm/mach/time.h> | ||
29 | #include <mach/imx-uart.h> | ||
30 | #include <mach/iomux-mx53.h> | ||
31 | |||
32 | #include "crm_regs.h" | ||
33 | #include "devices-imx53.h" | ||
34 | |||
35 | static iomux_v3_cfg_t mx53_evk_pads[] = { | ||
36 | MX53_PAD_CSI0_D10__UART1_TXD, | ||
37 | MX53_PAD_CSI0_D11__UART1_RXD, | ||
38 | MX53_PAD_ATA_DIOW__UART1_TXD, | ||
39 | MX53_PAD_ATA_DMACK__UART1_RXD, | ||
40 | |||
41 | MX53_PAD_ATA_BUFFER_EN__UART2_RXD, | ||
42 | MX53_PAD_ATA_DMARQ__UART2_TXD, | ||
43 | MX53_PAD_ATA_DIOR__UART2_RTS, | ||
44 | MX53_PAD_ATA_INTRQ__UART2_CTS, | ||
45 | |||
46 | MX53_PAD_ATA_CS_0__UART3_TXD, | ||
47 | MX53_PAD_ATA_CS_1__UART3_RXD, | ||
48 | MX53_PAD_ATA_DA_1__UART3_CTS, | ||
49 | MX53_PAD_ATA_DA_2__UART3_RTS, | ||
50 | }; | ||
51 | |||
52 | static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = { | ||
53 | .flags = IMXUART_HAVE_RTSCTS, | ||
54 | }; | ||
55 | |||
56 | static inline void mx53_evk_init_uart(void) | ||
57 | { | ||
58 | imx53_add_imx_uart(0, &mx53_evk_uart_pdata); | ||
59 | imx53_add_imx_uart(1, &mx53_evk_uart_pdata); | ||
60 | imx53_add_imx_uart(2, &mx53_evk_uart_pdata); | ||
61 | } | ||
62 | |||
63 | static void __init mx53_evk_board_init(void) | ||
64 | { | ||
65 | mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, | ||
66 | ARRAY_SIZE(mx53_evk_pads)); | ||
67 | mx53_evk_init_uart(); | ||
68 | } | ||
69 | |||
70 | static void __init mx53_evk_timer_init(void) | ||
71 | { | ||
72 | mx53_clocks_init(32768, 24000000, 22579200, 0); | ||
73 | } | ||
74 | |||
75 | static struct sys_timer mx53_evk_timer = { | ||
76 | .init = mx53_evk_timer_init, | ||
77 | }; | ||
78 | |||
79 | MACHINE_START(MX53_EVK, "Freescale MX53 EVK Board") | ||
80 | .map_io = mx53_map_io, | ||
81 | .init_irq = mx53_init_irq, | ||
82 | .init_machine = mx53_evk_board_init, | ||
83 | .timer = &mx53_evk_timer, | ||
84 | MACHINE_END | ||
diff --git a/arch/arm/mach-mx5/clock-mx51.c b/arch/arm/mach-mx5/clock-mx51-mx53.c index 8ac36d882927..785e1a336183 100644 --- a/arch/arm/mach-mx5/clock-mx51.c +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c | |||
@@ -14,8 +14,8 @@ | |||
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/clkdev.h> | ||
17 | 18 | ||
18 | #include <asm/clkdev.h> | ||
19 | #include <asm/div64.h> | 19 | #include <asm/div64.h> |
20 | 20 | ||
21 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
@@ -33,11 +33,15 @@ static struct clk pll1_main_clk; | |||
33 | static struct clk pll1_sw_clk; | 33 | static struct clk pll1_sw_clk; |
34 | static struct clk pll2_sw_clk; | 34 | static struct clk pll2_sw_clk; |
35 | static struct clk pll3_sw_clk; | 35 | static struct clk pll3_sw_clk; |
36 | static struct clk mx53_pll4_sw_clk; | ||
36 | static struct clk lp_apm_clk; | 37 | static struct clk lp_apm_clk; |
37 | static struct clk periph_apm_clk; | 38 | static struct clk periph_apm_clk; |
38 | static struct clk ahb_clk; | 39 | static struct clk ahb_clk; |
39 | static struct clk ipg_clk; | 40 | static struct clk ipg_clk; |
40 | static struct clk usboh3_clk; | 41 | static struct clk usboh3_clk; |
42 | static struct clk emi_fast_clk; | ||
43 | static struct clk ipu_clk; | ||
44 | static struct clk mipi_hsc1_clk; | ||
41 | 45 | ||
42 | #define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */ | 46 | #define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */ |
43 | 47 | ||
@@ -123,7 +127,7 @@ static inline u32 _get_mux(struct clk *parent, struct clk *m0, | |||
123 | return -EINVAL; | 127 | return -EINVAL; |
124 | } | 128 | } |
125 | 129 | ||
126 | static inline void __iomem *_get_pll_base(struct clk *pll) | 130 | static inline void __iomem *_mx51_get_pll_base(struct clk *pll) |
127 | { | 131 | { |
128 | if (pll == &pll1_main_clk) | 132 | if (pll == &pll1_main_clk) |
129 | return MX51_DPLL1_BASE; | 133 | return MX51_DPLL1_BASE; |
@@ -137,6 +141,30 @@ static inline void __iomem *_get_pll_base(struct clk *pll) | |||
137 | return NULL; | 141 | return NULL; |
138 | } | 142 | } |
139 | 143 | ||
144 | static inline void __iomem *_mx53_get_pll_base(struct clk *pll) | ||
145 | { | ||
146 | if (pll == &pll1_main_clk) | ||
147 | return MX53_DPLL1_BASE; | ||
148 | else if (pll == &pll2_sw_clk) | ||
149 | return MX53_DPLL2_BASE; | ||
150 | else if (pll == &pll3_sw_clk) | ||
151 | return MX53_DPLL3_BASE; | ||
152 | else if (pll == &mx53_pll4_sw_clk) | ||
153 | return MX53_DPLL4_BASE; | ||
154 | else | ||
155 | BUG(); | ||
156 | |||
157 | return NULL; | ||
158 | } | ||
159 | |||
160 | static inline void __iomem *_get_pll_base(struct clk *pll) | ||
161 | { | ||
162 | if (cpu_is_mx51()) | ||
163 | return _mx51_get_pll_base(pll); | ||
164 | else | ||
165 | return _mx53_get_pll_base(pll); | ||
166 | } | ||
167 | |||
140 | static unsigned long clk_pll_get_rate(struct clk *clk) | 168 | static unsigned long clk_pll_get_rate(struct clk *clk) |
141 | { | 169 | { |
142 | long mfi, mfn, mfd, pdf, ref_clk, mfn_abs; | 170 | long mfi, mfn, mfd, pdf, ref_clk, mfn_abs; |
@@ -514,7 +542,10 @@ static int _clk_max_enable(struct clk *clk) | |||
514 | 542 | ||
515 | /* Handshake with MAX when LPM is entered. */ | 543 | /* Handshake with MAX when LPM is entered. */ |
516 | reg = __raw_readl(MXC_CCM_CLPCR); | 544 | reg = __raw_readl(MXC_CCM_CLPCR); |
517 | reg &= ~MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS; | 545 | if (cpu_is_mx51()) |
546 | reg &= ~MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS; | ||
547 | else if (cpu_is_mx53()) | ||
548 | reg &= ~MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS; | ||
518 | __raw_writel(reg, MXC_CCM_CLPCR); | 549 | __raw_writel(reg, MXC_CCM_CLPCR); |
519 | 550 | ||
520 | return 0; | 551 | return 0; |
@@ -528,7 +559,10 @@ static void _clk_max_disable(struct clk *clk) | |||
528 | 559 | ||
529 | /* No Handshake with MAX when LPM is entered as its disabled. */ | 560 | /* No Handshake with MAX when LPM is entered as its disabled. */ |
530 | reg = __raw_readl(MXC_CCM_CLPCR); | 561 | reg = __raw_readl(MXC_CCM_CLPCR); |
531 | reg |= MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS; | 562 | if (cpu_is_mx51()) |
563 | reg |= MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS; | ||
564 | else if (cpu_is_mx53()) | ||
565 | reg &= ~MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS; | ||
532 | __raw_writel(reg, MXC_CCM_CLPCR); | 566 | __raw_writel(reg, MXC_CCM_CLPCR); |
533 | } | 567 | } |
534 | 568 | ||
@@ -679,6 +713,19 @@ static unsigned long clk_emi_slow_get_rate(struct clk *clk) | |||
679 | return clk_get_rate(clk->parent) / div; | 713 | return clk_get_rate(clk->parent) / div; |
680 | } | 714 | } |
681 | 715 | ||
716 | static unsigned long _clk_ddr_hf_get_rate(struct clk *clk) | ||
717 | { | ||
718 | unsigned long rate; | ||
719 | u32 reg, div; | ||
720 | |||
721 | reg = __raw_readl(MXC_CCM_CBCDR); | ||
722 | div = ((reg & MXC_CCM_CBCDR_DDR_PODF_MASK) >> | ||
723 | MXC_CCM_CBCDR_DDR_PODF_OFFSET) + 1; | ||
724 | rate = clk_get_rate(clk->parent) / div; | ||
725 | |||
726 | return rate; | ||
727 | } | ||
728 | |||
682 | /* External high frequency clock */ | 729 | /* External high frequency clock */ |
683 | static struct clk ckih_clk = { | 730 | static struct clk ckih_clk = { |
684 | .get_rate = get_high_reference_clock_rate, | 731 | .get_rate = get_high_reference_clock_rate, |
@@ -739,6 +786,14 @@ static struct clk pll3_sw_clk = { | |||
739 | .disable = _clk_pll_disable, | 786 | .disable = _clk_pll_disable, |
740 | }; | 787 | }; |
741 | 788 | ||
789 | /* PLL4 SW supplies to LVDS Display Bridge(LDB) */ | ||
790 | static struct clk mx53_pll4_sw_clk = { | ||
791 | .parent = &osc_clk, | ||
792 | .set_rate = _clk_pll_set_rate, | ||
793 | .enable = _clk_pll_enable, | ||
794 | .disable = _clk_pll_disable, | ||
795 | }; | ||
796 | |||
742 | /* Low-power Audio Playback Mode clock */ | 797 | /* Low-power Audio Playback Mode clock */ |
743 | static struct clk lp_apm_clk = { | 798 | static struct clk lp_apm_clk = { |
744 | .parent = &osc_clk, | 799 | .parent = &osc_clk, |
@@ -763,6 +818,12 @@ static struct clk ahb_clk = { | |||
763 | .round_rate = _clk_ahb_round_rate, | 818 | .round_rate = _clk_ahb_round_rate, |
764 | }; | 819 | }; |
765 | 820 | ||
821 | static struct clk iim_clk = { | ||
822 | .parent = &ipg_clk, | ||
823 | .enable_reg = MXC_CCM_CCGR0, | ||
824 | .enable_shift = MXC_CCM_CCGRx_CG15_OFFSET, | ||
825 | }; | ||
826 | |||
766 | /* Main IP interface clock for access to registers */ | 827 | /* Main IP interface clock for access to registers */ |
767 | static struct clk ipg_clk = { | 828 | static struct clk ipg_clk = { |
768 | .parent = &ahb_clk, | 829 | .parent = &ahb_clk, |
@@ -810,6 +871,10 @@ static struct clk kpp_clk = { | |||
810 | .id = 0, | 871 | .id = 0, |
811 | }; | 872 | }; |
812 | 873 | ||
874 | static struct clk dummy_clk = { | ||
875 | .id = 0, | ||
876 | }; | ||
877 | |||
813 | static struct clk emi_slow_clk = { | 878 | static struct clk emi_slow_clk = { |
814 | .parent = &pll2_sw_clk, | 879 | .parent = &pll2_sw_clk, |
815 | .enable_reg = MXC_CCM_CCGR5, | 880 | .enable_reg = MXC_CCM_CCGR5, |
@@ -819,6 +884,109 @@ static struct clk emi_slow_clk = { | |||
819 | .get_rate = clk_emi_slow_get_rate, | 884 | .get_rate = clk_emi_slow_get_rate, |
820 | }; | 885 | }; |
821 | 886 | ||
887 | static int clk_ipu_enable(struct clk *clk) | ||
888 | { | ||
889 | u32 reg; | ||
890 | |||
891 | _clk_ccgr_enable(clk); | ||
892 | |||
893 | /* Enable handshake with IPU when certain clock rates are changed */ | ||
894 | reg = __raw_readl(MXC_CCM_CCDR); | ||
895 | reg &= ~MXC_CCM_CCDR_IPU_HS_MASK; | ||
896 | __raw_writel(reg, MXC_CCM_CCDR); | ||
897 | |||
898 | /* Enable handshake with IPU when LPM is entered */ | ||
899 | reg = __raw_readl(MXC_CCM_CLPCR); | ||
900 | reg &= ~MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS; | ||
901 | __raw_writel(reg, MXC_CCM_CLPCR); | ||
902 | |||
903 | return 0; | ||
904 | } | ||
905 | |||
906 | static void clk_ipu_disable(struct clk *clk) | ||
907 | { | ||
908 | u32 reg; | ||
909 | |||
910 | _clk_ccgr_disable(clk); | ||
911 | |||
912 | /* Disable handshake with IPU whe dividers are changed */ | ||
913 | reg = __raw_readl(MXC_CCM_CCDR); | ||
914 | reg |= MXC_CCM_CCDR_IPU_HS_MASK; | ||
915 | __raw_writel(reg, MXC_CCM_CCDR); | ||
916 | |||
917 | /* Disable handshake with IPU when LPM is entered */ | ||
918 | reg = __raw_readl(MXC_CCM_CLPCR); | ||
919 | reg |= MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS; | ||
920 | __raw_writel(reg, MXC_CCM_CLPCR); | ||
921 | } | ||
922 | |||
923 | static struct clk ahbmux1_clk = { | ||
924 | .parent = &ahb_clk, | ||
925 | .secondary = &ahb_max_clk, | ||
926 | .enable_reg = MXC_CCM_CCGR0, | ||
927 | .enable_shift = MXC_CCM_CCGRx_CG8_OFFSET, | ||
928 | .enable = _clk_ccgr_enable, | ||
929 | .disable = _clk_ccgr_disable_inwait, | ||
930 | }; | ||
931 | |||
932 | static struct clk ipu_sec_clk = { | ||
933 | .parent = &emi_fast_clk, | ||
934 | .secondary = &ahbmux1_clk, | ||
935 | }; | ||
936 | |||
937 | static struct clk ddr_hf_clk = { | ||
938 | .parent = &pll1_sw_clk, | ||
939 | .get_rate = _clk_ddr_hf_get_rate, | ||
940 | }; | ||
941 | |||
942 | static struct clk ddr_clk = { | ||
943 | .parent = &ddr_hf_clk, | ||
944 | }; | ||
945 | |||
946 | /* clock definitions for MIPI HSC unit which has been removed | ||
947 | * from documentation, but not from hardware | ||
948 | */ | ||
949 | static int _clk_hsc_enable(struct clk *clk) | ||
950 | { | ||
951 | u32 reg; | ||
952 | |||
953 | _clk_ccgr_enable(clk); | ||
954 | /* Handshake with IPU when certain clock rates are changed. */ | ||
955 | reg = __raw_readl(MXC_CCM_CCDR); | ||
956 | reg &= ~MXC_CCM_CCDR_HSC_HS_MASK; | ||
957 | __raw_writel(reg, MXC_CCM_CCDR); | ||
958 | |||
959 | reg = __raw_readl(MXC_CCM_CLPCR); | ||
960 | reg &= ~MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS; | ||
961 | __raw_writel(reg, MXC_CCM_CLPCR); | ||
962 | |||
963 | return 0; | ||
964 | } | ||
965 | |||
966 | static void _clk_hsc_disable(struct clk *clk) | ||
967 | { | ||
968 | u32 reg; | ||
969 | |||
970 | _clk_ccgr_disable(clk); | ||
971 | /* No handshake with HSC as its not enabled. */ | ||
972 | reg = __raw_readl(MXC_CCM_CCDR); | ||
973 | reg |= MXC_CCM_CCDR_HSC_HS_MASK; | ||
974 | __raw_writel(reg, MXC_CCM_CCDR); | ||
975 | |||
976 | reg = __raw_readl(MXC_CCM_CLPCR); | ||
977 | reg |= MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS; | ||
978 | __raw_writel(reg, MXC_CCM_CLPCR); | ||
979 | } | ||
980 | |||
981 | static struct clk mipi_hsp_clk = { | ||
982 | .parent = &ipu_clk, | ||
983 | .enable_reg = MXC_CCM_CCGR4, | ||
984 | .enable_shift = MXC_CCM_CCGRx_CG6_OFFSET, | ||
985 | .enable = _clk_hsc_enable, | ||
986 | .disable = _clk_hsc_disable, | ||
987 | .secondary = &mipi_hsc1_clk, | ||
988 | }; | ||
989 | |||
822 | #define DEFINE_CLOCK_CCGR(name, i, er, es, pfx, p, s) \ | 990 | #define DEFINE_CLOCK_CCGR(name, i, er, es, pfx, p, s) \ |
823 | static struct clk name = { \ | 991 | static struct clk name = { \ |
824 | .id = i, \ | 992 | .id = i, \ |
@@ -927,6 +1095,41 @@ static struct clk usboh3_clk = { | |||
927 | .parent = &pll2_sw_clk, | 1095 | .parent = &pll2_sw_clk, |
928 | .get_rate = clk_usboh3_get_rate, | 1096 | .get_rate = clk_usboh3_get_rate, |
929 | .set_parent = clk_usboh3_set_parent, | 1097 | .set_parent = clk_usboh3_set_parent, |
1098 | .enable = _clk_ccgr_enable, | ||
1099 | .disable = _clk_ccgr_disable, | ||
1100 | .enable_reg = MXC_CCM_CCGR2, | ||
1101 | .enable_shift = MXC_CCM_CCGRx_CG14_OFFSET, | ||
1102 | }; | ||
1103 | |||
1104 | static struct clk usb_ahb_clk = { | ||
1105 | .parent = &ipg_clk, | ||
1106 | .enable = _clk_ccgr_enable, | ||
1107 | .disable = _clk_ccgr_disable, | ||
1108 | .enable_reg = MXC_CCM_CCGR2, | ||
1109 | .enable_shift = MXC_CCM_CCGRx_CG13_OFFSET, | ||
1110 | }; | ||
1111 | |||
1112 | static int clk_usb_phy1_set_parent(struct clk *clk, struct clk *parent) | ||
1113 | { | ||
1114 | u32 reg; | ||
1115 | |||
1116 | reg = __raw_readl(MXC_CCM_CSCMR1) & ~MXC_CCM_CSCMR1_USB_PHY_CLK_SEL; | ||
1117 | |||
1118 | if (parent == &pll3_sw_clk) | ||
1119 | reg |= 1 << MXC_CCM_CSCMR1_USB_PHY_CLK_SEL_OFFSET; | ||
1120 | |||
1121 | __raw_writel(reg, MXC_CCM_CSCMR1); | ||
1122 | |||
1123 | return 0; | ||
1124 | } | ||
1125 | |||
1126 | static struct clk usb_phy1_clk = { | ||
1127 | .parent = &pll3_sw_clk, | ||
1128 | .set_parent = clk_usb_phy1_set_parent, | ||
1129 | .enable = _clk_ccgr_enable, | ||
1130 | .enable_reg = MXC_CCM_CCGR2, | ||
1131 | .enable_shift = MXC_CCM_CCGRx_CG0_OFFSET, | ||
1132 | .disable = _clk_ccgr_disable, | ||
930 | }; | 1133 | }; |
931 | 1134 | ||
932 | /* eCSPI */ | 1135 | /* eCSPI */ |
@@ -1013,6 +1216,10 @@ DEFINE_CLOCK(ssi2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG10_OFFSET, | |||
1013 | NULL, NULL, &ipg_clk, NULL); | 1216 | NULL, NULL, &ipg_clk, NULL); |
1014 | DEFINE_CLOCK(ssi2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG11_OFFSET, | 1217 | DEFINE_CLOCK(ssi2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG11_OFFSET, |
1015 | NULL, NULL, &pll3_sw_clk, &ssi2_ipg_clk); | 1218 | NULL, NULL, &pll3_sw_clk, &ssi2_ipg_clk); |
1219 | DEFINE_CLOCK(ssi3_ipg_clk, 2, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG12_OFFSET, | ||
1220 | NULL, NULL, &ipg_clk, NULL); | ||
1221 | DEFINE_CLOCK(ssi3_clk, 2, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG13_OFFSET, | ||
1222 | NULL, NULL, &pll3_sw_clk, &ssi3_ipg_clk); | ||
1016 | 1223 | ||
1017 | /* eCSPI */ | 1224 | /* eCSPI */ |
1018 | DEFINE_CLOCK_FULL(ecspi1_ipg_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG9_OFFSET, | 1225 | DEFINE_CLOCK_FULL(ecspi1_ipg_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG9_OFFSET, |
@@ -1046,6 +1253,23 @@ DEFINE_CLOCK_FULL(esdhc2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG2_OFFSET, | |||
1046 | DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET, | 1253 | DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET, |
1047 | clk_esdhc2, &pll2_sw_clk, &esdhc2_ipg_clk); | 1254 | clk_esdhc2, &pll2_sw_clk, &esdhc2_ipg_clk); |
1048 | 1255 | ||
1256 | DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk); | ||
1257 | DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk); | ||
1258 | DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk); | ||
1259 | |||
1260 | /* IPU */ | ||
1261 | DEFINE_CLOCK_FULL(ipu_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG5_OFFSET, | ||
1262 | NULL, NULL, clk_ipu_enable, clk_ipu_disable, &ahb_clk, &ipu_sec_clk); | ||
1263 | |||
1264 | DEFINE_CLOCK_FULL(emi_fast_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG7_OFFSET, | ||
1265 | NULL, NULL, _clk_ccgr_enable, _clk_ccgr_disable_inwait, | ||
1266 | &ddr_clk, NULL); | ||
1267 | |||
1268 | DEFINE_CLOCK(ipu_di0_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG5_OFFSET, | ||
1269 | NULL, NULL, &pll3_sw_clk, NULL); | ||
1270 | DEFINE_CLOCK(ipu_di1_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG6_OFFSET, | ||
1271 | NULL, NULL, &pll3_sw_clk, NULL); | ||
1272 | |||
1049 | #define _REGISTER_CLOCK(d, n, c) \ | 1273 | #define _REGISTER_CLOCK(d, n, c) \ |
1050 | { \ | 1274 | { \ |
1051 | .dev_id = d, \ | 1275 | .dev_id = d, \ |
@@ -1053,7 +1277,7 @@ DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET, | |||
1053 | .clk = &c, \ | 1277 | .clk = &c, \ |
1054 | }, | 1278 | }, |
1055 | 1279 | ||
1056 | static struct clk_lookup lookups[] = { | 1280 | static struct clk_lookup mx51_lookups[] = { |
1057 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) | 1281 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) |
1058 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) | 1282 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) |
1059 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | 1283 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) |
@@ -1063,15 +1287,19 @@ static struct clk_lookup lookups[] = { | |||
1063 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) | 1287 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) |
1064 | _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) | 1288 | _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) |
1065 | _REGISTER_CLOCK("mxc-ehci.0", "usb", usboh3_clk) | 1289 | _REGISTER_CLOCK("mxc-ehci.0", "usb", usboh3_clk) |
1066 | _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", ahb_clk) | 1290 | _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", usb_ahb_clk) |
1291 | _REGISTER_CLOCK("mxc-ehci.0", "usb_phy1", usb_phy1_clk) | ||
1067 | _REGISTER_CLOCK("mxc-ehci.1", "usb", usboh3_clk) | 1292 | _REGISTER_CLOCK("mxc-ehci.1", "usb", usboh3_clk) |
1068 | _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", ahb_clk) | 1293 | _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_ahb_clk) |
1294 | _REGISTER_CLOCK("mxc-ehci.2", "usb", usboh3_clk) | ||
1295 | _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_ahb_clk) | ||
1069 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) | 1296 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) |
1070 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) | 1297 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) |
1071 | _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk) | 1298 | _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk) |
1072 | _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) | 1299 | _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) |
1073 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) | 1300 | _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) |
1074 | _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) | 1301 | _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) |
1302 | _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk) | ||
1075 | _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) | 1303 | _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) |
1076 | _REGISTER_CLOCK(NULL, "ckih", ckih_clk) | 1304 | _REGISTER_CLOCK(NULL, "ckih", ckih_clk) |
1077 | _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk) | 1305 | _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk) |
@@ -1082,6 +1310,22 @@ static struct clk_lookup lookups[] = { | |||
1082 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) | 1310 | _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) |
1083 | _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) | 1311 | _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) |
1084 | _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) | 1312 | _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) |
1313 | _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) | ||
1314 | _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) | ||
1315 | _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) | ||
1316 | _REGISTER_CLOCK(NULL, "mipi_hsp", mipi_hsp_clk) | ||
1317 | _REGISTER_CLOCK("imx-ipuv3", NULL, ipu_clk) | ||
1318 | _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk) | ||
1319 | _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk) | ||
1320 | }; | ||
1321 | |||
1322 | static struct clk_lookup mx53_lookups[] = { | ||
1323 | _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) | ||
1324 | _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) | ||
1325 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | ||
1326 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) | ||
1327 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | ||
1328 | _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) | ||
1085 | }; | 1329 | }; |
1086 | 1330 | ||
1087 | static void clk_tree_init(void) | 1331 | static void clk_tree_init(void) |
@@ -1114,14 +1358,22 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc, | |||
1114 | ckih2_reference = ckih2; | 1358 | ckih2_reference = ckih2; |
1115 | oscillator_reference = osc; | 1359 | oscillator_reference = osc; |
1116 | 1360 | ||
1117 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | 1361 | for (i = 0; i < ARRAY_SIZE(mx51_lookups); i++) |
1118 | clkdev_add(&lookups[i]); | 1362 | clkdev_add(&mx51_lookups[i]); |
1119 | 1363 | ||
1120 | clk_tree_init(); | 1364 | clk_tree_init(); |
1121 | 1365 | ||
1366 | clk_set_parent(&uart_root_clk, &pll3_sw_clk); | ||
1122 | clk_enable(&cpu_clk); | 1367 | clk_enable(&cpu_clk); |
1123 | clk_enable(&main_bus_clk); | 1368 | clk_enable(&main_bus_clk); |
1124 | 1369 | ||
1370 | clk_enable(&iim_clk); | ||
1371 | mx51_revision(); | ||
1372 | clk_disable(&iim_clk); | ||
1373 | |||
1374 | /* move usb_phy_clk to 24MHz */ | ||
1375 | clk_set_parent(&usb_phy1_clk, &osc_clk); | ||
1376 | |||
1125 | /* set the usboh3_clk parent to pll2_sw_clk */ | 1377 | /* set the usboh3_clk parent to pll2_sw_clk */ |
1126 | clk_set_parent(&usboh3_clk, &pll2_sw_clk); | 1378 | clk_set_parent(&usboh3_clk, &pll2_sw_clk); |
1127 | 1379 | ||
@@ -1138,3 +1390,31 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc, | |||
1138 | MX51_MXC_INT_GPT); | 1390 | MX51_MXC_INT_GPT); |
1139 | return 0; | 1391 | return 0; |
1140 | } | 1392 | } |
1393 | |||
1394 | int __init mx53_clocks_init(unsigned long ckil, unsigned long osc, | ||
1395 | unsigned long ckih1, unsigned long ckih2) | ||
1396 | { | ||
1397 | int i; | ||
1398 | |||
1399 | external_low_reference = ckil; | ||
1400 | external_high_reference = ckih1; | ||
1401 | ckih2_reference = ckih2; | ||
1402 | oscillator_reference = osc; | ||
1403 | |||
1404 | for (i = 0; i < ARRAY_SIZE(mx53_lookups); i++) | ||
1405 | clkdev_add(&mx53_lookups[i]); | ||
1406 | |||
1407 | clk_tree_init(); | ||
1408 | |||
1409 | clk_enable(&cpu_clk); | ||
1410 | clk_enable(&main_bus_clk); | ||
1411 | |||
1412 | clk_enable(&iim_clk); | ||
1413 | mx53_revision(); | ||
1414 | clk_disable(&iim_clk); | ||
1415 | |||
1416 | /* System timer */ | ||
1417 | mxc_timer_init(&gpt_clk, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR), | ||
1418 | MX53_INT_GPT); | ||
1419 | return 0; | ||
1420 | } | ||
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c index eaacb6e9b5d0..d40671da4372 100644 --- a/arch/arm/mach-mx5/cpu.c +++ b/arch/arm/mach-mx5/cpu.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * The code contained herein is licensed under the GNU General Public | 4 | * The code contained herein is licensed under the GNU General Public |
5 | * License. You may obtain a copy of the GNU General Public License | 5 | * License. You may obtain a copy of the GNU General Public License |
@@ -20,37 +20,18 @@ | |||
20 | 20 | ||
21 | static int cpu_silicon_rev = -1; | 21 | static int cpu_silicon_rev = -1; |
22 | 22 | ||
23 | #define SI_REV 0x48 | 23 | #define IIM_SREV 0x24 |
24 | 24 | ||
25 | static void query_silicon_parameter(void) | 25 | static int get_mx51_srev(void) |
26 | { | 26 | { |
27 | void __iomem *rom = ioremap(MX51_IROM_BASE_ADDR, MX51_IROM_SIZE); | 27 | void __iomem *iim_base = MX51_IO_ADDRESS(MX51_IIM_BASE_ADDR); |
28 | u32 rev; | 28 | u32 rev = readl(iim_base + IIM_SREV) & 0xff; |
29 | 29 | ||
30 | if (!rom) { | 30 | if (rev == 0x0) |
31 | cpu_silicon_rev = -EINVAL; | 31 | return IMX_CHIP_REVISION_2_0; |
32 | return; | 32 | else if (rev == 0x10) |
33 | } | 33 | return IMX_CHIP_REVISION_3_0; |
34 | 34 | return 0; | |
35 | rev = readl(rom + SI_REV); | ||
36 | switch (rev) { | ||
37 | case 0x1: | ||
38 | cpu_silicon_rev = MX51_CHIP_REV_1_0; | ||
39 | break; | ||
40 | case 0x2: | ||
41 | cpu_silicon_rev = MX51_CHIP_REV_1_1; | ||
42 | break; | ||
43 | case 0x10: | ||
44 | cpu_silicon_rev = MX51_CHIP_REV_2_0; | ||
45 | break; | ||
46 | case 0x20: | ||
47 | cpu_silicon_rev = MX51_CHIP_REV_3_0; | ||
48 | break; | ||
49 | default: | ||
50 | cpu_silicon_rev = 0; | ||
51 | } | ||
52 | |||
53 | iounmap(rom); | ||
54 | } | 35 | } |
55 | 36 | ||
56 | /* | 37 | /* |
@@ -64,7 +45,7 @@ int mx51_revision(void) | |||
64 | return -EINVAL; | 45 | return -EINVAL; |
65 | 46 | ||
66 | if (cpu_silicon_rev == -1) | 47 | if (cpu_silicon_rev == -1) |
67 | query_silicon_parameter(); | 48 | cpu_silicon_rev = get_mx51_srev(); |
68 | 49 | ||
69 | return cpu_silicon_rev; | 50 | return cpu_silicon_rev; |
70 | } | 51 | } |
@@ -79,7 +60,10 @@ EXPORT_SYMBOL(mx51_revision); | |||
79 | */ | 60 | */ |
80 | static int __init mx51_neon_fixup(void) | 61 | static int __init mx51_neon_fixup(void) |
81 | { | 62 | { |
82 | if (mx51_revision() < MX51_CHIP_REV_3_0 && (elf_hwcap & HWCAP_NEON)) { | 63 | if (!cpu_is_mx51()) |
64 | return 0; | ||
65 | |||
66 | if (mx51_revision() < IMX_CHIP_REVISION_3_0 && (elf_hwcap & HWCAP_NEON)) { | ||
83 | elf_hwcap &= ~HWCAP_NEON; | 67 | elf_hwcap &= ~HWCAP_NEON; |
84 | pr_info("Turning off NEON support, detected broken NEON implementation\n"); | 68 | pr_info("Turning off NEON support, detected broken NEON implementation\n"); |
85 | } | 69 | } |
@@ -89,29 +73,65 @@ static int __init mx51_neon_fixup(void) | |||
89 | late_initcall(mx51_neon_fixup); | 73 | late_initcall(mx51_neon_fixup); |
90 | #endif | 74 | #endif |
91 | 75 | ||
76 | static int get_mx53_srev(void) | ||
77 | { | ||
78 | void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR); | ||
79 | u32 rev = readl(iim_base + IIM_SREV) & 0xff; | ||
80 | |||
81 | if (rev == 0x0) | ||
82 | return IMX_CHIP_REVISION_1_0; | ||
83 | else if (rev == 0x10) | ||
84 | return IMX_CHIP_REVISION_2_0; | ||
85 | return 0; | ||
86 | } | ||
87 | |||
88 | /* | ||
89 | * Returns: | ||
90 | * the silicon revision of the cpu | ||
91 | * -EINVAL - not a mx53 | ||
92 | */ | ||
93 | int mx53_revision(void) | ||
94 | { | ||
95 | if (!cpu_is_mx53()) | ||
96 | return -EINVAL; | ||
97 | |||
98 | if (cpu_silicon_rev == -1) | ||
99 | cpu_silicon_rev = get_mx53_srev(); | ||
100 | |||
101 | return cpu_silicon_rev; | ||
102 | } | ||
103 | EXPORT_SYMBOL(mx53_revision); | ||
104 | |||
92 | static int __init post_cpu_init(void) | 105 | static int __init post_cpu_init(void) |
93 | { | 106 | { |
94 | unsigned int reg; | 107 | unsigned int reg; |
95 | void __iomem *base; | 108 | void __iomem *base; |
96 | 109 | ||
97 | if (!cpu_is_mx51()) | 110 | if (cpu_is_mx51() || cpu_is_mx53()) { |
98 | return 0; | 111 | if (cpu_is_mx51()) |
99 | 112 | base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR); | |
100 | base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR); | 113 | else |
101 | __raw_writel(0x0, base + 0x40); | 114 | base = MX53_IO_ADDRESS(MX53_AIPS1_BASE_ADDR); |
102 | __raw_writel(0x0, base + 0x44); | 115 | |
103 | __raw_writel(0x0, base + 0x48); | 116 | __raw_writel(0x0, base + 0x40); |
104 | __raw_writel(0x0, base + 0x4C); | 117 | __raw_writel(0x0, base + 0x44); |
105 | reg = __raw_readl(base + 0x50) & 0x00FFFFFF; | 118 | __raw_writel(0x0, base + 0x48); |
106 | __raw_writel(reg, base + 0x50); | 119 | __raw_writel(0x0, base + 0x4C); |
107 | 120 | reg = __raw_readl(base + 0x50) & 0x00FFFFFF; | |
108 | base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR); | 121 | __raw_writel(reg, base + 0x50); |
109 | __raw_writel(0x0, base + 0x40); | 122 | |
110 | __raw_writel(0x0, base + 0x44); | 123 | if (cpu_is_mx51()) |
111 | __raw_writel(0x0, base + 0x48); | 124 | base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR); |
112 | __raw_writel(0x0, base + 0x4C); | 125 | else |
113 | reg = __raw_readl(base + 0x50) & 0x00FFFFFF; | 126 | base = MX53_IO_ADDRESS(MX53_AIPS2_BASE_ADDR); |
114 | __raw_writel(reg, base + 0x50); | 127 | |
128 | __raw_writel(0x0, base + 0x40); | ||
129 | __raw_writel(0x0, base + 0x44); | ||
130 | __raw_writel(0x0, base + 0x48); | ||
131 | __raw_writel(0x0, base + 0x4C); | ||
132 | reg = __raw_readl(base + 0x50) & 0x00FFFFFF; | ||
133 | __raw_writel(reg, base + 0x50); | ||
134 | } | ||
115 | 135 | ||
116 | return 0; | 136 | return 0; |
117 | } | 137 | } |
diff --git a/arch/arm/mach-mx5/crm_regs.h b/arch/arm/mach-mx5/crm_regs.h index c776b9af0624..b462c22f53d8 100644 --- a/arch/arm/mach-mx5/crm_regs.h +++ b/arch/arm/mach-mx5/crm_regs.h | |||
@@ -18,6 +18,13 @@ | |||
18 | #define MX51_CORTEXA8_BASE MX51_IO_ADDRESS(MX51_ARM_BASE_ADDR) | 18 | #define MX51_CORTEXA8_BASE MX51_IO_ADDRESS(MX51_ARM_BASE_ADDR) |
19 | #define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR) | 19 | #define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR) |
20 | 20 | ||
21 | /*MX53*/ | ||
22 | #define MX53_CCM_BASE MX53_IO_ADDRESS(MX53_CCM_BASE_ADDR) | ||
23 | #define MX53_DPLL1_BASE MX53_IO_ADDRESS(MX53_PLL1_BASE_ADDR) | ||
24 | #define MX53_DPLL2_BASE MX53_IO_ADDRESS(MX53_PLL2_BASE_ADDR) | ||
25 | #define MX53_DPLL3_BASE MX53_IO_ADDRESS(MX53_PLL3_BASE_ADDR) | ||
26 | #define MX53_DPLL4_BASE MX53_IO_ADDRESS(MX53_PLL3_BASE_ADDR) | ||
27 | |||
21 | /* PLL Register Offsets */ | 28 | /* PLL Register Offsets */ |
22 | #define MXC_PLL_DP_CTL 0x00 | 29 | #define MXC_PLL_DP_CTL 0x00 |
23 | #define MXC_PLL_DP_CONFIG 0x04 | 30 | #define MXC_PLL_DP_CONFIG 0x04 |
@@ -380,7 +387,8 @@ | |||
380 | /* Define the bits in register CLPCR */ | 387 | /* Define the bits in register CLPCR */ |
381 | #define MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS (0x1 << 23) | 388 | #define MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS (0x1 << 23) |
382 | #define MXC_CCM_CLPCR_BYPASS_SCC_LPM_HS (0x1 << 22) | 389 | #define MXC_CCM_CLPCR_BYPASS_SCC_LPM_HS (0x1 << 22) |
383 | #define MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 21) | 390 | #define MX51_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 21) |
391 | #define MX53_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 25) | ||
384 | #define MXC_CCM_CLPCR_BYPASS_SDMA_LPM_HS (0x1 << 20) | 392 | #define MXC_CCM_CLPCR_BYPASS_SDMA_LPM_HS (0x1 << 20) |
385 | #define MXC_CCM_CLPCR_BYPASS_EMI_LPM_HS (0x1 << 19) | 393 | #define MXC_CCM_CLPCR_BYPASS_EMI_LPM_HS (0x1 << 19) |
386 | #define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18) | 394 | #define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18) |
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h index 8c50cb5d05f5..6302e4670000 100644 --- a/arch/arm/mach-mx5/devices-imx51.h +++ b/arch/arm/mach-mx5/devices-imx51.h | |||
@@ -31,6 +31,11 @@ extern const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst; | |||
31 | #define imx51_add_mxc_nand(pdata) \ | 31 | #define imx51_add_mxc_nand(pdata) \ |
32 | imx_add_mxc_nand(&imx51_mxc_nand_data, pdata) | 32 | imx_add_mxc_nand(&imx51_mxc_nand_data, pdata) |
33 | 33 | ||
34 | extern const struct imx_sdhci_esdhc_imx_data | ||
35 | imx51_sdhci_esdhc_imx_data[] __initconst; | ||
36 | #define imx51_add_sdhci_esdhc_imx(id, pdata) \ | ||
37 | imx_add_sdhci_esdhc_imx(&imx51_sdhci_esdhc_imx_data[id], pdata) | ||
38 | |||
34 | extern const struct imx_spi_imx_data imx51_cspi_data __initconst; | 39 | extern const struct imx_spi_imx_data imx51_cspi_data __initconst; |
35 | #define imx51_add_cspi(pdata) \ | 40 | #define imx51_add_cspi(pdata) \ |
36 | imx_add_spi_imx(&imx51_cspi_data, pdata) | 41 | imx_add_spi_imx(&imx51_cspi_data, pdata) |
@@ -39,6 +44,6 @@ extern const struct imx_spi_imx_data imx51_ecspi_data[] __initconst; | |||
39 | #define imx51_add_ecspi(id, pdata) \ | 44 | #define imx51_add_ecspi(id, pdata) \ |
40 | imx_add_spi_imx(&imx51_ecspi_data[id], pdata) | 45 | imx_add_spi_imx(&imx51_ecspi_data[id], pdata) |
41 | 46 | ||
42 | extern const struct imx_esdhc_imx_data imx51_esdhc_data[] __initconst; | 47 | extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst; |
43 | #define imx51_add_esdhc(id, pdata) \ | 48 | #define imx51_add_imx2_wdt(id, pdata) \ |
44 | imx_add_esdhc(&imx51_esdhc_data[id], pdata) | 49 | imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) |
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h new file mode 100644 index 000000000000..9d0ec2507fa6 --- /dev/null +++ b/arch/arm/mach-mx5/devices-imx53.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | #include <mach/mx53.h> | ||
9 | #include <mach/devices-common.h> | ||
10 | |||
11 | extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst; | ||
12 | #define imx53_add_imx_uart(id, pdata) \ | ||
13 | imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata) | ||
diff --git a/arch/arm/mach-mx5/devices-mx50.h b/arch/arm/mach-mx5/devices-mx50.h new file mode 100644 index 000000000000..98ab07468a0e --- /dev/null +++ b/arch/arm/mach-mx5/devices-mx50.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | |||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | |||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #include <mach/mx50.h> | ||
22 | #include <mach/devices-common.h> | ||
23 | |||
24 | extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst; | ||
25 | #define imx50_add_imx_uart(id, pdata) \ | ||
26 | imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata) | ||
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c index 4c7be87a7c9d..1bda5cb339dc 100644 --- a/arch/arm/mach-mx5/devices.c +++ b/arch/arm/mach-mx5/devices.c | |||
@@ -97,19 +97,27 @@ struct platform_device mxc_usbh1_device = { | |||
97 | }, | 97 | }, |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static struct resource mxc_wdt_resources[] = { | 100 | static struct resource usbh2_resources[] = { |
101 | { | 101 | { |
102 | .start = MX51_WDOG_BASE_ADDR, | 102 | .start = MX51_OTG_BASE_ADDR + 0x400, |
103 | .end = MX51_WDOG_BASE_ADDR + SZ_16K - 1, | 103 | .end = MX51_OTG_BASE_ADDR + 0x400 + 0x1ff, |
104 | .flags = IORESOURCE_MEM, | 104 | .flags = IORESOURCE_MEM, |
105 | }, | 105 | }, |
106 | { | ||
107 | .start = MX51_MXC_INT_USB_H2, | ||
108 | .flags = IORESOURCE_IRQ, | ||
109 | }, | ||
106 | }; | 110 | }; |
107 | 111 | ||
108 | struct platform_device mxc_wdt = { | 112 | struct platform_device mxc_usbh2_device = { |
109 | .name = "imx2-wdt", | 113 | .name = "mxc-ehci", |
110 | .id = 0, | 114 | .id = 2, |
111 | .num_resources = ARRAY_SIZE(mxc_wdt_resources), | 115 | .num_resources = ARRAY_SIZE(usbh2_resources), |
112 | .resource = mxc_wdt_resources, | 116 | .resource = usbh2_resources, |
117 | .dev = { | ||
118 | .dma_mask = &usb_dma_mask, | ||
119 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
120 | }, | ||
113 | }; | 121 | }; |
114 | 122 | ||
115 | static struct resource mxc_kpp_resources[] = { | 123 | static struct resource mxc_kpp_resources[] = { |
@@ -160,9 +168,36 @@ static struct mxc_gpio_port mxc_gpio_ports[] = { | |||
160 | .irq_high = MX51_MXC_INT_GPIO4_HIGH, | 168 | .irq_high = MX51_MXC_INT_GPIO4_HIGH, |
161 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3 | 169 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3 |
162 | }, | 170 | }, |
171 | { | ||
172 | .chip.label = "gpio-4", | ||
173 | .base = MX53_IO_ADDRESS(MX53_GPIO5_BASE_ADDR), | ||
174 | .irq = MX53_INT_GPIO5_LOW, | ||
175 | .irq_high = MX53_INT_GPIO5_HIGH, | ||
176 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 4 | ||
177 | }, | ||
178 | { | ||
179 | .chip.label = "gpio-5", | ||
180 | .base = MX53_IO_ADDRESS(MX53_GPIO6_BASE_ADDR), | ||
181 | .irq = MX53_INT_GPIO6_LOW, | ||
182 | .irq_high = MX53_INT_GPIO6_HIGH, | ||
183 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 5 | ||
184 | }, | ||
185 | { | ||
186 | .chip.label = "gpio-6", | ||
187 | .base = MX53_IO_ADDRESS(MX53_GPIO7_BASE_ADDR), | ||
188 | .irq = MX53_INT_GPIO7_LOW, | ||
189 | .irq_high = MX53_INT_GPIO7_HIGH, | ||
190 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 6 | ||
191 | }, | ||
163 | }; | 192 | }; |
164 | 193 | ||
165 | int __init imx51_register_gpios(void) | 194 | int __init imx51_register_gpios(void) |
166 | { | 195 | { |
196 | return mxc_gpio_init(mxc_gpio_ports, 4); | ||
197 | } | ||
198 | |||
199 | int __init imx53_register_gpios(void) | ||
200 | { | ||
167 | return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports)); | 201 | return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports)); |
168 | } | 202 | } |
203 | |||
diff --git a/arch/arm/mach-mx5/devices.h b/arch/arm/mach-mx5/devices.h index af1d07c0bbc1..16891aa3573c 100644 --- a/arch/arm/mach-mx5/devices.h +++ b/arch/arm/mach-mx5/devices.h | |||
@@ -1,6 +1,6 @@ | |||
1 | extern struct platform_device mxc_usbdr_host_device; | 1 | extern struct platform_device mxc_usbdr_host_device; |
2 | extern struct platform_device mxc_usbh1_device; | 2 | extern struct platform_device mxc_usbh1_device; |
3 | extern struct platform_device mxc_usbh2_device; | ||
3 | extern struct platform_device mxc_usbdr_udc_device; | 4 | extern struct platform_device mxc_usbdr_udc_device; |
4 | extern struct platform_device mxc_wdt; | ||
5 | extern struct platform_device mxc_hsi2c_device; | 5 | extern struct platform_device mxc_hsi2c_device; |
6 | extern struct platform_device mxc_keypad_device; | 6 | extern struct platform_device mxc_keypad_device; |
diff --git a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c index a2e6e8c39d25..c96d018ff8a2 100644 --- a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c | |||
@@ -33,12 +33,12 @@ | |||
33 | #include "devices-imx51.h" | 33 | #include "devices-imx51.h" |
34 | #include "devices.h" | 34 | #include "devices.h" |
35 | 35 | ||
36 | #define MBIMX51_TSC2007_GPIO (2*32 + 30) | 36 | #define MBIMX51_TSC2007_GPIO IMX_GPIO_NR(3, 30) |
37 | #define MBIMX51_TSC2007_IRQ (MXC_INTERNAL_IRQS + MBIMX51_TSC2007_GPIO) | 37 | #define MBIMX51_TSC2007_IRQ (MXC_INTERNAL_IRQS + MBIMX51_TSC2007_GPIO) |
38 | #define MBIMX51_LED0 (2*32 + 5) | 38 | #define MBIMX51_LED0 IMX_GPIO_NR(3, 5) |
39 | #define MBIMX51_LED1 (2*32 + 6) | 39 | #define MBIMX51_LED1 IMX_GPIO_NR(3, 6) |
40 | #define MBIMX51_LED2 (2*32 + 7) | 40 | #define MBIMX51_LED2 IMX_GPIO_NR(3, 7) |
41 | #define MBIMX51_LED3 (2*32 + 8) | 41 | #define MBIMX51_LED3 IMX_GPIO_NR(3, 8) |
42 | 42 | ||
43 | static struct gpio_led mbimx51_leds[] = { | 43 | static struct gpio_led mbimx51_leds[] = { |
44 | { | 44 | { |
@@ -84,7 +84,7 @@ static struct platform_device *devices[] __initdata = { | |||
84 | &mbimx51_leds_gpio, | 84 | &mbimx51_leds_gpio, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | static struct pad_desc mbimx51_pads[] = { | 87 | static iomux_v3_cfg_t mbimx51_pads[] = { |
88 | /* UART2 */ | 88 | /* UART2 */ |
89 | MX51_PAD_UART2_RXD__UART2_RXD, | 89 | MX51_PAD_UART2_RXD__UART2_RXD, |
90 | MX51_PAD_UART2_TXD__UART2_TXD, | 90 | MX51_PAD_UART2_TXD__UART2_TXD, |
@@ -96,13 +96,13 @@ static struct pad_desc mbimx51_pads[] = { | |||
96 | MX51_PAD_KEY_COL5__UART3_CTS, | 96 | MX51_PAD_KEY_COL5__UART3_CTS, |
97 | 97 | ||
98 | /* TSC2007 IRQ */ | 98 | /* TSC2007 IRQ */ |
99 | MX51_PAD_NANDF_D10__GPIO_3_30, | 99 | MX51_PAD_NANDF_D10__GPIO3_30, |
100 | 100 | ||
101 | /* LEDS */ | 101 | /* LEDS */ |
102 | MX51_PAD_DISPB2_SER_DIN__GPIO_3_5, | 102 | MX51_PAD_DISPB2_SER_DIN__GPIO3_5, |
103 | MX51_PAD_DISPB2_SER_DIO__GPIO_3_6, | 103 | MX51_PAD_DISPB2_SER_DIO__GPIO3_6, |
104 | MX51_PAD_DISPB2_SER_CLK__GPIO_3_7, | 104 | MX51_PAD_DISPB2_SER_CLK__GPIO3_7, |
105 | MX51_PAD_DISPB2_SER_RS__GPIO_3_8, | 105 | MX51_PAD_DISPB2_SER_RS__GPIO3_8, |
106 | 106 | ||
107 | /* KPP */ | 107 | /* KPP */ |
108 | MX51_PAD_KEY_ROW0__KEY_ROW0, | 108 | MX51_PAD_KEY_ROW0__KEY_ROW0, |
@@ -217,6 +217,6 @@ void __init eukrea_mbimx51_baseboard_init(void) | |||
217 | i2c_register_board_info(1, mbimx51_i2c_devices, | 217 | i2c_register_board_info(1, mbimx51_i2c_devices, |
218 | ARRAY_SIZE(mbimx51_i2c_devices)); | 218 | ARRAY_SIZE(mbimx51_i2c_devices)); |
219 | 219 | ||
220 | imx51_add_esdhc(0, NULL); | 220 | imx51_add_sdhci_esdhc_imx(0, NULL); |
221 | imx51_add_esdhc(1, NULL); | 221 | imx51_add_sdhci_esdhc_imx(1, NULL); |
222 | } | 222 | } |
diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c index 2b48f5190830..c372a4373691 100644 --- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | |||
@@ -45,14 +45,13 @@ | |||
45 | #include "devices-imx51.h" | 45 | #include "devices-imx51.h" |
46 | #include "devices.h" | 46 | #include "devices.h" |
47 | 47 | ||
48 | #define MBIMXSD_GPIO_3_31 IOMUX_PAD(0x554, 0x16C, 3, 0x0, 0, \ | 48 | static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { |
49 | MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) | ||
50 | |||
51 | static struct pad_desc eukrea_mbimxsd_pads[] = { | ||
52 | /* LED */ | 49 | /* LED */ |
53 | MX51_PAD_NANDF_D10__GPIO_3_30, | 50 | MX51_PAD_NANDF_D10__GPIO3_30, |
54 | /* SWITCH */ | 51 | /* SWITCH */ |
55 | MBIMXSD_GPIO_3_31, | 52 | _MX51_PAD_NANDF_D9__GPIO3_31 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | |
53 | PAD_CTL_PKE | PAD_CTL_SRE_FAST | | ||
54 | PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), | ||
56 | /* UART2 */ | 55 | /* UART2 */ |
57 | MX51_PAD_UART2_RXD__UART2_RXD, | 56 | MX51_PAD_UART2_RXD__UART2_RXD, |
58 | MX51_PAD_UART2_TXD__UART2_TXD, | 57 | MX51_PAD_UART2_TXD__UART2_TXD, |
@@ -70,8 +69,8 @@ static struct pad_desc eukrea_mbimxsd_pads[] = { | |||
70 | MX51_PAD_SD1_DATA3__SD1_DATA3, | 69 | MX51_PAD_SD1_DATA3__SD1_DATA3, |
71 | }; | 70 | }; |
72 | 71 | ||
73 | #define GPIO_LED1 (2 * 32 + 30) | 72 | #define GPIO_LED1 IMX_GPIO_NR(3, 30) |
74 | #define GPIO_SWITCH1 (2 * 32 + 31) | 73 | #define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) |
75 | 74 | ||
76 | static struct gpio_led eukrea_mbimxsd_leds[] = { | 75 | static struct gpio_led eukrea_mbimxsd_leds[] = { |
77 | { | 76 | { |
@@ -149,7 +148,7 @@ void __init eukrea_mbimxsd51_baseboard_init(void) | |||
149 | imx51_add_imx_uart(1, NULL); | 148 | imx51_add_imx_uart(1, NULL); |
150 | imx51_add_imx_uart(2, &uart_pdata); | 149 | imx51_add_imx_uart(2, &uart_pdata); |
151 | 150 | ||
152 | imx51_add_esdhc(0, NULL); | 151 | imx51_add_sdhci_esdhc_imx(0, NULL); |
153 | 152 | ||
154 | gpio_request(GPIO_LED1, "LED1"); | 153 | gpio_request(GPIO_LED1, "LED1"); |
155 | gpio_direction_output(GPIO_LED1, 1); | 154 | gpio_direction_output(GPIO_LED1, 1); |
diff --git a/arch/arm/mach-mx5/mm-mx50.c b/arch/arm/mach-mx5/mm-mx50.c new file mode 100644 index 000000000000..8c6540e58390 --- /dev/null +++ b/arch/arm/mach-mx5/mm-mx50.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | * Create static mapping between physical to virtual memory. | ||
19 | */ | ||
20 | |||
21 | #include <linux/mm.h> | ||
22 | #include <linux/init.h> | ||
23 | |||
24 | #include <asm/mach/map.h> | ||
25 | |||
26 | #include <mach/hardware.h> | ||
27 | #include <mach/common.h> | ||
28 | #include <mach/iomux-v3.h> | ||
29 | |||
30 | /* | ||
31 | * Define the MX50 memory map. | ||
32 | */ | ||
33 | static struct map_desc mx50_io_desc[] __initdata = { | ||
34 | imx_map_entry(MX50, TZIC, MT_DEVICE), | ||
35 | imx_map_entry(MX50, SPBA0, MT_DEVICE), | ||
36 | imx_map_entry(MX50, AIPS1, MT_DEVICE), | ||
37 | imx_map_entry(MX50, AIPS2, MT_DEVICE), | ||
38 | }; | ||
39 | |||
40 | /* | ||
41 | * This function initializes the memory map. It is called during the | ||
42 | * system startup to create static physical to virtual memory mappings | ||
43 | * for the IO modules. | ||
44 | */ | ||
45 | void __init mx50_map_io(void) | ||
46 | { | ||
47 | mxc_set_cpu_type(MXC_CPU_MX50); | ||
48 | mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR)); | ||
49 | mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR)); | ||
50 | iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc)); | ||
51 | } | ||
52 | |||
53 | int imx50_register_gpios(void); | ||
54 | |||
55 | void __init mx50_init_irq(void) | ||
56 | { | ||
57 | tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR)); | ||
58 | imx50_register_gpios(); | ||
59 | } | ||
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c index bc3f30db8d9a..457f9f95204b 100644 --- a/arch/arm/mach-mx5/mm.c +++ b/arch/arm/mach-mx5/mm.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * | 3 | * |
4 | * The code contained herein is licensed under the GNU General Public | 4 | * The code contained herein is licensed under the GNU General Public |
5 | * License. You may obtain a copy of the GNU General Public License | 5 | * License. You may obtain a copy of the GNU General Public License |
@@ -23,33 +23,21 @@ | |||
23 | /* | 23 | /* |
24 | * Define the MX51 memory map. | 24 | * Define the MX51 memory map. |
25 | */ | 25 | */ |
26 | static struct map_desc mxc_io_desc[] __initdata = { | 26 | static struct map_desc mx51_io_desc[] __initdata = { |
27 | { | 27 | imx_map_entry(MX51, IRAM, MT_DEVICE), |
28 | .virtual = MX51_IRAM_BASE_ADDR_VIRT, | 28 | imx_map_entry(MX51, DEBUG, MT_DEVICE), |
29 | .pfn = __phys_to_pfn(MX51_IRAM_BASE_ADDR), | 29 | imx_map_entry(MX51, AIPS1, MT_DEVICE), |
30 | .length = MX51_IRAM_SIZE, | 30 | imx_map_entry(MX51, SPBA0, MT_DEVICE), |
31 | .type = MT_DEVICE | 31 | imx_map_entry(MX51, AIPS2, MT_DEVICE), |
32 | }, { | 32 | }; |
33 | .virtual = MX51_DEBUG_BASE_ADDR_VIRT, | 33 | |
34 | .pfn = __phys_to_pfn(MX51_DEBUG_BASE_ADDR), | 34 | /* |
35 | .length = MX51_DEBUG_SIZE, | 35 | * Define the MX53 memory map. |
36 | .type = MT_DEVICE | 36 | */ |
37 | }, { | 37 | static struct map_desc mx53_io_desc[] __initdata = { |
38 | .virtual = MX51_AIPS1_BASE_ADDR_VIRT, | 38 | imx_map_entry(MX53, AIPS1, MT_DEVICE), |
39 | .pfn = __phys_to_pfn(MX51_AIPS1_BASE_ADDR), | 39 | imx_map_entry(MX53, SPBA0, MT_DEVICE), |
40 | .length = MX51_AIPS1_SIZE, | 40 | imx_map_entry(MX53, AIPS2, MT_DEVICE), |
41 | .type = MT_DEVICE | ||
42 | }, { | ||
43 | .virtual = MX51_SPBA0_BASE_ADDR_VIRT, | ||
44 | .pfn = __phys_to_pfn(MX51_SPBA0_BASE_ADDR), | ||
45 | .length = MX51_SPBA0_SIZE, | ||
46 | .type = MT_DEVICE | ||
47 | }, { | ||
48 | .virtual = MX51_AIPS2_BASE_ADDR_VIRT, | ||
49 | .pfn = __phys_to_pfn(MX51_AIPS2_BASE_ADDR), | ||
50 | .length = MX51_AIPS2_SIZE, | ||
51 | .type = MT_DEVICE | ||
52 | }, | ||
53 | }; | 41 | }; |
54 | 42 | ||
55 | /* | 43 | /* |
@@ -61,8 +49,16 @@ void __init mx51_map_io(void) | |||
61 | { | 49 | { |
62 | mxc_set_cpu_type(MXC_CPU_MX51); | 50 | mxc_set_cpu_type(MXC_CPU_MX51); |
63 | mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR)); | 51 | mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR)); |
64 | mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG_BASE_ADDR)); | 52 | mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR)); |
65 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | 53 | iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc)); |
54 | } | ||
55 | |||
56 | void __init mx53_map_io(void) | ||
57 | { | ||
58 | mxc_set_cpu_type(MXC_CPU_MX53); | ||
59 | mxc_iomux_v3_init(MX53_IO_ADDRESS(MX53_IOMUXC_BASE_ADDR)); | ||
60 | mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG_BASE_ADDR)); | ||
61 | iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc)); | ||
66 | } | 62 | } |
67 | 63 | ||
68 | int imx51_register_gpios(void); | 64 | int imx51_register_gpios(void); |
@@ -72,7 +68,7 @@ void __init mx51_init_irq(void) | |||
72 | unsigned long tzic_addr; | 68 | unsigned long tzic_addr; |
73 | void __iomem *tzic_virt; | 69 | void __iomem *tzic_virt; |
74 | 70 | ||
75 | if (mx51_revision() < MX51_CHIP_REV_2_0) | 71 | if (mx51_revision() < IMX_CHIP_REVISION_2_0) |
76 | tzic_addr = MX51_TZIC_BASE_ADDR_TO1; | 72 | tzic_addr = MX51_TZIC_BASE_ADDR_TO1; |
77 | else | 73 | else |
78 | tzic_addr = MX51_TZIC_BASE_ADDR; | 74 | tzic_addr = MX51_TZIC_BASE_ADDR; |
@@ -84,3 +80,20 @@ void __init mx51_init_irq(void) | |||
84 | tzic_init_irq(tzic_virt); | 80 | tzic_init_irq(tzic_virt); |
85 | imx51_register_gpios(); | 81 | imx51_register_gpios(); |
86 | } | 82 | } |
83 | |||
84 | int imx53_register_gpios(void); | ||
85 | |||
86 | void __init mx53_init_irq(void) | ||
87 | { | ||
88 | unsigned long tzic_addr; | ||
89 | void __iomem *tzic_virt; | ||
90 | |||
91 | tzic_addr = MX53_TZIC_BASE_ADDR; | ||
92 | |||
93 | tzic_virt = ioremap(tzic_addr, SZ_16K); | ||
94 | if (!tzic_virt) | ||
95 | panic("unable to map TZIC interrupt controller\n"); | ||
96 | |||
97 | tzic_init_irq(tzic_virt); | ||
98 | imx53_register_gpios(); | ||
99 | } | ||
diff --git a/arch/arm/mach-mxc91231/clock.c b/arch/arm/mach-mxc91231/clock.c index 5c85075d8a56..9fab505f1eb1 100644 --- a/arch/arm/mach-mxc91231/clock.c +++ b/arch/arm/mach-mxc91231/clock.c | |||
@@ -2,12 +2,12 @@ | |||
2 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
3 | #include <linux/init.h> | 3 | #include <linux/init.h> |
4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
5 | #include <linux/clkdev.h> | ||
5 | 6 | ||
6 | #include <mach/clock.h> | 7 | #include <mach/clock.h> |
7 | #include <mach/hardware.h> | 8 | #include <mach/hardware.h> |
8 | #include <mach/common.h> | 9 | #include <mach/common.h> |
9 | 10 | ||
10 | #include <asm/clkdev.h> | ||
11 | #include <asm/bug.h> | 11 | #include <asm/bug.h> |
12 | #include <asm/div64.h> | 12 | #include <asm/div64.h> |
13 | 13 | ||
diff --git a/arch/arm/mach-mxc91231/mm.c b/arch/arm/mach-mxc91231/mm.c index aeccfd755fee..7652c301da88 100644 --- a/arch/arm/mach-mxc91231/mm.c +++ b/arch/arm/mach-mxc91231/mm.c | |||
@@ -27,48 +27,15 @@ | |||
27 | /* | 27 | /* |
28 | * This structure defines the MXC memory map. | 28 | * This structure defines the MXC memory map. |
29 | */ | 29 | */ |
30 | static struct map_desc mxc_io_desc[] __initdata = { | 30 | static struct map_desc mxc91231_io_desc[] __initdata = { |
31 | { | 31 | imx_map_entry(MXC91231, L2CC, MT_DEVICE), |
32 | .virtual = MXC91231_L2CC_BASE_ADDR_VIRT, | 32 | imx_map_entry(MXC91231, X_MEMC, MT_DEVICE), |
33 | .pfn = __phys_to_pfn(MXC91231_L2CC_BASE_ADDR), | 33 | imx_map_entry(MXC91231, ROMP, MT_DEVICE), |
34 | .length = MXC91231_L2CC_SIZE, | 34 | imx_map_entry(MXC91231, AVIC, MT_DEVICE), |
35 | .type = MT_DEVICE, | 35 | imx_map_entry(MXC91231, AIPS1, MT_DEVICE), |
36 | }, { | 36 | imx_map_entry(MXC91231, SPBA0, MT_DEVICE), |
37 | .virtual = MXC91231_X_MEMC_BASE_ADDR_VIRT, | 37 | imx_map_entry(MXC91231, SPBA1, MT_DEVICE), |
38 | .pfn = __phys_to_pfn(MXC91231_X_MEMC_BASE_ADDR), | 38 | imx_map_entry(MXC91231, AIPS2, MT_DEVICE), |
39 | .length = MXC91231_X_MEMC_SIZE, | ||
40 | .type = MT_DEVICE, | ||
41 | }, { | ||
42 | .virtual = MXC91231_ROMP_BASE_ADDR_VIRT, | ||
43 | .pfn = __phys_to_pfn(MXC91231_ROMP_BASE_ADDR), | ||
44 | .length = MXC91231_ROMP_SIZE, | ||
45 | .type = MT_DEVICE, | ||
46 | }, { | ||
47 | .virtual = MXC91231_AVIC_BASE_ADDR_VIRT, | ||
48 | .pfn = __phys_to_pfn(MXC91231_AVIC_BASE_ADDR), | ||
49 | .length = MXC91231_AVIC_SIZE, | ||
50 | .type = MT_DEVICE, | ||
51 | }, { | ||
52 | .virtual = MXC91231_AIPS1_BASE_ADDR_VIRT, | ||
53 | .pfn = __phys_to_pfn(MXC91231_AIPS1_BASE_ADDR), | ||
54 | .length = MXC91231_AIPS1_SIZE, | ||
55 | .type = MT_DEVICE, | ||
56 | }, { | ||
57 | .virtual = MXC91231_SPBA0_BASE_ADDR_VIRT, | ||
58 | .pfn = __phys_to_pfn(MXC91231_SPBA0_BASE_ADDR), | ||
59 | .length = MXC91231_SPBA0_SIZE, | ||
60 | .type = MT_DEVICE, | ||
61 | }, { | ||
62 | .virtual = MXC91231_SPBA1_BASE_ADDR_VIRT, | ||
63 | .pfn = __phys_to_pfn(MXC91231_SPBA1_BASE_ADDR), | ||
64 | .length = MXC91231_SPBA1_SIZE, | ||
65 | .type = MT_DEVICE, | ||
66 | }, { | ||
67 | .virtual = MXC91231_AIPS2_BASE_ADDR_VIRT, | ||
68 | .pfn = __phys_to_pfn(MXC91231_AIPS2_BASE_ADDR), | ||
69 | .length = MXC91231_AIPS2_SIZE, | ||
70 | .type = MT_DEVICE, | ||
71 | }, | ||
72 | }; | 39 | }; |
73 | 40 | ||
74 | /* | 41 | /* |
@@ -80,7 +47,7 @@ void __init mxc91231_map_io(void) | |||
80 | { | 47 | { |
81 | mxc_set_cpu_type(MXC_CPU_MXC91231); | 48 | mxc_set_cpu_type(MXC_CPU_MXC91231); |
82 | 49 | ||
83 | iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); | 50 | iotable_init(mxc91231_io_desc, ARRAY_SIZE(mxc91231_io_desc)); |
84 | } | 51 | } |
85 | 52 | ||
86 | int mxc91231_register_gpios(void); | 53 | int mxc91231_register_gpios(void); |
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig new file mode 100644 index 000000000000..c4ac7b415195 --- /dev/null +++ b/arch/arm/mach-mxs/Kconfig | |||
@@ -0,0 +1,34 @@ | |||
1 | if ARCH_MXS | ||
2 | |||
3 | source "arch/arm/mach-mxs/devices/Kconfig" | ||
4 | |||
5 | config SOC_IMX23 | ||
6 | bool | ||
7 | select CPU_ARM926T | ||
8 | |||
9 | config SOC_IMX28 | ||
10 | bool | ||
11 | select CPU_ARM926T | ||
12 | |||
13 | comment "MXS platforms:" | ||
14 | |||
15 | config MACH_MX23EVK | ||
16 | bool "Support MX23EVK Platform" | ||
17 | select SOC_IMX23 | ||
18 | select MXS_HAVE_PLATFORM_DUART | ||
19 | default y | ||
20 | help | ||
21 | Include support for MX23EVK platform. This includes specific | ||
22 | configurations for the board and its peripherals. | ||
23 | |||
24 | config MACH_MX28EVK | ||
25 | bool "Support MX28EVK Platform" | ||
26 | select SOC_IMX28 | ||
27 | select MXS_HAVE_PLATFORM_DUART | ||
28 | select MXS_HAVE_PLATFORM_FEC | ||
29 | default y | ||
30 | help | ||
31 | Include support for MX28EVK platform. This includes specific | ||
32 | configurations for the board and its peripherals. | ||
33 | |||
34 | endif | ||
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile new file mode 100644 index 000000000000..39d3f9c2a841 --- /dev/null +++ b/arch/arm/mach-mxs/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # Common support | ||
2 | obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o | ||
3 | |||
4 | obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o | ||
5 | obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o | ||
6 | |||
7 | obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o | ||
8 | obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o | ||
9 | |||
10 | obj-y += devices/ | ||
diff --git a/arch/arm/mach-mxs/Makefile.boot b/arch/arm/mach-mxs/Makefile.boot new file mode 100644 index 000000000000..eb541e0291da --- /dev/null +++ b/arch/arm/mach-mxs/Makefile.boot | |||
@@ -0,0 +1 @@ | |||
zreladdr-y := 0x40008000 | |||
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c new file mode 100644 index 000000000000..8f5a19ab558c --- /dev/null +++ b/arch/arm/mach-mxs/clock-mx23.c | |||
@@ -0,0 +1,526 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/mm.h> | ||
20 | #include <linux/delay.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/jiffies.h> | ||
24 | |||
25 | #include <asm/clkdev.h> | ||
26 | #include <asm/div64.h> | ||
27 | |||
28 | #include <mach/mx23.h> | ||
29 | #include <mach/common.h> | ||
30 | #include <mach/clock.h> | ||
31 | |||
32 | #include "regs-clkctrl-mx23.h" | ||
33 | |||
34 | #define CLKCTRL_BASE_ADDR MX23_IO_ADDRESS(MX23_CLKCTRL_BASE_ADDR) | ||
35 | #define DIGCTRL_BASE_ADDR MX23_IO_ADDRESS(MX23_DIGCTL_BASE_ADDR) | ||
36 | |||
37 | #define PARENT_RATE_SHIFT 8 | ||
38 | |||
39 | static int _raw_clk_enable(struct clk *clk) | ||
40 | { | ||
41 | u32 reg; | ||
42 | |||
43 | if (clk->enable_reg) { | ||
44 | reg = __raw_readl(clk->enable_reg); | ||
45 | reg &= ~(1 << clk->enable_shift); | ||
46 | __raw_writel(reg, clk->enable_reg); | ||
47 | } | ||
48 | |||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | static void _raw_clk_disable(struct clk *clk) | ||
53 | { | ||
54 | u32 reg; | ||
55 | |||
56 | if (clk->enable_reg) { | ||
57 | reg = __raw_readl(clk->enable_reg); | ||
58 | reg |= 1 << clk->enable_shift; | ||
59 | __raw_writel(reg, clk->enable_reg); | ||
60 | } | ||
61 | } | ||
62 | |||
63 | /* | ||
64 | * ref_xtal_clk | ||
65 | */ | ||
66 | static unsigned long ref_xtal_clk_get_rate(struct clk *clk) | ||
67 | { | ||
68 | return 24000000; | ||
69 | } | ||
70 | |||
71 | static struct clk ref_xtal_clk = { | ||
72 | .get_rate = ref_xtal_clk_get_rate, | ||
73 | }; | ||
74 | |||
75 | /* | ||
76 | * pll_clk | ||
77 | */ | ||
78 | static unsigned long pll_clk_get_rate(struct clk *clk) | ||
79 | { | ||
80 | return 480000000; | ||
81 | } | ||
82 | |||
83 | static int pll_clk_enable(struct clk *clk) | ||
84 | { | ||
85 | __raw_writel(BM_CLKCTRL_PLLCTRL0_POWER | | ||
86 | BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS, | ||
87 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_PLLCTRL0_SET); | ||
88 | |||
89 | /* Only a 10us delay is need. PLLCTRL1 LOCK bitfied is only a timer | ||
90 | * and is incorrect (excessive). Per definition of the PLLCTRL0 | ||
91 | * POWER field, waiting at least 10us. | ||
92 | */ | ||
93 | udelay(10); | ||
94 | |||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | static void pll_clk_disable(struct clk *clk) | ||
99 | { | ||
100 | __raw_writel(BM_CLKCTRL_PLLCTRL0_POWER | | ||
101 | BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS, | ||
102 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_PLLCTRL0_CLR); | ||
103 | } | ||
104 | |||
105 | static struct clk pll_clk = { | ||
106 | .get_rate = pll_clk_get_rate, | ||
107 | .enable = pll_clk_enable, | ||
108 | .disable = pll_clk_disable, | ||
109 | .parent = &ref_xtal_clk, | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * ref_clk | ||
114 | */ | ||
115 | #define _CLK_GET_RATE_REF(name, sr, ss) \ | ||
116 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
117 | { \ | ||
118 | unsigned long parent_rate; \ | ||
119 | u32 reg, div; \ | ||
120 | \ | ||
121 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##sr); \ | ||
122 | div = (reg >> BP_CLKCTRL_##sr##_##ss##FRAC) & 0x3f; \ | ||
123 | parent_rate = clk_get_rate(clk->parent); \ | ||
124 | \ | ||
125 | return SH_DIV((parent_rate >> PARENT_RATE_SHIFT) * 18, \ | ||
126 | div, PARENT_RATE_SHIFT); \ | ||
127 | } | ||
128 | |||
129 | _CLK_GET_RATE_REF(ref_cpu_clk, FRAC, CPU) | ||
130 | _CLK_GET_RATE_REF(ref_emi_clk, FRAC, EMI) | ||
131 | _CLK_GET_RATE_REF(ref_pix_clk, FRAC, PIX) | ||
132 | _CLK_GET_RATE_REF(ref_io_clk, FRAC, IO) | ||
133 | |||
134 | #define _DEFINE_CLOCK_REF(name, er, es) \ | ||
135 | static struct clk name = { \ | ||
136 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
137 | .enable_shift = BP_CLKCTRL_##er##_CLKGATE##es, \ | ||
138 | .get_rate = name##_get_rate, \ | ||
139 | .enable = _raw_clk_enable, \ | ||
140 | .disable = _raw_clk_disable, \ | ||
141 | .parent = &pll_clk, \ | ||
142 | } | ||
143 | |||
144 | _DEFINE_CLOCK_REF(ref_cpu_clk, FRAC, CPU); | ||
145 | _DEFINE_CLOCK_REF(ref_emi_clk, FRAC, EMI); | ||
146 | _DEFINE_CLOCK_REF(ref_pix_clk, FRAC, PIX); | ||
147 | _DEFINE_CLOCK_REF(ref_io_clk, FRAC, IO); | ||
148 | |||
149 | /* | ||
150 | * General clocks | ||
151 | * | ||
152 | * clk_get_rate | ||
153 | */ | ||
154 | static unsigned long rtc_clk_get_rate(struct clk *clk) | ||
155 | { | ||
156 | /* ref_xtal_clk is implemented as the only parent */ | ||
157 | return clk_get_rate(clk->parent) / 768; | ||
158 | } | ||
159 | |||
160 | static unsigned long clk32k_clk_get_rate(struct clk *clk) | ||
161 | { | ||
162 | return clk->parent->get_rate(clk->parent) / 750; | ||
163 | } | ||
164 | |||
165 | #define _CLK_GET_RATE(name, rs) \ | ||
166 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
167 | { \ | ||
168 | u32 reg, div; \ | ||
169 | \ | ||
170 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
171 | \ | ||
172 | if (clk->parent == &ref_xtal_clk) \ | ||
173 | div = (reg & BM_CLKCTRL_##rs##_DIV_XTAL) >> \ | ||
174 | BP_CLKCTRL_##rs##_DIV_XTAL; \ | ||
175 | else \ | ||
176 | div = (reg & BM_CLKCTRL_##rs##_DIV_##rs) >> \ | ||
177 | BP_CLKCTRL_##rs##_DIV_##rs; \ | ||
178 | \ | ||
179 | if (!div) \ | ||
180 | return -EINVAL; \ | ||
181 | \ | ||
182 | return clk_get_rate(clk->parent) / div; \ | ||
183 | } | ||
184 | |||
185 | _CLK_GET_RATE(cpu_clk, CPU) | ||
186 | _CLK_GET_RATE(emi_clk, EMI) | ||
187 | |||
188 | #define _CLK_GET_RATE1(name, rs) \ | ||
189 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
190 | { \ | ||
191 | u32 reg, div; \ | ||
192 | \ | ||
193 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
194 | div = (reg & BM_CLKCTRL_##rs##_DIV) >> BP_CLKCTRL_##rs##_DIV; \ | ||
195 | \ | ||
196 | if (!div) \ | ||
197 | return -EINVAL; \ | ||
198 | \ | ||
199 | return clk_get_rate(clk->parent) / div; \ | ||
200 | } | ||
201 | |||
202 | _CLK_GET_RATE1(hbus_clk, HBUS) | ||
203 | _CLK_GET_RATE1(xbus_clk, XBUS) | ||
204 | _CLK_GET_RATE1(ssp_clk, SSP) | ||
205 | _CLK_GET_RATE1(gpmi_clk, GPMI) | ||
206 | _CLK_GET_RATE1(lcdif_clk, PIX) | ||
207 | |||
208 | #define _CLK_GET_RATE_STUB(name) \ | ||
209 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
210 | { \ | ||
211 | return clk_get_rate(clk->parent); \ | ||
212 | } | ||
213 | |||
214 | _CLK_GET_RATE_STUB(uart_clk) | ||
215 | _CLK_GET_RATE_STUB(audio_clk) | ||
216 | _CLK_GET_RATE_STUB(pwm_clk) | ||
217 | |||
218 | /* | ||
219 | * clk_set_rate | ||
220 | */ | ||
221 | static int cpu_clk_set_rate(struct clk *clk, unsigned long rate) | ||
222 | { | ||
223 | u32 reg, bm_busy, div_max, d, f, div, frac; | ||
224 | unsigned long diff, parent_rate, calc_rate; | ||
225 | int i; | ||
226 | |||
227 | parent_rate = clk_get_rate(clk->parent); | ||
228 | |||
229 | if (clk->parent == &ref_xtal_clk) { | ||
230 | div_max = BM_CLKCTRL_CPU_DIV_XTAL >> BP_CLKCTRL_CPU_DIV_XTAL; | ||
231 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_XTAL; | ||
232 | div = DIV_ROUND_UP(parent_rate, rate); | ||
233 | if (div == 0 || div > div_max) | ||
234 | return -EINVAL; | ||
235 | } else { | ||
236 | div_max = BM_CLKCTRL_CPU_DIV_CPU >> BP_CLKCTRL_CPU_DIV_CPU; | ||
237 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_CPU; | ||
238 | rate >>= PARENT_RATE_SHIFT; | ||
239 | parent_rate >>= PARENT_RATE_SHIFT; | ||
240 | diff = parent_rate; | ||
241 | div = frac = 1; | ||
242 | for (d = 1; d <= div_max; d++) { | ||
243 | f = parent_rate * 18 / d / rate; | ||
244 | if ((parent_rate * 18 / d) % rate) | ||
245 | f++; | ||
246 | if (f < 18 || f > 35) | ||
247 | continue; | ||
248 | |||
249 | calc_rate = parent_rate * 18 / f / d; | ||
250 | if (calc_rate > rate) | ||
251 | continue; | ||
252 | |||
253 | if (rate - calc_rate < diff) { | ||
254 | frac = f; | ||
255 | div = d; | ||
256 | diff = rate - calc_rate; | ||
257 | } | ||
258 | |||
259 | if (diff == 0) | ||
260 | break; | ||
261 | } | ||
262 | |||
263 | if (diff == parent_rate) | ||
264 | return -EINVAL; | ||
265 | |||
266 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_FRAC); | ||
267 | reg &= ~BM_CLKCTRL_FRAC_CPUFRAC; | ||
268 | reg |= frac; | ||
269 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_FRAC); | ||
270 | } | ||
271 | |||
272 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU); | ||
273 | reg &= ~BM_CLKCTRL_CPU_DIV_CPU; | ||
274 | reg |= div << BP_CLKCTRL_CPU_DIV_CPU; | ||
275 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU); | ||
276 | |||
277 | for (i = 10000; i; i--) | ||
278 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + | ||
279 | HW_CLKCTRL_CPU) & bm_busy)) | ||
280 | break; | ||
281 | if (!i) { | ||
282 | pr_err("%s: divider writing timeout\n", __func__); | ||
283 | return -ETIMEDOUT; | ||
284 | } | ||
285 | |||
286 | return 0; | ||
287 | } | ||
288 | |||
289 | #define _CLK_SET_RATE(name, dr) \ | ||
290 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
291 | { \ | ||
292 | u32 reg, div_max, div; \ | ||
293 | unsigned long parent_rate; \ | ||
294 | int i; \ | ||
295 | \ | ||
296 | parent_rate = clk_get_rate(clk->parent); \ | ||
297 | div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \ | ||
298 | \ | ||
299 | div = DIV_ROUND_UP(parent_rate, rate); \ | ||
300 | if (div == 0 || div > div_max) \ | ||
301 | return -EINVAL; \ | ||
302 | \ | ||
303 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
304 | reg &= ~BM_CLKCTRL_##dr##_DIV; \ | ||
305 | reg |= div << BP_CLKCTRL_##dr##_DIV; \ | ||
306 | if (reg | (1 << clk->enable_shift)) { \ | ||
307 | pr_err("%s: clock is gated\n", __func__); \ | ||
308 | return -EINVAL; \ | ||
309 | } \ | ||
310 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
311 | \ | ||
312 | for (i = 10000; i; i--) \ | ||
313 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
314 | HW_CLKCTRL_##dr) & BM_CLKCTRL_##dr##_BUSY)) \ | ||
315 | break; \ | ||
316 | if (!i) { \ | ||
317 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
318 | return -ETIMEDOUT; \ | ||
319 | } \ | ||
320 | \ | ||
321 | return 0; \ | ||
322 | } | ||
323 | |||
324 | _CLK_SET_RATE(xbus_clk, XBUS) | ||
325 | _CLK_SET_RATE(ssp_clk, SSP) | ||
326 | _CLK_SET_RATE(gpmi_clk, GPMI) | ||
327 | _CLK_SET_RATE(lcdif_clk, PIX) | ||
328 | |||
329 | #define _CLK_SET_RATE_STUB(name) \ | ||
330 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
331 | { \ | ||
332 | return -EINVAL; \ | ||
333 | } | ||
334 | |||
335 | _CLK_SET_RATE_STUB(emi_clk) | ||
336 | _CLK_SET_RATE_STUB(uart_clk) | ||
337 | _CLK_SET_RATE_STUB(audio_clk) | ||
338 | _CLK_SET_RATE_STUB(pwm_clk) | ||
339 | _CLK_SET_RATE_STUB(clk32k_clk) | ||
340 | |||
341 | /* | ||
342 | * clk_set_parent | ||
343 | */ | ||
344 | #define _CLK_SET_PARENT(name, bit) \ | ||
345 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
346 | { \ | ||
347 | if (parent != clk->parent) { \ | ||
348 | __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \ | ||
349 | HW_CLKCTRL_CLKSEQ_TOG); \ | ||
350 | clk->parent = parent; \ | ||
351 | } \ | ||
352 | \ | ||
353 | return 0; \ | ||
354 | } | ||
355 | |||
356 | _CLK_SET_PARENT(cpu_clk, CPU) | ||
357 | _CLK_SET_PARENT(emi_clk, EMI) | ||
358 | _CLK_SET_PARENT(ssp_clk, SSP) | ||
359 | _CLK_SET_PARENT(gpmi_clk, GPMI) | ||
360 | _CLK_SET_PARENT(lcdif_clk, PIX) | ||
361 | |||
362 | #define _CLK_SET_PARENT_STUB(name) \ | ||
363 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
364 | { \ | ||
365 | if (parent != clk->parent) \ | ||
366 | return -EINVAL; \ | ||
367 | else \ | ||
368 | return 0; \ | ||
369 | } | ||
370 | |||
371 | _CLK_SET_PARENT_STUB(uart_clk) | ||
372 | _CLK_SET_PARENT_STUB(audio_clk) | ||
373 | _CLK_SET_PARENT_STUB(pwm_clk) | ||
374 | _CLK_SET_PARENT_STUB(clk32k_clk) | ||
375 | |||
376 | /* | ||
377 | * clk definition | ||
378 | */ | ||
379 | static struct clk cpu_clk = { | ||
380 | .get_rate = cpu_clk_get_rate, | ||
381 | .set_rate = cpu_clk_set_rate, | ||
382 | .set_parent = cpu_clk_set_parent, | ||
383 | .parent = &ref_cpu_clk, | ||
384 | }; | ||
385 | |||
386 | static struct clk hbus_clk = { | ||
387 | .get_rate = hbus_clk_get_rate, | ||
388 | .parent = &cpu_clk, | ||
389 | }; | ||
390 | |||
391 | static struct clk xbus_clk = { | ||
392 | .get_rate = xbus_clk_get_rate, | ||
393 | .set_rate = xbus_clk_set_rate, | ||
394 | .parent = &ref_xtal_clk, | ||
395 | }; | ||
396 | |||
397 | static struct clk rtc_clk = { | ||
398 | .get_rate = rtc_clk_get_rate, | ||
399 | .parent = &ref_xtal_clk, | ||
400 | }; | ||
401 | |||
402 | /* usb_clk gate is controlled in DIGCTRL other than CLKCTRL */ | ||
403 | static struct clk usb_clk = { | ||
404 | .enable_reg = DIGCTRL_BASE_ADDR, | ||
405 | .enable_shift = 2, | ||
406 | .enable = _raw_clk_enable, | ||
407 | .disable = _raw_clk_disable, | ||
408 | .parent = &pll_clk, | ||
409 | }; | ||
410 | |||
411 | #define _DEFINE_CLOCK(name, er, es, p) \ | ||
412 | static struct clk name = { \ | ||
413 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
414 | .enable_shift = BP_CLKCTRL_##er##_##es, \ | ||
415 | .get_rate = name##_get_rate, \ | ||
416 | .set_rate = name##_set_rate, \ | ||
417 | .set_parent = name##_set_parent, \ | ||
418 | .enable = _raw_clk_enable, \ | ||
419 | .disable = _raw_clk_disable, \ | ||
420 | .parent = p, \ | ||
421 | } | ||
422 | |||
423 | _DEFINE_CLOCK(emi_clk, EMI, CLKGATE, &ref_xtal_clk); | ||
424 | _DEFINE_CLOCK(ssp_clk, SSP, CLKGATE, &ref_xtal_clk); | ||
425 | _DEFINE_CLOCK(gpmi_clk, GPMI, CLKGATE, &ref_xtal_clk); | ||
426 | _DEFINE_CLOCK(lcdif_clk, PIX, CLKGATE, &ref_xtal_clk); | ||
427 | _DEFINE_CLOCK(uart_clk, XTAL, UART_CLK_GATE, &ref_xtal_clk); | ||
428 | _DEFINE_CLOCK(audio_clk, XTAL, FILT_CLK24M_GATE, &ref_xtal_clk); | ||
429 | _DEFINE_CLOCK(pwm_clk, XTAL, PWM_CLK24M_GATE, &ref_xtal_clk); | ||
430 | _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk); | ||
431 | |||
432 | #define _REGISTER_CLOCK(d, n, c) \ | ||
433 | { \ | ||
434 | .dev_id = d, \ | ||
435 | .con_id = n, \ | ||
436 | .clk = &c, \ | ||
437 | }, | ||
438 | |||
439 | static struct clk_lookup lookups[] = { | ||
440 | _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) | ||
441 | _REGISTER_CLOCK("rtc", NULL, rtc_clk) | ||
442 | _REGISTER_CLOCK(NULL, "hclk", hbus_clk) | ||
443 | _REGISTER_CLOCK(NULL, "xclk", xbus_clk) | ||
444 | _REGISTER_CLOCK(NULL, "usb", usb_clk) | ||
445 | _REGISTER_CLOCK(NULL, "audio", audio_clk) | ||
446 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | ||
447 | }; | ||
448 | |||
449 | static int clk_misc_init(void) | ||
450 | { | ||
451 | u32 reg; | ||
452 | int i; | ||
453 | |||
454 | /* Fix up parent per register setting */ | ||
455 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ); | ||
456 | cpu_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_CPU) ? | ||
457 | &ref_xtal_clk : &ref_cpu_clk; | ||
458 | emi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_EMI) ? | ||
459 | &ref_xtal_clk : &ref_emi_clk; | ||
460 | ssp_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP) ? | ||
461 | &ref_xtal_clk : &ref_io_clk; | ||
462 | gpmi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_GPMI) ? | ||
463 | &ref_xtal_clk : &ref_io_clk; | ||
464 | lcdif_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_PIX) ? | ||
465 | &ref_xtal_clk : &ref_pix_clk; | ||
466 | |||
467 | /* Use int div over frac when both are available */ | ||
468 | __raw_writel(BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN, | ||
469 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
470 | __raw_writel(BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN, | ||
471 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
472 | __raw_writel(BM_CLKCTRL_HBUS_DIV_FRAC_EN, | ||
473 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS_CLR); | ||
474 | |||
475 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
476 | reg &= ~BM_CLKCTRL_XBUS_DIV_FRAC_EN; | ||
477 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
478 | |||
479 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP); | ||
480 | reg &= ~BM_CLKCTRL_SSP_DIV_FRAC_EN; | ||
481 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP); | ||
482 | |||
483 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
484 | reg &= ~BM_CLKCTRL_GPMI_DIV_FRAC_EN; | ||
485 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
486 | |||
487 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_PIX); | ||
488 | reg &= ~BM_CLKCTRL_PIX_DIV_FRAC_EN; | ||
489 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_PIX); | ||
490 | |||
491 | /* | ||
492 | * Set safe hbus clock divider. A divider of 3 ensure that | ||
493 | * the Vddd voltage required for the cpu clock is sufficiently | ||
494 | * high for the hbus clock. | ||
495 | */ | ||
496 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
497 | reg &= BM_CLKCTRL_HBUS_DIV; | ||
498 | reg |= 3 << BP_CLKCTRL_HBUS_DIV; | ||
499 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
500 | |||
501 | for (i = 10000; i; i--) | ||
502 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + | ||
503 | HW_CLKCTRL_HBUS) & BM_CLKCTRL_HBUS_BUSY)) | ||
504 | break; | ||
505 | if (!i) { | ||
506 | pr_err("%s: divider writing timeout\n", __func__); | ||
507 | return -ETIMEDOUT; | ||
508 | } | ||
509 | |||
510 | /* Gate off cpu clock in WFI for power saving */ | ||
511 | __raw_writel(BM_CLKCTRL_CPU_INTERRUPT_WAIT, | ||
512 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_SET); | ||
513 | |||
514 | return 0; | ||
515 | } | ||
516 | |||
517 | int __init mx23_clocks_init(void) | ||
518 | { | ||
519 | clk_misc_init(); | ||
520 | |||
521 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
522 | |||
523 | mxs_timer_init(&clk32k_clk, MX23_INT_TIMER0); | ||
524 | |||
525 | return 0; | ||
526 | } | ||
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c new file mode 100644 index 000000000000..74e2103c6011 --- /dev/null +++ b/arch/arm/mach-mxs/clock-mx28.c | |||
@@ -0,0 +1,734 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/mm.h> | ||
20 | #include <linux/delay.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/jiffies.h> | ||
24 | |||
25 | #include <asm/clkdev.h> | ||
26 | #include <asm/div64.h> | ||
27 | |||
28 | #include <mach/mx28.h> | ||
29 | #include <mach/common.h> | ||
30 | #include <mach/clock.h> | ||
31 | |||
32 | #include "regs-clkctrl-mx28.h" | ||
33 | |||
34 | #define CLKCTRL_BASE_ADDR MX28_IO_ADDRESS(MX28_CLKCTRL_BASE_ADDR) | ||
35 | #define DIGCTRL_BASE_ADDR MX28_IO_ADDRESS(MX28_DIGCTL_BASE_ADDR) | ||
36 | |||
37 | #define PARENT_RATE_SHIFT 8 | ||
38 | |||
39 | static struct clk pll2_clk; | ||
40 | static struct clk cpu_clk; | ||
41 | static struct clk emi_clk; | ||
42 | static struct clk saif0_clk; | ||
43 | static struct clk saif1_clk; | ||
44 | static struct clk clk32k_clk; | ||
45 | |||
46 | static int _raw_clk_enable(struct clk *clk) | ||
47 | { | ||
48 | u32 reg; | ||
49 | |||
50 | if (clk->enable_reg) { | ||
51 | reg = __raw_readl(clk->enable_reg); | ||
52 | reg &= ~(1 << clk->enable_shift); | ||
53 | __raw_writel(reg, clk->enable_reg); | ||
54 | } | ||
55 | |||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static void _raw_clk_disable(struct clk *clk) | ||
60 | { | ||
61 | u32 reg; | ||
62 | |||
63 | if (clk->enable_reg) { | ||
64 | reg = __raw_readl(clk->enable_reg); | ||
65 | reg |= 1 << clk->enable_shift; | ||
66 | __raw_writel(reg, clk->enable_reg); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /* | ||
71 | * ref_xtal_clk | ||
72 | */ | ||
73 | static unsigned long ref_xtal_clk_get_rate(struct clk *clk) | ||
74 | { | ||
75 | return 24000000; | ||
76 | } | ||
77 | |||
78 | static struct clk ref_xtal_clk = { | ||
79 | .get_rate = ref_xtal_clk_get_rate, | ||
80 | }; | ||
81 | |||
82 | /* | ||
83 | * pll_clk | ||
84 | */ | ||
85 | static unsigned long pll0_clk_get_rate(struct clk *clk) | ||
86 | { | ||
87 | return 480000000; | ||
88 | } | ||
89 | |||
90 | static unsigned long pll1_clk_get_rate(struct clk *clk) | ||
91 | { | ||
92 | return 480000000; | ||
93 | } | ||
94 | |||
95 | static unsigned long pll2_clk_get_rate(struct clk *clk) | ||
96 | { | ||
97 | return 50000000; | ||
98 | } | ||
99 | |||
100 | #define _CLK_ENABLE_PLL(name, r, g) \ | ||
101 | static int name##_enable(struct clk *clk) \ | ||
102 | { \ | ||
103 | __raw_writel(BM_CLKCTRL_##r##CTRL0_POWER, \ | ||
104 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_SET); \ | ||
105 | udelay(10); \ | ||
106 | \ | ||
107 | if (clk == &pll2_clk) \ | ||
108 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
109 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ | ||
110 | else \ | ||
111 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
112 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_SET); \ | ||
113 | \ | ||
114 | return 0; \ | ||
115 | } | ||
116 | |||
117 | _CLK_ENABLE_PLL(pll0_clk, PLL0, EN_USB_CLKS) | ||
118 | _CLK_ENABLE_PLL(pll1_clk, PLL1, EN_USB_CLKS) | ||
119 | _CLK_ENABLE_PLL(pll2_clk, PLL2, CLKGATE) | ||
120 | |||
121 | #define _CLK_DISABLE_PLL(name, r, g) \ | ||
122 | static void name##_disable(struct clk *clk) \ | ||
123 | { \ | ||
124 | __raw_writel(BM_CLKCTRL_##r##CTRL0_POWER, \ | ||
125 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ | ||
126 | \ | ||
127 | if (clk == &pll2_clk) \ | ||
128 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
129 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_SET); \ | ||
130 | else \ | ||
131 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
132 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ | ||
133 | \ | ||
134 | } | ||
135 | |||
136 | _CLK_DISABLE_PLL(pll0_clk, PLL0, EN_USB_CLKS) | ||
137 | _CLK_DISABLE_PLL(pll1_clk, PLL1, EN_USB_CLKS) | ||
138 | _CLK_DISABLE_PLL(pll2_clk, PLL2, CLKGATE) | ||
139 | |||
140 | #define _DEFINE_CLOCK_PLL(name) \ | ||
141 | static struct clk name = { \ | ||
142 | .get_rate = name##_get_rate, \ | ||
143 | .enable = name##_enable, \ | ||
144 | .disable = name##_disable, \ | ||
145 | .parent = &ref_xtal_clk, \ | ||
146 | } | ||
147 | |||
148 | _DEFINE_CLOCK_PLL(pll0_clk); | ||
149 | _DEFINE_CLOCK_PLL(pll1_clk); | ||
150 | _DEFINE_CLOCK_PLL(pll2_clk); | ||
151 | |||
152 | /* | ||
153 | * ref_clk | ||
154 | */ | ||
155 | #define _CLK_GET_RATE_REF(name, sr, ss) \ | ||
156 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
157 | { \ | ||
158 | unsigned long parent_rate; \ | ||
159 | u32 reg, div; \ | ||
160 | \ | ||
161 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##sr); \ | ||
162 | div = (reg >> BP_CLKCTRL_##sr##_##ss##FRAC) & 0x3f; \ | ||
163 | parent_rate = clk_get_rate(clk->parent); \ | ||
164 | \ | ||
165 | return SH_DIV((parent_rate >> PARENT_RATE_SHIFT) * 18, \ | ||
166 | div, PARENT_RATE_SHIFT); \ | ||
167 | } | ||
168 | |||
169 | _CLK_GET_RATE_REF(ref_cpu_clk, FRAC0, CPU) | ||
170 | _CLK_GET_RATE_REF(ref_emi_clk, FRAC0, EMI) | ||
171 | _CLK_GET_RATE_REF(ref_io0_clk, FRAC0, IO0) | ||
172 | _CLK_GET_RATE_REF(ref_io1_clk, FRAC0, IO1) | ||
173 | _CLK_GET_RATE_REF(ref_pix_clk, FRAC1, PIX) | ||
174 | _CLK_GET_RATE_REF(ref_gpmi_clk, FRAC1, GPMI) | ||
175 | |||
176 | #define _DEFINE_CLOCK_REF(name, er, es) \ | ||
177 | static struct clk name = { \ | ||
178 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
179 | .enable_shift = BP_CLKCTRL_##er##_CLKGATE##es, \ | ||
180 | .get_rate = name##_get_rate, \ | ||
181 | .enable = _raw_clk_enable, \ | ||
182 | .disable = _raw_clk_disable, \ | ||
183 | .parent = &pll0_clk, \ | ||
184 | } | ||
185 | |||
186 | _DEFINE_CLOCK_REF(ref_cpu_clk, FRAC0, CPU); | ||
187 | _DEFINE_CLOCK_REF(ref_emi_clk, FRAC0, EMI); | ||
188 | _DEFINE_CLOCK_REF(ref_io0_clk, FRAC0, IO0); | ||
189 | _DEFINE_CLOCK_REF(ref_io1_clk, FRAC0, IO1); | ||
190 | _DEFINE_CLOCK_REF(ref_pix_clk, FRAC1, PIX); | ||
191 | _DEFINE_CLOCK_REF(ref_gpmi_clk, FRAC1, GPMI); | ||
192 | |||
193 | /* | ||
194 | * General clocks | ||
195 | * | ||
196 | * clk_get_rate | ||
197 | */ | ||
198 | static unsigned long lradc_clk_get_rate(struct clk *clk) | ||
199 | { | ||
200 | return clk_get_rate(clk->parent) / 16; | ||
201 | } | ||
202 | |||
203 | static unsigned long rtc_clk_get_rate(struct clk *clk) | ||
204 | { | ||
205 | /* ref_xtal_clk is implemented as the only parent */ | ||
206 | return clk_get_rate(clk->parent) / 768; | ||
207 | } | ||
208 | |||
209 | static unsigned long clk32k_clk_get_rate(struct clk *clk) | ||
210 | { | ||
211 | return clk->parent->get_rate(clk->parent) / 750; | ||
212 | } | ||
213 | |||
214 | static unsigned long spdif_clk_get_rate(struct clk *clk) | ||
215 | { | ||
216 | return clk_get_rate(clk->parent) / 4; | ||
217 | } | ||
218 | |||
219 | #define _CLK_GET_RATE(name, rs) \ | ||
220 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
221 | { \ | ||
222 | u32 reg, div; \ | ||
223 | \ | ||
224 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
225 | \ | ||
226 | if (clk->parent == &ref_xtal_clk) \ | ||
227 | div = (reg & BM_CLKCTRL_##rs##_DIV_XTAL) >> \ | ||
228 | BP_CLKCTRL_##rs##_DIV_XTAL; \ | ||
229 | else \ | ||
230 | div = (reg & BM_CLKCTRL_##rs##_DIV_##rs) >> \ | ||
231 | BP_CLKCTRL_##rs##_DIV_##rs; \ | ||
232 | \ | ||
233 | if (!div) \ | ||
234 | return -EINVAL; \ | ||
235 | \ | ||
236 | return clk_get_rate(clk->parent) / div; \ | ||
237 | } | ||
238 | |||
239 | _CLK_GET_RATE(cpu_clk, CPU) | ||
240 | _CLK_GET_RATE(emi_clk, EMI) | ||
241 | |||
242 | #define _CLK_GET_RATE1(name, rs) \ | ||
243 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
244 | { \ | ||
245 | u32 reg, div; \ | ||
246 | \ | ||
247 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
248 | div = (reg & BM_CLKCTRL_##rs##_DIV) >> BP_CLKCTRL_##rs##_DIV; \ | ||
249 | \ | ||
250 | if (!div) \ | ||
251 | return -EINVAL; \ | ||
252 | \ | ||
253 | if (clk == &saif0_clk || clk == &saif1_clk) \ | ||
254 | return clk_get_rate(clk->parent) >> 16 * div; \ | ||
255 | else \ | ||
256 | return clk_get_rate(clk->parent) / div; \ | ||
257 | } | ||
258 | |||
259 | _CLK_GET_RATE1(hbus_clk, HBUS) | ||
260 | _CLK_GET_RATE1(xbus_clk, XBUS) | ||
261 | _CLK_GET_RATE1(ssp0_clk, SSP0) | ||
262 | _CLK_GET_RATE1(ssp1_clk, SSP1) | ||
263 | _CLK_GET_RATE1(ssp2_clk, SSP2) | ||
264 | _CLK_GET_RATE1(ssp3_clk, SSP3) | ||
265 | _CLK_GET_RATE1(gpmi_clk, GPMI) | ||
266 | _CLK_GET_RATE1(lcdif_clk, DIS_LCDIF) | ||
267 | _CLK_GET_RATE1(saif0_clk, SAIF0) | ||
268 | _CLK_GET_RATE1(saif1_clk, SAIF1) | ||
269 | |||
270 | #define _CLK_GET_RATE_STUB(name) \ | ||
271 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
272 | { \ | ||
273 | return clk_get_rate(clk->parent); \ | ||
274 | } | ||
275 | |||
276 | _CLK_GET_RATE_STUB(uart_clk) | ||
277 | _CLK_GET_RATE_STUB(pwm_clk) | ||
278 | _CLK_GET_RATE_STUB(can0_clk) | ||
279 | _CLK_GET_RATE_STUB(can1_clk) | ||
280 | _CLK_GET_RATE_STUB(fec_clk) | ||
281 | |||
282 | /* | ||
283 | * clk_set_rate | ||
284 | */ | ||
285 | /* fool compiler */ | ||
286 | #define BM_CLKCTRL_CPU_DIV 0 | ||
287 | #define BP_CLKCTRL_CPU_DIV 0 | ||
288 | #define BM_CLKCTRL_CPU_BUSY 0 | ||
289 | |||
290 | #define _CLK_SET_RATE(name, dr, fr, fs) \ | ||
291 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
292 | { \ | ||
293 | u32 reg, bm_busy, div_max, d, f, div, frac; \ | ||
294 | unsigned long diff, parent_rate, calc_rate; \ | ||
295 | int i; \ | ||
296 | \ | ||
297 | parent_rate = clk_get_rate(clk->parent); \ | ||
298 | div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \ | ||
299 | bm_busy = BM_CLKCTRL_##dr##_BUSY; \ | ||
300 | \ | ||
301 | if (clk->parent == &ref_xtal_clk) { \ | ||
302 | div = DIV_ROUND_UP(parent_rate, rate); \ | ||
303 | if (clk == &cpu_clk) { \ | ||
304 | div_max = BM_CLKCTRL_CPU_DIV_XTAL >> \ | ||
305 | BP_CLKCTRL_CPU_DIV_XTAL; \ | ||
306 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_XTAL; \ | ||
307 | } \ | ||
308 | if (div == 0 || div > div_max) \ | ||
309 | return -EINVAL; \ | ||
310 | } else { \ | ||
311 | rate >>= PARENT_RATE_SHIFT; \ | ||
312 | parent_rate >>= PARENT_RATE_SHIFT; \ | ||
313 | diff = parent_rate; \ | ||
314 | div = frac = 1; \ | ||
315 | if (clk == &cpu_clk) { \ | ||
316 | div_max = BM_CLKCTRL_CPU_DIV_CPU >> \ | ||
317 | BP_CLKCTRL_CPU_DIV_CPU; \ | ||
318 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_CPU; \ | ||
319 | } \ | ||
320 | for (d = 1; d <= div_max; d++) { \ | ||
321 | f = parent_rate * 18 / d / rate; \ | ||
322 | if ((parent_rate * 18 / d) % rate) \ | ||
323 | f++; \ | ||
324 | if (f < 18 || f > 35) \ | ||
325 | continue; \ | ||
326 | \ | ||
327 | calc_rate = parent_rate * 18 / f / d; \ | ||
328 | if (calc_rate > rate) \ | ||
329 | continue; \ | ||
330 | \ | ||
331 | if (rate - calc_rate < diff) { \ | ||
332 | frac = f; \ | ||
333 | div = d; \ | ||
334 | diff = rate - calc_rate; \ | ||
335 | } \ | ||
336 | \ | ||
337 | if (diff == 0) \ | ||
338 | break; \ | ||
339 | } \ | ||
340 | \ | ||
341 | if (diff == parent_rate) \ | ||
342 | return -EINVAL; \ | ||
343 | \ | ||
344 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ | ||
345 | reg &= ~BM_CLKCTRL_##fr##_##fs##FRAC; \ | ||
346 | reg |= frac; \ | ||
347 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ | ||
348 | } \ | ||
349 | \ | ||
350 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
351 | if (clk == &cpu_clk) { \ | ||
352 | reg &= ~BM_CLKCTRL_CPU_DIV_CPU; \ | ||
353 | reg |= div << BP_CLKCTRL_CPU_DIV_CPU; \ | ||
354 | } else { \ | ||
355 | reg &= ~BM_CLKCTRL_##dr##_DIV; \ | ||
356 | reg |= div << BP_CLKCTRL_##dr##_DIV; \ | ||
357 | if (reg | (1 << clk->enable_shift)) { \ | ||
358 | pr_err("%s: clock is gated\n", __func__); \ | ||
359 | return -EINVAL; \ | ||
360 | } \ | ||
361 | } \ | ||
362 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU); \ | ||
363 | \ | ||
364 | for (i = 10000; i; i--) \ | ||
365 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
366 | HW_CLKCTRL_##dr) & bm_busy)) \ | ||
367 | break; \ | ||
368 | if (!i) { \ | ||
369 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
370 | return -ETIMEDOUT; \ | ||
371 | } \ | ||
372 | \ | ||
373 | return 0; \ | ||
374 | } | ||
375 | |||
376 | _CLK_SET_RATE(cpu_clk, CPU, FRAC0, CPU) | ||
377 | _CLK_SET_RATE(ssp0_clk, SSP0, FRAC0, IO0) | ||
378 | _CLK_SET_RATE(ssp1_clk, SSP1, FRAC0, IO0) | ||
379 | _CLK_SET_RATE(ssp2_clk, SSP2, FRAC0, IO1) | ||
380 | _CLK_SET_RATE(ssp3_clk, SSP3, FRAC0, IO1) | ||
381 | _CLK_SET_RATE(lcdif_clk, DIS_LCDIF, FRAC1, PIX) | ||
382 | _CLK_SET_RATE(gpmi_clk, GPMI, FRAC1, GPMI) | ||
383 | |||
384 | #define _CLK_SET_RATE1(name, dr) \ | ||
385 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
386 | { \ | ||
387 | u32 reg, div_max, div; \ | ||
388 | unsigned long parent_rate; \ | ||
389 | int i; \ | ||
390 | \ | ||
391 | parent_rate = clk_get_rate(clk->parent); \ | ||
392 | div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \ | ||
393 | \ | ||
394 | div = DIV_ROUND_UP(parent_rate, rate); \ | ||
395 | if (div == 0 || div > div_max) \ | ||
396 | return -EINVAL; \ | ||
397 | \ | ||
398 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
399 | reg &= ~BM_CLKCTRL_##dr##_DIV; \ | ||
400 | reg |= div << BP_CLKCTRL_##dr##_DIV; \ | ||
401 | if (reg | (1 << clk->enable_shift)) { \ | ||
402 | pr_err("%s: clock is gated\n", __func__); \ | ||
403 | return -EINVAL; \ | ||
404 | } \ | ||
405 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
406 | \ | ||
407 | for (i = 10000; i; i--) \ | ||
408 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
409 | HW_CLKCTRL_##dr) & BM_CLKCTRL_##dr##_BUSY)) \ | ||
410 | break; \ | ||
411 | if (!i) { \ | ||
412 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
413 | return -ETIMEDOUT; \ | ||
414 | } \ | ||
415 | \ | ||
416 | return 0; \ | ||
417 | } | ||
418 | |||
419 | _CLK_SET_RATE1(xbus_clk, XBUS) | ||
420 | |||
421 | /* saif clock uses 16 bits frac div */ | ||
422 | #define _CLK_SET_RATE_SAIF(name, rs) \ | ||
423 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
424 | { \ | ||
425 | u16 div; \ | ||
426 | u32 reg; \ | ||
427 | u64 lrate; \ | ||
428 | unsigned long parent_rate; \ | ||
429 | int i; \ | ||
430 | \ | ||
431 | parent_rate = clk_get_rate(clk->parent); \ | ||
432 | if (rate > parent_rate) \ | ||
433 | return -EINVAL; \ | ||
434 | \ | ||
435 | lrate = (u64)rate << 16; \ | ||
436 | do_div(lrate, parent_rate); \ | ||
437 | div = (u16)lrate; \ | ||
438 | \ | ||
439 | if (!div) \ | ||
440 | return -EINVAL; \ | ||
441 | \ | ||
442 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
443 | reg &= ~BM_CLKCTRL_##rs##_DIV; \ | ||
444 | reg |= div << BP_CLKCTRL_##rs##_DIV; \ | ||
445 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
446 | \ | ||
447 | for (i = 10000; i; i--) \ | ||
448 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
449 | HW_CLKCTRL_##rs) & BM_CLKCTRL_##rs##_BUSY)) \ | ||
450 | break; \ | ||
451 | if (!i) { \ | ||
452 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
453 | return -ETIMEDOUT; \ | ||
454 | } \ | ||
455 | \ | ||
456 | return 0; \ | ||
457 | } | ||
458 | |||
459 | _CLK_SET_RATE_SAIF(saif0_clk, SAIF0) | ||
460 | _CLK_SET_RATE_SAIF(saif1_clk, SAIF1) | ||
461 | |||
462 | #define _CLK_SET_RATE_STUB(name) \ | ||
463 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
464 | { \ | ||
465 | return -EINVAL; \ | ||
466 | } | ||
467 | |||
468 | _CLK_SET_RATE_STUB(emi_clk) | ||
469 | _CLK_SET_RATE_STUB(uart_clk) | ||
470 | _CLK_SET_RATE_STUB(pwm_clk) | ||
471 | _CLK_SET_RATE_STUB(spdif_clk) | ||
472 | _CLK_SET_RATE_STUB(clk32k_clk) | ||
473 | _CLK_SET_RATE_STUB(can0_clk) | ||
474 | _CLK_SET_RATE_STUB(can1_clk) | ||
475 | _CLK_SET_RATE_STUB(fec_clk) | ||
476 | |||
477 | /* | ||
478 | * clk_set_parent | ||
479 | */ | ||
480 | #define _CLK_SET_PARENT(name, bit) \ | ||
481 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
482 | { \ | ||
483 | if (parent != clk->parent) { \ | ||
484 | __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \ | ||
485 | HW_CLKCTRL_CLKSEQ_TOG); \ | ||
486 | clk->parent = parent; \ | ||
487 | } \ | ||
488 | \ | ||
489 | return 0; \ | ||
490 | } | ||
491 | |||
492 | _CLK_SET_PARENT(cpu_clk, CPU) | ||
493 | _CLK_SET_PARENT(emi_clk, EMI) | ||
494 | _CLK_SET_PARENT(ssp0_clk, SSP0) | ||
495 | _CLK_SET_PARENT(ssp1_clk, SSP1) | ||
496 | _CLK_SET_PARENT(ssp2_clk, SSP2) | ||
497 | _CLK_SET_PARENT(ssp3_clk, SSP3) | ||
498 | _CLK_SET_PARENT(lcdif_clk, DIS_LCDIF) | ||
499 | _CLK_SET_PARENT(gpmi_clk, GPMI) | ||
500 | _CLK_SET_PARENT(saif0_clk, SAIF0) | ||
501 | _CLK_SET_PARENT(saif1_clk, SAIF1) | ||
502 | |||
503 | #define _CLK_SET_PARENT_STUB(name) \ | ||
504 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
505 | { \ | ||
506 | if (parent != clk->parent) \ | ||
507 | return -EINVAL; \ | ||
508 | else \ | ||
509 | return 0; \ | ||
510 | } | ||
511 | |||
512 | _CLK_SET_PARENT_STUB(pwm_clk) | ||
513 | _CLK_SET_PARENT_STUB(uart_clk) | ||
514 | _CLK_SET_PARENT_STUB(clk32k_clk) | ||
515 | _CLK_SET_PARENT_STUB(spdif_clk) | ||
516 | _CLK_SET_PARENT_STUB(fec_clk) | ||
517 | _CLK_SET_PARENT_STUB(can0_clk) | ||
518 | _CLK_SET_PARENT_STUB(can1_clk) | ||
519 | |||
520 | /* | ||
521 | * clk definition | ||
522 | */ | ||
523 | static struct clk cpu_clk = { | ||
524 | .get_rate = cpu_clk_get_rate, | ||
525 | .set_rate = cpu_clk_set_rate, | ||
526 | .set_parent = cpu_clk_set_parent, | ||
527 | .parent = &ref_cpu_clk, | ||
528 | }; | ||
529 | |||
530 | static struct clk hbus_clk = { | ||
531 | .get_rate = hbus_clk_get_rate, | ||
532 | .parent = &cpu_clk, | ||
533 | }; | ||
534 | |||
535 | static struct clk xbus_clk = { | ||
536 | .get_rate = xbus_clk_get_rate, | ||
537 | .set_rate = xbus_clk_set_rate, | ||
538 | .parent = &ref_xtal_clk, | ||
539 | }; | ||
540 | |||
541 | static struct clk lradc_clk = { | ||
542 | .get_rate = lradc_clk_get_rate, | ||
543 | .parent = &clk32k_clk, | ||
544 | }; | ||
545 | |||
546 | static struct clk rtc_clk = { | ||
547 | .get_rate = rtc_clk_get_rate, | ||
548 | .parent = &ref_xtal_clk, | ||
549 | }; | ||
550 | |||
551 | /* usb_clk gate is controlled in DIGCTRL other than CLKCTRL */ | ||
552 | static struct clk usb0_clk = { | ||
553 | .enable_reg = DIGCTRL_BASE_ADDR, | ||
554 | .enable_shift = 2, | ||
555 | .enable = _raw_clk_enable, | ||
556 | .disable = _raw_clk_disable, | ||
557 | .parent = &pll0_clk, | ||
558 | }; | ||
559 | |||
560 | static struct clk usb1_clk = { | ||
561 | .enable_reg = DIGCTRL_BASE_ADDR, | ||
562 | .enable_shift = 16, | ||
563 | .enable = _raw_clk_enable, | ||
564 | .disable = _raw_clk_disable, | ||
565 | .parent = &pll1_clk, | ||
566 | }; | ||
567 | |||
568 | #define _DEFINE_CLOCK(name, er, es, p) \ | ||
569 | static struct clk name = { \ | ||
570 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
571 | .enable_shift = BP_CLKCTRL_##er##_##es, \ | ||
572 | .get_rate = name##_get_rate, \ | ||
573 | .set_rate = name##_set_rate, \ | ||
574 | .set_parent = name##_set_parent, \ | ||
575 | .enable = _raw_clk_enable, \ | ||
576 | .disable = _raw_clk_disable, \ | ||
577 | .parent = p, \ | ||
578 | } | ||
579 | |||
580 | _DEFINE_CLOCK(emi_clk, EMI, CLKGATE, &ref_xtal_clk); | ||
581 | _DEFINE_CLOCK(ssp0_clk, SSP0, CLKGATE, &ref_xtal_clk); | ||
582 | _DEFINE_CLOCK(ssp1_clk, SSP1, CLKGATE, &ref_xtal_clk); | ||
583 | _DEFINE_CLOCK(ssp2_clk, SSP2, CLKGATE, &ref_xtal_clk); | ||
584 | _DEFINE_CLOCK(ssp3_clk, SSP3, CLKGATE, &ref_xtal_clk); | ||
585 | _DEFINE_CLOCK(lcdif_clk, DIS_LCDIF, CLKGATE, &ref_xtal_clk); | ||
586 | _DEFINE_CLOCK(gpmi_clk, GPMI, CLKGATE, &ref_xtal_clk); | ||
587 | _DEFINE_CLOCK(saif0_clk, SAIF0, CLKGATE, &ref_xtal_clk); | ||
588 | _DEFINE_CLOCK(saif1_clk, SAIF1, CLKGATE, &ref_xtal_clk); | ||
589 | _DEFINE_CLOCK(can0_clk, FLEXCAN, STOP_CAN0, &ref_xtal_clk); | ||
590 | _DEFINE_CLOCK(can1_clk, FLEXCAN, STOP_CAN1, &ref_xtal_clk); | ||
591 | _DEFINE_CLOCK(pwm_clk, XTAL, PWM_CLK24M_GATE, &ref_xtal_clk); | ||
592 | _DEFINE_CLOCK(uart_clk, XTAL, UART_CLK_GATE, &ref_xtal_clk); | ||
593 | _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk); | ||
594 | _DEFINE_CLOCK(spdif_clk, SPDIF, CLKGATE, &pll0_clk); | ||
595 | _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk); | ||
596 | |||
597 | #define _REGISTER_CLOCK(d, n, c) \ | ||
598 | { \ | ||
599 | .dev_id = d, \ | ||
600 | .con_id = n, \ | ||
601 | .clk = &c, \ | ||
602 | }, | ||
603 | |||
604 | static struct clk_lookup lookups[] = { | ||
605 | _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) | ||
606 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | ||
607 | _REGISTER_CLOCK("rtc", NULL, rtc_clk) | ||
608 | _REGISTER_CLOCK("pll2", NULL, pll2_clk) | ||
609 | _REGISTER_CLOCK(NULL, "hclk", hbus_clk) | ||
610 | _REGISTER_CLOCK(NULL, "xclk", xbus_clk) | ||
611 | _REGISTER_CLOCK(NULL, "can0", can0_clk) | ||
612 | _REGISTER_CLOCK(NULL, "can1", can1_clk) | ||
613 | _REGISTER_CLOCK(NULL, "usb0", usb0_clk) | ||
614 | _REGISTER_CLOCK(NULL, "usb1", usb1_clk) | ||
615 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | ||
616 | _REGISTER_CLOCK(NULL, "lradc", lradc_clk) | ||
617 | _REGISTER_CLOCK(NULL, "spdif", spdif_clk) | ||
618 | }; | ||
619 | |||
620 | static int clk_misc_init(void) | ||
621 | { | ||
622 | u32 reg; | ||
623 | int i; | ||
624 | |||
625 | /* Fix up parent per register setting */ | ||
626 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ); | ||
627 | cpu_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_CPU) ? | ||
628 | &ref_xtal_clk : &ref_cpu_clk; | ||
629 | emi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_EMI) ? | ||
630 | &ref_xtal_clk : &ref_emi_clk; | ||
631 | ssp0_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP0) ? | ||
632 | &ref_xtal_clk : &ref_io0_clk; | ||
633 | ssp1_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP1) ? | ||
634 | &ref_xtal_clk : &ref_io0_clk; | ||
635 | ssp2_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP2) ? | ||
636 | &ref_xtal_clk : &ref_io1_clk; | ||
637 | ssp3_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP3) ? | ||
638 | &ref_xtal_clk : &ref_io1_clk; | ||
639 | lcdif_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF) ? | ||
640 | &ref_xtal_clk : &ref_pix_clk; | ||
641 | gpmi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_GPMI) ? | ||
642 | &ref_xtal_clk : &ref_gpmi_clk; | ||
643 | saif0_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SAIF0) ? | ||
644 | &ref_xtal_clk : &pll0_clk; | ||
645 | saif1_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SAIF1) ? | ||
646 | &ref_xtal_clk : &pll0_clk; | ||
647 | |||
648 | /* Use int div over frac when both are available */ | ||
649 | __raw_writel(BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN, | ||
650 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
651 | __raw_writel(BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN, | ||
652 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
653 | __raw_writel(BM_CLKCTRL_HBUS_DIV_FRAC_EN, | ||
654 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS_CLR); | ||
655 | |||
656 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
657 | reg &= ~BM_CLKCTRL_XBUS_DIV_FRAC_EN; | ||
658 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
659 | |||
660 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP0); | ||
661 | reg &= ~BM_CLKCTRL_SSP0_DIV_FRAC_EN; | ||
662 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP0); | ||
663 | |||
664 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP1); | ||
665 | reg &= ~BM_CLKCTRL_SSP1_DIV_FRAC_EN; | ||
666 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP1); | ||
667 | |||
668 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP2); | ||
669 | reg &= ~BM_CLKCTRL_SSP2_DIV_FRAC_EN; | ||
670 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP2); | ||
671 | |||
672 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP3); | ||
673 | reg &= ~BM_CLKCTRL_SSP3_DIV_FRAC_EN; | ||
674 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP3); | ||
675 | |||
676 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
677 | reg &= ~BM_CLKCTRL_GPMI_DIV_FRAC_EN; | ||
678 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
679 | |||
680 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_DIS_LCDIF); | ||
681 | reg &= ~BM_CLKCTRL_DIS_LCDIF_DIV_FRAC_EN; | ||
682 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_DIS_LCDIF); | ||
683 | |||
684 | /* SAIF has to use frac div for functional operation */ | ||
685 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF0); | ||
686 | reg &= ~BM_CLKCTRL_SAIF0_DIV_FRAC_EN; | ||
687 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF0); | ||
688 | |||
689 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF1); | ||
690 | reg &= ~BM_CLKCTRL_SAIF1_DIV_FRAC_EN; | ||
691 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF1); | ||
692 | |||
693 | /* | ||
694 | * Set safe hbus clock divider. A divider of 3 ensure that | ||
695 | * the Vddd voltage required for the cpu clock is sufficiently | ||
696 | * high for the hbus clock. | ||
697 | */ | ||
698 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
699 | reg &= BM_CLKCTRL_HBUS_DIV; | ||
700 | reg |= 3 << BP_CLKCTRL_HBUS_DIV; | ||
701 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
702 | |||
703 | for (i = 10000; i; i--) | ||
704 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + | ||
705 | HW_CLKCTRL_HBUS) & BM_CLKCTRL_HBUS_ASM_BUSY)) | ||
706 | break; | ||
707 | if (!i) { | ||
708 | pr_err("%s: divider writing timeout\n", __func__); | ||
709 | return -ETIMEDOUT; | ||
710 | } | ||
711 | |||
712 | /* Gate off cpu clock in WFI for power saving */ | ||
713 | __raw_writel(BM_CLKCTRL_CPU_INTERRUPT_WAIT, | ||
714 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_SET); | ||
715 | |||
716 | /* Extra fec clock setting */ | ||
717 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET); | ||
718 | reg &= ~BM_CLKCTRL_ENET_SLEEP; | ||
719 | reg |= BM_CLKCTRL_ENET_CLK_OUT_EN; | ||
720 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET); | ||
721 | |||
722 | return 0; | ||
723 | } | ||
724 | |||
725 | int __init mx28_clocks_init(void) | ||
726 | { | ||
727 | clk_misc_init(); | ||
728 | |||
729 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
730 | |||
731 | mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0); | ||
732 | |||
733 | return 0; | ||
734 | } | ||
diff --git a/arch/arm/mach-mxs/clock.c b/arch/arm/mach-mxs/clock.c new file mode 100644 index 000000000000..e7d2269cf70e --- /dev/null +++ b/arch/arm/mach-mxs/clock.c | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | * Based on arch/arm/plat-omap/clock.c | ||
3 | * | ||
4 | * Copyright (C) 2004 - 2005 Nokia corporation | ||
5 | * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> | ||
6 | * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com> | ||
7 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
8 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
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 | /* #define DEBUG */ | ||
26 | |||
27 | #include <linux/clk.h> | ||
28 | #include <linux/err.h> | ||
29 | #include <linux/errno.h> | ||
30 | #include <linux/init.h> | ||
31 | #include <linux/io.h> | ||
32 | #include <linux/kernel.h> | ||
33 | #include <linux/list.h> | ||
34 | #include <linux/module.h> | ||
35 | #include <linux/mutex.h> | ||
36 | #include <linux/platform_device.h> | ||
37 | #include <linux/proc_fs.h> | ||
38 | #include <linux/semaphore.h> | ||
39 | #include <linux/string.h> | ||
40 | |||
41 | #include <mach/clock.h> | ||
42 | |||
43 | static LIST_HEAD(clocks); | ||
44 | static DEFINE_MUTEX(clocks_mutex); | ||
45 | |||
46 | /*------------------------------------------------------------------------- | ||
47 | * Standard clock functions defined in include/linux/clk.h | ||
48 | *-------------------------------------------------------------------------*/ | ||
49 | |||
50 | static void __clk_disable(struct clk *clk) | ||
51 | { | ||
52 | if (clk == NULL || IS_ERR(clk)) | ||
53 | return; | ||
54 | WARN_ON(!clk->usecount); | ||
55 | |||
56 | if (!(--clk->usecount)) { | ||
57 | if (clk->disable) | ||
58 | clk->disable(clk); | ||
59 | __clk_disable(clk->parent); | ||
60 | __clk_disable(clk->secondary); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | static int __clk_enable(struct clk *clk) | ||
65 | { | ||
66 | if (clk == NULL || IS_ERR(clk)) | ||
67 | return -EINVAL; | ||
68 | |||
69 | if (clk->usecount++ == 0) { | ||
70 | __clk_enable(clk->parent); | ||
71 | __clk_enable(clk->secondary); | ||
72 | |||
73 | if (clk->enable) | ||
74 | clk->enable(clk); | ||
75 | } | ||
76 | return 0; | ||
77 | } | ||
78 | |||
79 | /* This function increments the reference count on the clock and enables the | ||
80 | * clock if not already enabled. The parent clock tree is recursively enabled | ||
81 | */ | ||
82 | int clk_enable(struct clk *clk) | ||
83 | { | ||
84 | int ret = 0; | ||
85 | |||
86 | if (clk == NULL || IS_ERR(clk)) | ||
87 | return -EINVAL; | ||
88 | |||
89 | mutex_lock(&clocks_mutex); | ||
90 | ret = __clk_enable(clk); | ||
91 | mutex_unlock(&clocks_mutex); | ||
92 | |||
93 | return ret; | ||
94 | } | ||
95 | EXPORT_SYMBOL(clk_enable); | ||
96 | |||
97 | /* This function decrements the reference count on the clock and disables | ||
98 | * the clock when reference count is 0. The parent clock tree is | ||
99 | * recursively disabled | ||
100 | */ | ||
101 | void clk_disable(struct clk *clk) | ||
102 | { | ||
103 | if (clk == NULL || IS_ERR(clk)) | ||
104 | return; | ||
105 | |||
106 | mutex_lock(&clocks_mutex); | ||
107 | __clk_disable(clk); | ||
108 | mutex_unlock(&clocks_mutex); | ||
109 | } | ||
110 | EXPORT_SYMBOL(clk_disable); | ||
111 | |||
112 | /* Retrieve the *current* clock rate. If the clock itself | ||
113 | * does not provide a special calculation routine, ask | ||
114 | * its parent and so on, until one is able to return | ||
115 | * a valid clock rate | ||
116 | */ | ||
117 | unsigned long clk_get_rate(struct clk *clk) | ||
118 | { | ||
119 | if (clk == NULL || IS_ERR(clk)) | ||
120 | return 0UL; | ||
121 | |||
122 | if (clk->get_rate) | ||
123 | return clk->get_rate(clk); | ||
124 | |||
125 | return clk_get_rate(clk->parent); | ||
126 | } | ||
127 | EXPORT_SYMBOL(clk_get_rate); | ||
128 | |||
129 | /* Round the requested clock rate to the nearest supported | ||
130 | * rate that is less than or equal to the requested rate. | ||
131 | * This is dependent on the clock's current parent. | ||
132 | */ | ||
133 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
134 | { | ||
135 | if (clk == NULL || IS_ERR(clk) || !clk->round_rate) | ||
136 | return 0; | ||
137 | |||
138 | return clk->round_rate(clk, rate); | ||
139 | } | ||
140 | EXPORT_SYMBOL(clk_round_rate); | ||
141 | |||
142 | /* Set the clock to the requested clock rate. The rate must | ||
143 | * match a supported rate exactly based on what clk_round_rate returns | ||
144 | */ | ||
145 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
146 | { | ||
147 | int ret = -EINVAL; | ||
148 | |||
149 | if (clk == NULL || IS_ERR(clk) || clk->set_rate == NULL || rate == 0) | ||
150 | return ret; | ||
151 | |||
152 | mutex_lock(&clocks_mutex); | ||
153 | ret = clk->set_rate(clk, rate); | ||
154 | mutex_unlock(&clocks_mutex); | ||
155 | |||
156 | return ret; | ||
157 | } | ||
158 | EXPORT_SYMBOL(clk_set_rate); | ||
159 | |||
160 | /* Set the clock's parent to another clock source */ | ||
161 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
162 | { | ||
163 | int ret = -EINVAL; | ||
164 | struct clk *old; | ||
165 | |||
166 | if (clk == NULL || IS_ERR(clk) || parent == NULL || | ||
167 | IS_ERR(parent) || clk->set_parent == NULL) | ||
168 | return ret; | ||
169 | |||
170 | if (clk->usecount) | ||
171 | clk_enable(parent); | ||
172 | |||
173 | mutex_lock(&clocks_mutex); | ||
174 | ret = clk->set_parent(clk, parent); | ||
175 | if (ret == 0) { | ||
176 | old = clk->parent; | ||
177 | clk->parent = parent; | ||
178 | } else { | ||
179 | old = parent; | ||
180 | } | ||
181 | mutex_unlock(&clocks_mutex); | ||
182 | |||
183 | if (clk->usecount) | ||
184 | clk_disable(old); | ||
185 | |||
186 | return ret; | ||
187 | } | ||
188 | EXPORT_SYMBOL(clk_set_parent); | ||
189 | |||
190 | /* Retrieve the clock's parent clock source */ | ||
191 | struct clk *clk_get_parent(struct clk *clk) | ||
192 | { | ||
193 | struct clk *ret = NULL; | ||
194 | |||
195 | if (clk == NULL || IS_ERR(clk)) | ||
196 | return ret; | ||
197 | |||
198 | return clk->parent; | ||
199 | } | ||
200 | EXPORT_SYMBOL(clk_get_parent); | ||
diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h new file mode 100644 index 000000000000..d0f49fc0abb5 --- /dev/null +++ b/arch/arm/mach-mxs/devices-mx23.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it under | ||
8 | * the terms of the GNU General Public License version 2 as published by the | ||
9 | * Free Software Foundation. | ||
10 | */ | ||
11 | #include <mach/mx23.h> | ||
12 | #include <mach/devices-common.h> | ||
13 | |||
14 | extern const struct mxs_duart_data mx23_duart_data __initconst; | ||
15 | #define mx23_add_duart() \ | ||
16 | mxs_add_duart(&mx23_duart_data) | ||
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h new file mode 100644 index 000000000000..00b736c434ba --- /dev/null +++ b/arch/arm/mach-mxs/devices-mx28.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it under | ||
8 | * the terms of the GNU General Public License version 2 as published by the | ||
9 | * Free Software Foundation. | ||
10 | */ | ||
11 | #include <mach/mx28.h> | ||
12 | #include <mach/devices-common.h> | ||
13 | |||
14 | extern const struct mxs_duart_data mx28_duart_data __initconst; | ||
15 | #define mx28_add_duart() \ | ||
16 | mxs_add_duart(&mx28_duart_data) | ||
17 | |||
18 | extern const struct mxs_fec_data mx28_fec_data[] __initconst; | ||
19 | #define mx28_add_fec(id, pdata) \ | ||
20 | mxs_add_fec(&mx28_fec_data[id], pdata) | ||
diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c new file mode 100644 index 000000000000..6b60f02ca2e3 --- /dev/null +++ b/arch/arm/mach-mxs/devices.c | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * Copyright 2008 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, | ||
16 | * Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/slab.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/err.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <mach/common.h> | ||
25 | |||
26 | struct platform_device *__init mxs_add_platform_device_dmamask( | ||
27 | const char *name, int id, | ||
28 | const struct resource *res, unsigned int num_resources, | ||
29 | const void *data, size_t size_data, u64 dmamask) | ||
30 | { | ||
31 | int ret = -ENOMEM; | ||
32 | struct platform_device *pdev; | ||
33 | |||
34 | pdev = platform_device_alloc(name, id); | ||
35 | if (!pdev) | ||
36 | goto err; | ||
37 | |||
38 | if (dmamask) { | ||
39 | /* | ||
40 | * This memory isn't freed when the device is put, | ||
41 | * I don't have a nice idea for that though. Conceptually | ||
42 | * dma_mask in struct device should not be a pointer. | ||
43 | * See http://thread.gmane.org/gmane.linux.kernel.pci/9081 | ||
44 | */ | ||
45 | pdev->dev.dma_mask = | ||
46 | kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); | ||
47 | if (!pdev->dev.dma_mask) | ||
48 | /* ret is still -ENOMEM; */ | ||
49 | goto err; | ||
50 | |||
51 | *pdev->dev.dma_mask = dmamask; | ||
52 | pdev->dev.coherent_dma_mask = dmamask; | ||
53 | } | ||
54 | |||
55 | if (res) { | ||
56 | ret = platform_device_add_resources(pdev, res, num_resources); | ||
57 | if (ret) | ||
58 | goto err; | ||
59 | } | ||
60 | |||
61 | if (data) { | ||
62 | ret = platform_device_add_data(pdev, data, size_data); | ||
63 | if (ret) | ||
64 | goto err; | ||
65 | } | ||
66 | |||
67 | ret = platform_device_add(pdev); | ||
68 | if (ret) { | ||
69 | err: | ||
70 | platform_device_put(pdev); | ||
71 | return ERR_PTR(ret); | ||
72 | } | ||
73 | |||
74 | return pdev; | ||
75 | } | ||
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig new file mode 100644 index 000000000000..a35a2dc55395 --- /dev/null +++ b/arch/arm/mach-mxs/devices/Kconfig | |||
@@ -0,0 +1,5 @@ | |||
1 | config MXS_HAVE_PLATFORM_DUART | ||
2 | bool | ||
3 | |||
4 | config MXS_HAVE_PLATFORM_FEC | ||
5 | bool | ||
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile new file mode 100644 index 000000000000..4b5266a3e6d9 --- /dev/null +++ b/arch/arm/mach-mxs/devices/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o | ||
2 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o | ||
diff --git a/arch/arm/mach-mxs/devices/platform-duart.c b/arch/arm/mach-mxs/devices/platform-duart.c new file mode 100644 index 000000000000..2fe0df5b0aad --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-duart.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it under | ||
8 | * the terms of the GNU General Public License version 2 as published by the | ||
9 | * Free Software Foundation. | ||
10 | */ | ||
11 | #include <mach/mx23.h> | ||
12 | #include <mach/mx28.h> | ||
13 | #include <mach/devices-common.h> | ||
14 | |||
15 | #define mxs_duart_data_entry(soc) \ | ||
16 | { \ | ||
17 | .iobase = soc ## _DUART_BASE_ADDR, \ | ||
18 | .irq = soc ## _INT_DUART, \ | ||
19 | } | ||
20 | |||
21 | #ifdef CONFIG_SOC_IMX23 | ||
22 | const struct mxs_duart_data mx23_duart_data __initconst = | ||
23 | mxs_duart_data_entry(MX23); | ||
24 | #endif | ||
25 | |||
26 | #ifdef CONFIG_SOC_IMX28 | ||
27 | const struct mxs_duart_data mx28_duart_data __initconst = | ||
28 | mxs_duart_data_entry(MX28); | ||
29 | #endif | ||
30 | |||
31 | struct platform_device *__init mxs_add_duart( | ||
32 | const struct mxs_duart_data *data) | ||
33 | { | ||
34 | struct resource res[] = { | ||
35 | { | ||
36 | .start = data->iobase, | ||
37 | .end = data->iobase + SZ_8K - 1, | ||
38 | .flags = IORESOURCE_MEM, | ||
39 | }, { | ||
40 | .start = data->irq, | ||
41 | .end = data->irq, | ||
42 | .flags = IORESOURCE_IRQ, | ||
43 | }, | ||
44 | }; | ||
45 | |||
46 | return mxs_add_platform_device("mxs-duart", 0, res, ARRAY_SIZE(res), | ||
47 | NULL, 0); | ||
48 | } | ||
diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c new file mode 100644 index 000000000000..c08168cf3dec --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-fec.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <asm/sizes.h> | ||
10 | #include <mach/mx28.h> | ||
11 | #include <mach/devices-common.h> | ||
12 | |||
13 | #define mxs_fec_data_entry_single(soc, _id) \ | ||
14 | { \ | ||
15 | .id = _id, \ | ||
16 | .iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \ | ||
17 | .irq = soc ## _INT_ENET_MAC ## _id, \ | ||
18 | } | ||
19 | |||
20 | #define mxs_fec_data_entry(soc, _id) \ | ||
21 | [_id] = mxs_fec_data_entry_single(soc, _id) | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX28 | ||
24 | const struct mxs_fec_data mx28_fec_data[] __initconst = { | ||
25 | #define mx28_fec_data_entry(_id) \ | ||
26 | mxs_fec_data_entry(MX28, _id) | ||
27 | mx28_fec_data_entry(0), | ||
28 | mx28_fec_data_entry(1), | ||
29 | }; | ||
30 | #endif | ||
31 | |||
32 | struct platform_device *__init mxs_add_fec( | ||
33 | const struct mxs_fec_data *data, | ||
34 | const struct fec_platform_data *pdata) | ||
35 | { | ||
36 | struct resource res[] = { | ||
37 | { | ||
38 | .start = data->iobase, | ||
39 | .end = data->iobase + SZ_16K - 1, | ||
40 | .flags = IORESOURCE_MEM, | ||
41 | }, { | ||
42 | .start = data->irq, | ||
43 | .end = data->irq, | ||
44 | .flags = IORESOURCE_IRQ, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | return mxs_add_platform_device("fec", data->id, | ||
49 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
50 | } | ||
diff --git a/arch/arm/mach-mxs/gpio.c b/arch/arm/mach-mxs/gpio.c new file mode 100644 index 000000000000..d7ad7a61366d --- /dev/null +++ b/arch/arm/mach-mxs/gpio.c | |||
@@ -0,0 +1,325 @@ | |||
1 | /* | ||
2 | * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de> | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * Based on code from Freescale, | ||
6 | * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 | #include <linux/init.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/io.h> | ||
26 | #include <linux/irq.h> | ||
27 | #include <linux/gpio.h> | ||
28 | #include <mach/mx23.h> | ||
29 | #include <mach/mx28.h> | ||
30 | #include <asm-generic/bug.h> | ||
31 | |||
32 | #include "gpio.h" | ||
33 | |||
34 | static struct mxs_gpio_port *mxs_gpio_ports; | ||
35 | static int gpio_table_size; | ||
36 | |||
37 | #define PINCTRL_DOUT(n) ((cpu_is_mx23() ? 0x0500 : 0x0700) + (n) * 0x10) | ||
38 | #define PINCTRL_DIN(n) ((cpu_is_mx23() ? 0x0600 : 0x0900) + (n) * 0x10) | ||
39 | #define PINCTRL_DOE(n) ((cpu_is_mx23() ? 0x0700 : 0x0b00) + (n) * 0x10) | ||
40 | #define PINCTRL_PIN2IRQ(n) ((cpu_is_mx23() ? 0x0800 : 0x1000) + (n) * 0x10) | ||
41 | #define PINCTRL_IRQEN(n) ((cpu_is_mx23() ? 0x0900 : 0x1100) + (n) * 0x10) | ||
42 | #define PINCTRL_IRQLEV(n) ((cpu_is_mx23() ? 0x0a00 : 0x1200) + (n) * 0x10) | ||
43 | #define PINCTRL_IRQPOL(n) ((cpu_is_mx23() ? 0x0b00 : 0x1300) + (n) * 0x10) | ||
44 | #define PINCTRL_IRQSTAT(n) ((cpu_is_mx23() ? 0x0c00 : 0x1400) + (n) * 0x10) | ||
45 | |||
46 | #define GPIO_INT_FALL_EDGE 0x0 | ||
47 | #define GPIO_INT_LOW_LEV 0x1 | ||
48 | #define GPIO_INT_RISE_EDGE 0x2 | ||
49 | #define GPIO_INT_HIGH_LEV 0x3 | ||
50 | #define GPIO_INT_LEV_MASK (1 << 0) | ||
51 | #define GPIO_INT_POL_MASK (1 << 1) | ||
52 | |||
53 | /* Note: This driver assumes 32 GPIOs are handled in one register */ | ||
54 | |||
55 | static void clear_gpio_irqstatus(struct mxs_gpio_port *port, u32 index) | ||
56 | { | ||
57 | __mxs_clrl(1 << index, port->base + PINCTRL_IRQSTAT(port->id)); | ||
58 | } | ||
59 | |||
60 | static void set_gpio_irqenable(struct mxs_gpio_port *port, u32 index, | ||
61 | int enable) | ||
62 | { | ||
63 | if (enable) { | ||
64 | __mxs_setl(1 << index, port->base + PINCTRL_IRQEN(port->id)); | ||
65 | __mxs_setl(1 << index, port->base + PINCTRL_PIN2IRQ(port->id)); | ||
66 | } else { | ||
67 | __mxs_clrl(1 << index, port->base + PINCTRL_IRQEN(port->id)); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | static void mxs_gpio_ack_irq(u32 irq) | ||
72 | { | ||
73 | u32 gpio = irq_to_gpio(irq); | ||
74 | clear_gpio_irqstatus(&mxs_gpio_ports[gpio / 32], gpio & 0x1f); | ||
75 | } | ||
76 | |||
77 | static void mxs_gpio_mask_irq(u32 irq) | ||
78 | { | ||
79 | u32 gpio = irq_to_gpio(irq); | ||
80 | set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 0); | ||
81 | } | ||
82 | |||
83 | static void mxs_gpio_unmask_irq(u32 irq) | ||
84 | { | ||
85 | u32 gpio = irq_to_gpio(irq); | ||
86 | set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 1); | ||
87 | } | ||
88 | |||
89 | static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset); | ||
90 | |||
91 | static int mxs_gpio_set_irq_type(u32 irq, u32 type) | ||
92 | { | ||
93 | u32 gpio = irq_to_gpio(irq); | ||
94 | u32 pin_mask = 1 << (gpio & 31); | ||
95 | struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32]; | ||
96 | void __iomem *pin_addr; | ||
97 | int edge; | ||
98 | |||
99 | switch (type) { | ||
100 | case IRQ_TYPE_EDGE_RISING: | ||
101 | edge = GPIO_INT_RISE_EDGE; | ||
102 | break; | ||
103 | case IRQ_TYPE_EDGE_FALLING: | ||
104 | edge = GPIO_INT_FALL_EDGE; | ||
105 | break; | ||
106 | case IRQ_TYPE_LEVEL_LOW: | ||
107 | edge = GPIO_INT_LOW_LEV; | ||
108 | break; | ||
109 | case IRQ_TYPE_LEVEL_HIGH: | ||
110 | edge = GPIO_INT_HIGH_LEV; | ||
111 | break; | ||
112 | default: | ||
113 | return -EINVAL; | ||
114 | } | ||
115 | |||
116 | /* set level or edge */ | ||
117 | pin_addr = port->base + PINCTRL_IRQLEV(port->id); | ||
118 | if (edge & GPIO_INT_LEV_MASK) | ||
119 | __mxs_setl(pin_mask, pin_addr); | ||
120 | else | ||
121 | __mxs_clrl(pin_mask, pin_addr); | ||
122 | |||
123 | /* set polarity */ | ||
124 | pin_addr = port->base + PINCTRL_IRQPOL(port->id); | ||
125 | if (edge & GPIO_INT_POL_MASK) | ||
126 | __mxs_setl(pin_mask, pin_addr); | ||
127 | else | ||
128 | __mxs_clrl(pin_mask, pin_addr); | ||
129 | |||
130 | clear_gpio_irqstatus(port, gpio & 0x1f); | ||
131 | |||
132 | return 0; | ||
133 | } | ||
134 | |||
135 | /* MXS has one interrupt *per* gpio port */ | ||
136 | static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc) | ||
137 | { | ||
138 | u32 irq_stat; | ||
139 | struct mxs_gpio_port *port = (struct mxs_gpio_port *)get_irq_data(irq); | ||
140 | u32 gpio_irq_no_base = port->virtual_irq_start; | ||
141 | |||
142 | irq_stat = __raw_readl(port->base + PINCTRL_IRQSTAT(port->id)) & | ||
143 | __raw_readl(port->base + PINCTRL_IRQEN(port->id)); | ||
144 | |||
145 | while (irq_stat != 0) { | ||
146 | int irqoffset = fls(irq_stat) - 1; | ||
147 | generic_handle_irq(gpio_irq_no_base + irqoffset); | ||
148 | irq_stat &= ~(1 << irqoffset); | ||
149 | } | ||
150 | } | ||
151 | |||
152 | /* | ||
153 | * Set interrupt number "irq" in the GPIO as a wake-up source. | ||
154 | * While system is running, all registered GPIO interrupts need to have | ||
155 | * wake-up enabled. When system is suspended, only selected GPIO interrupts | ||
156 | * need to have wake-up enabled. | ||
157 | * @param irq interrupt source number | ||
158 | * @param enable enable as wake-up if equal to non-zero | ||
159 | * @return This function returns 0 on success. | ||
160 | */ | ||
161 | static int mxs_gpio_set_wake_irq(u32 irq, u32 enable) | ||
162 | { | ||
163 | u32 gpio = irq_to_gpio(irq); | ||
164 | u32 gpio_idx = gpio & 0x1f; | ||
165 | struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32]; | ||
166 | |||
167 | if (enable) { | ||
168 | if (port->irq_high && (gpio_idx >= 16)) | ||
169 | enable_irq_wake(port->irq_high); | ||
170 | else | ||
171 | enable_irq_wake(port->irq); | ||
172 | } else { | ||
173 | if (port->irq_high && (gpio_idx >= 16)) | ||
174 | disable_irq_wake(port->irq_high); | ||
175 | else | ||
176 | disable_irq_wake(port->irq); | ||
177 | } | ||
178 | |||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static struct irq_chip gpio_irq_chip = { | ||
183 | .ack = mxs_gpio_ack_irq, | ||
184 | .mask = mxs_gpio_mask_irq, | ||
185 | .unmask = mxs_gpio_unmask_irq, | ||
186 | .set_type = mxs_gpio_set_irq_type, | ||
187 | .set_wake = mxs_gpio_set_wake_irq, | ||
188 | }; | ||
189 | |||
190 | static void mxs_set_gpio_direction(struct gpio_chip *chip, unsigned offset, | ||
191 | int dir) | ||
192 | { | ||
193 | struct mxs_gpio_port *port = | ||
194 | container_of(chip, struct mxs_gpio_port, chip); | ||
195 | void __iomem *pin_addr = port->base + PINCTRL_DOE(port->id); | ||
196 | |||
197 | if (dir) | ||
198 | __mxs_setl(1 << offset, pin_addr); | ||
199 | else | ||
200 | __mxs_clrl(1 << offset, pin_addr); | ||
201 | } | ||
202 | |||
203 | static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
204 | { | ||
205 | struct mxs_gpio_port *port = | ||
206 | container_of(chip, struct mxs_gpio_port, chip); | ||
207 | |||
208 | return (__raw_readl(port->base + PINCTRL_DIN(port->id)) >> offset) & 1; | ||
209 | } | ||
210 | |||
211 | static void mxs_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
212 | { | ||
213 | struct mxs_gpio_port *port = | ||
214 | container_of(chip, struct mxs_gpio_port, chip); | ||
215 | void __iomem *pin_addr = port->base + PINCTRL_DOUT(port->id); | ||
216 | |||
217 | if (value) | ||
218 | __mxs_setl(1 << offset, pin_addr); | ||
219 | else | ||
220 | __mxs_clrl(1 << offset, pin_addr); | ||
221 | } | ||
222 | |||
223 | static int mxs_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
224 | { | ||
225 | struct mxs_gpio_port *port = | ||
226 | container_of(chip, struct mxs_gpio_port, chip); | ||
227 | |||
228 | return port->virtual_irq_start + offset; | ||
229 | } | ||
230 | |||
231 | static int mxs_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | ||
232 | { | ||
233 | mxs_set_gpio_direction(chip, offset, 0); | ||
234 | return 0; | ||
235 | } | ||
236 | |||
237 | static int mxs_gpio_direction_output(struct gpio_chip *chip, | ||
238 | unsigned offset, int value) | ||
239 | { | ||
240 | mxs_gpio_set(chip, offset, value); | ||
241 | mxs_set_gpio_direction(chip, offset, 1); | ||
242 | return 0; | ||
243 | } | ||
244 | |||
245 | int __init mxs_gpio_init(struct mxs_gpio_port *port, int cnt) | ||
246 | { | ||
247 | int i, j; | ||
248 | |||
249 | /* save for local usage */ | ||
250 | mxs_gpio_ports = port; | ||
251 | gpio_table_size = cnt; | ||
252 | |||
253 | pr_info("MXS GPIO hardware\n"); | ||
254 | |||
255 | for (i = 0; i < cnt; i++) { | ||
256 | /* disable the interrupt and clear the status */ | ||
257 | __raw_writel(0, port[i].base + PINCTRL_PIN2IRQ(i)); | ||
258 | __raw_writel(0, port[i].base + PINCTRL_IRQEN(i)); | ||
259 | |||
260 | /* clear address has to be used to clear IRQSTAT bits */ | ||
261 | __mxs_clrl(~0U, port[i].base + PINCTRL_IRQSTAT(i)); | ||
262 | |||
263 | for (j = port[i].virtual_irq_start; | ||
264 | j < port[i].virtual_irq_start + 32; j++) { | ||
265 | set_irq_chip(j, &gpio_irq_chip); | ||
266 | set_irq_handler(j, handle_level_irq); | ||
267 | set_irq_flags(j, IRQF_VALID); | ||
268 | } | ||
269 | |||
270 | /* setup one handler for each entry */ | ||
271 | set_irq_chained_handler(port[i].irq, mxs_gpio_irq_handler); | ||
272 | set_irq_data(port[i].irq, &port[i]); | ||
273 | |||
274 | /* register gpio chip */ | ||
275 | port[i].chip.direction_input = mxs_gpio_direction_input; | ||
276 | port[i].chip.direction_output = mxs_gpio_direction_output; | ||
277 | port[i].chip.get = mxs_gpio_get; | ||
278 | port[i].chip.set = mxs_gpio_set; | ||
279 | port[i].chip.to_irq = mxs_gpio_to_irq; | ||
280 | port[i].chip.base = i * 32; | ||
281 | port[i].chip.ngpio = 32; | ||
282 | |||
283 | /* its a serious configuration bug when it fails */ | ||
284 | BUG_ON(gpiochip_add(&port[i].chip) < 0); | ||
285 | } | ||
286 | |||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | #define DEFINE_MXS_GPIO_PORT(soc, _id) \ | ||
291 | { \ | ||
292 | .chip.label = "gpio-" #_id, \ | ||
293 | .id = _id, \ | ||
294 | .irq = soc ## _INT_GPIO ## _id, \ | ||
295 | .base = soc ## _IO_ADDRESS( \ | ||
296 | soc ## _PINCTRL ## _BASE_ADDR), \ | ||
297 | .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ | ||
298 | } | ||
299 | |||
300 | #define DEFINE_REGISTER_FUNCTION(prefix) \ | ||
301 | int __init prefix ## _register_gpios(void) \ | ||
302 | { \ | ||
303 | return mxs_gpio_init(prefix ## _gpio_ports, \ | ||
304 | ARRAY_SIZE(prefix ## _gpio_ports)); \ | ||
305 | } | ||
306 | |||
307 | #ifdef CONFIG_SOC_IMX23 | ||
308 | static struct mxs_gpio_port mx23_gpio_ports[] = { | ||
309 | DEFINE_MXS_GPIO_PORT(MX23, 0), | ||
310 | DEFINE_MXS_GPIO_PORT(MX23, 1), | ||
311 | DEFINE_MXS_GPIO_PORT(MX23, 2), | ||
312 | }; | ||
313 | DEFINE_REGISTER_FUNCTION(mx23) | ||
314 | #endif | ||
315 | |||
316 | #ifdef CONFIG_SOC_IMX28 | ||
317 | static struct mxs_gpio_port mx28_gpio_ports[] = { | ||
318 | DEFINE_MXS_GPIO_PORT(MX28, 0), | ||
319 | DEFINE_MXS_GPIO_PORT(MX28, 1), | ||
320 | DEFINE_MXS_GPIO_PORT(MX28, 2), | ||
321 | DEFINE_MXS_GPIO_PORT(MX28, 3), | ||
322 | DEFINE_MXS_GPIO_PORT(MX28, 4), | ||
323 | }; | ||
324 | DEFINE_REGISTER_FUNCTION(mx28) | ||
325 | #endif | ||
diff --git a/arch/arm/mach-mxs/gpio.h b/arch/arm/mach-mxs/gpio.h new file mode 100644 index 000000000000..005bb06630b1 --- /dev/null +++ b/arch/arm/mach-mxs/gpio.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.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 __MXS_GPIO_H__ | ||
21 | #define __MXS_GPIO_H__ | ||
22 | |||
23 | struct mxs_gpio_port { | ||
24 | void __iomem *base; | ||
25 | int id; | ||
26 | int irq; | ||
27 | int irq_high; | ||
28 | int virtual_irq_start; | ||
29 | struct gpio_chip chip; | ||
30 | }; | ||
31 | |||
32 | int mxs_gpio_init(struct mxs_gpio_port*, int); | ||
33 | |||
34 | #endif /* __MXS_GPIO_H__ */ | ||
diff --git a/arch/arm/mach-mxs/icoll.c b/arch/arm/mach-mxs/icoll.c new file mode 100644 index 000000000000..5dd43ba70058 --- /dev/null +++ b/arch/arm/mach-mxs/icoll.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/irq.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <mach/mxs.h> | ||
25 | #include <mach/common.h> | ||
26 | |||
27 | #define HW_ICOLL_VECTOR 0x0000 | ||
28 | #define HW_ICOLL_LEVELACK 0x0010 | ||
29 | #define HW_ICOLL_CTRL 0x0020 | ||
30 | #define HW_ICOLL_INTERRUPTn_SET(n) (0x0124 + (n) * 0x10) | ||
31 | #define HW_ICOLL_INTERRUPTn_CLR(n) (0x0128 + (n) * 0x10) | ||
32 | #define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004 | ||
33 | #define BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 0x1 | ||
34 | |||
35 | static void __iomem *icoll_base = MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR); | ||
36 | |||
37 | static void icoll_ack_irq(unsigned int irq) | ||
38 | { | ||
39 | /* | ||
40 | * The Interrupt Collector is able to prioritize irqs. | ||
41 | * Currently only level 0 is used. So acking can use | ||
42 | * BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 unconditionally. | ||
43 | */ | ||
44 | __raw_writel(BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0, | ||
45 | icoll_base + HW_ICOLL_LEVELACK); | ||
46 | } | ||
47 | |||
48 | static void icoll_mask_irq(unsigned int irq) | ||
49 | { | ||
50 | __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, | ||
51 | icoll_base + HW_ICOLL_INTERRUPTn_CLR(irq)); | ||
52 | } | ||
53 | |||
54 | static void icoll_unmask_irq(unsigned int irq) | ||
55 | { | ||
56 | __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, | ||
57 | icoll_base + HW_ICOLL_INTERRUPTn_SET(irq)); | ||
58 | } | ||
59 | |||
60 | static struct irq_chip mxs_icoll_chip = { | ||
61 | .ack = icoll_ack_irq, | ||
62 | .mask = icoll_mask_irq, | ||
63 | .unmask = icoll_unmask_irq, | ||
64 | }; | ||
65 | |||
66 | void __init icoll_init_irq(void) | ||
67 | { | ||
68 | int i; | ||
69 | |||
70 | /* | ||
71 | * Interrupt Collector reset, which initializes the priority | ||
72 | * for each irq to level 0. | ||
73 | */ | ||
74 | mxs_reset_block(icoll_base + HW_ICOLL_CTRL); | ||
75 | |||
76 | for (i = 0; i < MXS_INTERNAL_IRQS; i++) { | ||
77 | set_irq_chip(i, &mxs_icoll_chip); | ||
78 | set_irq_handler(i, handle_level_irq); | ||
79 | set_irq_flags(i, IRQF_VALID); | ||
80 | } | ||
81 | } | ||
diff --git a/arch/arm/mach-mxs/include/mach/clkdev.h b/arch/arm/mach-mxs/include/mach/clkdev.h new file mode 100644 index 000000000000..3a8f2e3a6309 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/clkdev.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __MACH_MXS_CLKDEV_H__ | ||
2 | #define __MACH_MXS_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/mach-mxs/include/mach/clock.h b/arch/arm/mach-mxs/include/mach/clock.h new file mode 100644 index 000000000000..041e276d8a32 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/clock.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.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 __MACH_MXS_CLOCK_H__ | ||
21 | #define __MACH_MXS_CLOCK_H__ | ||
22 | |||
23 | #ifndef __ASSEMBLY__ | ||
24 | #include <linux/list.h> | ||
25 | |||
26 | struct module; | ||
27 | |||
28 | struct clk { | ||
29 | int id; | ||
30 | /* Source clock this clk depends on */ | ||
31 | struct clk *parent; | ||
32 | /* Secondary clock to enable/disable with this clock */ | ||
33 | struct clk *secondary; | ||
34 | /* Reference count of clock enable/disable */ | ||
35 | __s8 usecount; | ||
36 | /* Register bit position for clock's enable/disable control. */ | ||
37 | u8 enable_shift; | ||
38 | /* Register address for clock's enable/disable control. */ | ||
39 | void __iomem *enable_reg; | ||
40 | u32 flags; | ||
41 | /* get the current clock rate (always a fresh value) */ | ||
42 | unsigned long (*get_rate) (struct clk *); | ||
43 | /* Function ptr to set the clock to a new rate. The rate must match a | ||
44 | supported rate returned from round_rate. Leave blank if clock is not | ||
45 | programmable */ | ||
46 | int (*set_rate) (struct clk *, unsigned long); | ||
47 | /* Function ptr to round the requested clock rate to the nearest | ||
48 | supported rate that is less than or equal to the requested rate. */ | ||
49 | unsigned long (*round_rate) (struct clk *, unsigned long); | ||
50 | /* Function ptr to enable the clock. Leave blank if clock can not | ||
51 | be gated. */ | ||
52 | int (*enable) (struct clk *); | ||
53 | /* Function ptr to disable the clock. Leave blank if clock can not | ||
54 | be gated. */ | ||
55 | void (*disable) (struct clk *); | ||
56 | /* Function ptr to set the parent clock of the clock. */ | ||
57 | int (*set_parent) (struct clk *, struct clk *); | ||
58 | }; | ||
59 | |||
60 | int clk_register(struct clk *clk); | ||
61 | void clk_unregister(struct clk *clk); | ||
62 | |||
63 | #endif /* __ASSEMBLY__ */ | ||
64 | #endif /* __MACH_MXS_CLOCK_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h new file mode 100644 index 000000000000..59133eb3cc96 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/common.h | |||
@@ -0,0 +1,31 @@ | |||
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 __MACH_MXS_COMMON_H__ | ||
12 | #define __MACH_MXS_COMMON_H__ | ||
13 | |||
14 | struct clk; | ||
15 | |||
16 | extern int mxs_reset_block(void __iomem *); | ||
17 | extern void mxs_timer_init(struct clk *, int); | ||
18 | |||
19 | extern int mx23_register_gpios(void); | ||
20 | extern int mx23_clocks_init(void); | ||
21 | extern void mx23_map_io(void); | ||
22 | extern void mx23_init_irq(void); | ||
23 | |||
24 | extern int mx28_register_gpios(void); | ||
25 | extern int mx28_clocks_init(void); | ||
26 | extern void mx28_map_io(void); | ||
27 | extern void mx28_init_irq(void); | ||
28 | |||
29 | extern void icoll_init_irq(void); | ||
30 | |||
31 | #endif /* __MACH_MXS_COMMON_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/debug-macro.S b/arch/arm/mach-mxs/include/mach/debug-macro.S new file mode 100644 index 000000000000..79650a1ad78d --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/debug-macro.S | |||
@@ -0,0 +1,38 @@ | |||
1 | /* arch/arm/mach-mxs/include/mach/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <mach/mx23.h> | ||
15 | #include <mach/mx28.h> | ||
16 | |||
17 | #ifdef CONFIG_SOC_IMX23 | ||
18 | #ifdef UART_PADDR | ||
19 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | ||
20 | #endif | ||
21 | #define UART_PADDR MX23_DUART_BASE_ADDR | ||
22 | #endif | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX28 | ||
25 | #ifdef UART_PADDR | ||
26 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | ||
27 | #endif | ||
28 | #define UART_PADDR MX28_DUART_BASE_ADDR | ||
29 | #endif | ||
30 | |||
31 | #define UART_VADDR MXS_IO_ADDRESS(UART_PADDR) | ||
32 | |||
33 | .macro addruart, rp, rv | ||
34 | ldr \rp, =UART_PADDR @ physical | ||
35 | ldr \rv, =UART_VADDR @ virtual | ||
36 | .endm | ||
37 | |||
38 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h new file mode 100644 index 000000000000..3da48d4d3273 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/devices-common.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/platform_device.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | struct platform_device *mxs_add_platform_device_dmamask( | ||
14 | const char *name, int id, | ||
15 | const struct resource *res, unsigned int num_resources, | ||
16 | const void *data, size_t size_data, u64 dmamask); | ||
17 | |||
18 | static inline struct platform_device *mxs_add_platform_device( | ||
19 | const char *name, int id, | ||
20 | const struct resource *res, unsigned int num_resources, | ||
21 | const void *data, size_t size_data) | ||
22 | { | ||
23 | return mxs_add_platform_device_dmamask( | ||
24 | name, id, res, num_resources, data, size_data, 0); | ||
25 | } | ||
26 | |||
27 | /* duart */ | ||
28 | struct mxs_duart_data { | ||
29 | resource_size_t iobase; | ||
30 | resource_size_t iosize; | ||
31 | resource_size_t irq; | ||
32 | }; | ||
33 | struct platform_device *__init mxs_add_duart( | ||
34 | const struct mxs_duart_data *data); | ||
35 | |||
36 | /* fec */ | ||
37 | #include <linux/fec.h> | ||
38 | struct mxs_fec_data { | ||
39 | int id; | ||
40 | resource_size_t iobase; | ||
41 | resource_size_t iosize; | ||
42 | resource_size_t irq; | ||
43 | }; | ||
44 | struct platform_device *__init mxs_add_fec( | ||
45 | const struct mxs_fec_data *data, | ||
46 | const struct fec_platform_data *pdata); | ||
diff --git a/arch/arm/mach-mxs/include/mach/entry-macro.S b/arch/arm/mach-mxs/include/mach/entry-macro.S new file mode 100644 index 000000000000..9f0da12e657a --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/entry-macro.S | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Low-level IRQ helper macros for Freescale MXS-based | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #include <mach/mxs.h> | ||
22 | |||
23 | #define MXS_ICOLL_VBASE MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR) | ||
24 | #define HW_ICOLL_STAT_OFFSET 0x70 | ||
25 | |||
26 | .macro disable_fiq | ||
27 | .endm | ||
28 | |||
29 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
30 | ldr \irqnr, [\base, #HW_ICOLL_STAT_OFFSET] | ||
31 | cmp \irqnr, #0x7F | ||
32 | strne \irqnr, [\base] | ||
33 | moveqs \irqnr, #0 | ||
34 | .endm | ||
35 | |||
36 | .macro get_irqnr_preamble, base, tmp | ||
37 | ldr \base, =MXS_ICOLL_VBASE | ||
38 | .endm | ||
39 | |||
40 | .macro arch_ret_to_user, tmp1, tmp2 | ||
41 | .endm | ||
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h new file mode 100644 index 000000000000..828ccccb6aad --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/gpio.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.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 __MACH_MXS_GPIO_H__ | ||
21 | #define __MACH_MXS_GPIO_H__ | ||
22 | |||
23 | #include <asm-generic/gpio.h> | ||
24 | |||
25 | #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) | ||
26 | |||
27 | /* use gpiolib dispatchers */ | ||
28 | #define gpio_get_value __gpio_get_value | ||
29 | #define gpio_set_value __gpio_set_value | ||
30 | #define gpio_cansleep __gpio_cansleep | ||
31 | #define gpio_to_irq __gpio_to_irq | ||
32 | |||
33 | #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) | ||
34 | |||
35 | #endif /* __MACH_MXS_GPIO_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/hardware.h b/arch/arm/mach-mxs/include/mach/hardware.h new file mode 100644 index 000000000000..53e89a09bf0d --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/hardware.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.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 __MACH_MXS_HARDWARE_H__ | ||
21 | #define __MACH_MXS_HARDWARE_H__ | ||
22 | |||
23 | #ifdef __ASSEMBLER__ | ||
24 | #define IOMEM(addr) (addr) | ||
25 | #else | ||
26 | #define IOMEM(addr) ((void __force __iomem *)(addr)) | ||
27 | #endif | ||
28 | |||
29 | #endif /* __MACH_MXS_HARDWARE_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/io.h b/arch/arm/mach-mxs/include/mach/io.h new file mode 100644 index 000000000000..289b7227e072 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/io.h | |||
@@ -0,0 +1,22 @@ | |||
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 __MACH_MXS_IO_H__ | ||
12 | #define __MACH_MXS_IO_H__ | ||
13 | |||
14 | /* Allow IO space to be anywhere in the memory */ | ||
15 | #define IO_SPACE_LIMIT 0xffffffff | ||
16 | |||
17 | /* io address mapping macro */ | ||
18 | #define __io(a) __typesafe_io(a) | ||
19 | |||
20 | #define __mem_pci(a) (a) | ||
21 | |||
22 | #endif /* __MACH_MXS_IO_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/iomux-mx23.h b/arch/arm/mach-mxs/include/mach/iomux-mx23.h new file mode 100644 index 000000000000..94e5dd83cdb8 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/iomux-mx23.h | |||
@@ -0,0 +1,355 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> | ||
3 | * Copyright (C) 2010 Freescale Semiconductor, Inc. | ||
4 | * | ||
5 | * The code contained herein is licensed under the GNU General Public | ||
6 | * License. You may obtain a copy of the GNU General Public License | ||
7 | * Version 2 or later at the following locations: | ||
8 | * | ||
9 | * http://www.opensource.org/licenses/gpl-license.html | ||
10 | * http://www.gnu.org/copyleft/gpl.html | ||
11 | */ | ||
12 | |||
13 | #ifndef __MACH_IOMUX_MX23_H__ | ||
14 | #define __MACH_IOMUX_MX23_H__ | ||
15 | |||
16 | #include <mach/iomux.h> | ||
17 | |||
18 | /* | ||
19 | * The naming convention for the pad modes is MX23_PAD_<padname>__<padmode> | ||
20 | * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num> | ||
21 | * See also iomux.h | ||
22 | * | ||
23 | * BANK PIN MUX | ||
24 | */ | ||
25 | /* MUXSEL_0 */ | ||
26 | #define MX23_PAD_GPMI_D00__GPMI_D00 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0) | ||
27 | #define MX23_PAD_GPMI_D01__GPMI_D01 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_0) | ||
28 | #define MX23_PAD_GPMI_D02__GPMI_D02 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_0) | ||
29 | #define MX23_PAD_GPMI_D03__GPMI_D03 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_0) | ||
30 | #define MX23_PAD_GPMI_D04__GPMI_D04 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_0) | ||
31 | #define MX23_PAD_GPMI_D05__GPMI_D05 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_0) | ||
32 | #define MX23_PAD_GPMI_D06__GPMI_D06 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_0) | ||
33 | #define MX23_PAD_GPMI_D07__GPMI_D07 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_0) | ||
34 | #define MX23_PAD_GPMI_D08__GPMI_D08 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_0) | ||
35 | #define MX23_PAD_GPMI_D09__GPMI_D09 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_0) | ||
36 | #define MX23_PAD_GPMI_D10__GPMI_D10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_0) | ||
37 | #define MX23_PAD_GPMI_D11__GPMI_D11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_0) | ||
38 | #define MX23_PAD_GPMI_D12__GPMI_D12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_0) | ||
39 | #define MX23_PAD_GPMI_D13__GPMI_D13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_0) | ||
40 | #define MX23_PAD_GPMI_D14__GPMI_D14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_0) | ||
41 | #define MX23_PAD_GPMI_D15__GPMI_D15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_0) | ||
42 | #define MX23_PAD_GPMI_CLE__GPMI_CLE MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_0) | ||
43 | #define MX23_PAD_GPMI_ALE__GPMI_ALE MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_0) | ||
44 | #define MX23_PAD_GPMI_CE2N__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_0) | ||
45 | #define MX23_PAD_GPMI_RDY0__GPMI_RDY0 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_0) | ||
46 | #define MX23_PAD_GPMI_RDY1__GPMI_RDY1 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_0) | ||
47 | #define MX23_PAD_GPMI_RDY2__GPMI_RDY2 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_0) | ||
48 | #define MX23_PAD_GPMI_RDY3__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_0) | ||
49 | #define MX23_PAD_GPMI_WPN__GPMI_WPN MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_0) | ||
50 | #define MX23_PAD_GPMI_WRN__GPMI_WRN MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_0) | ||
51 | #define MX23_PAD_GPMI_RDN__GPMI_RDN MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_0) | ||
52 | #define MX23_PAD_AUART1_CTS__AUART1_CTS MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_0) | ||
53 | #define MX23_PAD_AUART1_RTS__AUART1_RTS MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_0) | ||
54 | #define MX23_PAD_AUART1_RX__AUART1_RX MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_0) | ||
55 | #define MX23_PAD_AUART1_TX__AUART1_TX MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_0) | ||
56 | #define MX23_PAD_I2C_SCL__I2C_SCL MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_0) | ||
57 | #define MX23_PAD_I2C_SDA__I2C_SDA MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_0) | ||
58 | |||
59 | #define MX23_PAD_LCD_D00__LCD_D00 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_0) | ||
60 | #define MX23_PAD_LCD_D01__LCD_D01 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_0) | ||
61 | #define MX23_PAD_LCD_D02__LCD_D02 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_0) | ||
62 | #define MX23_PAD_LCD_D03__LCD_D03 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_0) | ||
63 | #define MX23_PAD_LCD_D04__LCD_D04 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_0) | ||
64 | #define MX23_PAD_LCD_D05__LCD_D05 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_0) | ||
65 | #define MX23_PAD_LCD_D06__LCD_D06 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_0) | ||
66 | #define MX23_PAD_LCD_D07__LCD_D07 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_0) | ||
67 | #define MX23_PAD_LCD_D08__LCD_D08 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_0) | ||
68 | #define MX23_PAD_LCD_D09__LCD_D09 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_0) | ||
69 | #define MX23_PAD_LCD_D10__LCD_D10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_0) | ||
70 | #define MX23_PAD_LCD_D11__LCD_D11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_0) | ||
71 | #define MX23_PAD_LCD_D12__LCD_D12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_0) | ||
72 | #define MX23_PAD_LCD_D13__LCD_D13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_0) | ||
73 | #define MX23_PAD_LCD_D14__LCD_D14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_0) | ||
74 | #define MX23_PAD_LCD_D15__LCD_D15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_0) | ||
75 | #define MX23_PAD_LCD_D16__LCD_D16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_0) | ||
76 | #define MX23_PAD_LCD_D17__LCD_D17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_0) | ||
77 | #define MX23_PAD_LCD_RESET__LCD_RESET MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_0) | ||
78 | #define MX23_PAD_LCD_RS__LCD_RS MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_0) | ||
79 | #define MX23_PAD_LCD_WR__LCD_WR MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_0) | ||
80 | #define MX23_PAD_LCD_CS__LCD_CS MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_0) | ||
81 | #define MX23_PAD_LCD_DOTCK__LCD_DOTCK MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_0) | ||
82 | #define MX23_PAD_LCD_ENABLE__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_0) | ||
83 | #define MX23_PAD_LCD_HSYNC__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_0) | ||
84 | #define MX23_PAD_LCD_VSYNC__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_0) | ||
85 | #define MX23_PAD_PWM0__PWM0 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_0) | ||
86 | #define MX23_PAD_PWM1__PWM1 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_0) | ||
87 | #define MX23_PAD_PWM2__PWM2 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_0) | ||
88 | #define MX23_PAD_PWM3__PWM3 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_0) | ||
89 | #define MX23_PAD_PWM4__PWM4 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_0) | ||
90 | |||
91 | #define MX23_PAD_SSP1_CMD__SSP1_CMD MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_0) | ||
92 | #define MX23_PAD_SSP1_DETECT__SSP1_DETECT MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_0) | ||
93 | #define MX23_PAD_SSP1_DATA0__SSP1_DATA0 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_0) | ||
94 | #define MX23_PAD_SSP1_DATA1__SSP1_DATA1 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_0) | ||
95 | #define MX23_PAD_SSP1_DATA2__SSP1_DATA2 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_0) | ||
96 | #define MX23_PAD_SSP1_DATA3__SSP1_DATA3 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_0) | ||
97 | #define MX23_PAD_SSP1_SCK__SSP1_SCK MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_0) | ||
98 | #define MX23_PAD_ROTARYA__ROTARYA MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_0) | ||
99 | #define MX23_PAD_ROTARYB__ROTARYB MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_0) | ||
100 | #define MX23_PAD_EMI_A00__EMI_A00 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_0) | ||
101 | #define MX23_PAD_EMI_A01__EMI_A01 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_0) | ||
102 | #define MX23_PAD_EMI_A02__EMI_A02 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_0) | ||
103 | #define MX23_PAD_EMI_A03__EMI_A03 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_0) | ||
104 | #define MX23_PAD_EMI_A04__EMI_A04 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_0) | ||
105 | #define MX23_PAD_EMI_A05__EMI_A05 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_0) | ||
106 | #define MX23_PAD_EMI_A06__EMI_A06 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_0) | ||
107 | #define MX23_PAD_EMI_A07__EMI_A07 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_0) | ||
108 | #define MX23_PAD_EMI_A08__EMI_A08 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_0) | ||
109 | #define MX23_PAD_EMI_A09__EMI_A09 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_0) | ||
110 | #define MX23_PAD_EMI_A10__EMI_A10 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_0) | ||
111 | #define MX23_PAD_EMI_A11__EMI_A11 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_0) | ||
112 | #define MX23_PAD_EMI_A12__EMI_A12 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_0) | ||
113 | #define MX23_PAD_EMI_BA0__EMI_BA0 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_0) | ||
114 | #define MX23_PAD_EMI_BA1__EMI_BA1 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_0) | ||
115 | #define MX23_PAD_EMI_CASN__EMI_CASN MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_0) | ||
116 | #define MX23_PAD_EMI_CE0N__EMI_CE0N MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_0) | ||
117 | #define MX23_PAD_EMI_CE1N__EMI_CE1N MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_0) | ||
118 | #define MX23_PAD_GPMI_CE1N__GPMI_CE1N MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_0) | ||
119 | #define MX23_PAD_GPMI_CE0N__GPMI_CE0N MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_0) | ||
120 | #define MX23_PAD_EMI_CKE__EMI_CKE MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_0) | ||
121 | #define MX23_PAD_EMI_RASN__EMI_RASN MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_0) | ||
122 | #define MX23_PAD_EMI_WEN__EMI_WEN MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_0) | ||
123 | |||
124 | #define MX23_PAD_EMI_D00__EMI_D00 MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_0) | ||
125 | #define MX23_PAD_EMI_D01__EMI_D01 MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_0) | ||
126 | #define MX23_PAD_EMI_D02__EMI_D02 MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_0) | ||
127 | #define MX23_PAD_EMI_D03__EMI_D03 MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_0) | ||
128 | #define MX23_PAD_EMI_D04__EMI_D04 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_0) | ||
129 | #define MX23_PAD_EMI_D05__EMI_D05 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_0) | ||
130 | #define MX23_PAD_EMI_D06__EMI_D06 MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_0) | ||
131 | #define MX23_PAD_EMI_D07__EMI_D07 MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_0) | ||
132 | #define MX23_PAD_EMI_D08__EMI_D08 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_0) | ||
133 | #define MX23_PAD_EMI_D09__EMI_D09 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_0) | ||
134 | #define MX23_PAD_EMI_D10__EMI_D10 MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_0) | ||
135 | #define MX23_PAD_EMI_D11__EMI_D11 MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_0) | ||
136 | #define MX23_PAD_EMI_D12__EMI_D12 MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_0) | ||
137 | #define MX23_PAD_EMI_D13__EMI_D13 MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_0) | ||
138 | #define MX23_PAD_EMI_D14__EMI_D14 MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_0) | ||
139 | #define MX23_PAD_EMI_D15__EMI_D15 MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_0) | ||
140 | #define MX23_PAD_EMI_DQM0__EMI_DQM0 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_0) | ||
141 | #define MX23_PAD_EMI_DQM1__EMI_DQM1 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_0) | ||
142 | #define MX23_PAD_EMI_DQS0__EMI_DQS0 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_0) | ||
143 | #define MX23_PAD_EMI_DQS1__EMI_DQS1 MXS_IOMUX_PAD_NAKED(3, 19, PAD_MUXSEL_0) | ||
144 | #define MX23_PAD_EMI_CLK__EMI_CLK MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_0) | ||
145 | #define MX23_PAD_EMI_CLKN__EMI_CLKN MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_0) | ||
146 | |||
147 | /* MUXSEL_1 */ | ||
148 | #define MX23_PAD_GPMI_D00__LCD_D8 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_1) | ||
149 | #define MX23_PAD_GPMI_D01__LCD_D9 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_1) | ||
150 | #define MX23_PAD_GPMI_D02__LCD_D10 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_1) | ||
151 | #define MX23_PAD_GPMI_D03__LCD_D11 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_1) | ||
152 | #define MX23_PAD_GPMI_D04__LCD_D12 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_1) | ||
153 | #define MX23_PAD_GPMI_D05__LCD_D13 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_1) | ||
154 | #define MX23_PAD_GPMI_D06__LCD_D14 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_1) | ||
155 | #define MX23_PAD_GPMI_D07__LCD_D15 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_1) | ||
156 | #define MX23_PAD_GPMI_D08__LCD_D18 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_1) | ||
157 | #define MX23_PAD_GPMI_D09__LCD_D19 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_1) | ||
158 | #define MX23_PAD_GPMI_D10__LCD_D20 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_1) | ||
159 | #define MX23_PAD_GPMI_D11__LCD_D21 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_1) | ||
160 | #define MX23_PAD_GPMI_D12__LCD_D22 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_1) | ||
161 | #define MX23_PAD_GPMI_D13__LCD_D23 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_1) | ||
162 | #define MX23_PAD_GPMI_D14__AUART2_RX MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_1) | ||
163 | #define MX23_PAD_GPMI_D15__AUART2_TX MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_1) | ||
164 | #define MX23_PAD_GPMI_CLE__LCD_D16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_1) | ||
165 | #define MX23_PAD_GPMI_ALE__LCD_D17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_1) | ||
166 | #define MX23_PAD_GPMI_CE2N__ATA_A2 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_1) | ||
167 | #define MX23_PAD_AUART1_RTS__IR_CLK MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_1) | ||
168 | #define MX23_PAD_AUART1_RX__IR_RX MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_1) | ||
169 | #define MX23_PAD_AUART1_TX__IR_TX MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_1) | ||
170 | #define MX23_PAD_I2C_SCL__GPMI_RDY2 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_1) | ||
171 | #define MX23_PAD_I2C_SDA__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_1) | ||
172 | |||
173 | #define MX23_PAD_LCD_D00__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_1) | ||
174 | #define MX23_PAD_LCD_D01__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_1) | ||
175 | #define MX23_PAD_LCD_D02__ETM_DA10 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_1) | ||
176 | #define MX23_PAD_LCD_D03__ETM_DA11 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_1) | ||
177 | #define MX23_PAD_LCD_D04__ETM_DA12 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_1) | ||
178 | #define MX23_PAD_LCD_D05__ETM_DA13 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_1) | ||
179 | #define MX23_PAD_LCD_D06__ETM_DA14 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_1) | ||
180 | #define MX23_PAD_LCD_D07__ETM_DA15 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_1) | ||
181 | #define MX23_PAD_LCD_D08__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_1) | ||
182 | #define MX23_PAD_LCD_D09__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_1) | ||
183 | #define MX23_PAD_LCD_D10__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_1) | ||
184 | #define MX23_PAD_LCD_D11__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_1) | ||
185 | #define MX23_PAD_LCD_D12__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_1) | ||
186 | #define MX23_PAD_LCD_D13__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_1) | ||
187 | #define MX23_PAD_LCD_D14__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_1) | ||
188 | #define MX23_PAD_LCD_D15__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_1) | ||
189 | #define MX23_PAD_LCD_RESET__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_1) | ||
190 | #define MX23_PAD_LCD_RS__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_1) | ||
191 | #define MX23_PAD_LCD_DOTCK__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_1) | ||
192 | #define MX23_PAD_LCD_ENABLE__I2C_SCL MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_1) | ||
193 | #define MX23_PAD_LCD_HSYNC__I2C_SDA MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_1) | ||
194 | #define MX23_PAD_LCD_VSYNC__LCD_BUSY MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_1) | ||
195 | #define MX23_PAD_PWM0__ROTARYA MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_1) | ||
196 | #define MX23_PAD_PWM1__ROTARYB MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_1) | ||
197 | #define MX23_PAD_PWM2__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_1) | ||
198 | #define MX23_PAD_PWM3__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_1) | ||
199 | #define MX23_PAD_PWM4__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_1) | ||
200 | |||
201 | #define MX23_PAD_SSP1_DETECT__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_1) | ||
202 | #define MX23_PAD_SSP1_DATA1__I2C_SCL MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_1) | ||
203 | #define MX23_PAD_SSP1_DATA2__I2C_SDA MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_1) | ||
204 | #define MX23_PAD_ROTARYA__AUART2_RTS MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_1) | ||
205 | #define MX23_PAD_ROTARYB__AUART2_CTS MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_1) | ||
206 | |||
207 | /* MUXSEL_2 */ | ||
208 | #define MX23_PAD_GPMI_D00__SSP2_DATA0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_2) | ||
209 | #define MX23_PAD_GPMI_D01__SSP2_DATA1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_2) | ||
210 | #define MX23_PAD_GPMI_D02__SSP2_DATA2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_2) | ||
211 | #define MX23_PAD_GPMI_D03__SSP2_DATA3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_2) | ||
212 | #define MX23_PAD_GPMI_D04__SSP2_DATA4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_2) | ||
213 | #define MX23_PAD_GPMI_D05__SSP2_DATA5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_2) | ||
214 | #define MX23_PAD_GPMI_D06__SSP2_DATA6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_2) | ||
215 | #define MX23_PAD_GPMI_D07__SSP2_DATA7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_2) | ||
216 | #define MX23_PAD_GPMI_D08__SSP1_DATA4 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_2) | ||
217 | #define MX23_PAD_GPMI_D09__SSP1_DATA5 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_2) | ||
218 | #define MX23_PAD_GPMI_D10__SSP1_DATA6 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_2) | ||
219 | #define MX23_PAD_GPMI_D11__SSP1_DATA7 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_2) | ||
220 | #define MX23_PAD_GPMI_D15__GPMI_CE3N MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_2) | ||
221 | #define MX23_PAD_GPMI_RDY0__SSP2_DETECT MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_2) | ||
222 | #define MX23_PAD_GPMI_RDY1__SSP2_CMD MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_2) | ||
223 | #define MX23_PAD_GPMI_WRN__SSP2_SCK MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_2) | ||
224 | #define MX23_PAD_AUART1_CTS__SSP1_DATA4 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_2) | ||
225 | #define MX23_PAD_AUART1_RTS__SSP1_DATA5 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_2) | ||
226 | #define MX23_PAD_AUART1_RX__SSP1_DATA6 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_2) | ||
227 | #define MX23_PAD_AUART1_TX__SSP1_DATA7 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_2) | ||
228 | #define MX23_PAD_I2C_SCL__AUART1_TX MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_2) | ||
229 | #define MX23_PAD_I2C_SDA__AUART1_RX MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_2) | ||
230 | |||
231 | #define MX23_PAD_LCD_D08__SAIF2_SDATA0 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_2) | ||
232 | #define MX23_PAD_LCD_D09__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_2) | ||
233 | #define MX23_PAD_LCD_D10__SAIF_MCLK_BITCLK MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_2) | ||
234 | #define MX23_PAD_LCD_D11__SAIF_LRCLK MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_2) | ||
235 | #define MX23_PAD_LCD_D12__SAIF2_SDATA1 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_2) | ||
236 | #define MX23_PAD_LCD_D13__SAIF2_SDATA2 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_2) | ||
237 | #define MX23_PAD_LCD_D14__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_2) | ||
238 | #define MX23_PAD_LCD_D15__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_2) | ||
239 | #define MX23_PAD_LCD_D16__SAIF_ALT_BITCLK MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_2) | ||
240 | #define MX23_PAD_LCD_RESET__GPMI_CE3N MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_2) | ||
241 | #define MX23_PAD_PWM0__DUART_RX MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_2) | ||
242 | #define MX23_PAD_PWM1__DUART_TX MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_2) | ||
243 | #define MX23_PAD_PWM3__AUART1_CTS MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_2) | ||
244 | #define MX23_PAD_PWM4__AUART1_RTS MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_2) | ||
245 | |||
246 | #define MX23_PAD_SSP1_CMD__JTAG_TDO MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_2) | ||
247 | #define MX23_PAD_SSP1_DETECT__USB_OTG_ID MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_2) | ||
248 | #define MX23_PAD_SSP1_DATA0__JTAG_TDI MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_2) | ||
249 | #define MX23_PAD_SSP1_DATA1__JTAG_TCLK MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_2) | ||
250 | #define MX23_PAD_SSP1_DATA2__JTAG_RTCK MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_2) | ||
251 | #define MX23_PAD_SSP1_DATA3__JTAG_TMS MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_2) | ||
252 | #define MX23_PAD_SSP1_SCK__JTAG_TRST MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_2) | ||
253 | #define MX23_PAD_ROTARYA__SPDIF MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_2) | ||
254 | #define MX23_PAD_ROTARYB__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_2) | ||
255 | |||
256 | /* MUXSEL_GPIO */ | ||
257 | #define MX23_PAD_GPMI_D00__GPO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO) | ||
258 | #define MX23_PAD_GPMI_D01__GPO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO) | ||
259 | #define MX23_PAD_GPMI_D02__GPO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO) | ||
260 | #define MX23_PAD_GPMI_D03__GPO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO) | ||
261 | #define MX23_PAD_GPMI_D04__GPO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO) | ||
262 | #define MX23_PAD_GPMI_D05__GPO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO) | ||
263 | #define MX23_PAD_GPMI_D06__GPO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO) | ||
264 | #define MX23_PAD_GPMI_D07__GPO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO) | ||
265 | #define MX23_PAD_GPMI_D08__GPO_0_8 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_GPIO) | ||
266 | #define MX23_PAD_GPMI_D09__GPO_0_9 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_GPIO) | ||
267 | #define MX23_PAD_GPMI_D10__GPO_0_10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_GPIO) | ||
268 | #define MX23_PAD_GPMI_D11__GPO_0_11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_GPIO) | ||
269 | #define MX23_PAD_GPMI_D12__GPO_0_12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_GPIO) | ||
270 | #define MX23_PAD_GPMI_D13__GPO_0_13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_GPIO) | ||
271 | #define MX23_PAD_GPMI_D14__GPO_0_14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_GPIO) | ||
272 | #define MX23_PAD_GPMI_D15__GPO_0_15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_GPIO) | ||
273 | #define MX23_PAD_GPMI_CLE__GPO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO) | ||
274 | #define MX23_PAD_GPMI_ALE__GPO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO) | ||
275 | #define MX23_PAD_GPMI_CE2N__GPO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO) | ||
276 | #define MX23_PAD_GPMI_RDY0__GPO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO) | ||
277 | #define MX23_PAD_GPMI_RDY1__GPO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO) | ||
278 | #define MX23_PAD_GPMI_RDY2__GPO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO) | ||
279 | #define MX23_PAD_GPMI_RDY3__GPO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO) | ||
280 | #define MX23_PAD_GPMI_WPN__GPO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO) | ||
281 | #define MX23_PAD_GPMI_WRN__GPO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO) | ||
282 | #define MX23_PAD_GPMI_RDN__GPO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO) | ||
283 | #define MX23_PAD_AUART1_CTS__GPO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO) | ||
284 | #define MX23_PAD_AUART1_RTS__GPO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO) | ||
285 | #define MX23_PAD_AUART1_RX__GPO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO) | ||
286 | #define MX23_PAD_AUART1_TX__GPO_0_29 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_GPIO) | ||
287 | #define MX23_PAD_I2C_SCL__GPO_0_30 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_GPIO) | ||
288 | #define MX23_PAD_I2C_SDA__GPO_0_31 MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_GPIO) | ||
289 | |||
290 | #define MX23_PAD_LCD_D00__GPO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO) | ||
291 | #define MX23_PAD_LCD_D01__GPO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO) | ||
292 | #define MX23_PAD_LCD_D02__GPO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO) | ||
293 | #define MX23_PAD_LCD_D03__GPO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO) | ||
294 | #define MX23_PAD_LCD_D04__GPO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO) | ||
295 | #define MX23_PAD_LCD_D05__GPO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO) | ||
296 | #define MX23_PAD_LCD_D06__GPO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO) | ||
297 | #define MX23_PAD_LCD_D07__GPO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO) | ||
298 | #define MX23_PAD_LCD_D08__GPO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO) | ||
299 | #define MX23_PAD_LCD_D09__GPO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO) | ||
300 | #define MX23_PAD_LCD_D10__GPO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO) | ||
301 | #define MX23_PAD_LCD_D11__GPO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO) | ||
302 | #define MX23_PAD_LCD_D12__GPO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO) | ||
303 | #define MX23_PAD_LCD_D13__GPO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO) | ||
304 | #define MX23_PAD_LCD_D14__GPO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO) | ||
305 | #define MX23_PAD_LCD_D15__GPO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO) | ||
306 | #define MX23_PAD_LCD_D16__GPO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO) | ||
307 | #define MX23_PAD_LCD_D17__GPO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO) | ||
308 | #define MX23_PAD_LCD_RESET__GPO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO) | ||
309 | #define MX23_PAD_LCD_RS__GPO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO) | ||
310 | #define MX23_PAD_LCD_WR__GPO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO) | ||
311 | #define MX23_PAD_LCD_CS__GPO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO) | ||
312 | #define MX23_PAD_LCD_DOTCK__GPO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO) | ||
313 | #define MX23_PAD_LCD_ENABLE__GPO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO) | ||
314 | #define MX23_PAD_LCD_HSYNC__GPO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO) | ||
315 | #define MX23_PAD_LCD_VSYNC__GPO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO) | ||
316 | #define MX23_PAD_PWM0__GPO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO) | ||
317 | #define MX23_PAD_PWM1__GPO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO) | ||
318 | #define MX23_PAD_PWM2__GPO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO) | ||
319 | #define MX23_PAD_PWM3__GPO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO) | ||
320 | #define MX23_PAD_PWM4__GPO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO) | ||
321 | |||
322 | #define MX23_PAD_SSP1_CMD__GPO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO) | ||
323 | #define MX23_PAD_SSP1_DETECT__GPO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO) | ||
324 | #define MX23_PAD_SSP1_DATA0__GPO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO) | ||
325 | #define MX23_PAD_SSP1_DATA1__GPO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO) | ||
326 | #define MX23_PAD_SSP1_DATA2__GPO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO) | ||
327 | #define MX23_PAD_SSP1_DATA3__GPO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO) | ||
328 | #define MX23_PAD_SSP1_SCK__GPO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO) | ||
329 | #define MX23_PAD_ROTARYA__GPO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO) | ||
330 | #define MX23_PAD_ROTARYB__GPO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO) | ||
331 | #define MX23_PAD_EMI_A00__GPO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO) | ||
332 | #define MX23_PAD_EMI_A01__GPO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO) | ||
333 | #define MX23_PAD_EMI_A02__GPO_2_11 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_GPIO) | ||
334 | #define MX23_PAD_EMI_A03__GPO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO) | ||
335 | #define MX23_PAD_EMI_A04__GPO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO) | ||
336 | #define MX23_PAD_EMI_A05__GPO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO) | ||
337 | #define MX23_PAD_EMI_A06__GPO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO) | ||
338 | #define MX23_PAD_EMI_A07__GPO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO) | ||
339 | #define MX23_PAD_EMI_A08__GPO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO) | ||
340 | #define MX23_PAD_EMI_A09__GPO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO) | ||
341 | #define MX23_PAD_EMI_A10__GPO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO) | ||
342 | #define MX23_PAD_EMI_A11__GPO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO) | ||
343 | #define MX23_PAD_EMI_A12__GPO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO) | ||
344 | #define MX23_PAD_EMI_BA0__GPO_2_22 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_GPIO) | ||
345 | #define MX23_PAD_EMI_BA1__GPO_2_23 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_GPIO) | ||
346 | #define MX23_PAD_EMI_CASN__GPO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO) | ||
347 | #define MX23_PAD_EMI_CE0N__GPO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO) | ||
348 | #define MX23_PAD_EMI_CE1N__GPO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO) | ||
349 | #define MX23_PAD_GPMI_CE1N__GPO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO) | ||
350 | #define MX23_PAD_GPMI_CE0N__GPO_2_28 MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_GPIO) | ||
351 | #define MX23_PAD_EMI_CKE__GPO_2_29 MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_GPIO) | ||
352 | #define MX23_PAD_EMI_RASN__GPO_2_30 MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_GPIO) | ||
353 | #define MX23_PAD_EMI_WEN__GPO_2_31 MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_GPIO) | ||
354 | |||
355 | #endif /* __MACH_IOMUX_MX23_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/iomux-mx28.h b/arch/arm/mach-mxs/include/mach/iomux-mx28.h new file mode 100644 index 000000000000..f50fefd10520 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/iomux-mx28.h | |||
@@ -0,0 +1,537 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> | ||
3 | * Copyright (C) 2010 Freescale Semiconductor, Inc. | ||
4 | * | ||
5 | * The code contained herein is licensed under the GNU General Public | ||
6 | * License. You may obtain a copy of the GNU General Public License | ||
7 | * Version 2 or later at the following locations: | ||
8 | * | ||
9 | * http://www.opensource.org/licenses/gpl-license.html | ||
10 | * http://www.gnu.org/copyleft/gpl.html | ||
11 | */ | ||
12 | |||
13 | #ifndef __MACH_IOMUX_MX28_H__ | ||
14 | #define __MACH_IOMUX_MX28_H__ | ||
15 | |||
16 | #include <mach/iomux.h> | ||
17 | |||
18 | /* | ||
19 | * The naming convention for the pad modes is MX28_PAD_<padname>__<padmode> | ||
20 | * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num> | ||
21 | * See also iomux.h | ||
22 | * | ||
23 | * BANK PIN MUX | ||
24 | */ | ||
25 | /* MUXSEL_0 */ | ||
26 | #define MX28_PAD_GPMI_D00__GPMI_D0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0) | ||
27 | #define MX28_PAD_GPMI_D01__GPMI_D1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_0) | ||
28 | #define MX28_PAD_GPMI_D02__GPMI_D2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_0) | ||
29 | #define MX28_PAD_GPMI_D03__GPMI_D3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_0) | ||
30 | #define MX28_PAD_GPMI_D04__GPMI_D4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_0) | ||
31 | #define MX28_PAD_GPMI_D05__GPMI_D5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_0) | ||
32 | #define MX28_PAD_GPMI_D06__GPMI_D6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_0) | ||
33 | #define MX28_PAD_GPMI_D07__GPMI_D7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_0) | ||
34 | #define MX28_PAD_GPMI_CE0N__GPMI_CE0N MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_0) | ||
35 | #define MX28_PAD_GPMI_CE1N__GPMI_CE1N MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_0) | ||
36 | #define MX28_PAD_GPMI_CE2N__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_0) | ||
37 | #define MX28_PAD_GPMI_CE3N__GPMI_CE3N MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_0) | ||
38 | #define MX28_PAD_GPMI_RDY0__GPMI_READY0 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_0) | ||
39 | #define MX28_PAD_GPMI_RDY1__GPMI_READY1 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_0) | ||
40 | #define MX28_PAD_GPMI_RDY2__GPMI_READY2 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_0) | ||
41 | #define MX28_PAD_GPMI_RDY3__GPMI_READY3 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_0) | ||
42 | #define MX28_PAD_GPMI_RDN__GPMI_RDN MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_0) | ||
43 | #define MX28_PAD_GPMI_WRN__GPMI_WRN MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_0) | ||
44 | #define MX28_PAD_GPMI_ALE__GPMI_ALE MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_0) | ||
45 | #define MX28_PAD_GPMI_CLE__GPMI_CLE MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_0) | ||
46 | #define MX28_PAD_GPMI_RESETN__GPMI_RESETN MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_0) | ||
47 | |||
48 | #define MX28_PAD_LCD_D00__LCD_D0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_0) | ||
49 | #define MX28_PAD_LCD_D01__LCD_D1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_0) | ||
50 | #define MX28_PAD_LCD_D02__LCD_D2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_0) | ||
51 | #define MX28_PAD_LCD_D03__LCD_D3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_0) | ||
52 | #define MX28_PAD_LCD_D04__LCD_D4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_0) | ||
53 | #define MX28_PAD_LCD_D05__LCD_D5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_0) | ||
54 | #define MX28_PAD_LCD_D06__LCD_D6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_0) | ||
55 | #define MX28_PAD_LCD_D07__LCD_D7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_0) | ||
56 | #define MX28_PAD_LCD_D08__LCD_D8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_0) | ||
57 | #define MX28_PAD_LCD_D09__LCD_D9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_0) | ||
58 | #define MX28_PAD_LCD_D10__LCD_D10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_0) | ||
59 | #define MX28_PAD_LCD_D11__LCD_D11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_0) | ||
60 | #define MX28_PAD_LCD_D12__LCD_D12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_0) | ||
61 | #define MX28_PAD_LCD_D13__LCD_D13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_0) | ||
62 | #define MX28_PAD_LCD_D14__LCD_D14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_0) | ||
63 | #define MX28_PAD_LCD_D15__LCD_D15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_0) | ||
64 | #define MX28_PAD_LCD_D16__LCD_D16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_0) | ||
65 | #define MX28_PAD_LCD_D17__LCD_D17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_0) | ||
66 | #define MX28_PAD_LCD_D18__LCD_D18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_0) | ||
67 | #define MX28_PAD_LCD_D19__LCD_D19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_0) | ||
68 | #define MX28_PAD_LCD_D20__LCD_D20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_0) | ||
69 | #define MX28_PAD_LCD_D21__LCD_D21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_0) | ||
70 | #define MX28_PAD_LCD_D22__LCD_D22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_0) | ||
71 | #define MX28_PAD_LCD_D23__LCD_D23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_0) | ||
72 | #define MX28_PAD_LCD_RD_E__LCD_RD_E MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_0) | ||
73 | #define MX28_PAD_LCD_WR_RWN__LCD_WR_RWN MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_0) | ||
74 | #define MX28_PAD_LCD_RS__LCD_RS MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_0) | ||
75 | #define MX28_PAD_LCD_CS__LCD_CS MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_0) | ||
76 | #define MX28_PAD_LCD_VSYNC__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_0) | ||
77 | #define MX28_PAD_LCD_HSYNC__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_0) | ||
78 | #define MX28_PAD_LCD_DOTCLK__LCD_DOTCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_0) | ||
79 | #define MX28_PAD_LCD_ENABLE__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 31, PAD_MUXSEL_0) | ||
80 | |||
81 | #define MX28_PAD_SSP0_DATA0__SSP0_D0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_0) | ||
82 | #define MX28_PAD_SSP0_DATA1__SSP0_D1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_0) | ||
83 | #define MX28_PAD_SSP0_DATA2__SSP0_D2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_0) | ||
84 | #define MX28_PAD_SSP0_DATA3__SSP0_D3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_0) | ||
85 | #define MX28_PAD_SSP0_DATA4__SSP0_D4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_0) | ||
86 | #define MX28_PAD_SSP0_DATA5__SSP0_D5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_0) | ||
87 | #define MX28_PAD_SSP0_DATA6__SSP0_D6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_0) | ||
88 | #define MX28_PAD_SSP0_DATA7__SSP0_D7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_0) | ||
89 | #define MX28_PAD_SSP0_CMD__SSP0_CMD MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_0) | ||
90 | #define MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_0) | ||
91 | #define MX28_PAD_SSP0_SCK__SSP0_SCK MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_0) | ||
92 | #define MX28_PAD_SSP1_SCK__SSP1_SCK MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_0) | ||
93 | #define MX28_PAD_SSP1_CMD__SSP1_CMD MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_0) | ||
94 | #define MX28_PAD_SSP1_DATA0__SSP1_D0 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_0) | ||
95 | #define MX28_PAD_SSP1_DATA3__SSP1_D3 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_0) | ||
96 | #define MX28_PAD_SSP2_SCK__SSP2_SCK MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_0) | ||
97 | #define MX28_PAD_SSP2_MOSI__SSP2_CMD MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_0) | ||
98 | #define MX28_PAD_SSP2_MISO__SSP2_D0 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_0) | ||
99 | #define MX28_PAD_SSP2_SS0__SSP2_D3 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_0) | ||
100 | #define MX28_PAD_SSP2_SS1__SSP2_D4 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_0) | ||
101 | #define MX28_PAD_SSP2_SS2__SSP2_D5 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_0) | ||
102 | #define MX28_PAD_SSP3_SCK__SSP3_SCK MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_0) | ||
103 | #define MX28_PAD_SSP3_MOSI__SSP3_CMD MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_0) | ||
104 | #define MX28_PAD_SSP3_MISO__SSP3_D0 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_0) | ||
105 | #define MX28_PAD_SSP3_SS0__SSP3_D3 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_0) | ||
106 | |||
107 | #define MX28_PAD_AUART0_RX__AUART0_RX MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_0) | ||
108 | #define MX28_PAD_AUART0_TX__AUART0_TX MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_0) | ||
109 | #define MX28_PAD_AUART0_CTS__AUART0_CTS MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_0) | ||
110 | #define MX28_PAD_AUART0_RTS__AUART0_RTS MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_0) | ||
111 | #define MX28_PAD_AUART1_RX__AUART1_RX MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_0) | ||
112 | #define MX28_PAD_AUART1_TX__AUART1_TX MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_0) | ||
113 | #define MX28_PAD_AUART1_CTS__AUART1_CTS MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_0) | ||
114 | #define MX28_PAD_AUART1_RTS__AUART1_RTS MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_0) | ||
115 | #define MX28_PAD_AUART2_RX__AUART2_RX MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_0) | ||
116 | #define MX28_PAD_AUART2_TX__AUART2_TX MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_0) | ||
117 | #define MX28_PAD_AUART2_CTS__AUART2_CTS MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_0) | ||
118 | #define MX28_PAD_AUART2_RTS__AUART2_RTS MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_0) | ||
119 | #define MX28_PAD_AUART3_RX__AUART3_RX MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_0) | ||
120 | #define MX28_PAD_AUART3_TX__AUART3_TX MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_0) | ||
121 | #define MX28_PAD_AUART3_CTS__AUART3_CTS MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_0) | ||
122 | #define MX28_PAD_AUART3_RTS__AUART3_RTS MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_0) | ||
123 | #define MX28_PAD_PWM0__PWM_0 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_0) | ||
124 | #define MX28_PAD_PWM1__PWM_1 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_0) | ||
125 | #define MX28_PAD_PWM2__PWM_2 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_0) | ||
126 | #define MX28_PAD_SAIF0_MCLK__SAIF0_MCLK MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_0) | ||
127 | #define MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_0) | ||
128 | #define MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_0) | ||
129 | #define MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_0) | ||
130 | #define MX28_PAD_I2C0_SCL__I2C0_SCL MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_0) | ||
131 | #define MX28_PAD_I2C0_SDA__I2C0_SDA MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_0) | ||
132 | #define MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_0) | ||
133 | #define MX28_PAD_SPDIF__SPDIF_TX MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_0) | ||
134 | #define MX28_PAD_PWM3__PWM_3 MXS_IOMUX_PAD_NAKED(3, 28, PAD_MUXSEL_0) | ||
135 | #define MX28_PAD_PWM4__PWM_4 MXS_IOMUX_PAD_NAKED(3, 29, PAD_MUXSEL_0) | ||
136 | #define MX28_PAD_LCD_RESET__LCD_RESET MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_0) | ||
137 | |||
138 | #define MX28_PAD_ENET0_MDC__ENET0_MDC MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_0) | ||
139 | #define MX28_PAD_ENET0_MDIO__ENET0_MDIO MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_0) | ||
140 | #define MX28_PAD_ENET0_RX_EN__ENET0_RX_EN MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_0) | ||
141 | #define MX28_PAD_ENET0_RXD0__ENET0_RXD0 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_0) | ||
142 | #define MX28_PAD_ENET0_RXD1__ENET0_RXD1 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_0) | ||
143 | #define MX28_PAD_ENET0_TX_CLK__ENET0_TX_CLK MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_0) | ||
144 | #define MX28_PAD_ENET0_TX_EN__ENET0_TX_EN MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_0) | ||
145 | #define MX28_PAD_ENET0_TXD0__ENET0_TXD0 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_0) | ||
146 | #define MX28_PAD_ENET0_TXD1__ENET0_TXD1 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_0) | ||
147 | #define MX28_PAD_ENET0_RXD2__ENET0_RXD2 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_0) | ||
148 | #define MX28_PAD_ENET0_RXD3__ENET0_RXD3 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_0) | ||
149 | #define MX28_PAD_ENET0_TXD2__ENET0_TXD2 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_0) | ||
150 | #define MX28_PAD_ENET0_TXD3__ENET0_TXD3 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_0) | ||
151 | #define MX28_PAD_ENET0_RX_CLK__ENET0_RX_CLK MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_0) | ||
152 | #define MX28_PAD_ENET0_COL__ENET0_COL MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_0) | ||
153 | #define MX28_PAD_ENET0_CRS__ENET0_CRS MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_0) | ||
154 | #define MX28_PAD_ENET_CLK__CLKCTRL_ENET MXS_IOMUX_PAD_NAKED(4, 16, PAD_MUXSEL_0) | ||
155 | #define MX28_PAD_JTAG_RTCK__JTAG_RTCK MXS_IOMUX_PAD_NAKED(4, 20, PAD_MUXSEL_0) | ||
156 | |||
157 | #define MX28_PAD_EMI_D00__EMI_DATA0 MXS_IOMUX_PAD_NAKED(5, 0, PAD_MUXSEL_0) | ||
158 | #define MX28_PAD_EMI_D01__EMI_DATA1 MXS_IOMUX_PAD_NAKED(5, 1, PAD_MUXSEL_0) | ||
159 | #define MX28_PAD_EMI_D02__EMI_DATA2 MXS_IOMUX_PAD_NAKED(5, 2, PAD_MUXSEL_0) | ||
160 | #define MX28_PAD_EMI_D03__EMI_DATA3 MXS_IOMUX_PAD_NAKED(5, 3, PAD_MUXSEL_0) | ||
161 | #define MX28_PAD_EMI_D04__EMI_DATA4 MXS_IOMUX_PAD_NAKED(5, 4, PAD_MUXSEL_0) | ||
162 | #define MX28_PAD_EMI_D05__EMI_DATA5 MXS_IOMUX_PAD_NAKED(5, 5, PAD_MUXSEL_0) | ||
163 | #define MX28_PAD_EMI_D06__EMI_DATA6 MXS_IOMUX_PAD_NAKED(5, 6, PAD_MUXSEL_0) | ||
164 | #define MX28_PAD_EMI_D07__EMI_DATA7 MXS_IOMUX_PAD_NAKED(5, 7, PAD_MUXSEL_0) | ||
165 | #define MX28_PAD_EMI_D08__EMI_DATA8 MXS_IOMUX_PAD_NAKED(5, 8, PAD_MUXSEL_0) | ||
166 | #define MX28_PAD_EMI_D09__EMI_DATA9 MXS_IOMUX_PAD_NAKED(5, 9, PAD_MUXSEL_0) | ||
167 | #define MX28_PAD_EMI_D10__EMI_DATA10 MXS_IOMUX_PAD_NAKED(5, 10, PAD_MUXSEL_0) | ||
168 | #define MX28_PAD_EMI_D11__EMI_DATA11 MXS_IOMUX_PAD_NAKED(5, 11, PAD_MUXSEL_0) | ||
169 | #define MX28_PAD_EMI_D12__EMI_DATA12 MXS_IOMUX_PAD_NAKED(5, 12, PAD_MUXSEL_0) | ||
170 | #define MX28_PAD_EMI_D13__EMI_DATA13 MXS_IOMUX_PAD_NAKED(5, 13, PAD_MUXSEL_0) | ||
171 | #define MX28_PAD_EMI_D14__EMI_DATA14 MXS_IOMUX_PAD_NAKED(5, 14, PAD_MUXSEL_0) | ||
172 | #define MX28_PAD_EMI_D15__EMI_DATA15 MXS_IOMUX_PAD_NAKED(5, 15, PAD_MUXSEL_0) | ||
173 | #define MX28_PAD_EMI_ODT0__EMI_ODT0 MXS_IOMUX_PAD_NAKED(5, 16, PAD_MUXSEL_0) | ||
174 | #define MX28_PAD_EMI_DQM0__EMI_DQM0 MXS_IOMUX_PAD_NAKED(5, 17, PAD_MUXSEL_0) | ||
175 | #define MX28_PAD_EMI_ODT1__EMI_ODT1 MXS_IOMUX_PAD_NAKED(5, 18, PAD_MUXSEL_0) | ||
176 | #define MX28_PAD_EMI_DQM1__EMI_DQM1 MXS_IOMUX_PAD_NAKED(5, 19, PAD_MUXSEL_0) | ||
177 | #define MX28_PAD_EMI_DDR_OPEN_FB__EMI_DDR_OPEN_FEEDBACK MXS_IOMUX_PAD_NAKED(5, 20, PAD_MUXSEL_0) | ||
178 | #define MX28_PAD_EMI_CLK__EMI_CLK MXS_IOMUX_PAD_NAKED(5, 21, PAD_MUXSEL_0) | ||
179 | #define MX28_PAD_EMI_DQS0__EMI_DQS0 MXS_IOMUX_PAD_NAKED(5, 22, PAD_MUXSEL_0) | ||
180 | #define MX28_PAD_EMI_DQS1__EMI_DQS1 MXS_IOMUX_PAD_NAKED(5, 23, PAD_MUXSEL_0) | ||
181 | #define MX28_PAD_EMI_DDR_OPEN__EMI_DDR_OPEN MXS_IOMUX_PAD_NAKED(5, 26, PAD_MUXSEL_0) | ||
182 | |||
183 | #define MX28_PAD_EMI_A00__EMI_ADDR0 MXS_IOMUX_PAD_NAKED(6, 0, PAD_MUXSEL_0) | ||
184 | #define MX28_PAD_EMI_A01__EMI_ADDR1 MXS_IOMUX_PAD_NAKED(6, 1, PAD_MUXSEL_0) | ||
185 | #define MX28_PAD_EMI_A02__EMI_ADDR2 MXS_IOMUX_PAD_NAKED(6, 2, PAD_MUXSEL_0) | ||
186 | #define MX28_PAD_EMI_A03__EMI_ADDR3 MXS_IOMUX_PAD_NAKED(6, 3, PAD_MUXSEL_0) | ||
187 | #define MX28_PAD_EMI_A04__EMI_ADDR4 MXS_IOMUX_PAD_NAKED(6, 4, PAD_MUXSEL_0) | ||
188 | #define MX28_PAD_EMI_A05__EMI_ADDR5 MXS_IOMUX_PAD_NAKED(6, 5, PAD_MUXSEL_0) | ||
189 | #define MX28_PAD_EMI_A06__EMI_ADDR6 MXS_IOMUX_PAD_NAKED(6, 6, PAD_MUXSEL_0) | ||
190 | #define MX28_PAD_EMI_A07__EMI_ADDR7 MXS_IOMUX_PAD_NAKED(6, 7, PAD_MUXSEL_0) | ||
191 | #define MX28_PAD_EMI_A08__EMI_ADDR8 MXS_IOMUX_PAD_NAKED(6, 8, PAD_MUXSEL_0) | ||
192 | #define MX28_PAD_EMI_A09__EMI_ADDR9 MXS_IOMUX_PAD_NAKED(6, 9, PAD_MUXSEL_0) | ||
193 | #define MX28_PAD_EMI_A10__EMI_ADDR10 MXS_IOMUX_PAD_NAKED(6, 10, PAD_MUXSEL_0) | ||
194 | #define MX28_PAD_EMI_A11__EMI_ADDR11 MXS_IOMUX_PAD_NAKED(6, 11, PAD_MUXSEL_0) | ||
195 | #define MX28_PAD_EMI_A12__EMI_ADDR12 MXS_IOMUX_PAD_NAKED(6, 12, PAD_MUXSEL_0) | ||
196 | #define MX28_PAD_EMI_A13__EMI_ADDR13 MXS_IOMUX_PAD_NAKED(6, 13, PAD_MUXSEL_0) | ||
197 | #define MX28_PAD_EMI_A14__EMI_ADDR14 MXS_IOMUX_PAD_NAKED(6, 14, PAD_MUXSEL_0) | ||
198 | #define MX28_PAD_EMI_BA0__EMI_BA0 MXS_IOMUX_PAD_NAKED(6, 16, PAD_MUXSEL_0) | ||
199 | #define MX28_PAD_EMI_BA1__EMI_BA1 MXS_IOMUX_PAD_NAKED(6, 17, PAD_MUXSEL_0) | ||
200 | #define MX28_PAD_EMI_BA2__EMI_BA2 MXS_IOMUX_PAD_NAKED(6, 18, PAD_MUXSEL_0) | ||
201 | #define MX28_PAD_EMI_CASN__EMI_CASN MXS_IOMUX_PAD_NAKED(6, 19, PAD_MUXSEL_0) | ||
202 | #define MX28_PAD_EMI_RASN__EMI_RASN MXS_IOMUX_PAD_NAKED(6, 20, PAD_MUXSEL_0) | ||
203 | #define MX28_PAD_EMI_WEN__EMI_WEN MXS_IOMUX_PAD_NAKED(6, 21, PAD_MUXSEL_0) | ||
204 | #define MX28_PAD_EMI_CE0N__EMI_CE0N MXS_IOMUX_PAD_NAKED(6, 22, PAD_MUXSEL_0) | ||
205 | #define MX28_PAD_EMI_CE1N__EMI_CE1N MXS_IOMUX_PAD_NAKED(6, 23, PAD_MUXSEL_0) | ||
206 | #define MX28_PAD_EMI_CKE__EMI_CKE MXS_IOMUX_PAD_NAKED(6, 24, PAD_MUXSEL_0) | ||
207 | |||
208 | /* MUXSEL_1 */ | ||
209 | #define MX28_PAD_GPMI_D00__SSP1_D0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_1) | ||
210 | #define MX28_PAD_GPMI_D01__SSP1_D1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_1) | ||
211 | #define MX28_PAD_GPMI_D02__SSP1_D2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_1) | ||
212 | #define MX28_PAD_GPMI_D03__SSP1_D3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_1) | ||
213 | #define MX28_PAD_GPMI_D04__SSP1_D4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_1) | ||
214 | #define MX28_PAD_GPMI_D05__SSP1_D5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_1) | ||
215 | #define MX28_PAD_GPMI_D06__SSP1_D6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_1) | ||
216 | #define MX28_PAD_GPMI_D07__SSP1_D7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_1) | ||
217 | #define MX28_PAD_GPMI_CE0N__SSP3_D0 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_1) | ||
218 | #define MX28_PAD_GPMI_CE1N__SSP3_D3 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_1) | ||
219 | #define MX28_PAD_GPMI_CE2N__CAN1_TX MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_1) | ||
220 | #define MX28_PAD_GPMI_CE3N__CAN1_RX MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_1) | ||
221 | #define MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_1) | ||
222 | #define MX28_PAD_GPMI_RDY1__SSP1_CMD MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_1) | ||
223 | #define MX28_PAD_GPMI_RDY2__CAN0_TX MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_1) | ||
224 | #define MX28_PAD_GPMI_RDY3__CAN0_RX MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_1) | ||
225 | #define MX28_PAD_GPMI_RDN__SSP3_SCK MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_1) | ||
226 | #define MX28_PAD_GPMI_WRN__SSP1_SCK MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_1) | ||
227 | #define MX28_PAD_GPMI_ALE__SSP3_D1 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_1) | ||
228 | #define MX28_PAD_GPMI_CLE__SSP3_D2 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_1) | ||
229 | #define MX28_PAD_GPMI_RESETN__SSP3_CMD MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_1) | ||
230 | |||
231 | #define MX28_PAD_LCD_D03__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_1) | ||
232 | #define MX28_PAD_LCD_D04__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_1) | ||
233 | #define MX28_PAD_LCD_D08__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_1) | ||
234 | #define MX28_PAD_LCD_D09__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_1) | ||
235 | #define MX28_PAD_LCD_D20__ENET1_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_1) | ||
236 | #define MX28_PAD_LCD_D21__ENET1_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_1) | ||
237 | #define MX28_PAD_LCD_D22__ENET1_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_1) | ||
238 | #define MX28_PAD_LCD_D23__ENET1_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_1) | ||
239 | #define MX28_PAD_LCD_RD_E__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_1) | ||
240 | #define MX28_PAD_LCD_WR_RWN__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_1) | ||
241 | #define MX28_PAD_LCD_RS__LCD_DOTCLK MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_1) | ||
242 | #define MX28_PAD_LCD_CS__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_1) | ||
243 | #define MX28_PAD_LCD_VSYNC__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_1) | ||
244 | #define MX28_PAD_LCD_HSYNC__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_1) | ||
245 | #define MX28_PAD_LCD_DOTCLK__SAIF1_MCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_1) | ||
246 | |||
247 | #define MX28_PAD_SSP0_DATA4__SSP2_D0 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_1) | ||
248 | #define MX28_PAD_SSP0_DATA5__SSP2_D3 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_1) | ||
249 | #define MX28_PAD_SSP0_DATA6__SSP2_CMD MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_1) | ||
250 | #define MX28_PAD_SSP0_DATA7__SSP2_SCK MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_1) | ||
251 | #define MX28_PAD_SSP1_SCK__SSP2_D1 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_1) | ||
252 | #define MX28_PAD_SSP1_CMD__SSP2_D2 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_1) | ||
253 | #define MX28_PAD_SSP1_DATA0__SSP2_D6 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_1) | ||
254 | #define MX28_PAD_SSP1_DATA3__SSP2_D7 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_1) | ||
255 | #define MX28_PAD_SSP2_SCK__AUART2_RX MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_1) | ||
256 | #define MX28_PAD_SSP2_MOSI__AUART2_TX MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_1) | ||
257 | #define MX28_PAD_SSP2_MISO__AUART3_RX MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_1) | ||
258 | #define MX28_PAD_SSP2_SS0__AUART3_TX MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_1) | ||
259 | #define MX28_PAD_SSP2_SS1__SSP2_D1 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_1) | ||
260 | #define MX28_PAD_SSP2_SS2__SSP2_D2 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_1) | ||
261 | #define MX28_PAD_SSP3_SCK__AUART4_TX MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_1) | ||
262 | #define MX28_PAD_SSP3_MOSI__AUART4_RX MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_1) | ||
263 | #define MX28_PAD_SSP3_MISO__AUART4_RTS MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_1) | ||
264 | #define MX28_PAD_SSP3_SS0__AUART4_CTS MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_1) | ||
265 | |||
266 | #define MX28_PAD_AUART0_RX__I2C0_SCL MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_1) | ||
267 | #define MX28_PAD_AUART0_TX__I2C0_SDA MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_1) | ||
268 | #define MX28_PAD_AUART0_CTS__AUART4_RX MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_1) | ||
269 | #define MX28_PAD_AUART0_RTS__AUART4_TX MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_1) | ||
270 | #define MX28_PAD_AUART1_RX__SSP2_CARD_DETECT MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_1) | ||
271 | #define MX28_PAD_AUART1_TX__SSP3_CARD_DETECT MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_1) | ||
272 | #define MX28_PAD_AUART1_CTS__USB0_OVERCURRENT MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_1) | ||
273 | #define MX28_PAD_AUART1_RTS__USB0_ID MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_1) | ||
274 | #define MX28_PAD_AUART2_RX__SSP3_D1 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_1) | ||
275 | #define MX28_PAD_AUART2_TX__SSP3_D2 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_1) | ||
276 | #define MX28_PAD_AUART2_CTS__I2C1_SCL MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_1) | ||
277 | #define MX28_PAD_AUART2_RTS__I2C1_SDA MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_1) | ||
278 | #define MX28_PAD_AUART3_RX__CAN0_TX MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_1) | ||
279 | #define MX28_PAD_AUART3_TX__CAN0_RX MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_1) | ||
280 | #define MX28_PAD_AUART3_CTS__CAN1_TX MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_1) | ||
281 | #define MX28_PAD_AUART3_RTS__CAN1_RX MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_1) | ||
282 | #define MX28_PAD_PWM0__I2C1_SCL MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_1) | ||
283 | #define MX28_PAD_PWM1__I2C1_SDA MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_1) | ||
284 | #define MX28_PAD_PWM2__USB0_ID MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_1) | ||
285 | #define MX28_PAD_SAIF0_MCLK__PWM_3 MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_1) | ||
286 | #define MX28_PAD_SAIF0_LRCLK__PWM_4 MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_1) | ||
287 | #define MX28_PAD_SAIF0_BITCLK__PWM_5 MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_1) | ||
288 | #define MX28_PAD_SAIF0_SDATA0__PWM_6 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_1) | ||
289 | #define MX28_PAD_I2C0_SCL__TIMROT_ROTARYA MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_1) | ||
290 | #define MX28_PAD_I2C0_SDA__TIMROT_ROTARYB MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_1) | ||
291 | #define MX28_PAD_SAIF1_SDATA0__PWM_7 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_1) | ||
292 | #define MX28_PAD_LCD_RESET__LCD_VSYNC MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_1) | ||
293 | |||
294 | #define MX28_PAD_ENET0_MDC__GPMI_CE4N MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_1) | ||
295 | #define MX28_PAD_ENET0_MDIO__GPMI_CE5N MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_1) | ||
296 | #define MX28_PAD_ENET0_RX_EN__GPMI_CE6N MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_1) | ||
297 | #define MX28_PAD_ENET0_RXD0__GPMI_CE7N MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_1) | ||
298 | #define MX28_PAD_ENET0_RXD1__GPMI_READY4 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_1) | ||
299 | #define MX28_PAD_ENET0_TX_CLK__HSADC_TRIGGER MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_1) | ||
300 | #define MX28_PAD_ENET0_TX_EN__GPMI_READY5 MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_1) | ||
301 | #define MX28_PAD_ENET0_TXD0__GPMI_READY6 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_1) | ||
302 | #define MX28_PAD_ENET0_TXD1__GPMI_READY7 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_1) | ||
303 | #define MX28_PAD_ENET0_RXD2__ENET1_RXD0 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_1) | ||
304 | #define MX28_PAD_ENET0_RXD3__ENET1_RXD1 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_1) | ||
305 | #define MX28_PAD_ENET0_TXD2__ENET1_TXD0 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_1) | ||
306 | #define MX28_PAD_ENET0_TXD3__ENET1_TXD1 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_1) | ||
307 | #define MX28_PAD_ENET0_RX_CLK__ENET0_RX_ER MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_1) | ||
308 | #define MX28_PAD_ENET0_COL__ENET1_TX_EN MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_1) | ||
309 | #define MX28_PAD_ENET0_CRS__ENET1_RX_EN MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_1) | ||
310 | |||
311 | /* MUXSEL_2 */ | ||
312 | #define MX28_PAD_GPMI_CE2N__ENET0_RX_ER MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_2) | ||
313 | #define MX28_PAD_GPMI_CE3N__SAIF1_MCLK MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_2) | ||
314 | #define MX28_PAD_GPMI_RDY0__USB0_ID MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_2) | ||
315 | #define MX28_PAD_GPMI_RDY2__ENET0_TX_ER MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_2) | ||
316 | #define MX28_PAD_GPMI_RDY3__HSADC_TRIGGER MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_2) | ||
317 | #define MX28_PAD_GPMI_ALE__SSP3_D4 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_2) | ||
318 | #define MX28_PAD_GPMI_CLE__SSP3_D5 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_2) | ||
319 | |||
320 | #define MX28_PAD_LCD_D00__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_2) | ||
321 | #define MX28_PAD_LCD_D01__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_2) | ||
322 | #define MX28_PAD_LCD_D02__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_2) | ||
323 | #define MX28_PAD_LCD_D03__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_2) | ||
324 | #define MX28_PAD_LCD_D04__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_2) | ||
325 | #define MX28_PAD_LCD_D05__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_2) | ||
326 | #define MX28_PAD_LCD_D06__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_2) | ||
327 | #define MX28_PAD_LCD_D07__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_2) | ||
328 | #define MX28_PAD_LCD_D08__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_2) | ||
329 | #define MX28_PAD_LCD_D09__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_2) | ||
330 | #define MX28_PAD_LCD_D10__ETM_DA10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_2) | ||
331 | #define MX28_PAD_LCD_D11__ETM_DA11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_2) | ||
332 | #define MX28_PAD_LCD_D12__ETM_DA12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_2) | ||
333 | #define MX28_PAD_LCD_D13__ETM_DA13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_2) | ||
334 | #define MX28_PAD_LCD_D14__ETM_DA14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_2) | ||
335 | #define MX28_PAD_LCD_D15__ETM_DA15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_2) | ||
336 | #define MX28_PAD_LCD_D16__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_2) | ||
337 | #define MX28_PAD_LCD_D17__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_2) | ||
338 | #define MX28_PAD_LCD_D18__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_2) | ||
339 | #define MX28_PAD_LCD_D19__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_2) | ||
340 | #define MX28_PAD_LCD_D20__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_2) | ||
341 | #define MX28_PAD_LCD_D21__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_2) | ||
342 | #define MX28_PAD_LCD_D22__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_2) | ||
343 | #define MX28_PAD_LCD_D23__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_2) | ||
344 | #define MX28_PAD_LCD_RD_E__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_2) | ||
345 | #define MX28_PAD_LCD_WR_RWN__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_2) | ||
346 | #define MX28_PAD_LCD_HSYNC__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_2) | ||
347 | #define MX28_PAD_LCD_DOTCLK__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_2) | ||
348 | |||
349 | #define MX28_PAD_SSP1_SCK__ENET0_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_2) | ||
350 | #define MX28_PAD_SSP1_CMD__ENET0_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_2) | ||
351 | #define MX28_PAD_SSP1_DATA0__ENET0_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_2) | ||
352 | #define MX28_PAD_SSP1_DATA3__ENET0_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_2) | ||
353 | #define MX28_PAD_SSP2_SCK__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_2) | ||
354 | #define MX28_PAD_SSP2_MOSI__SAIF0_SDATA2 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_2) | ||
355 | #define MX28_PAD_SSP2_MISO__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_2) | ||
356 | #define MX28_PAD_SSP2_SS0__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_2) | ||
357 | #define MX28_PAD_SSP2_SS1__USB1_OVERCURRENT MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_2) | ||
358 | #define MX28_PAD_SSP2_SS2__USB0_OVERCURRENT MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_2) | ||
359 | #define MX28_PAD_SSP3_SCK__ENET1_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_2) | ||
360 | #define MX28_PAD_SSP3_MOSI__ENET1_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_2) | ||
361 | #define MX28_PAD_SSP3_MISO__ENET1_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_2) | ||
362 | #define MX28_PAD_SSP3_SS0__ENET1_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_2) | ||
363 | |||
364 | #define MX28_PAD_AUART0_RX__DUART_CTS MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_2) | ||
365 | #define MX28_PAD_AUART0_TX__DUART_RTS MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_2) | ||
366 | #define MX28_PAD_AUART0_CTS__DUART_RX MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_2) | ||
367 | #define MX28_PAD_AUART0_RTS__DUART_TX MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_2) | ||
368 | #define MX28_PAD_AUART1_RX__PWM_0 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_2) | ||
369 | #define MX28_PAD_AUART1_TX__PWM_1 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_2) | ||
370 | #define MX28_PAD_AUART1_CTS__TIMROT_ROTARYA MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_2) | ||
371 | #define MX28_PAD_AUART1_RTS__TIMROT_ROTARYB MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_2) | ||
372 | #define MX28_PAD_AUART2_RX__SSP3_D4 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_2) | ||
373 | #define MX28_PAD_AUART2_TX__SSP3_D5 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_2) | ||
374 | #define MX28_PAD_AUART2_CTS__SAIF1_BITCLK MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_2) | ||
375 | #define MX28_PAD_AUART2_RTS__SAIF1_LRCLK MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_2) | ||
376 | #define MX28_PAD_AUART3_RX__ENET0_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_2) | ||
377 | #define MX28_PAD_AUART3_TX__ENET0_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_2) | ||
378 | #define MX28_PAD_AUART3_CTS__ENET0_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_2) | ||
379 | #define MX28_PAD_AUART3_RTS__ENET0_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_2) | ||
380 | #define MX28_PAD_PWM0__DUART_RX MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_2) | ||
381 | #define MX28_PAD_PWM1__DUART_TX MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_2) | ||
382 | #define MX28_PAD_PWM2__USB1_OVERCURRENT MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_2) | ||
383 | #define MX28_PAD_SAIF0_MCLK__AUART4_CTS MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_2) | ||
384 | #define MX28_PAD_SAIF0_LRCLK__AUART4_RTS MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_2) | ||
385 | #define MX28_PAD_SAIF0_BITCLK__AUART4_RX MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_2) | ||
386 | #define MX28_PAD_SAIF0_SDATA0__AUART4_TX MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_2) | ||
387 | #define MX28_PAD_I2C0_SCL__DUART_RX MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_2) | ||
388 | #define MX28_PAD_I2C0_SDA__DUART_TX MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_2) | ||
389 | #define MX28_PAD_SAIF1_SDATA0__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_2) | ||
390 | #define MX28_PAD_SPDIF__ENET1_RX_ER MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_2) | ||
391 | |||
392 | #define MX28_PAD_ENET0_MDC__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_2) | ||
393 | #define MX28_PAD_ENET0_MDIO__SAIF0_SDATA2 MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_2) | ||
394 | #define MX28_PAD_ENET0_RX_EN__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_2) | ||
395 | #define MX28_PAD_ENET0_RXD0__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_2) | ||
396 | #define MX28_PAD_ENET0_TX_CLK__ENET0_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_2) | ||
397 | #define MX28_PAD_ENET0_RXD2__ENET0_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_2) | ||
398 | #define MX28_PAD_ENET0_RXD3__ENET0_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_2) | ||
399 | #define MX28_PAD_ENET0_TXD2__ENET0_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_2) | ||
400 | #define MX28_PAD_ENET0_TXD3__ENET0_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_2) | ||
401 | #define MX28_PAD_ENET0_RX_CLK__ENET0_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_2) | ||
402 | #define MX28_PAD_ENET0_COL__ENET0_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_2) | ||
403 | #define MX28_PAD_ENET0_CRS__ENET0_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_2) | ||
404 | |||
405 | /* MUXSEL_GPIO */ | ||
406 | #define MX28_PAD_GPMI_D00__GPIO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO) | ||
407 | #define MX28_PAD_GPMI_D01__GPIO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO) | ||
408 | #define MX28_PAD_GPMI_D02__GPIO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO) | ||
409 | #define MX28_PAD_GPMI_D03__GPIO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO) | ||
410 | #define MX28_PAD_GPMI_D04__GPIO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO) | ||
411 | #define MX28_PAD_GPMI_D05__GPIO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO) | ||
412 | #define MX28_PAD_GPMI_D06__GPIO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO) | ||
413 | #define MX28_PAD_GPMI_D07__GPIO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO) | ||
414 | #define MX28_PAD_GPMI_CE0N__GPIO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO) | ||
415 | #define MX28_PAD_GPMI_CE1N__GPIO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO) | ||
416 | #define MX28_PAD_GPMI_CE2N__GPIO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO) | ||
417 | #define MX28_PAD_GPMI_CE3N__GPIO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO) | ||
418 | #define MX28_PAD_GPMI_RDY0__GPIO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO) | ||
419 | #define MX28_PAD_GPMI_RDY1__GPIO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO) | ||
420 | #define MX28_PAD_GPMI_RDY2__GPIO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO) | ||
421 | #define MX28_PAD_GPMI_RDY3__GPIO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO) | ||
422 | #define MX28_PAD_GPMI_RDN__GPIO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO) | ||
423 | #define MX28_PAD_GPMI_WRN__GPIO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO) | ||
424 | #define MX28_PAD_GPMI_ALE__GPIO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO) | ||
425 | #define MX28_PAD_GPMI_CLE__GPIO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO) | ||
426 | #define MX28_PAD_GPMI_RESETN__GPIO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO) | ||
427 | |||
428 | #define MX28_PAD_LCD_D00__GPIO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO) | ||
429 | #define MX28_PAD_LCD_D01__GPIO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO) | ||
430 | #define MX28_PAD_LCD_D02__GPIO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO) | ||
431 | #define MX28_PAD_LCD_D03__GPIO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO) | ||
432 | #define MX28_PAD_LCD_D04__GPIO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO) | ||
433 | #define MX28_PAD_LCD_D05__GPIO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO) | ||
434 | #define MX28_PAD_LCD_D06__GPIO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO) | ||
435 | #define MX28_PAD_LCD_D07__GPIO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO) | ||
436 | #define MX28_PAD_LCD_D08__GPIO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO) | ||
437 | #define MX28_PAD_LCD_D09__GPIO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO) | ||
438 | #define MX28_PAD_LCD_D10__GPIO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO) | ||
439 | #define MX28_PAD_LCD_D11__GPIO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO) | ||
440 | #define MX28_PAD_LCD_D12__GPIO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO) | ||
441 | #define MX28_PAD_LCD_D13__GPIO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO) | ||
442 | #define MX28_PAD_LCD_D14__GPIO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO) | ||
443 | #define MX28_PAD_LCD_D15__GPIO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO) | ||
444 | #define MX28_PAD_LCD_D16__GPIO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO) | ||
445 | #define MX28_PAD_LCD_D17__GPIO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO) | ||
446 | #define MX28_PAD_LCD_D18__GPIO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO) | ||
447 | #define MX28_PAD_LCD_D19__GPIO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO) | ||
448 | #define MX28_PAD_LCD_D20__GPIO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO) | ||
449 | #define MX28_PAD_LCD_D21__GPIO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO) | ||
450 | #define MX28_PAD_LCD_D22__GPIO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO) | ||
451 | #define MX28_PAD_LCD_D23__GPIO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO) | ||
452 | #define MX28_PAD_LCD_RD_E__GPIO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO) | ||
453 | #define MX28_PAD_LCD_WR_RWN__GPIO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO) | ||
454 | #define MX28_PAD_LCD_RS__GPIO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO) | ||
455 | #define MX28_PAD_LCD_CS__GPIO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO) | ||
456 | #define MX28_PAD_LCD_VSYNC__GPIO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO) | ||
457 | #define MX28_PAD_LCD_HSYNC__GPIO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO) | ||
458 | #define MX28_PAD_LCD_DOTCLK__GPIO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO) | ||
459 | #define MX28_PAD_LCD_ENABLE__GPIO_1_31 MXS_IOMUX_PAD_NAKED(1, 31, PAD_MUXSEL_GPIO) | ||
460 | |||
461 | #define MX28_PAD_SSP0_DATA0__GPIO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO) | ||
462 | #define MX28_PAD_SSP0_DATA1__GPIO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO) | ||
463 | #define MX28_PAD_SSP0_DATA2__GPIO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO) | ||
464 | #define MX28_PAD_SSP0_DATA3__GPIO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO) | ||
465 | #define MX28_PAD_SSP0_DATA4__GPIO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO) | ||
466 | #define MX28_PAD_SSP0_DATA5__GPIO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO) | ||
467 | #define MX28_PAD_SSP0_DATA6__GPIO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO) | ||
468 | #define MX28_PAD_SSP0_DATA7__GPIO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO) | ||
469 | #define MX28_PAD_SSP0_CMD__GPIO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO) | ||
470 | #define MX28_PAD_SSP0_DETECT__GPIO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO) | ||
471 | #define MX28_PAD_SSP0_SCK__GPIO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO) | ||
472 | #define MX28_PAD_SSP1_SCK__GPIO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO) | ||
473 | #define MX28_PAD_SSP1_CMD__GPIO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO) | ||
474 | #define MX28_PAD_SSP1_DATA0__GPIO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO) | ||
475 | #define MX28_PAD_SSP1_DATA3__GPIO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO) | ||
476 | #define MX28_PAD_SSP2_SCK__GPIO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO) | ||
477 | #define MX28_PAD_SSP2_MOSI__GPIO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO) | ||
478 | #define MX28_PAD_SSP2_MISO__GPIO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO) | ||
479 | #define MX28_PAD_SSP2_SS0__GPIO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO) | ||
480 | #define MX28_PAD_SSP2_SS1__GPIO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO) | ||
481 | #define MX28_PAD_SSP2_SS2__GPIO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO) | ||
482 | #define MX28_PAD_SSP3_SCK__GPIO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO) | ||
483 | #define MX28_PAD_SSP3_MOSI__GPIO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO) | ||
484 | #define MX28_PAD_SSP3_MISO__GPIO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO) | ||
485 | #define MX28_PAD_SSP3_SS0__GPIO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO) | ||
486 | |||
487 | #define MX28_PAD_AUART0_RX__GPIO_3_0 MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_GPIO) | ||
488 | #define MX28_PAD_AUART0_TX__GPIO_3_1 MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_GPIO) | ||
489 | #define MX28_PAD_AUART0_CTS__GPIO_3_2 MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_GPIO) | ||
490 | #define MX28_PAD_AUART0_RTS__GPIO_3_3 MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_GPIO) | ||
491 | #define MX28_PAD_AUART1_RX__GPIO_3_4 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_GPIO) | ||
492 | #define MX28_PAD_AUART1_TX__GPIO_3_5 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_GPIO) | ||
493 | #define MX28_PAD_AUART1_CTS__GPIO_3_6 MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_GPIO) | ||
494 | #define MX28_PAD_AUART1_RTS__GPIO_3_7 MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_GPIO) | ||
495 | #define MX28_PAD_AUART2_RX__GPIO_3_8 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_GPIO) | ||
496 | #define MX28_PAD_AUART2_TX__GPIO_3_9 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_GPIO) | ||
497 | #define MX28_PAD_AUART2_CTS__GPIO_3_10 MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_GPIO) | ||
498 | #define MX28_PAD_AUART2_RTS__GPIO_3_11 MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_GPIO) | ||
499 | #define MX28_PAD_AUART3_RX__GPIO_3_12 MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_GPIO) | ||
500 | #define MX28_PAD_AUART3_TX__GPIO_3_13 MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_GPIO) | ||
501 | #define MX28_PAD_AUART3_CTS__GPIO_3_14 MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_GPIO) | ||
502 | #define MX28_PAD_AUART3_RTS__GPIO_3_15 MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_GPIO) | ||
503 | #define MX28_PAD_PWM0__GPIO_3_16 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_GPIO) | ||
504 | #define MX28_PAD_PWM1__GPIO_3_17 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_GPIO) | ||
505 | #define MX28_PAD_PWM2__GPIO_3_18 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_GPIO) | ||
506 | #define MX28_PAD_SAIF0_MCLK__GPIO_3_20 MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_GPIO) | ||
507 | #define MX28_PAD_SAIF0_LRCLK__GPIO_3_21 MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_GPIO) | ||
508 | #define MX28_PAD_SAIF0_BITCLK__GPIO_3_22 MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_GPIO) | ||
509 | #define MX28_PAD_SAIF0_SDATA0__GPIO_3_23 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_GPIO) | ||
510 | #define MX28_PAD_I2C0_SCL__GPIO_3_24 MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_GPIO) | ||
511 | #define MX28_PAD_I2C0_SDA__GPIO_3_25 MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_GPIO) | ||
512 | #define MX28_PAD_SAIF1_SDATA0__GPIO_3_26 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_GPIO) | ||
513 | #define MX28_PAD_SPDIF__GPIO_3_27 MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_GPIO) | ||
514 | #define MX28_PAD_PWM3__GPIO_3_28 MXS_IOMUX_PAD_NAKED(3, 28, PAD_MUXSEL_GPIO) | ||
515 | #define MX28_PAD_PWM4__GPIO_3_29 MXS_IOMUX_PAD_NAKED(3, 29, PAD_MUXSEL_GPIO) | ||
516 | #define MX28_PAD_LCD_RESET__GPIO_3_30 MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_GPIO) | ||
517 | |||
518 | #define MX28_PAD_ENET0_MDC__GPIO_4_0 MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_GPIO) | ||
519 | #define MX28_PAD_ENET0_MDIO__GPIO_4_1 MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_GPIO) | ||
520 | #define MX28_PAD_ENET0_RX_EN__GPIO_4_2 MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_GPIO) | ||
521 | #define MX28_PAD_ENET0_RXD0__GPIO_4_3 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_GPIO) | ||
522 | #define MX28_PAD_ENET0_RXD1__GPIO_4_4 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_GPIO) | ||
523 | #define MX28_PAD_ENET0_TX_CLK__GPIO_4_5 MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_GPIO) | ||
524 | #define MX28_PAD_ENET0_TX_EN__GPIO_4_6 MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_GPIO) | ||
525 | #define MX28_PAD_ENET0_TXD0__GPIO_4_7 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_GPIO) | ||
526 | #define MX28_PAD_ENET0_TXD1__GPIO_4_8 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_GPIO) | ||
527 | #define MX28_PAD_ENET0_RXD2__GPIO_4_9 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_GPIO) | ||
528 | #define MX28_PAD_ENET0_RXD3__GPIO_4_10 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_GPIO) | ||
529 | #define MX28_PAD_ENET0_TXD2__GPIO_4_11 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_GPIO) | ||
530 | #define MX28_PAD_ENET0_TXD3__GPIO_4_12 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_GPIO) | ||
531 | #define MX28_PAD_ENET0_RX_CLK__GPIO_4_13 MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_GPIO) | ||
532 | #define MX28_PAD_ENET0_COL__GPIO_4_14 MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_GPIO) | ||
533 | #define MX28_PAD_ENET0_CRS__GPIO_4_15 MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_GPIO) | ||
534 | #define MX28_PAD_ENET_CLK__GPIO_4_16 MXS_IOMUX_PAD_NAKED(4, 16, PAD_MUXSEL_GPIO) | ||
535 | #define MX28_PAD_JTAG_RTCK__GPIO_4_20 MXS_IOMUX_PAD_NAKED(4, 20, PAD_MUXSEL_GPIO) | ||
536 | |||
537 | #endif /* __MACH_IOMUX_MX28_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/iomux.h b/arch/arm/mach-mxs/include/mach/iomux.h new file mode 100644 index 000000000000..fe558e3c5a9a --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/iomux.h | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH, | ||
3 | * <armlinux@phytec.de> | ||
4 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 | #ifndef __MACH_MXS_IOMUX_H__ | ||
22 | #define __MACH_MXS_IOMUX_H__ | ||
23 | |||
24 | /* | ||
25 | * IOMUX/PAD Bit field definitions | ||
26 | * | ||
27 | * PAD_BANK: 0..2 (3) | ||
28 | * PAD_PIN: 3..7 (5) | ||
29 | * PAD_MUXSEL: 8..9 (2) | ||
30 | * PAD_MA: 10..11 (2) | ||
31 | * PAD_MA_VALID: 12 (1) | ||
32 | * PAD_VOL: 13 (1) | ||
33 | * PAD_VOL_VALID: 14 (1) | ||
34 | * PAD_PULL: 15 (1) | ||
35 | * PAD_PULL_VALID: 16 (1) | ||
36 | * RESERVED: 17..31 (15) | ||
37 | */ | ||
38 | typedef u32 iomux_cfg_t; | ||
39 | |||
40 | #define MXS_PAD_BANK_SHIFT 0 | ||
41 | #define MXS_PAD_BANK_MASK ((iomux_cfg_t)0x7 << MXS_PAD_BANK_SHIFT) | ||
42 | #define MXS_PAD_PIN_SHIFT 3 | ||
43 | #define MXS_PAD_PIN_MASK ((iomux_cfg_t)0x1f << MXS_PAD_PIN_SHIFT) | ||
44 | #define MXS_PAD_MUXSEL_SHIFT 8 | ||
45 | #define MXS_PAD_MUXSEL_MASK ((iomux_cfg_t)0x3 << MXS_PAD_MUXSEL_SHIFT) | ||
46 | #define MXS_PAD_MA_SHIFT 10 | ||
47 | #define MXS_PAD_MA_MASK ((iomux_cfg_t)0x3 << MXS_PAD_MA_SHIFT) | ||
48 | #define MXS_PAD_MA_VALID_SHIFT 12 | ||
49 | #define MXS_PAD_MA_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_MA_VALID_SHIFT) | ||
50 | #define MXS_PAD_VOL_SHIFT 13 | ||
51 | #define MXS_PAD_VOL_MASK ((iomux_cfg_t)0x1 << MXS_PAD_VOL_SHIFT) | ||
52 | #define MXS_PAD_VOL_VALID_SHIFT 14 | ||
53 | #define MXS_PAD_VOL_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_VOL_VALID_SHIFT) | ||
54 | #define MXS_PAD_PULL_SHIFT 15 | ||
55 | #define MXS_PAD_PULL_MASK ((iomux_cfg_t)0x1 << MXS_PAD_PULL_SHIFT) | ||
56 | #define MXS_PAD_PULL_VALID_SHIFT 16 | ||
57 | #define MXS_PAD_PULL_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_PULL_VALID_SHIFT) | ||
58 | |||
59 | #define PAD_MUXSEL_0 0 | ||
60 | #define PAD_MUXSEL_1 1 | ||
61 | #define PAD_MUXSEL_2 2 | ||
62 | #define PAD_MUXSEL_GPIO 3 | ||
63 | |||
64 | #define PAD_4MA 0 | ||
65 | #define PAD_8MA 1 | ||
66 | #define PAD_12MA 2 | ||
67 | #define PAD_16MA 3 | ||
68 | |||
69 | #define PAD_1V8 0 | ||
70 | #define PAD_3V3 1 | ||
71 | |||
72 | #define PAD_NOPULL 0 | ||
73 | #define PAD_PULLUP 1 | ||
74 | |||
75 | #define MXS_PAD_4MA ((PAD_4MA << MXS_PAD_MA_SHIFT) | \ | ||
76 | MXS_PAD_MA_VALID_MASK) | ||
77 | #define MXS_PAD_8MA ((PAD_8MA << MXS_PAD_MA_SHIFT) | \ | ||
78 | MXS_PAD_MA_VALID_MASK) | ||
79 | #define MXS_PAD_12MA ((PAD_12MA << MXS_PAD_MA_SHIFT) | \ | ||
80 | MXS_PAD_MA_VALID_MASK) | ||
81 | #define MXS_PAD_16MA ((PAD_16MA << MXS_PAD_MA_SHIFT) | \ | ||
82 | MXS_PAD_MA_VALID_MASK) | ||
83 | |||
84 | #define MXS_PAD_1V8 ((PAD_1V8 << MXS_PAD_VOL_SHIFT) | \ | ||
85 | MXS_PAD_VOL_VALID_MASK) | ||
86 | #define MXS_PAD_3V3 ((PAD_3V3 << MXS_PAD_VOL_SHIFT) | \ | ||
87 | MXS_PAD_VOL_VALID_MASK) | ||
88 | |||
89 | #define MXS_PAD_NOPULL ((PAD_NOPULL << MXS_PAD_PULL_SHIFT) | \ | ||
90 | MXS_PAD_PULL_VALID_MASK) | ||
91 | #define MXS_PAD_PULLUP ((PAD_PULLUP << MXS_PAD_PULL_SHIFT) | \ | ||
92 | MXS_PAD_PULL_VALID_MASK) | ||
93 | |||
94 | #define MXS_IOMUX_PAD(_bank, _pin, _muxsel, _ma, _vol, _pull) \ | ||
95 | (((iomux_cfg_t)(_bank) << MXS_PAD_BANK_SHIFT) | \ | ||
96 | ((iomux_cfg_t)(_pin) << MXS_PAD_PIN_SHIFT) | \ | ||
97 | ((iomux_cfg_t)(_muxsel) << MXS_PAD_MUXSEL_SHIFT) | \ | ||
98 | ((iomux_cfg_t)(_ma) << MXS_PAD_MA_SHIFT) | \ | ||
99 | ((iomux_cfg_t)(_vol) << MXS_PAD_VOL_SHIFT) | \ | ||
100 | ((iomux_cfg_t)(_pull) << MXS_PAD_PULL_SHIFT)) | ||
101 | |||
102 | /* | ||
103 | * A pad becomes naked, when none of mA, vol or pull | ||
104 | * validity bits is set. | ||
105 | */ | ||
106 | #define MXS_IOMUX_PAD_NAKED(_bank, _pin, _muxsel) \ | ||
107 | MXS_IOMUX_PAD(_bank, _pin, _muxsel, 0, 0, 0) | ||
108 | |||
109 | static inline unsigned int PAD_BANK(iomux_cfg_t pad) | ||
110 | { | ||
111 | return (pad & MXS_PAD_BANK_MASK) >> MXS_PAD_BANK_SHIFT; | ||
112 | } | ||
113 | |||
114 | static inline unsigned int PAD_PIN(iomux_cfg_t pad) | ||
115 | { | ||
116 | return (pad & MXS_PAD_PIN_MASK) >> MXS_PAD_PIN_SHIFT; | ||
117 | } | ||
118 | |||
119 | static inline unsigned int PAD_MUXSEL(iomux_cfg_t pad) | ||
120 | { | ||
121 | return (pad & MXS_PAD_MUXSEL_MASK) >> MXS_PAD_MUXSEL_SHIFT; | ||
122 | } | ||
123 | |||
124 | static inline unsigned int PAD_MA(iomux_cfg_t pad) | ||
125 | { | ||
126 | return (pad & MXS_PAD_MA_MASK) >> MXS_PAD_MA_SHIFT; | ||
127 | } | ||
128 | |||
129 | static inline unsigned int PAD_MA_VALID(iomux_cfg_t pad) | ||
130 | { | ||
131 | return (pad & MXS_PAD_MA_VALID_MASK) >> MXS_PAD_MA_VALID_SHIFT; | ||
132 | } | ||
133 | |||
134 | static inline unsigned int PAD_VOL(iomux_cfg_t pad) | ||
135 | { | ||
136 | return (pad & MXS_PAD_VOL_MASK) >> MXS_PAD_VOL_SHIFT; | ||
137 | } | ||
138 | |||
139 | static inline unsigned int PAD_VOL_VALID(iomux_cfg_t pad) | ||
140 | { | ||
141 | return (pad & MXS_PAD_VOL_VALID_MASK) >> MXS_PAD_VOL_VALID_SHIFT; | ||
142 | } | ||
143 | |||
144 | static inline unsigned int PAD_PULL(iomux_cfg_t pad) | ||
145 | { | ||
146 | return (pad & MXS_PAD_PULL_MASK) >> MXS_PAD_PULL_SHIFT; | ||
147 | } | ||
148 | |||
149 | static inline unsigned int PAD_PULL_VALID(iomux_cfg_t pad) | ||
150 | { | ||
151 | return (pad & MXS_PAD_PULL_VALID_MASK) >> MXS_PAD_PULL_VALID_SHIFT; | ||
152 | } | ||
153 | |||
154 | /* | ||
155 | * configures a single pad in the iomuxer | ||
156 | */ | ||
157 | int mxs_iomux_setup_pad(iomux_cfg_t pad); | ||
158 | |||
159 | /* | ||
160 | * configures multiple pads | ||
161 | * convenient way to call the above function with tables | ||
162 | */ | ||
163 | int mxs_iomux_setup_multiple_pads(const iomux_cfg_t *pad_list, unsigned count); | ||
164 | |||
165 | #endif /* __MACH_MXS_IOMUX_H__*/ | ||
diff --git a/arch/arm/mach-mxs/include/mach/irqs.h b/arch/arm/mach-mxs/include/mach/irqs.h new file mode 100644 index 000000000000..f771039b814a --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/irqs.h | |||
@@ -0,0 +1,32 @@ | |||
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 __MACH_MXS_IRQS_H__ | ||
12 | #define __MACH_MXS_IRQS_H__ | ||
13 | |||
14 | #define MXS_INTERNAL_IRQS 128 | ||
15 | |||
16 | #define MXS_GPIO_IRQ_START MXS_INTERNAL_IRQS | ||
17 | |||
18 | /* the maximum for MXS-based */ | ||
19 | #define MXS_GPIO_IRQS (32 * 5) | ||
20 | |||
21 | /* | ||
22 | * The next 16 interrupts are for board specific purposes. Since | ||
23 | * the kernel can only run on one machine at a time, we can re-use | ||
24 | * these. If you need more, increase MXS_BOARD_IRQS, but keep it | ||
25 | * within sensible limits. | ||
26 | */ | ||
27 | #define MXS_BOARD_IRQ_START (MXS_GPIO_IRQ_START + MXS_GPIO_IRQS) | ||
28 | #define MXS_BOARD_IRQS 16 | ||
29 | |||
30 | #define NR_IRQS (MXS_BOARD_IRQ_START + MXS_BOARD_IRQS) | ||
31 | |||
32 | #endif /* __MACH_MXS_IRQS_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/memory.h b/arch/arm/mach-mxs/include/mach/memory.h new file mode 100644 index 000000000000..b5420a5c2d4b --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/memory.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MXS_MEMORY_H__ | ||
20 | #define __MACH_MXS_MEMORY_H__ | ||
21 | |||
22 | #define PHYS_OFFSET UL(0x40000000) | ||
23 | |||
24 | #endif /* __MACH_MXS_MEMORY_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/mx23.h b/arch/arm/mach-mxs/include/mach/mx23.h new file mode 100644 index 000000000000..9edd02ec8e30 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/mx23.h | |||
@@ -0,0 +1,145 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MX23_H__ | ||
20 | #define __MACH_MX23_H__ | ||
21 | |||
22 | #include <mach/mxs.h> | ||
23 | |||
24 | /* | ||
25 | * OCRAM | ||
26 | */ | ||
27 | #define MX23_OCRAM_BASE_ADDR 0x00000000 | ||
28 | #define MX23_OCRAM_SIZE SZ_32K | ||
29 | |||
30 | /* | ||
31 | * IO | ||
32 | */ | ||
33 | #define MX23_IO_BASE_ADDR 0x80000000 | ||
34 | #define MX23_IO_SIZE SZ_1M | ||
35 | |||
36 | #define MX23_ICOLL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x000000) | ||
37 | #define MX23_APBH_DMA_BASE_ADDR (MX23_IO_BASE_ADDR + 0x004000) | ||
38 | #define MX23_BCH_BASE_ADDR (MX23_IO_BASE_ADDR + 0x00a000) | ||
39 | #define MX23_GPMI_BASE_ADDR (MX23_IO_BASE_ADDR + 0x00c000) | ||
40 | #define MX23_SSP1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x010000) | ||
41 | #define MX23_PINCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x018000) | ||
42 | #define MX23_DIGCTL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x01c000) | ||
43 | #define MX23_ETM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x020000) | ||
44 | #define MX23_APBX_DMA_BASE_ADDR (MX23_IO_BASE_ADDR + 0x024000) | ||
45 | #define MX23_DCP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x028000) | ||
46 | #define MX23_PXP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02a000) | ||
47 | #define MX23_OCOTP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02c000) | ||
48 | #define MX23_AXI_AHB0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02e000) | ||
49 | #define MX23_LCDIF_BASE_ADDR (MX23_IO_BASE_ADDR + 0x030000) | ||
50 | #define MX23_SSP2_BASE_ADDR (MX23_IO_BASE_ADDR + 0x034000) | ||
51 | #define MX23_TVENC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x038000) | ||
52 | #define MX23_CLKCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x040000) | ||
53 | #define MX23_SAIF0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x042000) | ||
54 | #define MX23_POWER_BASE_ADDR (MX23_IO_BASE_ADDR + 0x044000) | ||
55 | #define MX23_SAIF1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x046000) | ||
56 | #define MX23_AUDIOOUT_BASE_ADDR (MX23_IO_BASE_ADDR + 0x048000) | ||
57 | #define MX23_AUDIOIN_BASE_ADDR (MX23_IO_BASE_ADDR + 0x04c000) | ||
58 | #define MX23_LRADC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x050000) | ||
59 | #define MX23_SPDIF_BASE_ADDR (MX23_IO_BASE_ADDR + 0x054000) | ||
60 | #define MX23_I2C0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x058000) | ||
61 | #define MX23_RTC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x05c000) | ||
62 | #define MX23_PWM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x064000) | ||
63 | #define MX23_TIMROT_BASE_ADDR (MX23_IO_BASE_ADDR + 0x068000) | ||
64 | #define MX23_AUART1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x06c000) | ||
65 | #define MX23_AUART2_BASE_ADDR (MX23_IO_BASE_ADDR + 0x06e000) | ||
66 | #define MX23_DUART_BASE_ADDR (MX23_IO_BASE_ADDR + 0x070000) | ||
67 | #define MX23_USBPHY_BASE_ADDR (MX23_IO_BASE_ADDR + 0x07c000) | ||
68 | #define MX23_USBCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x080000) | ||
69 | #define MX23_DRAM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x0e0000) | ||
70 | |||
71 | #define MX23_IO_P2V(x) MXS_IO_P2V(x) | ||
72 | #define MX23_IO_ADDRESS(x) IOMEM(MX23_IO_P2V(x)) | ||
73 | |||
74 | /* | ||
75 | * IRQ | ||
76 | */ | ||
77 | #define MX23_INT_DUART 0 | ||
78 | #define MX23_INT_COMMS_RX 1 | ||
79 | #define MX23_INT_COMMS_TX 1 | ||
80 | #define MX23_INT_SSP2_ERROR 2 | ||
81 | #define MX23_INT_VDD5V 3 | ||
82 | #define MX23_INT_HEADPHONE_SHORT 4 | ||
83 | #define MX23_INT_DAC_DMA 5 | ||
84 | #define MX23_INT_DAC_ERROR 6 | ||
85 | #define MX23_INT_ADC_DMA 7 | ||
86 | #define MX23_INT_ADC_ERROR 8 | ||
87 | #define MX23_INT_SPDIF_DMA 9 | ||
88 | #define MX23_INT_SAIF2_DMA 9 | ||
89 | #define MX23_INT_SPDIF_ERROR 10 | ||
90 | #define MX23_INT_SAIF1_IRQ 10 | ||
91 | #define MX23_INT_SAIF2_IRQ 10 | ||
92 | #define MX23_INT_USB_CTRL 11 | ||
93 | #define MX23_INT_USB_WAKEUP 12 | ||
94 | #define MX23_INT_GPMI_DMA 13 | ||
95 | #define MX23_INT_SSP1_DMA 14 | ||
96 | #define MX23_INT_SSP_ERROR 15 | ||
97 | #define MX23_INT_GPIO0 16 | ||
98 | #define MX23_INT_GPIO1 17 | ||
99 | #define MX23_INT_GPIO2 18 | ||
100 | #define MX23_INT_SAIF1_DMA 19 | ||
101 | #define MX23_INT_SSP2_DMA 20 | ||
102 | #define MX23_INT_ECC8_IRQ 21 | ||
103 | #define MX23_INT_RTC_ALARM 22 | ||
104 | #define MX23_INT_UARTAPP_TX_DMA 23 | ||
105 | #define MX23_INT_UARTAPP_INTERNAL 24 | ||
106 | #define MX23_INT_UARTAPP_RX_DMA 25 | ||
107 | #define MX23_INT_I2C_DMA 26 | ||
108 | #define MX23_INT_I2C_ERROR 27 | ||
109 | #define MX23_INT_TIMER0 28 | ||
110 | #define MX23_INT_TIMER1 29 | ||
111 | #define MX23_INT_TIMER2 30 | ||
112 | #define MX23_INT_TIMER3 31 | ||
113 | #define MX23_INT_BATT_BRNOUT 32 | ||
114 | #define MX23_INT_VDDD_BRNOUT 33 | ||
115 | #define MX23_INT_VDDIO_BRNOUT 34 | ||
116 | #define MX23_INT_VDD18_BRNOUT 35 | ||
117 | #define MX23_INT_TOUCH_DETECT 36 | ||
118 | #define MX23_INT_LRADC_CH0 37 | ||
119 | #define MX23_INT_LRADC_CH1 38 | ||
120 | #define MX23_INT_LRADC_CH2 39 | ||
121 | #define MX23_INT_LRADC_CH3 40 | ||
122 | #define MX23_INT_LRADC_CH4 41 | ||
123 | #define MX23_INT_LRADC_CH5 42 | ||
124 | #define MX23_INT_LRADC_CH6 43 | ||
125 | #define MX23_INT_LRADC_CH7 44 | ||
126 | #define MX23_INT_LCDIF_DMA 45 | ||
127 | #define MX23_INT_LCDIF_ERROR 46 | ||
128 | #define MX23_INT_DIGCTL_DEBUG_TRAP 47 | ||
129 | #define MX23_INT_RTC_1MSEC 48 | ||
130 | #define MX23_INT_DRI_DMA 49 | ||
131 | #define MX23_INT_DRI_ATTENTION 50 | ||
132 | #define MX23_INT_GPMI_ATTENTION 51 | ||
133 | #define MX23_INT_IR 52 | ||
134 | #define MX23_INT_DCP_VMI 53 | ||
135 | #define MX23_INT_DCP 54 | ||
136 | #define MX23_INT_BCH 56 | ||
137 | #define MX23_INT_PXP 57 | ||
138 | #define MX23_INT_UARTAPP2_TX_DMA 58 | ||
139 | #define MX23_INT_UARTAPP2_INTERNAL 59 | ||
140 | #define MX23_INT_UARTAPP2_RX_DMA 60 | ||
141 | #define MX23_INT_VDAC_DETECT 61 | ||
142 | #define MX23_INT_VDD5V_DROOP 64 | ||
143 | #define MX23_INT_DCDC4P2_BO 65 | ||
144 | |||
145 | #endif /* __MACH_MX23_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/mx28.h b/arch/arm/mach-mxs/include/mach/mx28.h new file mode 100644 index 000000000000..0716745267ad --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/mx28.h | |||
@@ -0,0 +1,188 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MX28_H__ | ||
20 | #define __MACH_MX28_H__ | ||
21 | |||
22 | #include <mach/mxs.h> | ||
23 | |||
24 | /* | ||
25 | * OCRAM | ||
26 | */ | ||
27 | #define MX28_OCRAM_BASE_ADDR 0x00000000 | ||
28 | #define MX28_OCRAM_SIZE SZ_128K | ||
29 | |||
30 | /* | ||
31 | * IO | ||
32 | */ | ||
33 | #define MX28_IO_BASE_ADDR 0x80000000 | ||
34 | #define MX28_IO_SIZE SZ_1M | ||
35 | |||
36 | #define MX28_ICOLL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x000000) | ||
37 | #define MX28_HSADC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x002000) | ||
38 | #define MX28_APBH_DMA_BASE_ADDR (MX28_IO_BASE_ADDR + 0x004000) | ||
39 | #define MX28_PERFMON_BASE_ADDR (MX28_IO_BASE_ADDR + 0x006000) | ||
40 | #define MX28_BCH_BASE_ADDR (MX28_IO_BASE_ADDR + 0x00a000) | ||
41 | #define MX28_GPMI_BASE_ADDR (MX28_IO_BASE_ADDR + 0x00c000) | ||
42 | #define MX28_SSP0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x010000) | ||
43 | #define MX28_SSP1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x012000) | ||
44 | #define MX28_SSP2_BASE_ADDR (MX28_IO_BASE_ADDR + 0x014000) | ||
45 | #define MX28_SSP3_BASE_ADDR (MX28_IO_BASE_ADDR + 0x016000) | ||
46 | #define MX28_PINCTRL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x018000) | ||
47 | #define MX28_DIGCTL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x01c000) | ||
48 | #define MX28_ETM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x022000) | ||
49 | #define MX28_APBX_DMA_BASE_ADDR (MX28_IO_BASE_ADDR + 0x024000) | ||
50 | #define MX28_DCP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x028000) | ||
51 | #define MX28_PXP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02a000) | ||
52 | #define MX28_OCOTP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02c000) | ||
53 | #define MX28_AXI_AHB0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02e000) | ||
54 | #define MX28_LCDIF_BASE_ADDR (MX28_IO_BASE_ADDR + 0x030000) | ||
55 | #define MX28_CAN0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x032000) | ||
56 | #define MX28_CAN1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x034000) | ||
57 | #define MX28_SIMDBG_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c000) | ||
58 | #define MX28_SIMGPMISEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c200) | ||
59 | #define MX28_SIMSSPSEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c300) | ||
60 | #define MX28_SIMMEMSEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c400) | ||
61 | #define MX28_GPIOMON_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c500) | ||
62 | #define MX28_SIMENET_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c700) | ||
63 | #define MX28_ARMJTAG_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c800) | ||
64 | #define MX28_CLKCTRL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x040000) | ||
65 | #define MX28_SAIF0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x042000) | ||
66 | #define MX28_POWER_BASE_ADDR (MX28_IO_BASE_ADDR + 0x044000) | ||
67 | #define MX28_SAIF1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x046000) | ||
68 | #define MX28_LRADC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x050000) | ||
69 | #define MX28_SPDIF_BASE_ADDR (MX28_IO_BASE_ADDR + 0x054000) | ||
70 | #define MX28_RTC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x056000) | ||
71 | #define MX28_I2C0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x058000) | ||
72 | #define MX28_I2C1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x05a000) | ||
73 | #define MX28_PWM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x064000) | ||
74 | #define MX28_TIMROT_BASE_ADDR (MX28_IO_BASE_ADDR + 0x068000) | ||
75 | #define MX28_AUART0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06a000) | ||
76 | #define MX28_AUART1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06c000) | ||
77 | #define MX28_AUART2_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06e000) | ||
78 | #define MX28_AUART3_BASE_ADDR (MX28_IO_BASE_ADDR + 0x070000) | ||
79 | #define MX28_AUART4_BASE_ADDR (MX28_IO_BASE_ADDR + 0x072000) | ||
80 | #define MX28_DUART_BASE_ADDR (MX28_IO_BASE_ADDR + 0x074000) | ||
81 | #define MX28_USBPHY0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x07C000) | ||
82 | #define MX28_USBPHY1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x07e000) | ||
83 | #define MX28_USBCTRL0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x080000) | ||
84 | #define MX28_USBCTRL1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x090000) | ||
85 | #define MX28_DFLPT_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0c0000) | ||
86 | #define MX28_DRAM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0e0000) | ||
87 | #define MX28_ENET_MAC0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0f0000) | ||
88 | #define MX28_ENET_MAC1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0f4000) | ||
89 | |||
90 | #define MX28_IO_P2V(x) MXS_IO_P2V(x) | ||
91 | #define MX28_IO_ADDRESS(x) IOMEM(MX28_IO_P2V(x)) | ||
92 | |||
93 | /* | ||
94 | * IRQ | ||
95 | */ | ||
96 | #define MX28_INT_BATT_BRNOUT 0 | ||
97 | #define MX28_INT_VDDD_BRNOUT 1 | ||
98 | #define MX28_INT_VDDIO_BRNOUT 2 | ||
99 | #define MX28_INT_VDDA_BRNOUT 3 | ||
100 | #define MX28_INT_VDD5V_DROOP 4 | ||
101 | #define MX28_INT_DCDC4P2_BRNOUT 5 | ||
102 | #define MX28_INT_VDD5V 6 | ||
103 | #define MX28_INT_CAN0 8 | ||
104 | #define MX28_INT_CAN1 9 | ||
105 | #define MX28_INT_LRADC_TOUCH 10 | ||
106 | #define MX28_INT_HSADC 13 | ||
107 | #define MX28_INT_IRADC_THRESH0 14 | ||
108 | #define MX28_INT_IRADC_THRESH1 15 | ||
109 | #define MX28_INT_LRADC_CH0 16 | ||
110 | #define MX28_INT_LRADC_CH1 17 | ||
111 | #define MX28_INT_LRADC_CH2 18 | ||
112 | #define MX28_INT_LRADC_CH3 19 | ||
113 | #define MX28_INT_LRADC_CH4 20 | ||
114 | #define MX28_INT_LRADC_CH5 21 | ||
115 | #define MX28_INT_LRADC_CH6 22 | ||
116 | #define MX28_INT_LRADC_CH7 23 | ||
117 | #define MX28_INT_LRADC_BUTTON0 24 | ||
118 | #define MX28_INT_LRADC_BUTTON1 25 | ||
119 | #define MX28_INT_PERFMON 27 | ||
120 | #define MX28_INT_RTC_1MSEC 28 | ||
121 | #define MX28_INT_RTC_ALARM 29 | ||
122 | #define MX28_INT_COMMS 31 | ||
123 | #define MX28_INT_EMI_ERR 32 | ||
124 | #define MX28_INT_LCDIF 38 | ||
125 | #define MX28_INT_PXP 39 | ||
126 | #define MX28_INT_BCH 41 | ||
127 | #define MX28_INT_GPMI 42 | ||
128 | #define MX28_INT_SPDIF_ERROR 45 | ||
129 | #define MX28_INT_DUART 47 | ||
130 | #define MX28_INT_TIMER0 48 | ||
131 | #define MX28_INT_TIMER1 49 | ||
132 | #define MX28_INT_TIMER2 50 | ||
133 | #define MX28_INT_TIMER3 51 | ||
134 | #define MX28_INT_DCP_VMI 52 | ||
135 | #define MX28_INT_DCP 53 | ||
136 | #define MX28_INT_DCP_SECURE 54 | ||
137 | #define MX28_INT_SAIF1 58 | ||
138 | #define MX28_INT_SAIF0 59 | ||
139 | #define MX28_INT_SPDIF_DMA 66 | ||
140 | #define MX28_INT_I2C0_DMA 68 | ||
141 | #define MX28_INT_I2C1_DMA 69 | ||
142 | #define MX28_INT_AUART0_RX_DMA 70 | ||
143 | #define MX28_INT_AUART0_TX_DMA 71 | ||
144 | #define MX28_INT_AUART1_RX_DMA 72 | ||
145 | #define MX28_INT_AUART1_TX_DMA 73 | ||
146 | #define MX28_INT_AUART2_RX_DMA 74 | ||
147 | #define MX28_INT_AUART2_TX_DMA 75 | ||
148 | #define MX28_INT_AUART3_RX_DMA 76 | ||
149 | #define MX28_INT_AUART3_TX_DMA 77 | ||
150 | #define MX28_INT_AUART4_RX_DMA 78 | ||
151 | #define MX28_INT_AUART4_TX_DMA 79 | ||
152 | #define MX28_INT_SAIF0_DMA 80 | ||
153 | #define MX28_INT_SAIF1_DMA 81 | ||
154 | #define MX28_INT_SSP0_DMA 82 | ||
155 | #define MX28_INT_SSP1_DMA 83 | ||
156 | #define MX28_INT_SSP2_DMA 84 | ||
157 | #define MX28_INT_SSP3_DMA 85 | ||
158 | #define MX28_INT_LCDIF_DMA 86 | ||
159 | #define MX28_INT_HSADC_DMA 87 | ||
160 | #define MX28_INT_GPMI_DMA 88 | ||
161 | #define MX28_INT_DIGCTL_DEBUG_TRAP 89 | ||
162 | #define MX28_INT_USB1 92 | ||
163 | #define MX28_INT_USB0 93 | ||
164 | #define MX28_INT_USB1_WAKEUP 94 | ||
165 | #define MX28_INT_USB0_WAKEUP 95 | ||
166 | #define MX28_INT_SSP0 96 | ||
167 | #define MX28_INT_SSP1 97 | ||
168 | #define MX28_INT_SSP2 98 | ||
169 | #define MX28_INT_SSP3 99 | ||
170 | #define MX28_INT_ENET_SWI 100 | ||
171 | #define MX28_INT_ENET_MAC0 101 | ||
172 | #define MX28_INT_ENET_MAC1 102 | ||
173 | #define MX28_INT_ENET_MAC0_1588 103 | ||
174 | #define MX28_INT_ENET_MAC1_1588 104 | ||
175 | #define MX28_INT_I2C1_ERROR 110 | ||
176 | #define MX28_INT_I2C0_ERROR 111 | ||
177 | #define MX28_INT_AUART0 112 | ||
178 | #define MX28_INT_AUART1 113 | ||
179 | #define MX28_INT_AUART2 114 | ||
180 | #define MX28_INT_AUART3 115 | ||
181 | #define MX28_INT_AUART4 116 | ||
182 | #define MX28_INT_GPIO4 123 | ||
183 | #define MX28_INT_GPIO3 124 | ||
184 | #define MX28_INT_GPIO2 125 | ||
185 | #define MX28_INT_GPIO1 126 | ||
186 | #define MX28_INT_GPIO0 127 | ||
187 | |||
188 | #endif /* __MACH_MX28_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h new file mode 100644 index 000000000000..f186c08c2911 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/mxs.h | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MXS_H__ | ||
20 | #define __MACH_MXS_H__ | ||
21 | |||
22 | #ifndef __ASSEMBLER__ | ||
23 | #include <linux/io.h> | ||
24 | #endif | ||
25 | #include <asm/mach-types.h> | ||
26 | #include <mach/hardware.h> | ||
27 | |||
28 | /* | ||
29 | * MXS CPU types | ||
30 | */ | ||
31 | #define cpu_is_mx23() (machine_is_mx23evk()) | ||
32 | #define cpu_is_mx28() (machine_is_mx28evk()) | ||
33 | |||
34 | /* | ||
35 | * IO addresses common to MXS-based | ||
36 | */ | ||
37 | #define MXS_IO_BASE_ADDR 0x80000000 | ||
38 | #define MXS_IO_SIZE SZ_1M | ||
39 | |||
40 | #define MXS_ICOLL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x000000) | ||
41 | #define MXS_APBH_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x004000) | ||
42 | #define MXS_BCH_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00a000) | ||
43 | #define MXS_GPMI_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00c000) | ||
44 | #define MXS_PINCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x018000) | ||
45 | #define MXS_DIGCTL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x01c000) | ||
46 | #define MXS_APBX_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x024000) | ||
47 | #define MXS_DCP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x028000) | ||
48 | #define MXS_PXP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02a000) | ||
49 | #define MXS_OCOTP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02c000) | ||
50 | #define MXS_AXI_AHB0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02e000) | ||
51 | #define MXS_LCDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x030000) | ||
52 | #define MXS_CLKCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x040000) | ||
53 | #define MXS_SAIF0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x042000) | ||
54 | #define MXS_POWER_BASE_ADDR (MXS_IO_BASE_ADDR + 0x044000) | ||
55 | #define MXS_SAIF1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x046000) | ||
56 | #define MXS_LRADC_BASE_ADDR (MXS_IO_BASE_ADDR + 0x050000) | ||
57 | #define MXS_SPDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x054000) | ||
58 | #define MXS_I2C0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x058000) | ||
59 | #define MXS_PWM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x064000) | ||
60 | #define MXS_TIMROT_BASE_ADDR (MXS_IO_BASE_ADDR + 0x068000) | ||
61 | #define MXS_AUART1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06c000) | ||
62 | #define MXS_AUART2_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06e000) | ||
63 | #define MXS_DRAM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x0e0000) | ||
64 | |||
65 | /* | ||
66 | * It maps the whole address space to [0xf4000000, 0xf50fffff]. | ||
67 | * | ||
68 | * OCRAM 0x00000000+0x020000 -> 0xf4000000+0x020000 | ||
69 | * IO 0x80000000+0x100000 -> 0xf5000000+0x100000 | ||
70 | */ | ||
71 | #define MXS_IO_P2V(x) (0xf4000000 + \ | ||
72 | (((x) & 0x80000000) >> 7) + \ | ||
73 | (((x) & 0x000fffff))) | ||
74 | |||
75 | #define MXS_IO_ADDRESS(x) IOMEM(MXS_IO_P2V(x)) | ||
76 | |||
77 | #define mxs_map_entry(soc, name, _type) { \ | ||
78 | .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \ | ||
79 | .pfn = __phys_to_pfn(soc ## _ ## name ## _BASE_ADDR), \ | ||
80 | .length = soc ## _ ## name ## _SIZE, \ | ||
81 | .type = _type, \ | ||
82 | } | ||
83 | |||
84 | #define MXS_SET_ADDR 0x4 | ||
85 | #define MXS_CLR_ADDR 0x8 | ||
86 | #define MXS_TOG_ADDR 0xc | ||
87 | |||
88 | #ifndef __ASSEMBLER__ | ||
89 | static inline void __mxs_setl(u32 mask, void __iomem *reg) | ||
90 | { | ||
91 | __raw_writel(mask, reg + MXS_SET_ADDR); | ||
92 | } | ||
93 | |||
94 | static inline void __mxs_clrl(u32 mask, void __iomem *reg) | ||
95 | { | ||
96 | __raw_writel(mask, reg + MXS_CLR_ADDR); | ||
97 | } | ||
98 | |||
99 | static inline void __mxs_togl(u32 mask, void __iomem *reg) | ||
100 | { | ||
101 | __raw_writel(mask, reg + MXS_TOG_ADDR); | ||
102 | } | ||
103 | #endif | ||
104 | |||
105 | #endif /* __MACH_MXS_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/system.h b/arch/arm/mach-mxs/include/mach/system.h new file mode 100644 index 000000000000..0e428239b433 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/system.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
4 | * Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef __MACH_MXS_SYSTEM_H__ | ||
18 | #define __MACH_MXS_SYSTEM_H__ | ||
19 | |||
20 | static inline void arch_idle(void) | ||
21 | { | ||
22 | cpu_do_idle(); | ||
23 | } | ||
24 | |||
25 | void arch_reset(char mode, const char *cmd); | ||
26 | |||
27 | #endif /* __MACH_MXS_SYSTEM_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/timex.h b/arch/arm/mach-mxs/include/mach/timex.h new file mode 100644 index 000000000000..734ce8984a64 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/timex.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __MACH_MXS_TIMEX_H__ | ||
17 | #define __MACH_MXS_TIMEX_H__ | ||
18 | |||
19 | #define CLOCK_TICK_RATE 32000 /* 32K */ | ||
20 | |||
21 | #endif /* __MACH_MXS_TIMEX_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h new file mode 100644 index 000000000000..a005e76f34f9 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/uncompress.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mxs/include/mach/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
5 | * Copyright (C) Shane Nay (shane@minirl.com) | ||
6 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | */ | ||
18 | #ifndef __MACH_MXS_UNCOMPRESS_H__ | ||
19 | #define __MACH_MXS_UNCOMPRESS_H__ | ||
20 | |||
21 | #include <asm/mach-types.h> | ||
22 | |||
23 | static unsigned long mxs_duart_base; | ||
24 | |||
25 | #define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x))) | ||
26 | |||
27 | #define MXS_DUART_DR 0x00 | ||
28 | #define MXS_DUART_FR 0x18 | ||
29 | #define MXS_DUART_FR_TXFE (1 << 7) | ||
30 | #define MXS_DUART_CR 0x30 | ||
31 | #define MXS_DUART_CR_UARTEN (1 << 0) | ||
32 | |||
33 | /* | ||
34 | * The following code assumes the serial port has already been | ||
35 | * initialized by the bootloader. If it's not, the output is | ||
36 | * simply discarded. | ||
37 | */ | ||
38 | |||
39 | static void putc(int ch) | ||
40 | { | ||
41 | if (!mxs_duart_base) | ||
42 | return; | ||
43 | if (!(MXS_DUART(MXS_DUART_CR) & MXS_DUART_CR_UARTEN)) | ||
44 | return; | ||
45 | |||
46 | while (!(MXS_DUART(MXS_DUART_FR) & MXS_DUART_FR_TXFE)) | ||
47 | barrier(); | ||
48 | |||
49 | MXS_DUART(MXS_DUART_DR) = ch; | ||
50 | } | ||
51 | |||
52 | static inline void flush(void) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | #define MX23_DUART_BASE_ADDR 0x80070000 | ||
57 | #define MX28_DUART_BASE_ADDR 0x80074000 | ||
58 | |||
59 | static inline void __arch_decomp_setup(unsigned long arch_id) | ||
60 | { | ||
61 | switch (arch_id) { | ||
62 | case MACH_TYPE_MX23EVK: | ||
63 | mxs_duart_base = MX23_DUART_BASE_ADDR; | ||
64 | break; | ||
65 | case MACH_TYPE_MX28EVK: | ||
66 | mxs_duart_base = MX28_DUART_BASE_ADDR; | ||
67 | break; | ||
68 | default: | ||
69 | break; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | #define arch_decomp_setup() __arch_decomp_setup(arch_id) | ||
74 | #define arch_decomp_wdog() | ||
75 | |||
76 | #endif /* __MACH_MXS_UNCOMPRESS_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/vmalloc.h b/arch/arm/mach-mxs/include/mach/vmalloc.h new file mode 100644 index 000000000000..103b0165ed0b --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/vmalloc.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 Russell King. | ||
3 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __MACH_MXS_VMALLOC_H__ | ||
17 | #define __MACH_MXS_VMALLOC_H__ | ||
18 | |||
19 | /* vmalloc ending address */ | ||
20 | #define VMALLOC_END 0xf4000000UL | ||
21 | |||
22 | #endif /* __MACH_MXS_VMALLOC_H__ */ | ||
diff --git a/arch/arm/mach-mxs/iomux.c b/arch/arm/mach-mxs/iomux.c new file mode 100644 index 000000000000..0e804e2f11f4 --- /dev/null +++ b/arch/arm/mach-mxs/iomux.c | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2006,2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> | ||
4 | * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH, | ||
5 | * <armlinux@phytec.de> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version 2 | ||
10 | * of the License, or (at your option) any later version. | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
19 | * MA 02110-1301, USA. | ||
20 | */ | ||
21 | |||
22 | #include <linux/errno.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/kernel.h> | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/string.h> | ||
27 | #include <linux/gpio.h> | ||
28 | |||
29 | #include <asm/mach/map.h> | ||
30 | |||
31 | #include <mach/mxs.h> | ||
32 | #include <mach/iomux.h> | ||
33 | |||
34 | /* | ||
35 | * configures a single pad in the iomuxer | ||
36 | */ | ||
37 | int mxs_iomux_setup_pad(iomux_cfg_t pad) | ||
38 | { | ||
39 | u32 reg, ofs, bp, bm; | ||
40 | void __iomem *iomux_base = MXS_IO_ADDRESS(MXS_PINCTRL_BASE_ADDR); | ||
41 | |||
42 | /* muxsel */ | ||
43 | ofs = 0x100; | ||
44 | ofs += PAD_BANK(pad) * 0x20 + PAD_PIN(pad) / 16 * 0x10; | ||
45 | bp = PAD_PIN(pad) % 16 * 2; | ||
46 | bm = 0x3 << bp; | ||
47 | reg = __raw_readl(iomux_base + ofs); | ||
48 | reg &= ~bm; | ||
49 | reg |= PAD_MUXSEL(pad) << bp; | ||
50 | __raw_writel(reg, iomux_base + ofs); | ||
51 | |||
52 | /* drive */ | ||
53 | ofs = cpu_is_mx23() ? 0x200 : 0x300; | ||
54 | ofs += PAD_BANK(pad) * 0x40 + PAD_PIN(pad) / 8 * 0x10; | ||
55 | /* mA */ | ||
56 | if (PAD_MA_VALID(pad)) { | ||
57 | bp = PAD_PIN(pad) % 8 * 4; | ||
58 | bm = 0x3 << bp; | ||
59 | reg = __raw_readl(iomux_base + ofs); | ||
60 | reg &= ~bm; | ||
61 | reg |= PAD_MA(pad) << bp; | ||
62 | __raw_writel(reg, iomux_base + ofs); | ||
63 | } | ||
64 | /* vol */ | ||
65 | if (PAD_VOL_VALID(pad)) { | ||
66 | bp = PAD_PIN(pad) % 8 * 4 + 2; | ||
67 | if (PAD_VOL(pad)) | ||
68 | __mxs_setl(1 << bp, iomux_base + ofs); | ||
69 | else | ||
70 | __mxs_clrl(1 << bp, iomux_base + ofs); | ||
71 | } | ||
72 | |||
73 | /* pull */ | ||
74 | if (PAD_PULL_VALID(pad)) { | ||
75 | ofs = cpu_is_mx23() ? 0x400 : 0x600; | ||
76 | ofs += PAD_BANK(pad) * 0x10; | ||
77 | bp = PAD_PIN(pad); | ||
78 | if (PAD_PULL(pad)) | ||
79 | __mxs_setl(1 << bp, iomux_base + ofs); | ||
80 | else | ||
81 | __mxs_clrl(1 << bp, iomux_base + ofs); | ||
82 | } | ||
83 | |||
84 | return 0; | ||
85 | } | ||
86 | |||
87 | int mxs_iomux_setup_multiple_pads(const iomux_cfg_t *pad_list, unsigned count) | ||
88 | { | ||
89 | const iomux_cfg_t *p = pad_list; | ||
90 | int i; | ||
91 | int ret; | ||
92 | |||
93 | for (i = 0; i < count; i++) { | ||
94 | ret = mxs_iomux_setup_pad(*p); | ||
95 | if (ret) | ||
96 | return ret; | ||
97 | p++; | ||
98 | } | ||
99 | |||
100 | return 0; | ||
101 | } | ||
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c new file mode 100644 index 000000000000..aa0640052f58 --- /dev/null +++ b/arch/arm/mach-mxs/mach-mx23evk.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 | |||
15 | #include <linux/delay.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/irq.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <asm/mach/time.h> | ||
23 | |||
24 | #include <mach/common.h> | ||
25 | #include <mach/iomux-mx23.h> | ||
26 | |||
27 | #include "devices-mx23.h" | ||
28 | |||
29 | static const iomux_cfg_t mx23evk_pads[] __initconst = { | ||
30 | /* duart */ | ||
31 | MX23_PAD_PWM0__DUART_RX | MXS_PAD_4MA, | ||
32 | MX23_PAD_PWM1__DUART_TX | MXS_PAD_4MA, | ||
33 | }; | ||
34 | |||
35 | static void __init mx23evk_init(void) | ||
36 | { | ||
37 | mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads)); | ||
38 | |||
39 | mx23_add_duart(); | ||
40 | } | ||
41 | |||
42 | static void __init mx23evk_timer_init(void) | ||
43 | { | ||
44 | mx23_clocks_init(); | ||
45 | } | ||
46 | |||
47 | static struct sys_timer mx23evk_timer = { | ||
48 | .init = mx23evk_timer_init, | ||
49 | }; | ||
50 | |||
51 | MACHINE_START(MX23EVK, "Freescale MX23 EVK") | ||
52 | /* Maintainer: Freescale Semiconductor, Inc. */ | ||
53 | .map_io = mx23_map_io, | ||
54 | .init_irq = mx23_init_irq, | ||
55 | .init_machine = mx23evk_init, | ||
56 | .timer = &mx23evk_timer, | ||
57 | MACHINE_END | ||
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c new file mode 100644 index 000000000000..d162e95910f3 --- /dev/null +++ b/arch/arm/mach-mxs/mach-mx28evk.c | |||
@@ -0,0 +1,138 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 | |||
15 | #include <linux/delay.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/clk.h> | ||
20 | |||
21 | #include <asm/mach-types.h> | ||
22 | #include <asm/mach/arch.h> | ||
23 | #include <asm/mach/time.h> | ||
24 | |||
25 | #include <mach/common.h> | ||
26 | #include <mach/iomux-mx28.h> | ||
27 | |||
28 | #include "devices-mx28.h" | ||
29 | #include "gpio.h" | ||
30 | |||
31 | #define MX28EVK_FEC_PHY_POWER MXS_GPIO_NR(2, 15) | ||
32 | #define MX28EVK_FEC_PHY_RESET MXS_GPIO_NR(4, 13) | ||
33 | |||
34 | static const iomux_cfg_t mx28evk_pads[] __initconst = { | ||
35 | /* duart */ | ||
36 | MX28_PAD_PWM0__DUART_RX | | ||
37 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
38 | MX28_PAD_PWM1__DUART_TX | | ||
39 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
40 | |||
41 | /* fec0 */ | ||
42 | MX28_PAD_ENET0_MDC__ENET0_MDC | | ||
43 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
44 | MX28_PAD_ENET0_MDIO__ENET0_MDIO | | ||
45 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
46 | MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | | ||
47 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
48 | MX28_PAD_ENET0_RXD0__ENET0_RXD0 | | ||
49 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
50 | MX28_PAD_ENET0_RXD1__ENET0_RXD1 | | ||
51 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
52 | MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | | ||
53 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
54 | MX28_PAD_ENET0_TXD0__ENET0_TXD0 | | ||
55 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
56 | MX28_PAD_ENET0_TXD1__ENET0_TXD1 | | ||
57 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
58 | MX28_PAD_ENET_CLK__CLKCTRL_ENET | | ||
59 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
60 | /* phy power line */ | ||
61 | MX28_PAD_SSP1_DATA3__GPIO_2_15 | | ||
62 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
63 | /* phy reset line */ | ||
64 | MX28_PAD_ENET0_RX_CLK__GPIO_4_13 | | ||
65 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
66 | }; | ||
67 | |||
68 | /* fec */ | ||
69 | static void __init mx28evk_fec_reset(void) | ||
70 | { | ||
71 | int ret; | ||
72 | struct clk *clk; | ||
73 | |||
74 | /* Enable fec phy clock */ | ||
75 | clk = clk_get_sys("pll2", NULL); | ||
76 | if (!IS_ERR(clk)) | ||
77 | clk_enable(clk); | ||
78 | |||
79 | /* Power up fec phy */ | ||
80 | ret = gpio_request(MX28EVK_FEC_PHY_POWER, "fec-phy-power"); | ||
81 | if (ret) { | ||
82 | pr_err("Failed to request gpio fec-phy-%s: %d\n", "power", ret); | ||
83 | return; | ||
84 | } | ||
85 | |||
86 | ret = gpio_direction_output(MX28EVK_FEC_PHY_POWER, 0); | ||
87 | if (ret) { | ||
88 | pr_err("Failed to drive gpio fec-phy-%s: %d\n", "power", ret); | ||
89 | return; | ||
90 | } | ||
91 | |||
92 | /* Reset fec phy */ | ||
93 | ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset"); | ||
94 | if (ret) { | ||
95 | pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret); | ||
96 | return; | ||
97 | } | ||
98 | |||
99 | gpio_direction_output(MX28EVK_FEC_PHY_RESET, 0); | ||
100 | if (ret) { | ||
101 | pr_err("Failed to drive gpio fec-phy-%s: %d\n", "reset", ret); | ||
102 | return; | ||
103 | } | ||
104 | |||
105 | mdelay(1); | ||
106 | gpio_set_value(MX28EVK_FEC_PHY_RESET, 1); | ||
107 | } | ||
108 | |||
109 | static const struct fec_platform_data mx28_fec_pdata __initconst = { | ||
110 | .phy = PHY_INTERFACE_MODE_RMII, | ||
111 | }; | ||
112 | |||
113 | static void __init mx28evk_init(void) | ||
114 | { | ||
115 | mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads)); | ||
116 | |||
117 | mx28_add_duart(); | ||
118 | |||
119 | mx28evk_fec_reset(); | ||
120 | mx28_add_fec(0, &mx28_fec_pdata); | ||
121 | } | ||
122 | |||
123 | static void __init mx28evk_timer_init(void) | ||
124 | { | ||
125 | mx28_clocks_init(); | ||
126 | } | ||
127 | |||
128 | static struct sys_timer mx28evk_timer = { | ||
129 | .init = mx28evk_timer_init, | ||
130 | }; | ||
131 | |||
132 | MACHINE_START(MX28EVK, "Freescale MX28 EVK") | ||
133 | /* Maintainer: Freescale Semiconductor, Inc. */ | ||
134 | .map_io = mx28_map_io, | ||
135 | .init_irq = mx28_init_irq, | ||
136 | .init_machine = mx28evk_init, | ||
137 | .timer = &mx28evk_timer, | ||
138 | MACHINE_END | ||
diff --git a/arch/arm/mach-mxs/mm-mx23.c b/arch/arm/mach-mxs/mm-mx23.c new file mode 100644 index 000000000000..5148cd64a6b7 --- /dev/null +++ b/arch/arm/mach-mxs/mm-mx23.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | * | ||
11 | * Create static mapping between physical to virtual memory. | ||
12 | */ | ||
13 | |||
14 | #include <linux/mm.h> | ||
15 | #include <linux/init.h> | ||
16 | |||
17 | #include <asm/mach/map.h> | ||
18 | |||
19 | #include <mach/mx23.h> | ||
20 | #include <mach/common.h> | ||
21 | #include <mach/iomux.h> | ||
22 | |||
23 | /* | ||
24 | * Define the MX23 memory map. | ||
25 | */ | ||
26 | static struct map_desc mx23_io_desc[] __initdata = { | ||
27 | mxs_map_entry(MX23, OCRAM, MT_DEVICE), | ||
28 | mxs_map_entry(MX23, IO, MT_DEVICE), | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * This function initializes the memory map. It is called during the | ||
33 | * system startup to create static physical to virtual memory mappings | ||
34 | * for the IO modules. | ||
35 | */ | ||
36 | void __init mx23_map_io(void) | ||
37 | { | ||
38 | iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc)); | ||
39 | } | ||
40 | |||
41 | void __init mx23_init_irq(void) | ||
42 | { | ||
43 | icoll_init_irq(); | ||
44 | mx23_register_gpios(); | ||
45 | } | ||
diff --git a/arch/arm/mach-mxs/mm-mx28.c b/arch/arm/mach-mxs/mm-mx28.c new file mode 100644 index 000000000000..7e4cea32ebc6 --- /dev/null +++ b/arch/arm/mach-mxs/mm-mx28.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | * | ||
11 | * Create static mapping between physical to virtual memory. | ||
12 | */ | ||
13 | |||
14 | #include <linux/mm.h> | ||
15 | #include <linux/init.h> | ||
16 | |||
17 | #include <asm/mach/map.h> | ||
18 | |||
19 | #include <mach/mx28.h> | ||
20 | #include <mach/common.h> | ||
21 | #include <mach/iomux.h> | ||
22 | |||
23 | /* | ||
24 | * Define the MX28 memory map. | ||
25 | */ | ||
26 | static struct map_desc mx28_io_desc[] __initdata = { | ||
27 | mxs_map_entry(MX28, OCRAM, MT_DEVICE), | ||
28 | mxs_map_entry(MX28, IO, MT_DEVICE), | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * This function initializes the memory map. It is called during the | ||
33 | * system startup to create static physical to virtual memory mappings | ||
34 | * for the IO modules. | ||
35 | */ | ||
36 | void __init mx28_map_io(void) | ||
37 | { | ||
38 | iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc)); | ||
39 | } | ||
40 | |||
41 | void __init mx28_init_irq(void) | ||
42 | { | ||
43 | icoll_init_irq(); | ||
44 | mx28_register_gpios(); | ||
45 | } | ||
diff --git a/arch/arm/mach-mxs/regs-clkctrl-mx23.h b/arch/arm/mach-mxs/regs-clkctrl-mx23.h new file mode 100644 index 000000000000..dbc04747b691 --- /dev/null +++ b/arch/arm/mach-mxs/regs-clkctrl-mx23.h | |||
@@ -0,0 +1,455 @@ | |||
1 | /* | ||
2 | * Freescale CLKCTRL Register Definitions | ||
3 | * | ||
4 | * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. | ||
5 | * Copyright 2008-2010 Freescale Semiconductor, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | * This file is created by xml file. Don't Edit it. | ||
22 | * | ||
23 | * Xml Revision: 1.48 | ||
24 | * Template revision: 26195 | ||
25 | */ | ||
26 | |||
27 | #ifndef __REGS_CLKCTRL_MX23_H__ | ||
28 | #define __REGS_CLKCTRL_MX23_H__ | ||
29 | |||
30 | |||
31 | #define HW_CLKCTRL_PLLCTRL0 (0x00000000) | ||
32 | #define HW_CLKCTRL_PLLCTRL0_SET (0x00000004) | ||
33 | #define HW_CLKCTRL_PLLCTRL0_CLR (0x00000008) | ||
34 | #define HW_CLKCTRL_PLLCTRL0_TOG (0x0000000c) | ||
35 | |||
36 | #define BP_CLKCTRL_PLLCTRL0_RSRVD6 30 | ||
37 | #define BM_CLKCTRL_PLLCTRL0_RSRVD6 0xC0000000 | ||
38 | #define BF_CLKCTRL_PLLCTRL0_RSRVD6(v) \ | ||
39 | (((v) << 30) & BM_CLKCTRL_PLLCTRL0_RSRVD6) | ||
40 | #define BP_CLKCTRL_PLLCTRL0_LFR_SEL 28 | ||
41 | #define BM_CLKCTRL_PLLCTRL0_LFR_SEL 0x30000000 | ||
42 | #define BF_CLKCTRL_PLLCTRL0_LFR_SEL(v) \ | ||
43 | (((v) << 28) & BM_CLKCTRL_PLLCTRL0_LFR_SEL) | ||
44 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__DEFAULT 0x0 | ||
45 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_2 0x1 | ||
46 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_05 0x2 | ||
47 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__UNDEFINED 0x3 | ||
48 | #define BP_CLKCTRL_PLLCTRL0_RSRVD5 26 | ||
49 | #define BM_CLKCTRL_PLLCTRL0_RSRVD5 0x0C000000 | ||
50 | #define BF_CLKCTRL_PLLCTRL0_RSRVD5(v) \ | ||
51 | (((v) << 26) & BM_CLKCTRL_PLLCTRL0_RSRVD5) | ||
52 | #define BP_CLKCTRL_PLLCTRL0_CP_SEL 24 | ||
53 | #define BM_CLKCTRL_PLLCTRL0_CP_SEL 0x03000000 | ||
54 | #define BF_CLKCTRL_PLLCTRL0_CP_SEL(v) \ | ||
55 | (((v) << 24) & BM_CLKCTRL_PLLCTRL0_CP_SEL) | ||
56 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__DEFAULT 0x0 | ||
57 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_2 0x1 | ||
58 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_05 0x2 | ||
59 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__UNDEFINED 0x3 | ||
60 | #define BP_CLKCTRL_PLLCTRL0_RSRVD4 22 | ||
61 | #define BM_CLKCTRL_PLLCTRL0_RSRVD4 0x00C00000 | ||
62 | #define BF_CLKCTRL_PLLCTRL0_RSRVD4(v) \ | ||
63 | (((v) << 22) & BM_CLKCTRL_PLLCTRL0_RSRVD4) | ||
64 | #define BP_CLKCTRL_PLLCTRL0_DIV_SEL 20 | ||
65 | #define BM_CLKCTRL_PLLCTRL0_DIV_SEL 0x00300000 | ||
66 | #define BF_CLKCTRL_PLLCTRL0_DIV_SEL(v) \ | ||
67 | (((v) << 20) & BM_CLKCTRL_PLLCTRL0_DIV_SEL) | ||
68 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__DEFAULT 0x0 | ||
69 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWER 0x1 | ||
70 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWEST 0x2 | ||
71 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__UNDEFINED 0x3 | ||
72 | #define BM_CLKCTRL_PLLCTRL0_RSRVD3 0x00080000 | ||
73 | #define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000 | ||
74 | #define BM_CLKCTRL_PLLCTRL0_RSRVD2 0x00020000 | ||
75 | #define BM_CLKCTRL_PLLCTRL0_POWER 0x00010000 | ||
76 | #define BP_CLKCTRL_PLLCTRL0_RSRVD1 0 | ||
77 | #define BM_CLKCTRL_PLLCTRL0_RSRVD1 0x0000FFFF | ||
78 | #define BF_CLKCTRL_PLLCTRL0_RSRVD1(v) \ | ||
79 | (((v) << 0) & BM_CLKCTRL_PLLCTRL0_RSRVD1) | ||
80 | |||
81 | #define HW_CLKCTRL_PLLCTRL1 (0x00000010) | ||
82 | |||
83 | #define BM_CLKCTRL_PLLCTRL1_LOCK 0x80000000 | ||
84 | #define BM_CLKCTRL_PLLCTRL1_FORCE_LOCK 0x40000000 | ||
85 | #define BP_CLKCTRL_PLLCTRL1_RSRVD1 16 | ||
86 | #define BM_CLKCTRL_PLLCTRL1_RSRVD1 0x3FFF0000 | ||
87 | #define BF_CLKCTRL_PLLCTRL1_RSRVD1(v) \ | ||
88 | (((v) << 16) & BM_CLKCTRL_PLLCTRL1_RSRVD1) | ||
89 | #define BP_CLKCTRL_PLLCTRL1_LOCK_COUNT 0 | ||
90 | #define BM_CLKCTRL_PLLCTRL1_LOCK_COUNT 0x0000FFFF | ||
91 | #define BF_CLKCTRL_PLLCTRL1_LOCK_COUNT(v) \ | ||
92 | (((v) << 0) & BM_CLKCTRL_PLLCTRL1_LOCK_COUNT) | ||
93 | |||
94 | #define HW_CLKCTRL_CPU (0x00000020) | ||
95 | #define HW_CLKCTRL_CPU_SET (0x00000024) | ||
96 | #define HW_CLKCTRL_CPU_CLR (0x00000028) | ||
97 | #define HW_CLKCTRL_CPU_TOG (0x0000002c) | ||
98 | |||
99 | #define BP_CLKCTRL_CPU_RSRVD5 30 | ||
100 | #define BM_CLKCTRL_CPU_RSRVD5 0xC0000000 | ||
101 | #define BF_CLKCTRL_CPU_RSRVD5(v) \ | ||
102 | (((v) << 30) & BM_CLKCTRL_CPU_RSRVD5) | ||
103 | #define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000 | ||
104 | #define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000 | ||
105 | #define BM_CLKCTRL_CPU_RSRVD4 0x08000000 | ||
106 | #define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000 | ||
107 | #define BP_CLKCTRL_CPU_DIV_XTAL 16 | ||
108 | #define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000 | ||
109 | #define BF_CLKCTRL_CPU_DIV_XTAL(v) \ | ||
110 | (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL) | ||
111 | #define BP_CLKCTRL_CPU_RSRVD3 13 | ||
112 | #define BM_CLKCTRL_CPU_RSRVD3 0x0000E000 | ||
113 | #define BF_CLKCTRL_CPU_RSRVD3(v) \ | ||
114 | (((v) << 13) & BM_CLKCTRL_CPU_RSRVD3) | ||
115 | #define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000 | ||
116 | #define BM_CLKCTRL_CPU_RSRVD2 0x00000800 | ||
117 | #define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400 | ||
118 | #define BP_CLKCTRL_CPU_RSRVD1 6 | ||
119 | #define BM_CLKCTRL_CPU_RSRVD1 0x000003C0 | ||
120 | #define BF_CLKCTRL_CPU_RSRVD1(v) \ | ||
121 | (((v) << 6) & BM_CLKCTRL_CPU_RSRVD1) | ||
122 | #define BP_CLKCTRL_CPU_DIV_CPU 0 | ||
123 | #define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F | ||
124 | #define BF_CLKCTRL_CPU_DIV_CPU(v) \ | ||
125 | (((v) << 0) & BM_CLKCTRL_CPU_DIV_CPU) | ||
126 | |||
127 | #define HW_CLKCTRL_HBUS (0x00000030) | ||
128 | #define HW_CLKCTRL_HBUS_SET (0x00000034) | ||
129 | #define HW_CLKCTRL_HBUS_CLR (0x00000038) | ||
130 | #define HW_CLKCTRL_HBUS_TOG (0x0000003c) | ||
131 | |||
132 | #define BP_CLKCTRL_HBUS_RSRVD4 30 | ||
133 | #define BM_CLKCTRL_HBUS_RSRVD4 0xC0000000 | ||
134 | #define BF_CLKCTRL_HBUS_RSRVD4(v) \ | ||
135 | (((v) << 30) & BM_CLKCTRL_HBUS_RSRVD4) | ||
136 | #define BM_CLKCTRL_HBUS_BUSY 0x20000000 | ||
137 | #define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x10000000 | ||
138 | #define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x08000000 | ||
139 | #define BM_CLKCTRL_HBUS_APBHDMA_AS_ENABLE 0x04000000 | ||
140 | #define BM_CLKCTRL_HBUS_APBXDMA_AS_ENABLE 0x02000000 | ||
141 | #define BM_CLKCTRL_HBUS_TRAFFIC_JAM_AS_ENABLE 0x01000000 | ||
142 | #define BM_CLKCTRL_HBUS_TRAFFIC_AS_ENABLE 0x00800000 | ||
143 | #define BM_CLKCTRL_HBUS_CPU_DATA_AS_ENABLE 0x00400000 | ||
144 | #define BM_CLKCTRL_HBUS_CPU_INSTR_AS_ENABLE 0x00200000 | ||
145 | #define BM_CLKCTRL_HBUS_AUTO_SLOW_MODE 0x00100000 | ||
146 | #define BM_CLKCTRL_HBUS_RSRVD2 0x00080000 | ||
147 | #define BP_CLKCTRL_HBUS_SLOW_DIV 16 | ||
148 | #define BM_CLKCTRL_HBUS_SLOW_DIV 0x00070000 | ||
149 | #define BF_CLKCTRL_HBUS_SLOW_DIV(v) \ | ||
150 | (((v) << 16) & BM_CLKCTRL_HBUS_SLOW_DIV) | ||
151 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY1 0x0 | ||
152 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY2 0x1 | ||
153 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY4 0x2 | ||
154 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3 | ||
155 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4 | ||
156 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5 | ||
157 | #define BP_CLKCTRL_HBUS_RSRVD1 6 | ||
158 | #define BM_CLKCTRL_HBUS_RSRVD1 0x0000FFC0 | ||
159 | #define BF_CLKCTRL_HBUS_RSRVD1(v) \ | ||
160 | (((v) << 6) & BM_CLKCTRL_HBUS_RSRVD1) | ||
161 | #define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020 | ||
162 | #define BP_CLKCTRL_HBUS_DIV 0 | ||
163 | #define BM_CLKCTRL_HBUS_DIV 0x0000001F | ||
164 | #define BF_CLKCTRL_HBUS_DIV(v) \ | ||
165 | (((v) << 0) & BM_CLKCTRL_HBUS_DIV) | ||
166 | |||
167 | #define HW_CLKCTRL_XBUS (0x00000040) | ||
168 | |||
169 | #define BM_CLKCTRL_XBUS_BUSY 0x80000000 | ||
170 | #define BP_CLKCTRL_XBUS_RSRVD1 11 | ||
171 | #define BM_CLKCTRL_XBUS_RSRVD1 0x7FFFF800 | ||
172 | #define BF_CLKCTRL_XBUS_RSRVD1(v) \ | ||
173 | (((v) << 11) & BM_CLKCTRL_XBUS_RSRVD1) | ||
174 | #define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400 | ||
175 | #define BP_CLKCTRL_XBUS_DIV 0 | ||
176 | #define BM_CLKCTRL_XBUS_DIV 0x000003FF | ||
177 | #define BF_CLKCTRL_XBUS_DIV(v) \ | ||
178 | (((v) << 0) & BM_CLKCTRL_XBUS_DIV) | ||
179 | |||
180 | #define HW_CLKCTRL_XTAL (0x00000050) | ||
181 | #define HW_CLKCTRL_XTAL_SET (0x00000054) | ||
182 | #define HW_CLKCTRL_XTAL_CLR (0x00000058) | ||
183 | #define HW_CLKCTRL_XTAL_TOG (0x0000005c) | ||
184 | |||
185 | #define BP_CLKCTRL_XTAL_UART_CLK_GATE 31 | ||
186 | #define BM_CLKCTRL_XTAL_UART_CLK_GATE 0x80000000 | ||
187 | #define BP_CLKCTRL_XTAL_FILT_CLK24M_GATE 30 | ||
188 | #define BM_CLKCTRL_XTAL_FILT_CLK24M_GATE 0x40000000 | ||
189 | #define BP_CLKCTRL_XTAL_PWM_CLK24M_GATE 29 | ||
190 | #define BM_CLKCTRL_XTAL_PWM_CLK24M_GATE 0x20000000 | ||
191 | #define BM_CLKCTRL_XTAL_DRI_CLK24M_GATE 0x10000000 | ||
192 | #define BM_CLKCTRL_XTAL_DIGCTRL_CLK1M_GATE 0x08000000 | ||
193 | #define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26 | ||
194 | #define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000 | ||
195 | #define BP_CLKCTRL_XTAL_RSRVD1 2 | ||
196 | #define BM_CLKCTRL_XTAL_RSRVD1 0x03FFFFFC | ||
197 | #define BF_CLKCTRL_XTAL_RSRVD1(v) \ | ||
198 | (((v) << 2) & BM_CLKCTRL_XTAL_RSRVD1) | ||
199 | #define BP_CLKCTRL_XTAL_DIV_UART 0 | ||
200 | #define BM_CLKCTRL_XTAL_DIV_UART 0x00000003 | ||
201 | #define BF_CLKCTRL_XTAL_DIV_UART(v) \ | ||
202 | (((v) << 0) & BM_CLKCTRL_XTAL_DIV_UART) | ||
203 | |||
204 | #define HW_CLKCTRL_PIX (0x00000060) | ||
205 | |||
206 | #define BP_CLKCTRL_PIX_CLKGATE 31 | ||
207 | #define BM_CLKCTRL_PIX_CLKGATE 0x80000000 | ||
208 | #define BM_CLKCTRL_PIX_RSRVD2 0x40000000 | ||
209 | #define BM_CLKCTRL_PIX_BUSY 0x20000000 | ||
210 | #define BP_CLKCTRL_PIX_RSRVD1 13 | ||
211 | #define BM_CLKCTRL_PIX_RSRVD1 0x1FFFE000 | ||
212 | #define BF_CLKCTRL_PIX_RSRVD1(v) \ | ||
213 | (((v) << 13) & BM_CLKCTRL_PIX_RSRVD1) | ||
214 | #define BM_CLKCTRL_PIX_DIV_FRAC_EN 0x00001000 | ||
215 | #define BP_CLKCTRL_PIX_DIV 0 | ||
216 | #define BM_CLKCTRL_PIX_DIV 0x00000FFF | ||
217 | #define BF_CLKCTRL_PIX_DIV(v) \ | ||
218 | (((v) << 0) & BM_CLKCTRL_PIX_DIV) | ||
219 | |||
220 | #define HW_CLKCTRL_SSP (0x00000070) | ||
221 | |||
222 | #define BP_CLKCTRL_SSP_CLKGATE 31 | ||
223 | #define BM_CLKCTRL_SSP_CLKGATE 0x80000000 | ||
224 | #define BM_CLKCTRL_SSP_RSRVD2 0x40000000 | ||
225 | #define BM_CLKCTRL_SSP_BUSY 0x20000000 | ||
226 | #define BP_CLKCTRL_SSP_RSRVD1 10 | ||
227 | #define BM_CLKCTRL_SSP_RSRVD1 0x1FFFFC00 | ||
228 | #define BF_CLKCTRL_SSP_RSRVD1(v) \ | ||
229 | (((v) << 10) & BM_CLKCTRL_SSP_RSRVD1) | ||
230 | #define BM_CLKCTRL_SSP_DIV_FRAC_EN 0x00000200 | ||
231 | #define BP_CLKCTRL_SSP_DIV 0 | ||
232 | #define BM_CLKCTRL_SSP_DIV 0x000001FF | ||
233 | #define BF_CLKCTRL_SSP_DIV(v) \ | ||
234 | (((v) << 0) & BM_CLKCTRL_SSP_DIV) | ||
235 | |||
236 | #define HW_CLKCTRL_GPMI (0x00000080) | ||
237 | |||
238 | #define BP_CLKCTRL_GPMI_CLKGATE 31 | ||
239 | #define BM_CLKCTRL_GPMI_CLKGATE 0x80000000 | ||
240 | #define BM_CLKCTRL_GPMI_RSRVD2 0x40000000 | ||
241 | #define BM_CLKCTRL_GPMI_BUSY 0x20000000 | ||
242 | #define BP_CLKCTRL_GPMI_RSRVD1 11 | ||
243 | #define BM_CLKCTRL_GPMI_RSRVD1 0x1FFFF800 | ||
244 | #define BF_CLKCTRL_GPMI_RSRVD1(v) \ | ||
245 | (((v) << 11) & BM_CLKCTRL_GPMI_RSRVD1) | ||
246 | #define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400 | ||
247 | #define BP_CLKCTRL_GPMI_DIV 0 | ||
248 | #define BM_CLKCTRL_GPMI_DIV 0x000003FF | ||
249 | #define BF_CLKCTRL_GPMI_DIV(v) \ | ||
250 | (((v) << 0) & BM_CLKCTRL_GPMI_DIV) | ||
251 | |||
252 | #define HW_CLKCTRL_SPDIF (0x00000090) | ||
253 | |||
254 | #define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000 | ||
255 | #define BP_CLKCTRL_SPDIF_RSRVD 0 | ||
256 | #define BM_CLKCTRL_SPDIF_RSRVD 0x7FFFFFFF | ||
257 | #define BF_CLKCTRL_SPDIF_RSRVD(v) \ | ||
258 | (((v) << 0) & BM_CLKCTRL_SPDIF_RSRVD) | ||
259 | |||
260 | #define HW_CLKCTRL_EMI (0x000000a0) | ||
261 | |||
262 | #define BP_CLKCTRL_EMI_CLKGATE 31 | ||
263 | #define BM_CLKCTRL_EMI_CLKGATE 0x80000000 | ||
264 | #define BM_CLKCTRL_EMI_SYNC_MODE_EN 0x40000000 | ||
265 | #define BM_CLKCTRL_EMI_BUSY_REF_XTAL 0x20000000 | ||
266 | #define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000 | ||
267 | #define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000 | ||
268 | #define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000 | ||
269 | #define BP_CLKCTRL_EMI_RSRVD3 18 | ||
270 | #define BM_CLKCTRL_EMI_RSRVD3 0x03FC0000 | ||
271 | #define BF_CLKCTRL_EMI_RSRVD3(v) \ | ||
272 | (((v) << 18) & BM_CLKCTRL_EMI_RSRVD3) | ||
273 | #define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000 | ||
274 | #define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000 | ||
275 | #define BP_CLKCTRL_EMI_RSRVD2 12 | ||
276 | #define BM_CLKCTRL_EMI_RSRVD2 0x0000F000 | ||
277 | #define BF_CLKCTRL_EMI_RSRVD2(v) \ | ||
278 | (((v) << 12) & BM_CLKCTRL_EMI_RSRVD2) | ||
279 | #define BP_CLKCTRL_EMI_DIV_XTAL 8 | ||
280 | #define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00 | ||
281 | #define BF_CLKCTRL_EMI_DIV_XTAL(v) \ | ||
282 | (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL) | ||
283 | #define BP_CLKCTRL_EMI_RSRVD1 6 | ||
284 | #define BM_CLKCTRL_EMI_RSRVD1 0x000000C0 | ||
285 | #define BF_CLKCTRL_EMI_RSRVD1(v) \ | ||
286 | (((v) << 6) & BM_CLKCTRL_EMI_RSRVD1) | ||
287 | #define BP_CLKCTRL_EMI_DIV_EMI 0 | ||
288 | #define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F | ||
289 | #define BF_CLKCTRL_EMI_DIV_EMI(v) \ | ||
290 | (((v) << 0) & BM_CLKCTRL_EMI_DIV_EMI) | ||
291 | |||
292 | #define HW_CLKCTRL_IR (0x000000b0) | ||
293 | |||
294 | #define BM_CLKCTRL_IR_CLKGATE 0x80000000 | ||
295 | #define BM_CLKCTRL_IR_RSRVD3 0x40000000 | ||
296 | #define BM_CLKCTRL_IR_AUTO_DIV 0x20000000 | ||
297 | #define BM_CLKCTRL_IR_IR_BUSY 0x10000000 | ||
298 | #define BM_CLKCTRL_IR_IROV_BUSY 0x08000000 | ||
299 | #define BP_CLKCTRL_IR_RSRVD2 25 | ||
300 | #define BM_CLKCTRL_IR_RSRVD2 0x06000000 | ||
301 | #define BF_CLKCTRL_IR_RSRVD2(v) \ | ||
302 | (((v) << 25) & BM_CLKCTRL_IR_RSRVD2) | ||
303 | #define BP_CLKCTRL_IR_IROV_DIV 16 | ||
304 | #define BM_CLKCTRL_IR_IROV_DIV 0x01FF0000 | ||
305 | #define BF_CLKCTRL_IR_IROV_DIV(v) \ | ||
306 | (((v) << 16) & BM_CLKCTRL_IR_IROV_DIV) | ||
307 | #define BP_CLKCTRL_IR_RSRVD1 10 | ||
308 | #define BM_CLKCTRL_IR_RSRVD1 0x0000FC00 | ||
309 | #define BF_CLKCTRL_IR_RSRVD1(v) \ | ||
310 | (((v) << 10) & BM_CLKCTRL_IR_RSRVD1) | ||
311 | #define BP_CLKCTRL_IR_IR_DIV 0 | ||
312 | #define BM_CLKCTRL_IR_IR_DIV 0x000003FF | ||
313 | #define BF_CLKCTRL_IR_IR_DIV(v) \ | ||
314 | (((v) << 0) & BM_CLKCTRL_IR_IR_DIV) | ||
315 | |||
316 | #define HW_CLKCTRL_SAIF (0x000000c0) | ||
317 | |||
318 | #define BM_CLKCTRL_SAIF_CLKGATE 0x80000000 | ||
319 | #define BM_CLKCTRL_SAIF_RSRVD2 0x40000000 | ||
320 | #define BM_CLKCTRL_SAIF_BUSY 0x20000000 | ||
321 | #define BP_CLKCTRL_SAIF_RSRVD1 17 | ||
322 | #define BM_CLKCTRL_SAIF_RSRVD1 0x1FFE0000 | ||
323 | #define BF_CLKCTRL_SAIF_RSRVD1(v) \ | ||
324 | (((v) << 17) & BM_CLKCTRL_SAIF_RSRVD1) | ||
325 | #define BM_CLKCTRL_SAIF_DIV_FRAC_EN 0x00010000 | ||
326 | #define BP_CLKCTRL_SAIF_DIV 0 | ||
327 | #define BM_CLKCTRL_SAIF_DIV 0x0000FFFF | ||
328 | #define BF_CLKCTRL_SAIF_DIV(v) \ | ||
329 | (((v) << 0) & BM_CLKCTRL_SAIF_DIV) | ||
330 | |||
331 | #define HW_CLKCTRL_TV (0x000000d0) | ||
332 | |||
333 | #define BM_CLKCTRL_TV_CLK_TV108M_GATE 0x80000000 | ||
334 | #define BM_CLKCTRL_TV_CLK_TV_GATE 0x40000000 | ||
335 | #define BP_CLKCTRL_TV_RSRVD 0 | ||
336 | #define BM_CLKCTRL_TV_RSRVD 0x3FFFFFFF | ||
337 | #define BF_CLKCTRL_TV_RSRVD(v) \ | ||
338 | (((v) << 0) & BM_CLKCTRL_TV_RSRVD) | ||
339 | |||
340 | #define HW_CLKCTRL_ETM (0x000000e0) | ||
341 | |||
342 | #define BM_CLKCTRL_ETM_CLKGATE 0x80000000 | ||
343 | #define BM_CLKCTRL_ETM_RSRVD2 0x40000000 | ||
344 | #define BM_CLKCTRL_ETM_BUSY 0x20000000 | ||
345 | #define BP_CLKCTRL_ETM_RSRVD1 7 | ||
346 | #define BM_CLKCTRL_ETM_RSRVD1 0x1FFFFF80 | ||
347 | #define BF_CLKCTRL_ETM_RSRVD1(v) \ | ||
348 | (((v) << 7) & BM_CLKCTRL_ETM_RSRVD1) | ||
349 | #define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000040 | ||
350 | #define BP_CLKCTRL_ETM_DIV 0 | ||
351 | #define BM_CLKCTRL_ETM_DIV 0x0000003F | ||
352 | #define BF_CLKCTRL_ETM_DIV(v) \ | ||
353 | (((v) << 0) & BM_CLKCTRL_ETM_DIV) | ||
354 | |||
355 | #define HW_CLKCTRL_FRAC (0x000000f0) | ||
356 | #define HW_CLKCTRL_FRAC_SET (0x000000f4) | ||
357 | #define HW_CLKCTRL_FRAC_CLR (0x000000f8) | ||
358 | #define HW_CLKCTRL_FRAC_TOG (0x000000fc) | ||
359 | |||
360 | #define BP_CLKCTRL_FRAC_CLKGATEIO 31 | ||
361 | #define BM_CLKCTRL_FRAC_CLKGATEIO 0x80000000 | ||
362 | #define BM_CLKCTRL_FRAC_IO_STABLE 0x40000000 | ||
363 | #define BP_CLKCTRL_FRAC_IOFRAC 24 | ||
364 | #define BM_CLKCTRL_FRAC_IOFRAC 0x3F000000 | ||
365 | #define BF_CLKCTRL_FRAC_IOFRAC(v) \ | ||
366 | (((v) << 24) & BM_CLKCTRL_FRAC_IOFRAC) | ||
367 | #define BP_CLKCTRL_FRAC_CLKGATEPIX 23 | ||
368 | #define BM_CLKCTRL_FRAC_CLKGATEPIX 0x00800000 | ||
369 | #define BM_CLKCTRL_FRAC_PIX_STABLE 0x00400000 | ||
370 | #define BP_CLKCTRL_FRAC_PIXFRAC 16 | ||
371 | #define BM_CLKCTRL_FRAC_PIXFRAC 0x003F0000 | ||
372 | #define BF_CLKCTRL_FRAC_PIXFRAC(v) \ | ||
373 | (((v) << 16) & BM_CLKCTRL_FRAC_PIXFRAC) | ||
374 | #define BP_CLKCTRL_FRAC_CLKGATEEMI 15 | ||
375 | #define BM_CLKCTRL_FRAC_CLKGATEEMI 0x00008000 | ||
376 | #define BM_CLKCTRL_FRAC_EMI_STABLE 0x00004000 | ||
377 | #define BP_CLKCTRL_FRAC_EMIFRAC 8 | ||
378 | #define BM_CLKCTRL_FRAC_EMIFRAC 0x00003F00 | ||
379 | #define BF_CLKCTRL_FRAC_EMIFRAC(v) \ | ||
380 | (((v) << 8) & BM_CLKCTRL_FRAC_EMIFRAC) | ||
381 | #define BP_CLKCTRL_FRAC_CLKGATECPU 7 | ||
382 | #define BM_CLKCTRL_FRAC_CLKGATECPU 0x00000080 | ||
383 | #define BM_CLKCTRL_FRAC_CPU_STABLE 0x00000040 | ||
384 | #define BP_CLKCTRL_FRAC_CPUFRAC 0 | ||
385 | #define BM_CLKCTRL_FRAC_CPUFRAC 0x0000003F | ||
386 | #define BF_CLKCTRL_FRAC_CPUFRAC(v) \ | ||
387 | (((v) << 0) & BM_CLKCTRL_FRAC_CPUFRAC) | ||
388 | |||
389 | #define HW_CLKCTRL_FRAC1 (0x00000100) | ||
390 | #define HW_CLKCTRL_FRAC1_SET (0x00000104) | ||
391 | #define HW_CLKCTRL_FRAC1_CLR (0x00000108) | ||
392 | #define HW_CLKCTRL_FRAC1_TOG (0x0000010c) | ||
393 | |||
394 | #define BM_CLKCTRL_FRAC1_CLKGATEVID 0x80000000 | ||
395 | #define BM_CLKCTRL_FRAC1_VID_STABLE 0x40000000 | ||
396 | #define BP_CLKCTRL_FRAC1_RSRVD1 0 | ||
397 | #define BM_CLKCTRL_FRAC1_RSRVD1 0x3FFFFFFF | ||
398 | #define BF_CLKCTRL_FRAC1_RSRVD1(v) \ | ||
399 | (((v) << 0) & BM_CLKCTRL_FRAC1_RSRVD1) | ||
400 | |||
401 | #define HW_CLKCTRL_CLKSEQ (0x00000110) | ||
402 | #define HW_CLKCTRL_CLKSEQ_SET (0x00000114) | ||
403 | #define HW_CLKCTRL_CLKSEQ_CLR (0x00000118) | ||
404 | #define HW_CLKCTRL_CLKSEQ_TOG (0x0000011c) | ||
405 | |||
406 | #define BP_CLKCTRL_CLKSEQ_RSRVD1 9 | ||
407 | #define BM_CLKCTRL_CLKSEQ_RSRVD1 0xFFFFFE00 | ||
408 | #define BF_CLKCTRL_CLKSEQ_RSRVD1(v) \ | ||
409 | (((v) << 9) & BM_CLKCTRL_CLKSEQ_RSRVD1) | ||
410 | #define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100 | ||
411 | #define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00000080 | ||
412 | #define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000040 | ||
413 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP 0x00000020 | ||
414 | #define BM_CLKCTRL_CLKSEQ_BYPASS_GPMI 0x00000010 | ||
415 | #define BM_CLKCTRL_CLKSEQ_BYPASS_IR 0x00000008 | ||
416 | #define BM_CLKCTRL_CLKSEQ_RSRVD0 0x00000004 | ||
417 | #define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002 | ||
418 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF 0x00000001 | ||
419 | |||
420 | #define HW_CLKCTRL_RESET (0x00000120) | ||
421 | |||
422 | #define BP_CLKCTRL_RESET_RSRVD 2 | ||
423 | #define BM_CLKCTRL_RESET_RSRVD 0xFFFFFFFC | ||
424 | #define BF_CLKCTRL_RESET_RSRVD(v) \ | ||
425 | (((v) << 2) & BM_CLKCTRL_RESET_RSRVD) | ||
426 | #define BM_CLKCTRL_RESET_CHIP 0x00000002 | ||
427 | #define BM_CLKCTRL_RESET_DIG 0x00000001 | ||
428 | |||
429 | #define HW_CLKCTRL_STATUS (0x00000130) | ||
430 | |||
431 | #define BP_CLKCTRL_STATUS_CPU_LIMIT 30 | ||
432 | #define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000 | ||
433 | #define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \ | ||
434 | (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT) | ||
435 | #define BP_CLKCTRL_STATUS_RSRVD 0 | ||
436 | #define BM_CLKCTRL_STATUS_RSRVD 0x3FFFFFFF | ||
437 | #define BF_CLKCTRL_STATUS_RSRVD(v) \ | ||
438 | (((v) << 0) & BM_CLKCTRL_STATUS_RSRVD) | ||
439 | |||
440 | #define HW_CLKCTRL_VERSION (0x00000140) | ||
441 | |||
442 | #define BP_CLKCTRL_VERSION_MAJOR 24 | ||
443 | #define BM_CLKCTRL_VERSION_MAJOR 0xFF000000 | ||
444 | #define BF_CLKCTRL_VERSION_MAJOR(v) \ | ||
445 | (((v) << 24) & BM_CLKCTRL_VERSION_MAJOR) | ||
446 | #define BP_CLKCTRL_VERSION_MINOR 16 | ||
447 | #define BM_CLKCTRL_VERSION_MINOR 0x00FF0000 | ||
448 | #define BF_CLKCTRL_VERSION_MINOR(v) \ | ||
449 | (((v) << 16) & BM_CLKCTRL_VERSION_MINOR) | ||
450 | #define BP_CLKCTRL_VERSION_STEP 0 | ||
451 | #define BM_CLKCTRL_VERSION_STEP 0x0000FFFF | ||
452 | #define BF_CLKCTRL_VERSION_STEP(v) \ | ||
453 | (((v) << 0) & BM_CLKCTRL_VERSION_STEP) | ||
454 | |||
455 | #endif /* __REGS_CLKCTRL_MX23_H__ */ | ||
diff --git a/arch/arm/mach-mxs/regs-clkctrl-mx28.h b/arch/arm/mach-mxs/regs-clkctrl-mx28.h new file mode 100644 index 000000000000..661df18755f7 --- /dev/null +++ b/arch/arm/mach-mxs/regs-clkctrl-mx28.h | |||
@@ -0,0 +1,663 @@ | |||
1 | /* | ||
2 | * Freescale CLKCTRL Register Definitions | ||
3 | * | ||
4 | * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | * This file is created by xml file. Don't Edit it. | ||
21 | * | ||
22 | * Xml Revision: 1.48 | ||
23 | * Template revision: 26195 | ||
24 | */ | ||
25 | |||
26 | #ifndef __REGS_CLKCTRL_MX28_H__ | ||
27 | #define __REGS_CLKCTRL_MX28_H__ | ||
28 | |||
29 | #define HW_CLKCTRL_PLL0CTRL0 (0x00000000) | ||
30 | #define HW_CLKCTRL_PLL0CTRL0_SET (0x00000004) | ||
31 | #define HW_CLKCTRL_PLL0CTRL0_CLR (0x00000008) | ||
32 | #define HW_CLKCTRL_PLL0CTRL0_TOG (0x0000000c) | ||
33 | |||
34 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD6 30 | ||
35 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD6 0xC0000000 | ||
36 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD6(v) \ | ||
37 | (((v) << 30) & BM_CLKCTRL_PLL0CTRL0_RSRVD6) | ||
38 | #define BP_CLKCTRL_PLL0CTRL0_LFR_SEL 28 | ||
39 | #define BM_CLKCTRL_PLL0CTRL0_LFR_SEL 0x30000000 | ||
40 | #define BF_CLKCTRL_PLL0CTRL0_LFR_SEL(v) \ | ||
41 | (((v) << 28) & BM_CLKCTRL_PLL0CTRL0_LFR_SEL) | ||
42 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__DEFAULT 0x0 | ||
43 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_2 0x1 | ||
44 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_05 0x2 | ||
45 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__UNDEFINED 0x3 | ||
46 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD5 26 | ||
47 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD5 0x0C000000 | ||
48 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD5(v) \ | ||
49 | (((v) << 26) & BM_CLKCTRL_PLL0CTRL0_RSRVD5) | ||
50 | #define BP_CLKCTRL_PLL0CTRL0_CP_SEL 24 | ||
51 | #define BM_CLKCTRL_PLL0CTRL0_CP_SEL 0x03000000 | ||
52 | #define BF_CLKCTRL_PLL0CTRL0_CP_SEL(v) \ | ||
53 | (((v) << 24) & BM_CLKCTRL_PLL0CTRL0_CP_SEL) | ||
54 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__DEFAULT 0x0 | ||
55 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_2 0x1 | ||
56 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_05 0x2 | ||
57 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__UNDEFINED 0x3 | ||
58 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD4 22 | ||
59 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD4 0x00C00000 | ||
60 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD4(v) \ | ||
61 | (((v) << 22) & BM_CLKCTRL_PLL0CTRL0_RSRVD4) | ||
62 | #define BP_CLKCTRL_PLL0CTRL0_DIV_SEL 20 | ||
63 | #define BM_CLKCTRL_PLL0CTRL0_DIV_SEL 0x00300000 | ||
64 | #define BF_CLKCTRL_PLL0CTRL0_DIV_SEL(v) \ | ||
65 | (((v) << 20) & BM_CLKCTRL_PLL0CTRL0_DIV_SEL) | ||
66 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__DEFAULT 0x0 | ||
67 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWER 0x1 | ||
68 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWEST 0x2 | ||
69 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__UNDEFINED 0x3 | ||
70 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD3 0x00080000 | ||
71 | #define BM_CLKCTRL_PLL0CTRL0_EN_USB_CLKS 0x00040000 | ||
72 | #define BM_CLKCTRL_PLL0CTRL0_POWER 0x00020000 | ||
73 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD1 0 | ||
74 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD1 0x0001FFFF | ||
75 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD1(v) \ | ||
76 | (((v) << 0) & BM_CLKCTRL_PLL0CTRL0_RSRVD1) | ||
77 | |||
78 | #define HW_CLKCTRL_PLL0CTRL1 (0x00000010) | ||
79 | |||
80 | #define BM_CLKCTRL_PLL0CTRL1_LOCK 0x80000000 | ||
81 | #define BM_CLKCTRL_PLL0CTRL1_FORCE_LOCK 0x40000000 | ||
82 | #define BP_CLKCTRL_PLL0CTRL1_RSRVD1 16 | ||
83 | #define BM_CLKCTRL_PLL0CTRL1_RSRVD1 0x3FFF0000 | ||
84 | #define BF_CLKCTRL_PLL0CTRL1_RSRVD1(v) \ | ||
85 | (((v) << 16) & BM_CLKCTRL_PLL0CTRL1_RSRVD1) | ||
86 | #define BP_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0 | ||
87 | #define BM_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0x0000FFFF | ||
88 | #define BF_CLKCTRL_PLL0CTRL1_LOCK_COUNT(v) \ | ||
89 | (((v) << 0) & BM_CLKCTRL_PLL0CTRL1_LOCK_COUNT) | ||
90 | |||
91 | #define HW_CLKCTRL_PLL1CTRL0 (0x00000020) | ||
92 | #define HW_CLKCTRL_PLL1CTRL0_SET (0x00000024) | ||
93 | #define HW_CLKCTRL_PLL1CTRL0_CLR (0x00000028) | ||
94 | #define HW_CLKCTRL_PLL1CTRL0_TOG (0x0000002c) | ||
95 | |||
96 | #define BM_CLKCTRL_PLL1CTRL0_CLKGATEEMI 0x80000000 | ||
97 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD6 0x40000000 | ||
98 | #define BP_CLKCTRL_PLL1CTRL0_LFR_SEL 28 | ||
99 | #define BM_CLKCTRL_PLL1CTRL0_LFR_SEL 0x30000000 | ||
100 | #define BF_CLKCTRL_PLL1CTRL0_LFR_SEL(v) \ | ||
101 | (((v) << 28) & BM_CLKCTRL_PLL1CTRL0_LFR_SEL) | ||
102 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__DEFAULT 0x0 | ||
103 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_2 0x1 | ||
104 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_05 0x2 | ||
105 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__UNDEFINED 0x3 | ||
106 | #define BP_CLKCTRL_PLL1CTRL0_RSRVD5 26 | ||
107 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD5 0x0C000000 | ||
108 | #define BF_CLKCTRL_PLL1CTRL0_RSRVD5(v) \ | ||
109 | (((v) << 26) & BM_CLKCTRL_PLL1CTRL0_RSRVD5) | ||
110 | #define BP_CLKCTRL_PLL1CTRL0_CP_SEL 24 | ||
111 | #define BM_CLKCTRL_PLL1CTRL0_CP_SEL 0x03000000 | ||
112 | #define BF_CLKCTRL_PLL1CTRL0_CP_SEL(v) \ | ||
113 | (((v) << 24) & BM_CLKCTRL_PLL1CTRL0_CP_SEL) | ||
114 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__DEFAULT 0x0 | ||
115 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_2 0x1 | ||
116 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_05 0x2 | ||
117 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__UNDEFINED 0x3 | ||
118 | #define BP_CLKCTRL_PLL1CTRL0_RSRVD4 22 | ||
119 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD4 0x00C00000 | ||
120 | #define BF_CLKCTRL_PLL1CTRL0_RSRVD4(v) \ | ||
121 | (((v) << 22) & BM_CLKCTRL_PLL1CTRL0_RSRVD4) | ||
122 | #define BP_CLKCTRL_PLL1CTRL0_DIV_SEL 20 | ||
123 | #define BM_CLKCTRL_PLL1CTRL0_DIV_SEL 0x00300000 | ||
124 | #define BF_CLKCTRL_PLL1CTRL0_DIV_SEL(v) \ | ||
125 | (((v) << 20) & BM_CLKCTRL_PLL1CTRL0_DIV_SEL) | ||
126 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__DEFAULT 0x0 | ||
127 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWER 0x1 | ||
128 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWEST 0x2 | ||
129 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__UNDEFINED 0x3 | ||
130 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD3 0x00080000 | ||
131 | #define BM_CLKCTRL_PLL1CTRL0_EN_USB_CLKS 0x00040000 | ||
132 | #define BM_CLKCTRL_PLL1CTRL0_POWER 0x00020000 | ||
133 | #define BP_CLKCTRL_PLL1CTRL0_RSRVD1 0 | ||
134 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD1 0x0001FFFF | ||
135 | #define BF_CLKCTRL_PLL1CTRL0_RSRVD1(v) \ | ||
136 | (((v) << 0) & BM_CLKCTRL_PLL1CTRL0_RSRVD1) | ||
137 | |||
138 | #define HW_CLKCTRL_PLL1CTRL1 (0x00000030) | ||
139 | |||
140 | #define BM_CLKCTRL_PLL1CTRL1_LOCK 0x80000000 | ||
141 | #define BM_CLKCTRL_PLL1CTRL1_FORCE_LOCK 0x40000000 | ||
142 | #define BP_CLKCTRL_PLL1CTRL1_RSRVD1 16 | ||
143 | #define BM_CLKCTRL_PLL1CTRL1_RSRVD1 0x3FFF0000 | ||
144 | #define BF_CLKCTRL_PLL1CTRL1_RSRVD1(v) \ | ||
145 | (((v) << 16) & BM_CLKCTRL_PLL1CTRL1_RSRVD1) | ||
146 | #define BP_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0 | ||
147 | #define BM_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0x0000FFFF | ||
148 | #define BF_CLKCTRL_PLL1CTRL1_LOCK_COUNT(v) \ | ||
149 | (((v) << 0) & BM_CLKCTRL_PLL1CTRL1_LOCK_COUNT) | ||
150 | |||
151 | #define HW_CLKCTRL_PLL2CTRL0 (0x00000040) | ||
152 | #define HW_CLKCTRL_PLL2CTRL0_SET (0x00000044) | ||
153 | #define HW_CLKCTRL_PLL2CTRL0_CLR (0x00000048) | ||
154 | #define HW_CLKCTRL_PLL2CTRL0_TOG (0x0000004c) | ||
155 | |||
156 | #define BM_CLKCTRL_PLL2CTRL0_CLKGATE 0x80000000 | ||
157 | #define BM_CLKCTRL_PLL2CTRL0_RSRVD3 0x40000000 | ||
158 | #define BP_CLKCTRL_PLL2CTRL0_LFR_SEL 28 | ||
159 | #define BM_CLKCTRL_PLL2CTRL0_LFR_SEL 0x30000000 | ||
160 | #define BF_CLKCTRL_PLL2CTRL0_LFR_SEL(v) \ | ||
161 | (((v) << 28) & BM_CLKCTRL_PLL2CTRL0_LFR_SEL) | ||
162 | #define BM_CLKCTRL_PLL2CTRL0_RSRVD2 0x08000000 | ||
163 | #define BM_CLKCTRL_PLL2CTRL0_HOLD_RING_OFF_B 0x04000000 | ||
164 | #define BP_CLKCTRL_PLL2CTRL0_CP_SEL 24 | ||
165 | #define BM_CLKCTRL_PLL2CTRL0_CP_SEL 0x03000000 | ||
166 | #define BF_CLKCTRL_PLL2CTRL0_CP_SEL(v) \ | ||
167 | (((v) << 24) & BM_CLKCTRL_PLL2CTRL0_CP_SEL) | ||
168 | #define BM_CLKCTRL_PLL2CTRL0_POWER 0x00800000 | ||
169 | #define BP_CLKCTRL_PLL2CTRL0_RSRVD1 0 | ||
170 | #define BM_CLKCTRL_PLL2CTRL0_RSRVD1 0x007FFFFF | ||
171 | #define BF_CLKCTRL_PLL2CTRL0_RSRVD1(v) \ | ||
172 | (((v) << 0) & BM_CLKCTRL_PLL2CTRL0_RSRVD1) | ||
173 | |||
174 | #define HW_CLKCTRL_CPU (0x00000050) | ||
175 | #define HW_CLKCTRL_CPU_SET (0x00000054) | ||
176 | #define HW_CLKCTRL_CPU_CLR (0x00000058) | ||
177 | #define HW_CLKCTRL_CPU_TOG (0x0000005c) | ||
178 | |||
179 | #define BP_CLKCTRL_CPU_RSRVD5 30 | ||
180 | #define BM_CLKCTRL_CPU_RSRVD5 0xC0000000 | ||
181 | #define BF_CLKCTRL_CPU_RSRVD5(v) \ | ||
182 | (((v) << 30) & BM_CLKCTRL_CPU_RSRVD5) | ||
183 | #define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000 | ||
184 | #define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000 | ||
185 | #define BM_CLKCTRL_CPU_RSRVD4 0x08000000 | ||
186 | #define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000 | ||
187 | #define BP_CLKCTRL_CPU_DIV_XTAL 16 | ||
188 | #define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000 | ||
189 | #define BF_CLKCTRL_CPU_DIV_XTAL(v) \ | ||
190 | (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL) | ||
191 | #define BP_CLKCTRL_CPU_RSRVD3 13 | ||
192 | #define BM_CLKCTRL_CPU_RSRVD3 0x0000E000 | ||
193 | #define BF_CLKCTRL_CPU_RSRVD3(v) \ | ||
194 | (((v) << 13) & BM_CLKCTRL_CPU_RSRVD3) | ||
195 | #define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000 | ||
196 | #define BM_CLKCTRL_CPU_RSRVD2 0x00000800 | ||
197 | #define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400 | ||
198 | #define BP_CLKCTRL_CPU_RSRVD1 6 | ||
199 | #define BM_CLKCTRL_CPU_RSRVD1 0x000003C0 | ||
200 | #define BF_CLKCTRL_CPU_RSRVD1(v) \ | ||
201 | (((v) << 6) & BM_CLKCTRL_CPU_RSRVD1) | ||
202 | #define BP_CLKCTRL_CPU_DIV_CPU 0 | ||
203 | #define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F | ||
204 | #define BF_CLKCTRL_CPU_DIV_CPU(v) \ | ||
205 | (((v) << 0) & BM_CLKCTRL_CPU_DIV_CPU) | ||
206 | |||
207 | #define HW_CLKCTRL_HBUS (0x00000060) | ||
208 | #define HW_CLKCTRL_HBUS_SET (0x00000064) | ||
209 | #define HW_CLKCTRL_HBUS_CLR (0x00000068) | ||
210 | #define HW_CLKCTRL_HBUS_TOG (0x0000006c) | ||
211 | |||
212 | #define BM_CLKCTRL_HBUS_ASM_BUSY 0x80000000 | ||
213 | #define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x40000000 | ||
214 | #define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x20000000 | ||
215 | #define BM_CLKCTRL_HBUS_RSRVD2 0x10000000 | ||
216 | #define BM_CLKCTRL_HBUS_ASM_EMIPORT_AS_ENABLE 0x08000000 | ||
217 | #define BM_CLKCTRL_HBUS_APBHDMA_AS_ENABLE 0x04000000 | ||
218 | #define BM_CLKCTRL_HBUS_APBXDMA_AS_ENABLE 0x02000000 | ||
219 | #define BM_CLKCTRL_HBUS_TRAFFIC_JAM_AS_ENABLE 0x01000000 | ||
220 | #define BM_CLKCTRL_HBUS_TRAFFIC_AS_ENABLE 0x00800000 | ||
221 | #define BM_CLKCTRL_HBUS_CPU_DATA_AS_ENABLE 0x00400000 | ||
222 | #define BM_CLKCTRL_HBUS_CPU_INSTR_AS_ENABLE 0x00200000 | ||
223 | #define BM_CLKCTRL_HBUS_ASM_ENABLE 0x00100000 | ||
224 | #define BM_CLKCTRL_HBUS_AUTO_CLEAR_DIV_ENABLE 0x00080000 | ||
225 | #define BP_CLKCTRL_HBUS_SLOW_DIV 16 | ||
226 | #define BM_CLKCTRL_HBUS_SLOW_DIV 0x00070000 | ||
227 | #define BF_CLKCTRL_HBUS_SLOW_DIV(v) \ | ||
228 | (((v) << 16) & BM_CLKCTRL_HBUS_SLOW_DIV) | ||
229 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY1 0x0 | ||
230 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY2 0x1 | ||
231 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY4 0x2 | ||
232 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3 | ||
233 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4 | ||
234 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5 | ||
235 | #define BP_CLKCTRL_HBUS_RSRVD1 6 | ||
236 | #define BM_CLKCTRL_HBUS_RSRVD1 0x0000FFC0 | ||
237 | #define BF_CLKCTRL_HBUS_RSRVD1(v) \ | ||
238 | (((v) << 6) & BM_CLKCTRL_HBUS_RSRVD1) | ||
239 | #define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020 | ||
240 | #define BP_CLKCTRL_HBUS_DIV 0 | ||
241 | #define BM_CLKCTRL_HBUS_DIV 0x0000001F | ||
242 | #define BF_CLKCTRL_HBUS_DIV(v) \ | ||
243 | (((v) << 0) & BM_CLKCTRL_HBUS_DIV) | ||
244 | |||
245 | #define HW_CLKCTRL_XBUS (0x00000070) | ||
246 | |||
247 | #define BM_CLKCTRL_XBUS_BUSY 0x80000000 | ||
248 | #define BP_CLKCTRL_XBUS_RSRVD1 12 | ||
249 | #define BM_CLKCTRL_XBUS_RSRVD1 0x7FFFF000 | ||
250 | #define BF_CLKCTRL_XBUS_RSRVD1(v) \ | ||
251 | (((v) << 12) & BM_CLKCTRL_XBUS_RSRVD1) | ||
252 | #define BM_CLKCTRL_XBUS_AUTO_CLEAR_DIV_ENABLE 0x00000800 | ||
253 | #define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400 | ||
254 | #define BP_CLKCTRL_XBUS_DIV 0 | ||
255 | #define BM_CLKCTRL_XBUS_DIV 0x000003FF | ||
256 | #define BF_CLKCTRL_XBUS_DIV(v) \ | ||
257 | (((v) << 0) & BM_CLKCTRL_XBUS_DIV) | ||
258 | |||
259 | #define HW_CLKCTRL_XTAL (0x00000080) | ||
260 | #define HW_CLKCTRL_XTAL_SET (0x00000084) | ||
261 | #define HW_CLKCTRL_XTAL_CLR (0x00000088) | ||
262 | #define HW_CLKCTRL_XTAL_TOG (0x0000008c) | ||
263 | |||
264 | #define BP_CLKCTRL_XTAL_UART_CLK_GATE 31 | ||
265 | #define BM_CLKCTRL_XTAL_UART_CLK_GATE 0x80000000 | ||
266 | #define BM_CLKCTRL_XTAL_RSRVD3 0x40000000 | ||
267 | #define BP_CLKCTRL_XTAL_PWM_CLK24M_GATE 29 | ||
268 | #define BM_CLKCTRL_XTAL_PWM_CLK24M_GATE 0x20000000 | ||
269 | #define BP_CLKCTRL_XTAL_RSRVD2 27 | ||
270 | #define BM_CLKCTRL_XTAL_RSRVD2 0x18000000 | ||
271 | #define BF_CLKCTRL_XTAL_RSRVD2(v) \ | ||
272 | (((v) << 27) & BM_CLKCTRL_XTAL_RSRVD2) | ||
273 | #define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26 | ||
274 | #define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000 | ||
275 | #define BP_CLKCTRL_XTAL_RSRVD1 2 | ||
276 | #define BM_CLKCTRL_XTAL_RSRVD1 0x03FFFFFC | ||
277 | #define BF_CLKCTRL_XTAL_RSRVD1(v) \ | ||
278 | (((v) << 2) & BM_CLKCTRL_XTAL_RSRVD1) | ||
279 | #define BP_CLKCTRL_XTAL_DIV_UART 0 | ||
280 | #define BM_CLKCTRL_XTAL_DIV_UART 0x00000003 | ||
281 | #define BF_CLKCTRL_XTAL_DIV_UART(v) \ | ||
282 | (((v) << 0) & BM_CLKCTRL_XTAL_DIV_UART) | ||
283 | |||
284 | #define HW_CLKCTRL_SSP0 (0x00000090) | ||
285 | |||
286 | #define BP_CLKCTRL_SSP0_CLKGATE 31 | ||
287 | #define BM_CLKCTRL_SSP0_CLKGATE 0x80000000 | ||
288 | #define BM_CLKCTRL_SSP0_RSRVD2 0x40000000 | ||
289 | #define BM_CLKCTRL_SSP0_BUSY 0x20000000 | ||
290 | #define BP_CLKCTRL_SSP0_RSRVD1 10 | ||
291 | #define BM_CLKCTRL_SSP0_RSRVD1 0x1FFFFC00 | ||
292 | #define BF_CLKCTRL_SSP0_RSRVD1(v) \ | ||
293 | (((v) << 10) & BM_CLKCTRL_SSP0_RSRVD1) | ||
294 | #define BM_CLKCTRL_SSP0_DIV_FRAC_EN 0x00000200 | ||
295 | #define BP_CLKCTRL_SSP0_DIV 0 | ||
296 | #define BM_CLKCTRL_SSP0_DIV 0x000001FF | ||
297 | #define BF_CLKCTRL_SSP0_DIV(v) \ | ||
298 | (((v) << 0) & BM_CLKCTRL_SSP0_DIV) | ||
299 | |||
300 | #define HW_CLKCTRL_SSP1 (0x000000a0) | ||
301 | |||
302 | #define BP_CLKCTRL_SSP1_CLKGATE 31 | ||
303 | #define BM_CLKCTRL_SSP1_CLKGATE 0x80000000 | ||
304 | #define BM_CLKCTRL_SSP1_RSRVD2 0x40000000 | ||
305 | #define BM_CLKCTRL_SSP1_BUSY 0x20000000 | ||
306 | #define BP_CLKCTRL_SSP1_RSRVD1 10 | ||
307 | #define BM_CLKCTRL_SSP1_RSRVD1 0x1FFFFC00 | ||
308 | #define BF_CLKCTRL_SSP1_RSRVD1(v) \ | ||
309 | (((v) << 10) & BM_CLKCTRL_SSP1_RSRVD1) | ||
310 | #define BM_CLKCTRL_SSP1_DIV_FRAC_EN 0x00000200 | ||
311 | #define BP_CLKCTRL_SSP1_DIV 0 | ||
312 | #define BM_CLKCTRL_SSP1_DIV 0x000001FF | ||
313 | #define BF_CLKCTRL_SSP1_DIV(v) \ | ||
314 | (((v) << 0) & BM_CLKCTRL_SSP1_DIV) | ||
315 | |||
316 | #define HW_CLKCTRL_SSP2 (0x000000b0) | ||
317 | |||
318 | #define BP_CLKCTRL_SSP2_CLKGATE 31 | ||
319 | #define BM_CLKCTRL_SSP2_CLKGATE 0x80000000 | ||
320 | #define BM_CLKCTRL_SSP2_RSRVD2 0x40000000 | ||
321 | #define BM_CLKCTRL_SSP2_BUSY 0x20000000 | ||
322 | #define BP_CLKCTRL_SSP2_RSRVD1 10 | ||
323 | #define BM_CLKCTRL_SSP2_RSRVD1 0x1FFFFC00 | ||
324 | #define BF_CLKCTRL_SSP2_RSRVD1(v) \ | ||
325 | (((v) << 10) & BM_CLKCTRL_SSP2_RSRVD1) | ||
326 | #define BM_CLKCTRL_SSP2_DIV_FRAC_EN 0x00000200 | ||
327 | #define BP_CLKCTRL_SSP2_DIV 0 | ||
328 | #define BM_CLKCTRL_SSP2_DIV 0x000001FF | ||
329 | #define BF_CLKCTRL_SSP2_DIV(v) \ | ||
330 | (((v) << 0) & BM_CLKCTRL_SSP2_DIV) | ||
331 | |||
332 | #define HW_CLKCTRL_SSP3 (0x000000c0) | ||
333 | |||
334 | #define BP_CLKCTRL_SSP3_CLKGATE 31 | ||
335 | #define BM_CLKCTRL_SSP3_CLKGATE 0x80000000 | ||
336 | #define BM_CLKCTRL_SSP3_RSRVD2 0x40000000 | ||
337 | #define BM_CLKCTRL_SSP3_BUSY 0x20000000 | ||
338 | #define BP_CLKCTRL_SSP3_RSRVD1 10 | ||
339 | #define BM_CLKCTRL_SSP3_RSRVD1 0x1FFFFC00 | ||
340 | #define BF_CLKCTRL_SSP3_RSRVD1(v) \ | ||
341 | (((v) << 10) & BM_CLKCTRL_SSP3_RSRVD1) | ||
342 | #define BM_CLKCTRL_SSP3_DIV_FRAC_EN 0x00000200 | ||
343 | #define BP_CLKCTRL_SSP3_DIV 0 | ||
344 | #define BM_CLKCTRL_SSP3_DIV 0x000001FF | ||
345 | #define BF_CLKCTRL_SSP3_DIV(v) \ | ||
346 | (((v) << 0) & BM_CLKCTRL_SSP3_DIV) | ||
347 | |||
348 | #define HW_CLKCTRL_GPMI (0x000000d0) | ||
349 | |||
350 | #define BP_CLKCTRL_GPMI_CLKGATE 31 | ||
351 | #define BM_CLKCTRL_GPMI_CLKGATE 0x80000000 | ||
352 | #define BM_CLKCTRL_GPMI_RSRVD2 0x40000000 | ||
353 | #define BM_CLKCTRL_GPMI_BUSY 0x20000000 | ||
354 | #define BP_CLKCTRL_GPMI_RSRVD1 11 | ||
355 | #define BM_CLKCTRL_GPMI_RSRVD1 0x1FFFF800 | ||
356 | #define BF_CLKCTRL_GPMI_RSRVD1(v) \ | ||
357 | (((v) << 11) & BM_CLKCTRL_GPMI_RSRVD1) | ||
358 | #define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400 | ||
359 | #define BP_CLKCTRL_GPMI_DIV 0 | ||
360 | #define BM_CLKCTRL_GPMI_DIV 0x000003FF | ||
361 | #define BF_CLKCTRL_GPMI_DIV(v) \ | ||
362 | (((v) << 0) & BM_CLKCTRL_GPMI_DIV) | ||
363 | |||
364 | #define HW_CLKCTRL_SPDIF (0x000000e0) | ||
365 | |||
366 | #define BP_CLKCTRL_SPDIF_CLKGATE 31 | ||
367 | #define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000 | ||
368 | #define BP_CLKCTRL_SPDIF_RSRVD 0 | ||
369 | #define BM_CLKCTRL_SPDIF_RSRVD 0x7FFFFFFF | ||
370 | #define BF_CLKCTRL_SPDIF_RSRVD(v) \ | ||
371 | (((v) << 0) & BM_CLKCTRL_SPDIF_RSRVD) | ||
372 | |||
373 | #define HW_CLKCTRL_EMI (0x000000f0) | ||
374 | |||
375 | #define BP_CLKCTRL_EMI_CLKGATE 31 | ||
376 | #define BM_CLKCTRL_EMI_CLKGATE 0x80000000 | ||
377 | #define BM_CLKCTRL_EMI_SYNC_MODE_EN 0x40000000 | ||
378 | #define BM_CLKCTRL_EMI_BUSY_REF_XTAL 0x20000000 | ||
379 | #define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000 | ||
380 | #define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000 | ||
381 | #define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000 | ||
382 | #define BP_CLKCTRL_EMI_RSRVD3 18 | ||
383 | #define BM_CLKCTRL_EMI_RSRVD3 0x03FC0000 | ||
384 | #define BF_CLKCTRL_EMI_RSRVD3(v) \ | ||
385 | (((v) << 18) & BM_CLKCTRL_EMI_RSRVD3) | ||
386 | #define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000 | ||
387 | #define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000 | ||
388 | #define BP_CLKCTRL_EMI_RSRVD2 12 | ||
389 | #define BM_CLKCTRL_EMI_RSRVD2 0x0000F000 | ||
390 | #define BF_CLKCTRL_EMI_RSRVD2(v) \ | ||
391 | (((v) << 12) & BM_CLKCTRL_EMI_RSRVD2) | ||
392 | #define BP_CLKCTRL_EMI_DIV_XTAL 8 | ||
393 | #define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00 | ||
394 | #define BF_CLKCTRL_EMI_DIV_XTAL(v) \ | ||
395 | (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL) | ||
396 | #define BP_CLKCTRL_EMI_RSRVD1 6 | ||
397 | #define BM_CLKCTRL_EMI_RSRVD1 0x000000C0 | ||
398 | #define BF_CLKCTRL_EMI_RSRVD1(v) \ | ||
399 | (((v) << 6) & BM_CLKCTRL_EMI_RSRVD1) | ||
400 | #define BP_CLKCTRL_EMI_DIV_EMI 0 | ||
401 | #define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F | ||
402 | #define BF_CLKCTRL_EMI_DIV_EMI(v) \ | ||
403 | (((v) << 0) & BM_CLKCTRL_EMI_DIV_EMI) | ||
404 | |||
405 | #define HW_CLKCTRL_SAIF0 (0x00000100) | ||
406 | |||
407 | #define BP_CLKCTRL_SAIF0_CLKGATE 31 | ||
408 | #define BM_CLKCTRL_SAIF0_CLKGATE 0x80000000 | ||
409 | #define BM_CLKCTRL_SAIF0_RSRVD2 0x40000000 | ||
410 | #define BM_CLKCTRL_SAIF0_BUSY 0x20000000 | ||
411 | #define BP_CLKCTRL_SAIF0_RSRVD1 17 | ||
412 | #define BM_CLKCTRL_SAIF0_RSRVD1 0x1FFE0000 | ||
413 | #define BF_CLKCTRL_SAIF0_RSRVD1(v) \ | ||
414 | (((v) << 17) & BM_CLKCTRL_SAIF0_RSRVD1) | ||
415 | #define BM_CLKCTRL_SAIF0_DIV_FRAC_EN 0x00010000 | ||
416 | #define BP_CLKCTRL_SAIF0_DIV 0 | ||
417 | #define BM_CLKCTRL_SAIF0_DIV 0x0000FFFF | ||
418 | #define BF_CLKCTRL_SAIF0_DIV(v) \ | ||
419 | (((v) << 0) & BM_CLKCTRL_SAIF0_DIV) | ||
420 | |||
421 | #define HW_CLKCTRL_SAIF1 (0x00000110) | ||
422 | |||
423 | #define BP_CLKCTRL_SAIF1_CLKGATE 31 | ||
424 | #define BM_CLKCTRL_SAIF1_CLKGATE 0x80000000 | ||
425 | #define BM_CLKCTRL_SAIF1_RSRVD2 0x40000000 | ||
426 | #define BM_CLKCTRL_SAIF1_BUSY 0x20000000 | ||
427 | #define BP_CLKCTRL_SAIF1_RSRVD1 17 | ||
428 | #define BM_CLKCTRL_SAIF1_RSRVD1 0x1FFE0000 | ||
429 | #define BF_CLKCTRL_SAIF1_RSRVD1(v) \ | ||
430 | (((v) << 17) & BM_CLKCTRL_SAIF1_RSRVD1) | ||
431 | #define BM_CLKCTRL_SAIF1_DIV_FRAC_EN 0x00010000 | ||
432 | #define BP_CLKCTRL_SAIF1_DIV 0 | ||
433 | #define BM_CLKCTRL_SAIF1_DIV 0x0000FFFF | ||
434 | #define BF_CLKCTRL_SAIF1_DIV(v) \ | ||
435 | (((v) << 0) & BM_CLKCTRL_SAIF1_DIV) | ||
436 | |||
437 | #define HW_CLKCTRL_DIS_LCDIF (0x00000120) | ||
438 | |||
439 | #define BP_CLKCTRL_DIS_LCDIF_CLKGATE 31 | ||
440 | #define BM_CLKCTRL_DIS_LCDIF_CLKGATE 0x80000000 | ||
441 | #define BM_CLKCTRL_DIS_LCDIF_RSRVD2 0x40000000 | ||
442 | #define BM_CLKCTRL_DIS_LCDIF_BUSY 0x20000000 | ||
443 | #define BP_CLKCTRL_DIS_LCDIF_RSRVD1 14 | ||
444 | #define BM_CLKCTRL_DIS_LCDIF_RSRVD1 0x1FFFC000 | ||
445 | #define BF_CLKCTRL_DIS_LCDIF_RSRVD1(v) \ | ||
446 | (((v) << 14) & BM_CLKCTRL_DIS_LCDIF_RSRVD1) | ||
447 | #define BM_CLKCTRL_DIS_LCDIF_DIV_FRAC_EN 0x00002000 | ||
448 | #define BP_CLKCTRL_DIS_LCDIF_DIV 0 | ||
449 | #define BM_CLKCTRL_DIS_LCDIF_DIV 0x00001FFF | ||
450 | #define BF_CLKCTRL_DIS_LCDIF_DIV(v) \ | ||
451 | (((v) << 0) & BM_CLKCTRL_DIS_LCDIF_DIV) | ||
452 | |||
453 | #define HW_CLKCTRL_ETM (0x00000130) | ||
454 | |||
455 | #define BM_CLKCTRL_ETM_CLKGATE 0x80000000 | ||
456 | #define BM_CLKCTRL_ETM_RSRVD2 0x40000000 | ||
457 | #define BM_CLKCTRL_ETM_BUSY 0x20000000 | ||
458 | #define BP_CLKCTRL_ETM_RSRVD1 8 | ||
459 | #define BM_CLKCTRL_ETM_RSRVD1 0x1FFFFF00 | ||
460 | #define BF_CLKCTRL_ETM_RSRVD1(v) \ | ||
461 | (((v) << 8) & BM_CLKCTRL_ETM_RSRVD1) | ||
462 | #define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000080 | ||
463 | #define BP_CLKCTRL_ETM_DIV 0 | ||
464 | #define BM_CLKCTRL_ETM_DIV 0x0000007F | ||
465 | #define BF_CLKCTRL_ETM_DIV(v) \ | ||
466 | (((v) << 0) & BM_CLKCTRL_ETM_DIV) | ||
467 | |||
468 | #define HW_CLKCTRL_ENET (0x00000140) | ||
469 | |||
470 | #define BM_CLKCTRL_ENET_SLEEP 0x80000000 | ||
471 | #define BP_CLKCTRL_ENET_DISABLE 30 | ||
472 | #define BM_CLKCTRL_ENET_DISABLE 0x40000000 | ||
473 | #define BM_CLKCTRL_ENET_STATUS 0x20000000 | ||
474 | #define BM_CLKCTRL_ENET_RSRVD1 0x10000000 | ||
475 | #define BM_CLKCTRL_ENET_BUSY_TIME 0x08000000 | ||
476 | #define BP_CLKCTRL_ENET_DIV_TIME 21 | ||
477 | #define BM_CLKCTRL_ENET_DIV_TIME 0x07E00000 | ||
478 | #define BF_CLKCTRL_ENET_DIV_TIME(v) \ | ||
479 | (((v) << 21) & BM_CLKCTRL_ENET_DIV_TIME) | ||
480 | #define BM_CLKCTRL_ENET_BUSY 0x08000000 | ||
481 | #define BP_CLKCTRL_ENET_DIV 21 | ||
482 | #define BM_CLKCTRL_ENET_DIV 0x07E00000 | ||
483 | #define BF_CLKCTRL_ENET_DIV(v) \ | ||
484 | (((v) << 21) & BM_CLKCTRL_ENET_DIV) | ||
485 | #define BP_CLKCTRL_ENET_TIME_SEL 19 | ||
486 | #define BM_CLKCTRL_ENET_TIME_SEL 0x00180000 | ||
487 | #define BF_CLKCTRL_ENET_TIME_SEL(v) \ | ||
488 | (((v) << 19) & BM_CLKCTRL_ENET_TIME_SEL) | ||
489 | #define BV_CLKCTRL_ENET_TIME_SEL__XTAL 0x0 | ||
490 | #define BV_CLKCTRL_ENET_TIME_SEL__PLL 0x1 | ||
491 | #define BV_CLKCTRL_ENET_TIME_SEL__RMII_CLK 0x2 | ||
492 | #define BV_CLKCTRL_ENET_TIME_SEL__UNDEFINED 0x3 | ||
493 | #define BM_CLKCTRL_ENET_CLK_OUT_EN 0x00040000 | ||
494 | #define BM_CLKCTRL_ENET_RESET_BY_SW_CHIP 0x00020000 | ||
495 | #define BM_CLKCTRL_ENET_RESET_BY_SW 0x00010000 | ||
496 | #define BP_CLKCTRL_ENET_RSRVD0 0 | ||
497 | #define BM_CLKCTRL_ENET_RSRVD0 0x0000FFFF | ||
498 | #define BF_CLKCTRL_ENET_RSRVD0(v) \ | ||
499 | (((v) << 0) & BM_CLKCTRL_ENET_RSRVD0) | ||
500 | |||
501 | #define HW_CLKCTRL_HSADC (0x00000150) | ||
502 | |||
503 | #define BM_CLKCTRL_HSADC_RSRVD2 0x80000000 | ||
504 | #define BM_CLKCTRL_HSADC_RESETB 0x40000000 | ||
505 | #define BP_CLKCTRL_HSADC_FREQDIV 28 | ||
506 | #define BM_CLKCTRL_HSADC_FREQDIV 0x30000000 | ||
507 | #define BF_CLKCTRL_HSADC_FREQDIV(v) \ | ||
508 | (((v) << 28) & BM_CLKCTRL_HSADC_FREQDIV) | ||
509 | #define BP_CLKCTRL_HSADC_RSRVD1 0 | ||
510 | #define BM_CLKCTRL_HSADC_RSRVD1 0x0FFFFFFF | ||
511 | #define BF_CLKCTRL_HSADC_RSRVD1(v) \ | ||
512 | (((v) << 0) & BM_CLKCTRL_HSADC_RSRVD1) | ||
513 | |||
514 | #define HW_CLKCTRL_FLEXCAN (0x00000160) | ||
515 | |||
516 | #define BM_CLKCTRL_FLEXCAN_RSRVD2 0x80000000 | ||
517 | #define BP_CLKCTRL_FLEXCAN_STOP_CAN0 30 | ||
518 | #define BM_CLKCTRL_FLEXCAN_STOP_CAN0 0x40000000 | ||
519 | #define BM_CLKCTRL_FLEXCAN_CAN0_STATUS 0x20000000 | ||
520 | #define BP_CLKCTRL_FLEXCAN_STOP_CAN1 28 | ||
521 | #define BM_CLKCTRL_FLEXCAN_STOP_CAN1 0x10000000 | ||
522 | #define BM_CLKCTRL_FLEXCAN_CAN1_STATUS 0x08000000 | ||
523 | #define BP_CLKCTRL_FLEXCAN_RSRVD1 0 | ||
524 | #define BM_CLKCTRL_FLEXCAN_RSRVD1 0x07FFFFFF | ||
525 | #define BF_CLKCTRL_FLEXCAN_RSRVD1(v) \ | ||
526 | (((v) << 0) & BM_CLKCTRL_FLEXCAN_RSRVD1) | ||
527 | |||
528 | #define HW_CLKCTRL_FRAC0 (0x000001b0) | ||
529 | #define HW_CLKCTRL_FRAC0_SET (0x000001b4) | ||
530 | #define HW_CLKCTRL_FRAC0_CLR (0x000001b8) | ||
531 | #define HW_CLKCTRL_FRAC0_TOG (0x000001bc) | ||
532 | |||
533 | #define BP_CLKCTRL_FRAC0_CLKGATEIO0 31 | ||
534 | #define BM_CLKCTRL_FRAC0_CLKGATEIO0 0x80000000 | ||
535 | #define BM_CLKCTRL_FRAC0_IO0_STABLE 0x40000000 | ||
536 | #define BP_CLKCTRL_FRAC0_IO0FRAC 24 | ||
537 | #define BM_CLKCTRL_FRAC0_IO0FRAC 0x3F000000 | ||
538 | #define BF_CLKCTRL_FRAC0_IO0FRAC(v) \ | ||
539 | (((v) << 24) & BM_CLKCTRL_FRAC0_IO0FRAC) | ||
540 | #define BP_CLKCTRL_FRAC0_CLKGATEIO1 23 | ||
541 | #define BM_CLKCTRL_FRAC0_CLKGATEIO1 0x00800000 | ||
542 | #define BM_CLKCTRL_FRAC0_IO1_STABLE 0x00400000 | ||
543 | #define BP_CLKCTRL_FRAC0_IO1FRAC 16 | ||
544 | #define BM_CLKCTRL_FRAC0_IO1FRAC 0x003F0000 | ||
545 | #define BF_CLKCTRL_FRAC0_IO1FRAC(v) \ | ||
546 | (((v) << 16) & BM_CLKCTRL_FRAC0_IO1FRAC) | ||
547 | #define BP_CLKCTRL_FRAC0_CLKGATEEMI 15 | ||
548 | #define BM_CLKCTRL_FRAC0_CLKGATEEMI 0x00008000 | ||
549 | #define BM_CLKCTRL_FRAC0_EMI_STABLE 0x00004000 | ||
550 | #define BP_CLKCTRL_FRAC0_EMIFRAC 8 | ||
551 | #define BM_CLKCTRL_FRAC0_EMIFRAC 0x00003F00 | ||
552 | #define BF_CLKCTRL_FRAC0_EMIFRAC(v) \ | ||
553 | (((v) << 8) & BM_CLKCTRL_FRAC0_EMIFRAC) | ||
554 | #define BP_CLKCTRL_FRAC0_CLKGATECPU 7 | ||
555 | #define BM_CLKCTRL_FRAC0_CLKGATECPU 0x00000080 | ||
556 | #define BM_CLKCTRL_FRAC0_CPU_STABLE 0x00000040 | ||
557 | #define BP_CLKCTRL_FRAC0_CPUFRAC 0 | ||
558 | #define BM_CLKCTRL_FRAC0_CPUFRAC 0x0000003F | ||
559 | #define BF_CLKCTRL_FRAC0_CPUFRAC(v) \ | ||
560 | (((v) << 0) & BM_CLKCTRL_FRAC0_CPUFRAC) | ||
561 | |||
562 | #define HW_CLKCTRL_FRAC1 (0x000001c0) | ||
563 | #define HW_CLKCTRL_FRAC1_SET (0x000001c4) | ||
564 | #define HW_CLKCTRL_FRAC1_CLR (0x000001c8) | ||
565 | #define HW_CLKCTRL_FRAC1_TOG (0x000001cc) | ||
566 | |||
567 | #define BP_CLKCTRL_FRAC1_RSRVD2 24 | ||
568 | #define BM_CLKCTRL_FRAC1_RSRVD2 0xFF000000 | ||
569 | #define BF_CLKCTRL_FRAC1_RSRVD2(v) \ | ||
570 | (((v) << 24) & BM_CLKCTRL_FRAC1_RSRVD2) | ||
571 | #define BP_CLKCTRL_FRAC1_CLKGATEGPMI 23 | ||
572 | #define BM_CLKCTRL_FRAC1_CLKGATEGPMI 0x00800000 | ||
573 | #define BM_CLKCTRL_FRAC1_GPMI_STABLE 0x00400000 | ||
574 | #define BP_CLKCTRL_FRAC1_GPMIFRAC 16 | ||
575 | #define BM_CLKCTRL_FRAC1_GPMIFRAC 0x003F0000 | ||
576 | #define BF_CLKCTRL_FRAC1_GPMIFRAC(v) \ | ||
577 | (((v) << 16) & BM_CLKCTRL_FRAC1_GPMIFRAC) | ||
578 | #define BP_CLKCTRL_FRAC1_CLKGATEHSADC 15 | ||
579 | #define BM_CLKCTRL_FRAC1_CLKGATEHSADC 0x00008000 | ||
580 | #define BM_CLKCTRL_FRAC1_HSADC_STABLE 0x00004000 | ||
581 | #define BP_CLKCTRL_FRAC1_HSADCFRAC 8 | ||
582 | #define BM_CLKCTRL_FRAC1_HSADCFRAC 0x00003F00 | ||
583 | #define BF_CLKCTRL_FRAC1_HSADCFRAC(v) \ | ||
584 | (((v) << 8) & BM_CLKCTRL_FRAC1_HSADCFRAC) | ||
585 | #define BP_CLKCTRL_FRAC1_CLKGATEPIX 7 | ||
586 | #define BM_CLKCTRL_FRAC1_CLKGATEPIX 0x00000080 | ||
587 | #define BM_CLKCTRL_FRAC1_PIX_STABLE 0x00000040 | ||
588 | #define BP_CLKCTRL_FRAC1_PIXFRAC 0 | ||
589 | #define BM_CLKCTRL_FRAC1_PIXFRAC 0x0000003F | ||
590 | #define BF_CLKCTRL_FRAC1_PIXFRAC(v) \ | ||
591 | (((v) << 0) & BM_CLKCTRL_FRAC1_PIXFRAC) | ||
592 | |||
593 | #define HW_CLKCTRL_CLKSEQ (0x000001d0) | ||
594 | #define HW_CLKCTRL_CLKSEQ_SET (0x000001d4) | ||
595 | #define HW_CLKCTRL_CLKSEQ_CLR (0x000001d8) | ||
596 | #define HW_CLKCTRL_CLKSEQ_TOG (0x000001dc) | ||
597 | |||
598 | #define BP_CLKCTRL_CLKSEQ_RSRVD0 19 | ||
599 | #define BM_CLKCTRL_CLKSEQ_RSRVD0 0xFFF80000 | ||
600 | #define BF_CLKCTRL_CLKSEQ_RSRVD0(v) \ | ||
601 | (((v) << 19) & BM_CLKCTRL_CLKSEQ_RSRVD0) | ||
602 | #define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00040000 | ||
603 | #define BP_CLKCTRL_CLKSEQ_RSRVD1 15 | ||
604 | #define BM_CLKCTRL_CLKSEQ_RSRVD1 0x00038000 | ||
605 | #define BF_CLKCTRL_CLKSEQ_RSRVD1(v) \ | ||
606 | (((v) << 15) & BM_CLKCTRL_CLKSEQ_RSRVD1) | ||
607 | #define BM_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF 0x00004000 | ||
608 | #define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__BYPASS 0x1 | ||
609 | #define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__PFD 0x0 | ||
610 | #define BP_CLKCTRL_CLKSEQ_RSRVD2 9 | ||
611 | #define BM_CLKCTRL_CLKSEQ_RSRVD2 0x00003E00 | ||
612 | #define BF_CLKCTRL_CLKSEQ_RSRVD2(v) \ | ||
613 | (((v) << 9) & BM_CLKCTRL_CLKSEQ_RSRVD2) | ||
614 | #define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100 | ||
615 | #define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000080 | ||
616 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP3 0x00000040 | ||
617 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP2 0x00000020 | ||
618 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP1 0x00000010 | ||
619 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP0 0x00000008 | ||
620 | #define BM_CLKCTRL_CLKSEQ_BYPASS_GPMI 0x00000004 | ||
621 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF1 0x00000002 | ||
622 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF0 0x00000001 | ||
623 | |||
624 | #define HW_CLKCTRL_RESET (0x000001e0) | ||
625 | |||
626 | #define BP_CLKCTRL_RESET_RSRVD 6 | ||
627 | #define BM_CLKCTRL_RESET_RSRVD 0xFFFFFFC0 | ||
628 | #define BF_CLKCTRL_RESET_RSRVD(v) \ | ||
629 | (((v) << 6) & BM_CLKCTRL_RESET_RSRVD) | ||
630 | #define BM_CLKCTRL_RESET_WDOG_POR_DISABLE 0x00000020 | ||
631 | #define BM_CLKCTRL_RESET_EXTERNAL_RESET_ENABLE 0x00000010 | ||
632 | #define BM_CLKCTRL_RESET_THERMAL_RESET_ENABLE 0x00000008 | ||
633 | #define BM_CLKCTRL_RESET_THERMAL_RESET_DEFAULT 0x00000004 | ||
634 | #define BM_CLKCTRL_RESET_CHIP 0x00000002 | ||
635 | #define BM_CLKCTRL_RESET_DIG 0x00000001 | ||
636 | |||
637 | #define HW_CLKCTRL_STATUS (0x000001f0) | ||
638 | |||
639 | #define BP_CLKCTRL_STATUS_CPU_LIMIT 30 | ||
640 | #define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000 | ||
641 | #define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \ | ||
642 | (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT) | ||
643 | #define BP_CLKCTRL_STATUS_RSRVD 0 | ||
644 | #define BM_CLKCTRL_STATUS_RSRVD 0x3FFFFFFF | ||
645 | #define BF_CLKCTRL_STATUS_RSRVD(v) \ | ||
646 | (((v) << 0) & BM_CLKCTRL_STATUS_RSRVD) | ||
647 | |||
648 | #define HW_CLKCTRL_VERSION (0x00000200) | ||
649 | |||
650 | #define BP_CLKCTRL_VERSION_MAJOR 24 | ||
651 | #define BM_CLKCTRL_VERSION_MAJOR 0xFF000000 | ||
652 | #define BF_CLKCTRL_VERSION_MAJOR(v) \ | ||
653 | (((v) << 24) & BM_CLKCTRL_VERSION_MAJOR) | ||
654 | #define BP_CLKCTRL_VERSION_MINOR 16 | ||
655 | #define BM_CLKCTRL_VERSION_MINOR 0x00FF0000 | ||
656 | #define BF_CLKCTRL_VERSION_MINOR(v) \ | ||
657 | (((v) << 16) & BM_CLKCTRL_VERSION_MINOR) | ||
658 | #define BP_CLKCTRL_VERSION_STEP 0 | ||
659 | #define BM_CLKCTRL_VERSION_STEP 0x0000FFFF | ||
660 | #define BF_CLKCTRL_VERSION_STEP(v) \ | ||
661 | (((v) << 0) & BM_CLKCTRL_VERSION_STEP) | ||
662 | |||
663 | #endif /* __REGS_CLKCTRL_MX28_H__ */ | ||
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c new file mode 100644 index 000000000000..9343d7edd4f6 --- /dev/null +++ b/arch/arm/mach-mxs/system.c | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
4 | * Copyright 2006-2007,2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
6 | * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, yanok@emcraft.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/clk.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/err.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/init.h> | ||
25 | |||
26 | #include <asm/proc-fns.h> | ||
27 | #include <asm/system.h> | ||
28 | |||
29 | #include <mach/mxs.h> | ||
30 | #include <mach/common.h> | ||
31 | |||
32 | #define MX23_CLKCTRL_RESET_OFFSET 0x120 | ||
33 | #define MX28_CLKCTRL_RESET_OFFSET 0x1e0 | ||
34 | #define MXS_CLKCTRL_RESET_CHIP (1 << 1) | ||
35 | |||
36 | #define MXS_MODULE_CLKGATE (1 << 30) | ||
37 | #define MXS_MODULE_SFTRST (1 << 31) | ||
38 | |||
39 | static void __iomem *mxs_clkctrl_reset_addr; | ||
40 | |||
41 | /* | ||
42 | * Reset the system. It is called by machine_restart(). | ||
43 | */ | ||
44 | void arch_reset(char mode, const char *cmd) | ||
45 | { | ||
46 | /* reset the chip */ | ||
47 | __mxs_setl(MXS_CLKCTRL_RESET_CHIP, mxs_clkctrl_reset_addr); | ||
48 | |||
49 | pr_err("Failed to assert the chip reset\n"); | ||
50 | |||
51 | /* Delay to allow the serial port to show the message */ | ||
52 | mdelay(50); | ||
53 | |||
54 | /* We'll take a jump through zero as a poor second */ | ||
55 | cpu_reset(0); | ||
56 | } | ||
57 | |||
58 | static int __init mxs_arch_reset_init(void) | ||
59 | { | ||
60 | struct clk *clk; | ||
61 | |||
62 | mxs_clkctrl_reset_addr = MXS_IO_ADDRESS(MXS_CLKCTRL_BASE_ADDR) + | ||
63 | (cpu_is_mx23() ? MX23_CLKCTRL_RESET_OFFSET : | ||
64 | MX28_CLKCTRL_RESET_OFFSET); | ||
65 | |||
66 | clk = clk_get_sys("rtc", NULL); | ||
67 | if (!IS_ERR(clk)) | ||
68 | clk_enable(clk); | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | core_initcall(mxs_arch_reset_init); | ||
73 | |||
74 | /* | ||
75 | * Clear the bit and poll it cleared. This is usually called with | ||
76 | * a reset address and mask being either SFTRST(bit 31) or CLKGATE | ||
77 | * (bit 30). | ||
78 | */ | ||
79 | static int clear_poll_bit(void __iomem *addr, u32 mask) | ||
80 | { | ||
81 | int timeout = 0x400; | ||
82 | |||
83 | /* clear the bit */ | ||
84 | __mxs_clrl(mask, addr); | ||
85 | |||
86 | /* | ||
87 | * SFTRST needs 3 GPMI clocks to settle, the reference manual | ||
88 | * recommends to wait 1us. | ||
89 | */ | ||
90 | udelay(1); | ||
91 | |||
92 | /* poll the bit becoming clear */ | ||
93 | while ((__raw_readl(addr) & mask) && --timeout) | ||
94 | /* nothing */; | ||
95 | |||
96 | return !timeout; | ||
97 | } | ||
98 | |||
99 | int mxs_reset_block(void __iomem *reset_addr) | ||
100 | { | ||
101 | int ret; | ||
102 | int timeout = 0x400; | ||
103 | |||
104 | /* clear and poll SFTRST */ | ||
105 | ret = clear_poll_bit(reset_addr, MXS_MODULE_SFTRST); | ||
106 | if (unlikely(ret)) | ||
107 | goto error; | ||
108 | |||
109 | /* clear CLKGATE */ | ||
110 | __mxs_clrl(MXS_MODULE_CLKGATE, reset_addr); | ||
111 | |||
112 | /* set SFTRST to reset the block */ | ||
113 | __mxs_setl(MXS_MODULE_SFTRST, reset_addr); | ||
114 | udelay(1); | ||
115 | |||
116 | /* poll CLKGATE becoming set */ | ||
117 | while ((!(__raw_readl(reset_addr) & MXS_MODULE_CLKGATE)) && --timeout) | ||
118 | /* nothing */; | ||
119 | if (unlikely(!timeout)) | ||
120 | goto error; | ||
121 | |||
122 | /* clear and poll SFTRST */ | ||
123 | ret = clear_poll_bit(reset_addr, MXS_MODULE_SFTRST); | ||
124 | if (unlikely(ret)) | ||
125 | goto error; | ||
126 | |||
127 | /* clear and poll CLKGATE */ | ||
128 | ret = clear_poll_bit(reset_addr, MXS_MODULE_CLKGATE); | ||
129 | if (unlikely(ret)) | ||
130 | goto error; | ||
131 | |||
132 | return 0; | ||
133 | |||
134 | error: | ||
135 | pr_err("%s(%p): module reset timeout\n", __func__, reset_addr); | ||
136 | return -ETIMEDOUT; | ||
137 | } | ||
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c new file mode 100644 index 000000000000..13647f301860 --- /dev/null +++ b/arch/arm/mach-mxs/timer.c | |||
@@ -0,0 +1,296 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000-2001 Deep Blue Solutions | ||
3 | * Copyright (C) 2002 Shane Nay (shane@minirl.com) | ||
4 | * Copyright (C) 2006-2007 Pavel Pisa (ppisa@pikron.com) | ||
5 | * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) | ||
6 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 | #include <linux/interrupt.h> | ||
24 | #include <linux/irq.h> | ||
25 | #include <linux/clockchips.h> | ||
26 | #include <linux/clk.h> | ||
27 | |||
28 | #include <asm/mach/time.h> | ||
29 | #include <mach/mxs.h> | ||
30 | #include <mach/common.h> | ||
31 | |||
32 | /* | ||
33 | * There are 2 versions of the timrot on Freescale MXS-based SoCs. | ||
34 | * The v1 on MX23 only gets 16 bits counter, while v2 on MX28 | ||
35 | * extends the counter to 32 bits. | ||
36 | * | ||
37 | * The implementation uses two timers, one for clock_event and | ||
38 | * another for clocksource. MX28 uses timrot 0 and 1, while MX23 | ||
39 | * uses 0 and 2. | ||
40 | */ | ||
41 | |||
42 | #define MX23_TIMROT_VERSION_OFFSET 0x0a0 | ||
43 | #define MX28_TIMROT_VERSION_OFFSET 0x120 | ||
44 | #define BP_TIMROT_MAJOR_VERSION 24 | ||
45 | #define BV_TIMROT_VERSION_1 0x01 | ||
46 | #define BV_TIMROT_VERSION_2 0x02 | ||
47 | #define timrot_is_v1() (timrot_major_version == BV_TIMROT_VERSION_1) | ||
48 | |||
49 | /* | ||
50 | * There are 4 registers for each timrotv2 instance, and 2 registers | ||
51 | * for each timrotv1. So address step 0x40 in macros below strides | ||
52 | * one instance of timrotv2 while two instances of timrotv1. | ||
53 | * | ||
54 | * As the result, HW_TIMROT_XXXn(1) defines the address of timrot1 | ||
55 | * on MX28 while timrot2 on MX23. | ||
56 | */ | ||
57 | /* common between v1 and v2 */ | ||
58 | #define HW_TIMROT_ROTCTRL 0x00 | ||
59 | #define HW_TIMROT_TIMCTRLn(n) (0x20 + (n) * 0x40) | ||
60 | /* v1 only */ | ||
61 | #define HW_TIMROT_TIMCOUNTn(n) (0x30 + (n) * 0x40) | ||
62 | /* v2 only */ | ||
63 | #define HW_TIMROT_RUNNING_COUNTn(n) (0x30 + (n) * 0x40) | ||
64 | #define HW_TIMROT_FIXED_COUNTn(n) (0x40 + (n) * 0x40) | ||
65 | |||
66 | #define BM_TIMROT_TIMCTRLn_RELOAD (1 << 6) | ||
67 | #define BM_TIMROT_TIMCTRLn_UPDATE (1 << 7) | ||
68 | #define BM_TIMROT_TIMCTRLn_IRQ_EN (1 << 14) | ||
69 | #define BM_TIMROT_TIMCTRLn_IRQ (1 << 15) | ||
70 | #define BP_TIMROT_TIMCTRLn_SELECT 0 | ||
71 | #define BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL 0x8 | ||
72 | #define BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL 0xb | ||
73 | |||
74 | static struct clock_event_device mxs_clockevent_device; | ||
75 | static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED; | ||
76 | |||
77 | static void __iomem *mxs_timrot_base = MXS_IO_ADDRESS(MXS_TIMROT_BASE_ADDR); | ||
78 | static u32 timrot_major_version; | ||
79 | |||
80 | static inline void timrot_irq_disable(void) | ||
81 | { | ||
82 | __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ_EN, | ||
83 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
84 | } | ||
85 | |||
86 | static inline void timrot_irq_enable(void) | ||
87 | { | ||
88 | __mxs_setl(BM_TIMROT_TIMCTRLn_IRQ_EN, | ||
89 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
90 | } | ||
91 | |||
92 | static void timrot_irq_acknowledge(void) | ||
93 | { | ||
94 | __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ, | ||
95 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
96 | } | ||
97 | |||
98 | static cycle_t timrotv1_get_cycles(struct clocksource *cs) | ||
99 | { | ||
100 | return ~((__raw_readl(mxs_timrot_base + HW_TIMROT_TIMCOUNTn(1)) | ||
101 | & 0xffff0000) >> 16); | ||
102 | } | ||
103 | |||
104 | static cycle_t timrotv2_get_cycles(struct clocksource *cs) | ||
105 | { | ||
106 | return ~__raw_readl(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1)); | ||
107 | } | ||
108 | |||
109 | static int timrotv1_set_next_event(unsigned long evt, | ||
110 | struct clock_event_device *dev) | ||
111 | { | ||
112 | /* timrot decrements the count */ | ||
113 | __raw_writel(evt, mxs_timrot_base + HW_TIMROT_TIMCOUNTn(0)); | ||
114 | |||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | static int timrotv2_set_next_event(unsigned long evt, | ||
119 | struct clock_event_device *dev) | ||
120 | { | ||
121 | /* timrot decrements the count */ | ||
122 | __raw_writel(evt, mxs_timrot_base + HW_TIMROT_FIXED_COUNTn(0)); | ||
123 | |||
124 | return 0; | ||
125 | } | ||
126 | |||
127 | static irqreturn_t mxs_timer_interrupt(int irq, void *dev_id) | ||
128 | { | ||
129 | struct clock_event_device *evt = dev_id; | ||
130 | |||
131 | timrot_irq_acknowledge(); | ||
132 | evt->event_handler(evt); | ||
133 | |||
134 | return IRQ_HANDLED; | ||
135 | } | ||
136 | |||
137 | static struct irqaction mxs_timer_irq = { | ||
138 | .name = "MXS Timer Tick", | ||
139 | .dev_id = &mxs_clockevent_device, | ||
140 | .flags = IRQF_TIMER | IRQF_IRQPOLL, | ||
141 | .handler = mxs_timer_interrupt, | ||
142 | }; | ||
143 | |||
144 | #ifdef DEBUG | ||
145 | static const char *clock_event_mode_label[] const = { | ||
146 | [CLOCK_EVT_MODE_PERIODIC] = "CLOCK_EVT_MODE_PERIODIC", | ||
147 | [CLOCK_EVT_MODE_ONESHOT] = "CLOCK_EVT_MODE_ONESHOT", | ||
148 | [CLOCK_EVT_MODE_SHUTDOWN] = "CLOCK_EVT_MODE_SHUTDOWN", | ||
149 | [CLOCK_EVT_MODE_UNUSED] = "CLOCK_EVT_MODE_UNUSED" | ||
150 | }; | ||
151 | #endif /* DEBUG */ | ||
152 | |||
153 | static void mxs_set_mode(enum clock_event_mode mode, | ||
154 | struct clock_event_device *evt) | ||
155 | { | ||
156 | /* Disable interrupt in timer module */ | ||
157 | timrot_irq_disable(); | ||
158 | |||
159 | if (mode != mxs_clockevent_mode) { | ||
160 | /* Set event time into the furthest future */ | ||
161 | if (timrot_is_v1()) | ||
162 | __raw_writel(0xffff, | ||
163 | mxs_timrot_base + HW_TIMROT_TIMCOUNTn(1)); | ||
164 | else | ||
165 | __raw_writel(0xffffffff, | ||
166 | mxs_timrot_base + HW_TIMROT_FIXED_COUNTn(1)); | ||
167 | |||
168 | /* Clear pending interrupt */ | ||
169 | timrot_irq_acknowledge(); | ||
170 | } | ||
171 | |||
172 | #ifdef DEBUG | ||
173 | pr_info("%s: changing mode from %s to %s\n", __func__, | ||
174 | clock_event_mode_label[mxs_clockevent_mode], | ||
175 | clock_event_mode_label[mode]); | ||
176 | #endif /* DEBUG */ | ||
177 | |||
178 | /* Remember timer mode */ | ||
179 | mxs_clockevent_mode = mode; | ||
180 | |||
181 | switch (mode) { | ||
182 | case CLOCK_EVT_MODE_PERIODIC: | ||
183 | pr_err("%s: Periodic mode is not implemented\n", __func__); | ||
184 | break; | ||
185 | case CLOCK_EVT_MODE_ONESHOT: | ||
186 | timrot_irq_enable(); | ||
187 | break; | ||
188 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
189 | case CLOCK_EVT_MODE_UNUSED: | ||
190 | case CLOCK_EVT_MODE_RESUME: | ||
191 | /* Left event sources disabled, no more interrupts appear */ | ||
192 | break; | ||
193 | } | ||
194 | } | ||
195 | |||
196 | static struct clock_event_device mxs_clockevent_device = { | ||
197 | .name = "mxs_timrot", | ||
198 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
199 | .shift = 32, | ||
200 | .set_mode = mxs_set_mode, | ||
201 | .set_next_event = timrotv2_set_next_event, | ||
202 | .rating = 200, | ||
203 | }; | ||
204 | |||
205 | static int __init mxs_clockevent_init(struct clk *timer_clk) | ||
206 | { | ||
207 | unsigned int c = clk_get_rate(timer_clk); | ||
208 | |||
209 | mxs_clockevent_device.mult = | ||
210 | div_sc(c, NSEC_PER_SEC, mxs_clockevent_device.shift); | ||
211 | mxs_clockevent_device.cpumask = cpumask_of(0); | ||
212 | if (timrot_is_v1()) { | ||
213 | mxs_clockevent_device.set_next_event = timrotv1_set_next_event; | ||
214 | mxs_clockevent_device.max_delta_ns = | ||
215 | clockevent_delta2ns(0xfffe, &mxs_clockevent_device); | ||
216 | mxs_clockevent_device.min_delta_ns = | ||
217 | clockevent_delta2ns(0xf, &mxs_clockevent_device); | ||
218 | } else { | ||
219 | mxs_clockevent_device.max_delta_ns = | ||
220 | clockevent_delta2ns(0xfffffffe, &mxs_clockevent_device); | ||
221 | mxs_clockevent_device.min_delta_ns = | ||
222 | clockevent_delta2ns(0xf, &mxs_clockevent_device); | ||
223 | } | ||
224 | |||
225 | clockevents_register_device(&mxs_clockevent_device); | ||
226 | |||
227 | return 0; | ||
228 | } | ||
229 | |||
230 | static struct clocksource clocksource_mxs = { | ||
231 | .name = "mxs_timer", | ||
232 | .rating = 200, | ||
233 | .read = timrotv2_get_cycles, | ||
234 | .mask = CLOCKSOURCE_MASK(32), | ||
235 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
236 | }; | ||
237 | |||
238 | static int __init mxs_clocksource_init(struct clk *timer_clk) | ||
239 | { | ||
240 | unsigned int c = clk_get_rate(timer_clk); | ||
241 | |||
242 | if (timrot_is_v1()) { | ||
243 | clocksource_mxs.read = timrotv1_get_cycles; | ||
244 | clocksource_mxs.mask = CLOCKSOURCE_MASK(16); | ||
245 | } | ||
246 | |||
247 | clocksource_register_hz(&clocksource_mxs, c); | ||
248 | |||
249 | return 0; | ||
250 | } | ||
251 | |||
252 | void __init mxs_timer_init(struct clk *timer_clk, int irq) | ||
253 | { | ||
254 | clk_enable(timer_clk); | ||
255 | |||
256 | /* | ||
257 | * Initialize timers to a known state | ||
258 | */ | ||
259 | mxs_reset_block(mxs_timrot_base + HW_TIMROT_ROTCTRL); | ||
260 | |||
261 | /* get timrot version */ | ||
262 | timrot_major_version = __raw_readl(mxs_timrot_base + | ||
263 | (cpu_is_mx23() ? MX23_TIMROT_VERSION_OFFSET : | ||
264 | MX28_TIMROT_VERSION_OFFSET)); | ||
265 | timrot_major_version >>= BP_TIMROT_MAJOR_VERSION; | ||
266 | |||
267 | /* one for clock_event */ | ||
268 | __raw_writel((timrot_is_v1() ? | ||
269 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : | ||
270 | BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | | ||
271 | BM_TIMROT_TIMCTRLn_UPDATE | | ||
272 | BM_TIMROT_TIMCTRLn_IRQ_EN, | ||
273 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
274 | |||
275 | /* another for clocksource */ | ||
276 | __raw_writel((timrot_is_v1() ? | ||
277 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : | ||
278 | BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | | ||
279 | BM_TIMROT_TIMCTRLn_RELOAD, | ||
280 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(1)); | ||
281 | |||
282 | /* set clocksource timer fixed count to the maximum */ | ||
283 | if (timrot_is_v1()) | ||
284 | __raw_writel(0xffff, | ||
285 | mxs_timrot_base + HW_TIMROT_TIMCOUNTn(1)); | ||
286 | else | ||
287 | __raw_writel(0xffffffff, | ||
288 | mxs_timrot_base + HW_TIMROT_FIXED_COUNTn(1)); | ||
289 | |||
290 | /* init and register the timer to the framework */ | ||
291 | mxs_clocksource_init(timer_clk); | ||
292 | mxs_clockevent_init(timer_clk); | ||
293 | |||
294 | /* Make irqs happen */ | ||
295 | setup_irq(irq, &mxs_timer_irq); | ||
296 | } | ||
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c index 82801dbf0579..f12f22d09b6c 100644 --- a/arch/arm/mach-netx/time.c +++ b/arch/arm/mach-netx/time.c | |||
@@ -114,7 +114,6 @@ static struct clocksource clocksource_netx = { | |||
114 | .rating = 200, | 114 | .rating = 200, |
115 | .read = netx_get_cycles, | 115 | .read = netx_get_cycles, |
116 | .mask = CLOCKSOURCE_MASK(32), | 116 | .mask = CLOCKSOURCE_MASK(32), |
117 | .shift = 20, | ||
118 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 117 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
119 | }; | 118 | }; |
120 | 119 | ||
@@ -151,9 +150,7 @@ static void __init netx_timer_init(void) | |||
151 | writel(NETX_GPIO_COUNTER_CTRL_RUN, | 150 | writel(NETX_GPIO_COUNTER_CTRL_RUN, |
152 | NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); | 151 | NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); |
153 | 152 | ||
154 | clocksource_netx.mult = | 153 | clocksource_register_hz(&clocksource_netx, CLOCK_TICK_RATE); |
155 | clocksource_hz2mult(CLOCK_TICK_RATE, clocksource_netx.shift); | ||
156 | clocksource_register(&clocksource_netx); | ||
157 | 154 | ||
158 | netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, | 155 | netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, |
159 | netx_clockevent.shift); | 156 | netx_clockevent.shift); |
diff --git a/arch/arm/mach-nomadik/clock.c b/arch/arm/mach-nomadik/clock.c index 89f793adf776..48a59f24e10c 100644 --- a/arch/arm/mach-nomadik/clock.c +++ b/arch/arm/mach-nomadik/clock.c | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
9 | #include <linux/clk.h> | 9 | #include <linux/clk.h> |
10 | #include <asm/clkdev.h> | 10 | #include <linux/clkdev.h> |
11 | #include "clock.h" | 11 | #include "clock.h" |
12 | 12 | ||
13 | /* | 13 | /* |
diff --git a/arch/arm/mach-ns9xxx/time-ns9360.c b/arch/arm/mach-ns9xxx/time-ns9360.c index 77281260358a..9ca32f55728b 100644 --- a/arch/arm/mach-ns9xxx/time-ns9360.c +++ b/arch/arm/mach-ns9xxx/time-ns9360.c | |||
@@ -35,7 +35,6 @@ static struct clocksource ns9360_clocksource = { | |||
35 | .rating = 300, | 35 | .rating = 300, |
36 | .read = ns9360_clocksource_read, | 36 | .read = ns9360_clocksource_read, |
37 | .mask = CLOCKSOURCE_MASK(32), | 37 | .mask = CLOCKSOURCE_MASK(32), |
38 | .shift = 20, | ||
39 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 38 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
40 | }; | 39 | }; |
41 | 40 | ||
@@ -148,10 +147,7 @@ static void __init ns9360_timer_init(void) | |||
148 | 147 | ||
149 | __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE)); | 148 | __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE)); |
150 | 149 | ||
151 | ns9360_clocksource.mult = clocksource_hz2mult(ns9360_cpuclock(), | 150 | clocksource_register_hz(&ns9360_clocksource, ns9360_cpuclock()); |
152 | ns9360_clocksource.shift); | ||
153 | |||
154 | clocksource_register(&ns9360_clocksource); | ||
155 | 151 | ||
156 | latch = SH_DIV(ns9360_cpuclock(), HZ, 0); | 152 | latch = SH_DIV(ns9360_cpuclock(), HZ, 0); |
157 | 153 | ||
diff --git a/arch/arm/mach-nuc93x/clock.h b/arch/arm/mach-nuc93x/clock.h index 18e51be4816f..4de1f1da9dc5 100644 --- a/arch/arm/mach-nuc93x/clock.h +++ b/arch/arm/mach-nuc93x/clock.h | |||
@@ -10,7 +10,7 @@ | |||
10 | * the Free Software Foundation; either version 2 of the License. | 10 | * the Free Software Foundation; either version 2 of the License. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <asm/clkdev.h> | 13 | #include <linux/clkdev.h> |
14 | 14 | ||
15 | void nuc93x_clk_enable(struct clk *clk, int enable); | 15 | void nuc93x_clk_enable(struct clk *clk, int enable); |
16 | void clks_register(struct clk_lookup *clks, size_t num); | 16 | void clks_register(struct clk_lookup *clks, size_t num); |
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index b8c7fb9d7921..84ef70476b51 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -17,9 +17,9 @@ | |||
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/clkdev.h> | ||
20 | 21 | ||
21 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
22 | #include <asm/clkdev.h> | ||
23 | 23 | ||
24 | #include <plat/cpu.h> | 24 | #include <plat/cpu.h> |
25 | #include <plat/usb.h> | 25 | #include <plat/usb.h> |
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 1be6a214d88d..abb34ff2041b 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -208,7 +208,6 @@ static struct clocksource clocksource_mpu = { | |||
208 | .rating = 300, | 208 | .rating = 300, |
209 | .read = mpu_read, | 209 | .read = mpu_read, |
210 | .mask = CLOCKSOURCE_MASK(32), | 210 | .mask = CLOCKSOURCE_MASK(32), |
211 | .shift = 24, | ||
212 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 211 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
213 | }; | 212 | }; |
214 | 213 | ||
@@ -217,13 +216,10 @@ static void __init omap_init_clocksource(unsigned long rate) | |||
217 | static char err[] __initdata = KERN_ERR | 216 | static char err[] __initdata = KERN_ERR |
218 | "%s: can't register clocksource!\n"; | 217 | "%s: can't register clocksource!\n"; |
219 | 218 | ||
220 | clocksource_mpu.mult | ||
221 | = clocksource_khz2mult(rate/1000, clocksource_mpu.shift); | ||
222 | |||
223 | setup_irq(INT_TIMER2, &omap_mpu_timer2_irq); | 219 | setup_irq(INT_TIMER2, &omap_mpu_timer2_irq); |
224 | omap_mpu_timer_start(1, ~0, 1); | 220 | omap_mpu_timer_start(1, ~0, 1); |
225 | 221 | ||
226 | if (clocksource_register(&clocksource_mpu)) | 222 | if (clocksource_register_hz(&clocksource_mpu, rate)) |
227 | printk(err, clocksource_mpu.name); | 223 | printk(err, clocksource_mpu.name); |
228 | } | 224 | } |
229 | 225 | ||
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index ed8d330522f1..ebb888f59365 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -26,10 +26,10 @@ | |||
26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
28 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
29 | #include <linux/clkdev.h> | ||
29 | 30 | ||
30 | #include <plat/cpu.h> | 31 | #include <plat/cpu.h> |
31 | #include <plat/clock.h> | 32 | #include <plat/clock.h> |
32 | #include <asm/clkdev.h> | ||
33 | 33 | ||
34 | #include "clock.h" | 34 | #include "clock.h" |
35 | #include "prm.h" | 35 | #include "prm.h" |
diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S index 06e64e1fc28a..d54c4f89a8bd 100644 --- a/arch/arm/mach-omap2/include/mach/entry-macro.S +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S | |||
@@ -105,6 +105,35 @@ omap_irq_base: .word 0 | |||
105 | 9999: | 105 | 9999: |
106 | .endm | 106 | .endm |
107 | 107 | ||
108 | #ifdef CONFIG_SMP | ||
109 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
110 | * register) is preserved from the macro above. | ||
111 | * If there is an IPI, we immediately signal end of interrupt | ||
112 | * on the controller, since this requires the original irqstat | ||
113 | * value which we won't easily be able to recreate later. | ||
114 | */ | ||
115 | |||
116 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
117 | bic \irqnr, \irqstat, #0x1c00 | ||
118 | cmp \irqnr, #16 | ||
119 | it cc | ||
120 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
121 | it cs | ||
122 | cmpcs \irqnr, \irqnr | ||
123 | .endm | ||
124 | |||
125 | /* As above, this assumes that irqstat and base are preserved */ | ||
126 | |||
127 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
128 | bic \irqnr, \irqstat, #0x1c00 | ||
129 | mov \tmp, #0 | ||
130 | cmp \irqnr, #29 | ||
131 | itt eq | ||
132 | moveq \tmp, #1 | ||
133 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
134 | cmp \tmp, #0 | ||
135 | .endm | ||
136 | #endif /* CONFIG_SMP */ | ||
108 | 137 | ||
109 | #else /* MULTI_OMAP2 */ | 138 | #else /* MULTI_OMAP2 */ |
110 | 139 | ||
@@ -141,74 +170,16 @@ omap_irq_base: .word 0 | |||
141 | 170 | ||
142 | 171 | ||
143 | #ifdef CONFIG_ARCH_OMAP4 | 172 | #ifdef CONFIG_ARCH_OMAP4 |
173 | #define HAVE_GET_IRQNR_PREAMBLE | ||
174 | #include <asm/hardware/entry-macro-gic.S> | ||
144 | 175 | ||
145 | .macro get_irqnr_preamble, base, tmp | 176 | .macro get_irqnr_preamble, base, tmp |
146 | ldr \base, =OMAP4_IRQ_BASE | 177 | ldr \base, =OMAP4_IRQ_BASE |
147 | .endm | 178 | .endm |
148 | 179 | ||
149 | /* | ||
150 | * The interrupt numbering scheme is defined in the | ||
151 | * interrupt controller spec. To wit: | ||
152 | * | ||
153 | * Interrupts 0-15 are IPI | ||
154 | * 16-28 are reserved | ||
155 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
156 | * 32-1020 are global | ||
157 | * 1021-1022 are reserved | ||
158 | * 1023 is "spurious" (no interrupt) | ||
159 | * | ||
160 | * For now, we ignore all local interrupts so only return an | ||
161 | * interrupt if it's between 30 and 1020. The test_for_ipi | ||
162 | * routine below will pick up on IPIs. | ||
163 | * A simple read from the controller will tell us the number | ||
164 | * of the highest priority enabled interrupt. | ||
165 | * We then just need to check whether it is in the | ||
166 | * valid range for an IRQ (30-1020 inclusive). | ||
167 | */ | ||
168 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
169 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
170 | |||
171 | ldr \tmp, =1021 | ||
172 | |||
173 | bic \irqnr, \irqstat, #0x1c00 | ||
174 | |||
175 | cmp \irqnr, #29 | ||
176 | cmpcc \irqnr, \irqnr | ||
177 | cmpne \irqnr, \tmp | ||
178 | cmpcs \irqnr, \irqnr | ||
179 | .endm | ||
180 | #endif | 180 | #endif |
181 | #endif /* MULTI_OMAP2 */ | ||
182 | |||
183 | #ifdef CONFIG_SMP | ||
184 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
185 | * register) is preserved from the macro above. | ||
186 | * If there is an IPI, we immediately signal end of interrupt | ||
187 | * on the controller, since this requires the original irqstat | ||
188 | * value which we won't easily be able to recreate later. | ||
189 | */ | ||
190 | 181 | ||
191 | .macro test_for_ipi, irqnr, irqstat, base, tmp | 182 | #endif /* MULTI_OMAP2 */ |
192 | bic \irqnr, \irqstat, #0x1c00 | ||
193 | cmp \irqnr, #16 | ||
194 | it cc | ||
195 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
196 | it cs | ||
197 | cmpcs \irqnr, \irqnr | ||
198 | .endm | ||
199 | |||
200 | /* As above, this assumes that irqstat and base are preserved */ | ||
201 | |||
202 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
203 | bic \irqnr, \irqstat, #0x1c00 | ||
204 | mov \tmp, #0 | ||
205 | cmp \irqnr, #29 | ||
206 | itt eq | ||
207 | moveq \tmp, #1 | ||
208 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
209 | cmp \tmp, #0 | ||
210 | .endm | ||
211 | #endif /* CONFIG_SMP */ | ||
212 | 183 | ||
213 | .macro irq_prio_table | 184 | .macro irq_prio_table |
214 | .endm | 185 | .endm |
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h index 2744dfee1ff4..5b0270b28934 100644 --- a/arch/arm/mach-omap2/include/mach/omap4-common.h +++ b/arch/arm/mach-omap2/include/mach/omap4-common.h | |||
@@ -24,7 +24,6 @@ | |||
24 | extern void __iomem *l2cache_base; | 24 | extern void __iomem *l2cache_base; |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | extern void __iomem *gic_cpu_base_addr; | ||
28 | extern void __iomem *gic_dist_base_addr; | 27 | extern void __iomem *gic_dist_base_addr; |
29 | 28 | ||
30 | extern void __init gic_init_irq(void); | 29 | extern void __init gic_init_irq(void); |
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c index 6cee456ca542..4976b9393e49 100644 --- a/arch/arm/mach-omap2/omap-hotplug.c +++ b/arch/arm/mach-omap2/omap-hotplug.c | |||
@@ -17,16 +17,13 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
19 | #include <linux/smp.h> | 19 | #include <linux/smp.h> |
20 | #include <linux/completion.h> | ||
21 | 20 | ||
22 | #include <asm/cacheflush.h> | 21 | #include <asm/cacheflush.h> |
23 | #include <mach/omap4-common.h> | 22 | #include <mach/omap4-common.h> |
24 | 23 | ||
25 | static DECLARE_COMPLETION(cpu_killed); | ||
26 | |||
27 | int platform_cpu_kill(unsigned int cpu) | 24 | int platform_cpu_kill(unsigned int cpu) |
28 | { | 25 | { |
29 | return wait_for_completion_timeout(&cpu_killed, 5000); | 26 | return 1; |
30 | } | 27 | } |
31 | 28 | ||
32 | /* | 29 | /* |
@@ -35,15 +32,6 @@ int platform_cpu_kill(unsigned int cpu) | |||
35 | */ | 32 | */ |
36 | void platform_cpu_die(unsigned int cpu) | 33 | void platform_cpu_die(unsigned int cpu) |
37 | { | 34 | { |
38 | unsigned int this_cpu = hard_smp_processor_id(); | ||
39 | |||
40 | if (cpu != this_cpu) { | ||
41 | pr_crit("platform_cpu_die running on %u, should be %u\n", | ||
42 | this_cpu, cpu); | ||
43 | BUG(); | ||
44 | } | ||
45 | pr_notice("CPU%u: shutdown\n", cpu); | ||
46 | complete(&cpu_killed); | ||
47 | flush_cache_all(); | 35 | flush_cache_all(); |
48 | dsb(); | 36 | dsb(); |
49 | 37 | ||
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 9e9f70e18e3c..b66cfe8bc464 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | 22 | ||
23 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
24 | #include <asm/localtimer.h> | ||
25 | #include <asm/smp_scu.h> | 24 | #include <asm/smp_scu.h> |
26 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
27 | #include <mach/omap4-common.h> | 26 | #include <mach/omap4-common.h> |
@@ -29,28 +28,16 @@ | |||
29 | /* SCU base address */ | 28 | /* SCU base address */ |
30 | static void __iomem *scu_base; | 29 | static void __iomem *scu_base; |
31 | 30 | ||
32 | /* | ||
33 | * Use SCU config register to count number of cores | ||
34 | */ | ||
35 | static inline unsigned int get_core_count(void) | ||
36 | { | ||
37 | if (scu_base) | ||
38 | return scu_get_core_count(scu_base); | ||
39 | return 1; | ||
40 | } | ||
41 | |||
42 | static DEFINE_SPINLOCK(boot_lock); | 31 | static DEFINE_SPINLOCK(boot_lock); |
43 | 32 | ||
44 | void __cpuinit platform_secondary_init(unsigned int cpu) | 33 | void __cpuinit platform_secondary_init(unsigned int cpu) |
45 | { | 34 | { |
46 | trace_hardirqs_off(); | ||
47 | |||
48 | /* | 35 | /* |
49 | * If any interrupts are already enabled for the primary | 36 | * If any interrupts are already enabled for the primary |
50 | * core (e.g. timer irq), then they will not have been enabled | 37 | * core (e.g. timer irq), then they will not have been enabled |
51 | * for us: do so | 38 | * for us: do so |
52 | */ | 39 | */ |
53 | gic_cpu_init(0, gic_cpu_base_addr); | 40 | gic_secondary_init(0); |
54 | 41 | ||
55 | /* | 42 | /* |
56 | * Synchronise with the boot thread. | 43 | * Synchronise with the boot thread. |
@@ -76,7 +63,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
76 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); | 63 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); |
77 | flush_cache_all(); | 64 | flush_cache_all(); |
78 | smp_wmb(); | 65 | smp_wmb(); |
79 | smp_cross_call(cpumask_of(cpu)); | 66 | smp_cross_call(cpumask_of(cpu), 1); |
80 | 67 | ||
81 | /* | 68 | /* |
82 | * Now the secondary core is starting up let it run its | 69 | * Now the secondary core is starting up let it run its |
@@ -118,25 +105,9 @@ void __init smp_init_cpus(void) | |||
118 | scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); | 105 | scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); |
119 | BUG_ON(!scu_base); | 106 | BUG_ON(!scu_base); |
120 | 107 | ||
121 | ncores = get_core_count(); | 108 | ncores = scu_get_core_count(scu_base); |
122 | |||
123 | for (i = 0; i < ncores; i++) | ||
124 | set_cpu_possible(i, true); | ||
125 | } | ||
126 | |||
127 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
128 | { | ||
129 | unsigned int ncores = get_core_count(); | ||
130 | unsigned int cpu = smp_processor_id(); | ||
131 | int i; | ||
132 | 109 | ||
133 | /* sanity check */ | 110 | /* sanity check */ |
134 | if (ncores == 0) { | ||
135 | printk(KERN_ERR | ||
136 | "OMAP4: strange core count of 0? Default to 1\n"); | ||
137 | ncores = 1; | ||
138 | } | ||
139 | |||
140 | if (ncores > NR_CPUS) { | 111 | if (ncores > NR_CPUS) { |
141 | printk(KERN_WARNING | 112 | printk(KERN_WARNING |
142 | "OMAP4: no. of cores (%d) greater than configured " | 113 | "OMAP4: no. of cores (%d) greater than configured " |
@@ -144,13 +115,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
144 | ncores, NR_CPUS); | 115 | ncores, NR_CPUS); |
145 | ncores = NR_CPUS; | 116 | ncores = NR_CPUS; |
146 | } | 117 | } |
147 | smp_store_cpu_info(cpu); | ||
148 | 118 | ||
149 | /* | 119 | for (i = 0; i < ncores; i++) |
150 | * are we trying to boot more cores than exist? | 120 | set_cpu_possible(i, true); |
151 | */ | 121 | } |
152 | if (max_cpus > ncores) | 122 | |
153 | max_cpus = ncores; | 123 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
124 | { | ||
125 | int i; | ||
154 | 126 | ||
155 | /* | 127 | /* |
156 | * Initialise the present map, which describes the set of CPUs | 128 | * Initialise the present map, which describes the set of CPUs |
@@ -159,18 +131,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
159 | for (i = 0; i < max_cpus; i++) | 131 | for (i = 0; i < max_cpus; i++) |
160 | set_cpu_present(i, true); | 132 | set_cpu_present(i, true); |
161 | 133 | ||
162 | if (max_cpus > 1) { | 134 | /* |
163 | /* | 135 | * Initialise the SCU and wake up the secondary core using |
164 | * Enable the local timer or broadcast device for the | 136 | * wakeup_secondary(). |
165 | * boot CPU, but only if we have more than one CPU. | 137 | */ |
166 | */ | 138 | scu_enable(scu_base); |
167 | percpu_timer_setup(); | 139 | wakeup_secondary(); |
168 | |||
169 | /* | ||
170 | * Initialise the SCU and wake up the secondary core using | ||
171 | * wakeup_secondary(). | ||
172 | */ | ||
173 | scu_enable(scu_base); | ||
174 | wakeup_secondary(); | ||
175 | } | ||
176 | } | 140 | } |
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 2f895553e6a8..666e852988d5 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -26,21 +26,22 @@ | |||
26 | void __iomem *l2cache_base; | 26 | void __iomem *l2cache_base; |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | void __iomem *gic_cpu_base_addr; | ||
30 | void __iomem *gic_dist_base_addr; | 29 | void __iomem *gic_dist_base_addr; |
31 | 30 | ||
32 | 31 | ||
33 | void __init gic_init_irq(void) | 32 | void __init gic_init_irq(void) |
34 | { | 33 | { |
34 | void __iomem *gic_cpu_base; | ||
35 | |||
35 | /* Static mapping, never released */ | 36 | /* Static mapping, never released */ |
36 | gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); | 37 | gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); |
37 | BUG_ON(!gic_dist_base_addr); | 38 | BUG_ON(!gic_dist_base_addr); |
38 | gic_dist_init(0, gic_dist_base_addr, 29); | ||
39 | 39 | ||
40 | /* Static mapping, never released */ | 40 | /* Static mapping, never released */ |
41 | gic_cpu_base_addr = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); | 41 | gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); |
42 | BUG_ON(!gic_cpu_base_addr); | 42 | BUG_ON(!gic_cpu_base); |
43 | gic_cpu_init(0, gic_cpu_base_addr); | 43 | |
44 | gic_init(0, 29, gic_dist_base_addr, gic_cpu_base); | ||
44 | } | 45 | } |
45 | 46 | ||
46 | #ifdef CONFIG_CACHE_L2X0 | 47 | #ifdef CONFIG_CACHE_L2X0 |
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index e13c29eecf2b..a7816dbdc6b1 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
@@ -195,7 +195,6 @@ static struct clocksource clocksource_gpt = { | |||
195 | .rating = 300, | 195 | .rating = 300, |
196 | .read = clocksource_read_cycles, | 196 | .read = clocksource_read_cycles, |
197 | .mask = CLOCKSOURCE_MASK(32), | 197 | .mask = CLOCKSOURCE_MASK(32), |
198 | .shift = 24, | ||
199 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 198 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
200 | }; | 199 | }; |
201 | 200 | ||
@@ -220,9 +219,7 @@ static void __init omap2_gp_clocksource_init(void) | |||
220 | 219 | ||
221 | omap_dm_timer_set_load_start(gpt, 1, 0); | 220 | omap_dm_timer_set_load_start(gpt, 1, 0); |
222 | 221 | ||
223 | clocksource_gpt.mult = | 222 | if (clocksource_register_hz(&clocksource_gpt, tick_rate)) |
224 | clocksource_khz2mult(tick_rate/1000, clocksource_gpt.shift); | ||
225 | if (clocksource_register(&clocksource_gpt)) | ||
226 | printk(err2, clocksource_gpt.name); | 223 | printk(err2, clocksource_gpt.name); |
227 | } | 224 | } |
228 | #endif | 225 | #endif |
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig index c897e03e413d..6604fc6ca58a 100644 --- a/arch/arm/mach-orion5x/Kconfig +++ b/arch/arm/mach-orion5x/Kconfig | |||
@@ -51,6 +51,13 @@ config MACH_LINKSTATION_PRO | |||
51 | Buffalo Linkstation Pro/Live platform. Both v1 and | 51 | Buffalo Linkstation Pro/Live platform. Both v1 and |
52 | v2 devices are supported. | 52 | v2 devices are supported. |
53 | 53 | ||
54 | config MACH_LINKSTATION_LSCHL | ||
55 | bool "Buffalo Linkstation Live v3 (LS-CHL)" | ||
56 | select I2C_BOARDINFO | ||
57 | help | ||
58 | Say 'Y' here if you want your kernel to support the | ||
59 | Buffalo Linkstation Live v3 (LS-CHL) platform. | ||
60 | |||
54 | config MACH_LINKSTATION_MINI | 61 | config MACH_LINKSTATION_MINI |
55 | bool "Buffalo Linkstation Mini" | 62 | bool "Buffalo Linkstation Mini" |
56 | select I2C_BOARDINFO | 63 | select I2C_BOARDINFO |
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile index eb6eabcb41e4..7f18cdacd487 100644 --- a/arch/arm/mach-orion5x/Makefile +++ b/arch/arm/mach-orion5x/Makefile | |||
@@ -21,3 +21,4 @@ obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o | |||
21 | obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o | 21 | obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o |
22 | obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o | 22 | obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o |
23 | obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o | 23 | obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o |
24 | obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o | ||
diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h index c47b033bd999..c5196101a237 100644 --- a/arch/arm/mach-orion5x/include/mach/io.h +++ b/arch/arm/mach-orion5x/include/mach/io.h | |||
@@ -38,8 +38,8 @@ __arch_iounmap(void __iomem *addr) | |||
38 | __iounmap(addr); | 38 | __iounmap(addr); |
39 | } | 39 | } |
40 | 40 | ||
41 | #define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m) | 41 | #define __arch_ioremap __arch_ioremap |
42 | #define __arch_iounmap(a) __arch_iounmap(a) | 42 | #define __arch_iounmap __arch_iounmap |
43 | #define __io(a) __typesafe_io(a) | 43 | #define __io(a) __typesafe_io(a) |
44 | #define __mem_pci(a) (a) | 44 | #define __mem_pci(a) (a) |
45 | 45 | ||
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c new file mode 100644 index 000000000000..20a9b66cbafa --- /dev/null +++ b/arch/arm/mach-orion5x/ls-chl-setup.c | |||
@@ -0,0 +1,327 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-orion5x/ls-chl-setup.c | ||
3 | * | ||
4 | * Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk> | ||
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/physmap.h> | ||
15 | #include <linux/mv643xx_eth.h> | ||
16 | #include <linux/leds.h> | ||
17 | #include <linux/gpio_keys.h> | ||
18 | #include <linux/gpio-fan.h> | ||
19 | #include <linux/input.h> | ||
20 | #include <linux/i2c.h> | ||
21 | #include <linux/ata_platform.h> | ||
22 | #include <linux/gpio.h> | ||
23 | #include <asm/mach-types.h> | ||
24 | #include <asm/mach/arch.h> | ||
25 | #include <asm/system.h> | ||
26 | #include <mach/orion5x.h> | ||
27 | #include "common.h" | ||
28 | #include "mpp.h" | ||
29 | |||
30 | /***************************************************************************** | ||
31 | * Linkstation LS-CHL Info | ||
32 | ****************************************************************************/ | ||
33 | |||
34 | /* | ||
35 | * 256K NOR flash Device bus boot chip select | ||
36 | */ | ||
37 | |||
38 | #define LSCHL_NOR_BOOT_BASE 0xf4000000 | ||
39 | #define LSCHL_NOR_BOOT_SIZE SZ_256K | ||
40 | |||
41 | /***************************************************************************** | ||
42 | * 256KB NOR Flash on BOOT Device | ||
43 | ****************************************************************************/ | ||
44 | |||
45 | static struct physmap_flash_data lschl_nor_flash_data = { | ||
46 | .width = 1, | ||
47 | }; | ||
48 | |||
49 | static struct resource lschl_nor_flash_resource = { | ||
50 | .flags = IORESOURCE_MEM, | ||
51 | .start = LSCHL_NOR_BOOT_BASE, | ||
52 | .end = LSCHL_NOR_BOOT_BASE + LSCHL_NOR_BOOT_SIZE - 1, | ||
53 | }; | ||
54 | |||
55 | static struct platform_device lschl_nor_flash = { | ||
56 | .name = "physmap-flash", | ||
57 | .id = 0, | ||
58 | .dev = { | ||
59 | .platform_data = &lschl_nor_flash_data, | ||
60 | }, | ||
61 | .num_resources = 1, | ||
62 | .resource = &lschl_nor_flash_resource, | ||
63 | }; | ||
64 | |||
65 | /***************************************************************************** | ||
66 | * Ethernet | ||
67 | ****************************************************************************/ | ||
68 | |||
69 | static struct mv643xx_eth_platform_data lschl_eth_data = { | ||
70 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
71 | }; | ||
72 | |||
73 | /***************************************************************************** | ||
74 | * RTC 5C372a on I2C bus | ||
75 | ****************************************************************************/ | ||
76 | |||
77 | static struct i2c_board_info __initdata lschl_i2c_rtc = { | ||
78 | I2C_BOARD_INFO("rs5c372a", 0x32), | ||
79 | }; | ||
80 | |||
81 | /***************************************************************************** | ||
82 | * LEDs attached to GPIO | ||
83 | ****************************************************************************/ | ||
84 | |||
85 | #define LSCHL_GPIO_LED_ALARM 2 | ||
86 | #define LSCHL_GPIO_LED_INFO 3 | ||
87 | #define LSCHL_GPIO_LED_FUNC 17 | ||
88 | #define LSCHL_GPIO_LED_PWR 0 | ||
89 | |||
90 | static struct gpio_led lschl_led_pins[] = { | ||
91 | { | ||
92 | .name = "alarm:red", | ||
93 | .gpio = LSCHL_GPIO_LED_ALARM, | ||
94 | .active_low = 1, | ||
95 | }, { | ||
96 | .name = "info:amber", | ||
97 | .gpio = LSCHL_GPIO_LED_INFO, | ||
98 | .active_low = 1, | ||
99 | }, { | ||
100 | .name = "func:blue:top", | ||
101 | .gpio = LSCHL_GPIO_LED_FUNC, | ||
102 | .active_low = 1, | ||
103 | }, { | ||
104 | .name = "power:blue:bottom", | ||
105 | .gpio = LSCHL_GPIO_LED_PWR, | ||
106 | }, | ||
107 | }; | ||
108 | |||
109 | static struct gpio_led_platform_data lschl_led_data = { | ||
110 | .leds = lschl_led_pins, | ||
111 | .num_leds = ARRAY_SIZE(lschl_led_pins), | ||
112 | }; | ||
113 | |||
114 | static struct platform_device lschl_leds = { | ||
115 | .name = "leds-gpio", | ||
116 | .id = -1, | ||
117 | .dev = { | ||
118 | .platform_data = &lschl_led_data, | ||
119 | }, | ||
120 | }; | ||
121 | |||
122 | /***************************************************************************** | ||
123 | * SATA | ||
124 | ****************************************************************************/ | ||
125 | static struct mv_sata_platform_data lschl_sata_data = { | ||
126 | .n_ports = 2, | ||
127 | }; | ||
128 | |||
129 | /***************************************************************************** | ||
130 | * LS-CHL specific power off method: reboot | ||
131 | ****************************************************************************/ | ||
132 | /* | ||
133 | * On the LS-CHL, the shutdown process is following: | ||
134 | * - Userland monitors key events until the power switch goes to off position | ||
135 | * - The board reboots | ||
136 | * - U-boot starts and goes into an idle mode waiting for the user | ||
137 | * to move the switch to ON position | ||
138 | * | ||
139 | */ | ||
140 | |||
141 | static void lschl_power_off(void) | ||
142 | { | ||
143 | arm_machine_restart('h', NULL); | ||
144 | } | ||
145 | |||
146 | /***************************************************************************** | ||
147 | * General Setup | ||
148 | ****************************************************************************/ | ||
149 | #define LSCHL_GPIO_USB_POWER 9 | ||
150 | #define LSCHL_GPIO_AUTO_POWER 17 | ||
151 | #define LSCHL_GPIO_POWER 18 | ||
152 | |||
153 | /**************************************************************************** | ||
154 | * GPIO Attached Keys | ||
155 | ****************************************************************************/ | ||
156 | #define LSCHL_GPIO_KEY_FUNC 15 | ||
157 | #define LSCHL_GPIO_KEY_POWER 8 | ||
158 | #define LSCHL_GPIO_KEY_AUTOPOWER 10 | ||
159 | #define LSCHL_SW_POWER 0x00 | ||
160 | #define LSCHL_SW_AUTOPOWER 0x01 | ||
161 | #define LSCHL_SW_FUNC 0x02 | ||
162 | |||
163 | static struct gpio_keys_button lschl_buttons[] = { | ||
164 | { | ||
165 | .type = EV_SW, | ||
166 | .code = LSCHL_SW_POWER, | ||
167 | .gpio = LSCHL_GPIO_KEY_POWER, | ||
168 | .desc = "Power-on Switch", | ||
169 | .active_low = 1, | ||
170 | }, { | ||
171 | .type = EV_SW, | ||
172 | .code = LSCHL_SW_AUTOPOWER, | ||
173 | .gpio = LSCHL_GPIO_KEY_AUTOPOWER, | ||
174 | .desc = "Power-auto Switch", | ||
175 | .active_low = 1, | ||
176 | }, { | ||
177 | .type = EV_SW, | ||
178 | .code = LSCHL_SW_FUNC, | ||
179 | .gpio = LSCHL_GPIO_KEY_FUNC, | ||
180 | .desc = "Function Switch", | ||
181 | .active_low = 1, | ||
182 | }, | ||
183 | }; | ||
184 | |||
185 | static struct gpio_keys_platform_data lschl_button_data = { | ||
186 | .buttons = lschl_buttons, | ||
187 | .nbuttons = ARRAY_SIZE(lschl_buttons), | ||
188 | }; | ||
189 | |||
190 | static struct platform_device lschl_button_device = { | ||
191 | .name = "gpio-keys", | ||
192 | .id = -1, | ||
193 | .num_resources = 0, | ||
194 | .dev = { | ||
195 | .platform_data = &lschl_button_data, | ||
196 | }, | ||
197 | }; | ||
198 | |||
199 | #define LSCHL_GPIO_HDD_POWER 1 | ||
200 | |||
201 | /**************************************************************************** | ||
202 | * GPIO Fan | ||
203 | ****************************************************************************/ | ||
204 | |||
205 | #define LSCHL_GPIO_FAN_LOW 16 | ||
206 | #define LSCHL_GPIO_FAN_HIGH 14 | ||
207 | #define LSCHL_GPIO_FAN_LOCK 6 | ||
208 | |||
209 | static struct gpio_fan_alarm lschl_alarm = { | ||
210 | .gpio = LSCHL_GPIO_FAN_LOCK, | ||
211 | }; | ||
212 | |||
213 | static struct gpio_fan_speed lschl_speeds[] = { | ||
214 | { | ||
215 | .rpm = 0, | ||
216 | .ctrl_val = 3, | ||
217 | }, { | ||
218 | .rpm = 1500, | ||
219 | .ctrl_val = 2, | ||
220 | }, { | ||
221 | .rpm = 3250, | ||
222 | .ctrl_val = 1, | ||
223 | }, { | ||
224 | .rpm = 5000, | ||
225 | .ctrl_val = 0, | ||
226 | }, | ||
227 | }; | ||
228 | |||
229 | static int lschl_gpio_list[] = { | ||
230 | LSCHL_GPIO_FAN_HIGH, LSCHL_GPIO_FAN_LOW, | ||
231 | }; | ||
232 | |||
233 | static struct gpio_fan_platform_data lschl_fan_data = { | ||
234 | .num_ctrl = ARRAY_SIZE(lschl_gpio_list), | ||
235 | .ctrl = lschl_gpio_list, | ||
236 | .alarm = &lschl_alarm, | ||
237 | .num_speed = ARRAY_SIZE(lschl_speeds), | ||
238 | .speed = lschl_speeds, | ||
239 | }; | ||
240 | |||
241 | static struct platform_device lschl_fan_device = { | ||
242 | .name = "gpio-fan", | ||
243 | .id = -1, | ||
244 | .num_resources = 0, | ||
245 | .dev = { | ||
246 | .platform_data = &lschl_fan_data, | ||
247 | }, | ||
248 | }; | ||
249 | |||
250 | /**************************************************************************** | ||
251 | * GPIO Data | ||
252 | ****************************************************************************/ | ||
253 | |||
254 | static struct orion5x_mpp_mode lschl_mpp_modes[] __initdata = { | ||
255 | { 0, MPP_GPIO }, /* LED POWER */ | ||
256 | { 1, MPP_GPIO }, /* HDD POWER */ | ||
257 | { 2, MPP_GPIO }, /* LED ALARM */ | ||
258 | { 3, MPP_GPIO }, /* LED INFO */ | ||
259 | { 4, MPP_UNUSED }, | ||
260 | { 5, MPP_UNUSED }, | ||
261 | { 6, MPP_GPIO }, /* FAN LOCK */ | ||
262 | { 7, MPP_GPIO }, /* SW INIT */ | ||
263 | { 8, MPP_GPIO }, /* SW POWER */ | ||
264 | { 9, MPP_GPIO }, /* USB POWER */ | ||
265 | { 10, MPP_GPIO }, /* SW AUTO POWER */ | ||
266 | { 11, MPP_UNUSED }, | ||
267 | { 12, MPP_UNUSED }, | ||
268 | { 13, MPP_UNUSED }, | ||
269 | { 14, MPP_GPIO }, /* FAN HIGH */ | ||
270 | { 15, MPP_GPIO }, /* SW FUNC */ | ||
271 | { 16, MPP_GPIO }, /* FAN LOW */ | ||
272 | { 17, MPP_GPIO }, /* LED FUNC */ | ||
273 | { 18, MPP_UNUSED }, | ||
274 | { 19, MPP_UNUSED }, | ||
275 | { -1 }, | ||
276 | }; | ||
277 | |||
278 | static void __init lschl_init(void) | ||
279 | { | ||
280 | /* | ||
281 | * Setup basic Orion functions. Needs to be called early. | ||
282 | */ | ||
283 | orion5x_init(); | ||
284 | |||
285 | orion5x_mpp_conf(lschl_mpp_modes); | ||
286 | |||
287 | /* | ||
288 | * Configure peripherals. | ||
289 | */ | ||
290 | orion5x_ehci0_init(); | ||
291 | orion5x_ehci1_init(); | ||
292 | orion5x_eth_init(&lschl_eth_data); | ||
293 | orion5x_i2c_init(); | ||
294 | orion5x_sata_init(&lschl_sata_data); | ||
295 | orion5x_uart0_init(); | ||
296 | orion5x_xor_init(); | ||
297 | |||
298 | orion5x_setup_dev_boot_win(LSCHL_NOR_BOOT_BASE, | ||
299 | LSCHL_NOR_BOOT_SIZE); | ||
300 | platform_device_register(&lschl_nor_flash); | ||
301 | |||
302 | platform_device_register(&lschl_leds); | ||
303 | |||
304 | platform_device_register(&lschl_button_device); | ||
305 | |||
306 | platform_device_register(&lschl_fan_device); | ||
307 | |||
308 | i2c_register_board_info(0, &lschl_i2c_rtc, 1); | ||
309 | |||
310 | /* usb power on */ | ||
311 | gpio_set_value(LSCHL_GPIO_USB_POWER, 1); | ||
312 | |||
313 | /* register power-off method */ | ||
314 | pm_power_off = lschl_power_off; | ||
315 | |||
316 | pr_info("%s: finished\n", __func__); | ||
317 | } | ||
318 | |||
319 | MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)") | ||
320 | /* Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk> */ | ||
321 | .boot_params = 0x00000100, | ||
322 | .init_machine = lschl_init, | ||
323 | .map_io = orion5x_map_io, | ||
324 | .init_irq = orion5x_init_irq, | ||
325 | .timer = &orion5x_timer, | ||
326 | .fixup = tag_fixup_mem32, | ||
327 | MACHINE_END | ||
diff --git a/arch/arm/mach-pnx4008/clock.c b/arch/arm/mach-pnx4008/clock.c index 9d1975fa4d9f..a4a3819c96cb 100644 --- a/arch/arm/mach-pnx4008/clock.c +++ b/arch/arm/mach-pnx4008/clock.c | |||
@@ -21,8 +21,7 @@ | |||
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | #include <linux/clkdev.h> | |
25 | #include <asm/clkdev.h> | ||
26 | 25 | ||
27 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
28 | #include <mach/clock.h> | 27 | #include <mach/clock.h> |
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index c93e73d54dd1..2fc9f94cdd29 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -50,6 +50,10 @@ config MACH_SAAR | |||
50 | select PXA3xx | 50 | select PXA3xx |
51 | select CPU_PXA930 | 51 | select CPU_PXA930 |
52 | 52 | ||
53 | config MACH_SAARB | ||
54 | bool "PXA955 Handheld Platform (aka SAARB)" | ||
55 | select CPU_PXA955 | ||
56 | |||
53 | comment "Third Party Dev Platforms (sorted by vendor name)" | 57 | comment "Third Party Dev Platforms (sorted by vendor name)" |
54 | 58 | ||
55 | config ARCH_PXA_IDP | 59 | config ARCH_PXA_IDP |
@@ -94,6 +98,7 @@ config MACH_ARMCORE | |||
94 | select PXA27x | 98 | select PXA27x |
95 | select IWMMXT | 99 | select IWMMXT |
96 | select PXA25x | 100 | select PXA25x |
101 | select MIGHT_HAVE_PCI | ||
97 | 102 | ||
98 | config MACH_EM_X270 | 103 | config MACH_EM_X270 |
99 | bool "CompuLab EM-x270 platform" | 104 | bool "CompuLab EM-x270 platform" |
@@ -232,10 +237,6 @@ config MACH_COLIBRI | |||
232 | bool "Toradex Colibri PXA270" | 237 | bool "Toradex Colibri PXA270" |
233 | select PXA27x | 238 | select PXA27x |
234 | 239 | ||
235 | config MACH_COLIBRI_PXA270_EVALBOARD | ||
236 | bool "Toradex Colibri Evaluation Carrier Board support (PXA270)" | ||
237 | depends on MACH_COLIBRI | ||
238 | |||
239 | config MACH_COLIBRI_PXA270_INCOME | 240 | config MACH_COLIBRI_PXA270_INCOME |
240 | bool "Income s.r.o. PXA270 SBC" | 241 | bool "Income s.r.o. PXA270 SBC" |
241 | depends on MACH_COLIBRI | 242 | depends on MACH_COLIBRI |
@@ -253,6 +254,10 @@ config MACH_COLIBRI320 | |||
253 | select PXA3xx | 254 | select PXA3xx |
254 | select CPU_PXA320 | 255 | select CPU_PXA320 |
255 | 256 | ||
257 | config MACH_COLIBRI_EVALBOARD | ||
258 | bool "Toradex Colibri Evaluation Carrier Board support" | ||
259 | depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320 | ||
260 | |||
256 | config MACH_VPAC270 | 261 | config MACH_VPAC270 |
257 | bool "Voipac PXA270" | 262 | bool "Voipac PXA270" |
258 | select PXA27x | 263 | select PXA27x |
@@ -652,11 +657,17 @@ config CPU_PXA935 | |||
652 | help | 657 | help |
653 | PXA935 (codename Tavor-P65) | 658 | PXA935 (codename Tavor-P65) |
654 | 659 | ||
655 | config CPU_PXA950 | 660 | config PXA95x |
656 | bool | 661 | bool |
657 | select CPU_PXA930 | 662 | select CPU_PJ4 |
663 | help | ||
664 | Select code specific to PXA95x variants | ||
665 | |||
666 | config CPU_PXA955 | ||
667 | bool | ||
668 | select PXA95x | ||
658 | help | 669 | help |
659 | PXA950 (codename Tavor-PV2) | 670 | PXA950 (codename MG1) |
660 | 671 | ||
661 | config PXA_SHARP_C7xx | 672 | config PXA_SHARP_C7xx |
662 | bool | 673 | bool |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index e2f89c2c6f49..cc39d17b2e07 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -16,9 +16,10 @@ endif | |||
16 | # Generic drivers that other drivers may depend upon | 16 | # Generic drivers that other drivers may depend upon |
17 | 17 | ||
18 | # SoC-specific code | 18 | # SoC-specific code |
19 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o | 19 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa25x.o |
20 | obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o pxa2xx.o pxa27x.o | 20 | obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa27x.o |
21 | obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o | 21 | obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o clock-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o |
22 | obj-$(CONFIG_PXA95x) += mfp-pxa3xx.o clock-pxa3xx.o pxa95x.o smemc.o | ||
22 | obj-$(CONFIG_CPU_PXA300) += pxa300.o | 23 | obj-$(CONFIG_CPU_PXA300) += pxa300.o |
23 | obj-$(CONFIG_CPU_PXA320) += pxa320.o | 24 | obj-$(CONFIG_CPU_PXA320) += pxa320.o |
24 | obj-$(CONFIG_CPU_PXA930) += pxa930.o | 25 | obj-$(CONFIG_CPU_PXA930) += pxa930.o |
@@ -34,6 +35,7 @@ obj-$(CONFIG_MACH_LITTLETON) += littleton.o | |||
34 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o | 35 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o |
35 | obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o | 36 | obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o |
36 | obj-$(CONFIG_MACH_SAAR) += saar.o | 37 | obj-$(CONFIG_MACH_SAAR) += saar.o |
38 | obj-$(CONFIG_MACH_SAARB) += saarb.o | ||
37 | 39 | ||
38 | # 3rd Party Dev Platforms | 40 | # 3rd Party Dev Platforms |
39 | obj-$(CONFIG_ARCH_PXA_IDP) += idp.o | 41 | obj-$(CONFIG_ARCH_PXA_IDP) += idp.o |
@@ -60,7 +62,7 @@ obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o | |||
60 | obj-$(CONFIG_MACH_PCM027) += pcm027.o | 62 | obj-$(CONFIG_MACH_PCM027) += pcm027.o |
61 | obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o | 63 | obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o |
62 | obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o | 64 | obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o |
63 | obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o | 65 | obj-$(CONFIG_MACH_COLIBRI_EVALBOARD) += colibri-evalboard.o |
64 | obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o | 66 | obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o |
65 | obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o | 67 | obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o |
66 | obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o | 68 | obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o |
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index 21e188901935..ccb2d0cebcc3 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -567,27 +567,29 @@ static inline void balloon3_i2c_init(void) {} | |||
567 | * NAND | 567 | * NAND |
568 | ******************************************************************************/ | 568 | ******************************************************************************/ |
569 | #if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE) | 569 | #if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
570 | static uint16_t balloon3_ctl = | ||
571 | BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 | | ||
572 | BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 | | ||
573 | BALLOON3_NAND_CONTROL_FLWP; | ||
574 | |||
575 | static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | 570 | static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
576 | { | 571 | { |
577 | struct nand_chip *this = mtd->priv; | 572 | struct nand_chip *this = mtd->priv; |
573 | uint8_t balloon3_ctl_set = 0, balloon3_ctl_clr = 0; | ||
578 | 574 | ||
579 | if (ctrl & NAND_CTRL_CHANGE) { | 575 | if (ctrl & NAND_CTRL_CHANGE) { |
580 | if (ctrl & NAND_CLE) | 576 | if (ctrl & NAND_CLE) |
581 | balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCLE; | 577 | balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLCLE; |
582 | else | 578 | else |
583 | balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLCLE; | 579 | balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLCLE; |
584 | 580 | ||
585 | if (ctrl & NAND_ALE) | 581 | if (ctrl & NAND_ALE) |
586 | balloon3_ctl |= BALLOON3_NAND_CONTROL_FLALE; | 582 | balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLALE; |
587 | else | 583 | else |
588 | balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLALE; | 584 | balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLALE; |
589 | 585 | ||
590 | __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); | 586 | if (balloon3_ctl_clr) |
587 | __raw_writel(balloon3_ctl_clr, | ||
588 | BALLOON3_NAND_CONTROL_REG); | ||
589 | if (balloon3_ctl_set) | ||
590 | __raw_writel(balloon3_ctl_set, | ||
591 | BALLOON3_NAND_CONTROL_REG | | ||
592 | BALLOON3_FPGA_SETnCLR); | ||
591 | } | 593 | } |
592 | 594 | ||
593 | if (cmd != NAND_CMD_NONE) | 595 | if (cmd != NAND_CMD_NONE) |
@@ -599,28 +601,33 @@ static void balloon3_nand_select_chip(struct mtd_info *mtd, int chip) | |||
599 | if (chip < 0 || chip > 3) | 601 | if (chip < 0 || chip > 3) |
600 | return; | 602 | return; |
601 | 603 | ||
602 | balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCE0 | | 604 | /* Assert all nCE lines */ |
603 | BALLOON3_NAND_CONTROL_FLCE1 | | 605 | __raw_writew( |
604 | BALLOON3_NAND_CONTROL_FLCE2 | | 606 | BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 | |
605 | BALLOON3_NAND_CONTROL_FLCE3; | 607 | BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3, |
608 | BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR); | ||
606 | 609 | ||
607 | /* Deassert correct nCE line */ | 610 | /* Deassert correct nCE line */ |
608 | balloon3_ctl &= ~(BALLOON3_NAND_CONTROL_FLCE0 << chip); | 611 | __raw_writew(BALLOON3_NAND_CONTROL_FLCE0 << chip, |
612 | BALLOON3_NAND_CONTROL_REG); | ||
613 | } | ||
609 | 614 | ||
610 | __raw_writew(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); | 615 | static int balloon3_nand_dev_ready(struct mtd_info *mtd) |
616 | { | ||
617 | return __raw_readl(BALLOON3_NAND_STAT_REG) & BALLOON3_NAND_STAT_RNB; | ||
611 | } | 618 | } |
612 | 619 | ||
613 | static int balloon3_nand_probe(struct platform_device *pdev) | 620 | static int balloon3_nand_probe(struct platform_device *pdev) |
614 | { | 621 | { |
615 | void __iomem *temp_map; | ||
616 | uint16_t ver; | 622 | uint16_t ver; |
617 | int ret; | 623 | int ret; |
618 | 624 | ||
619 | __raw_writew(BALLOON3_NAND_CONTROL2_16BIT, BALLOON3_NAND_CONTROL2_REG); | 625 | __raw_writew(BALLOON3_NAND_CONTROL2_16BIT, |
626 | BALLOON3_NAND_CONTROL2_REG | BALLOON3_FPGA_SETnCLR); | ||
620 | 627 | ||
621 | ver = __raw_readw(BALLOON3_FPGA_VER); | 628 | ver = __raw_readw(BALLOON3_FPGA_VER); |
622 | if (ver > 0x0201) | 629 | if (ver < 0x4f08) |
623 | pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. " | 630 | pr_warn("The FPGA code, version 0x%04x, is too old. " |
624 | "NAND support might be broken in this version!", ver); | 631 | "NAND support might be broken in this version!", ver); |
625 | 632 | ||
626 | /* Power up the NAND chips */ | 633 | /* Power up the NAND chips */ |
@@ -635,7 +642,11 @@ static int balloon3_nand_probe(struct platform_device *pdev) | |||
635 | gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1); | 642 | gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1); |
636 | 643 | ||
637 | /* Deassert all nCE lines and write protect line */ | 644 | /* Deassert all nCE lines and write protect line */ |
638 | __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); | 645 | __raw_writel( |
646 | BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 | | ||
647 | BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 | | ||
648 | BALLOON3_NAND_CONTROL_FLWP, | ||
649 | BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR); | ||
639 | return 0; | 650 | return 0; |
640 | 651 | ||
641 | err2: | 652 | err2: |
@@ -677,7 +688,7 @@ struct platform_nand_data balloon3_nand_pdata = { | |||
677 | }, | 688 | }, |
678 | .ctrl = { | 689 | .ctrl = { |
679 | .hwcontrol = 0, | 690 | .hwcontrol = 0, |
680 | .dev_ready = 0, | 691 | .dev_ready = balloon3_nand_dev_ready, |
681 | .select_chip = balloon3_nand_select_chip, | 692 | .select_chip = balloon3_nand_select_chip, |
682 | .cmd_ctrl = balloon3_nand_cmd_ctl, | 693 | .cmd_ctrl = balloon3_nand_cmd_ctl, |
683 | .probe = balloon3_nand_probe, | 694 | .probe = balloon3_nand_probe, |
@@ -802,7 +813,7 @@ static struct map_desc balloon3_io_desc[] __initdata = { | |||
802 | 813 | ||
803 | static void __init balloon3_map_io(void) | 814 | static void __init balloon3_map_io(void) |
804 | { | 815 | { |
805 | pxa_map_io(); | 816 | pxa27x_map_io(); |
806 | iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc)); | 817 | iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc)); |
807 | } | 818 | } |
808 | 819 | ||
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c index 4bd7a3cda48c..4284513f396a 100644 --- a/arch/arm/mach-pxa/capc7117.c +++ b/arch/arm/mach-pxa/capc7117.c | |||
@@ -149,7 +149,7 @@ static void __init capc7117_init(void) | |||
149 | MACHINE_START(CAPC7117, | 149 | MACHINE_START(CAPC7117, |
150 | "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") | 150 | "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") |
151 | .boot_params = 0xa0000100, | 151 | .boot_params = 0xa0000100, |
152 | .map_io = pxa_map_io, | 152 | .map_io = pxa3xx_map_io, |
153 | .init_irq = pxa3xx_init_irq, | 153 | .init_irq = pxa3xx_init_irq, |
154 | .timer = &pxa_timer, | 154 | .timer = &pxa_timer, |
155 | .init_machine = capc7117_init | 155 | .init_machine = capc7117_init |
diff --git a/arch/arm/mach-pxa/clock-pxa2xx.c b/arch/arm/mach-pxa/clock-pxa2xx.c new file mode 100644 index 000000000000..1ce090448493 --- /dev/null +++ b/arch/arm/mach-pxa/clock-pxa2xx.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/clock-pxa2xx.c | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/sysdev.h> | ||
13 | |||
14 | #include <mach/pxa2xx-regs.h> | ||
15 | |||
16 | #include "clock.h" | ||
17 | |||
18 | void clk_pxa2xx_cken_enable(struct clk *clk) | ||
19 | { | ||
20 | CKEN |= 1 << clk->cken; | ||
21 | } | ||
22 | |||
23 | void clk_pxa2xx_cken_disable(struct clk *clk) | ||
24 | { | ||
25 | CKEN &= ~(1 << clk->cken); | ||
26 | } | ||
27 | |||
28 | const struct clkops clk_pxa2xx_cken_ops = { | ||
29 | .enable = clk_pxa2xx_cken_enable, | ||
30 | .disable = clk_pxa2xx_cken_disable, | ||
31 | }; | ||
32 | |||
33 | #ifdef CONFIG_PM | ||
34 | static uint32_t saved_cken; | ||
35 | |||
36 | static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state) | ||
37 | { | ||
38 | saved_cken = CKEN; | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static int pxa2xx_clock_resume(struct sys_device *d) | ||
43 | { | ||
44 | CKEN = saved_cken; | ||
45 | return 0; | ||
46 | } | ||
47 | #else | ||
48 | #define pxa2xx_clock_suspend NULL | ||
49 | #define pxa2xx_clock_resume NULL | ||
50 | #endif | ||
51 | |||
52 | struct sysdev_class pxa2xx_clock_sysclass = { | ||
53 | .name = "pxa2xx-clock", | ||
54 | .suspend = pxa2xx_clock_suspend, | ||
55 | .resume = pxa2xx_clock_resume, | ||
56 | }; | ||
57 | |||
58 | static int __init pxa2xx_clock_init(void) | ||
59 | { | ||
60 | if (cpu_is_pxa2xx()) | ||
61 | return sysdev_class_register(&pxa2xx_clock_sysclass); | ||
62 | return 0; | ||
63 | } | ||
64 | postcore_initcall(pxa2xx_clock_init); | ||
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c new file mode 100644 index 000000000000..1b08a34ab234 --- /dev/null +++ b/arch/arm/mach-pxa/clock-pxa3xx.c | |||
@@ -0,0 +1,218 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/clock-pxa3xx.c | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/io.h> | ||
13 | |||
14 | #include <mach/smemc.h> | ||
15 | #include <mach/pxa3xx-regs.h> | ||
16 | |||
17 | #include "clock.h" | ||
18 | |||
19 | /* Crystal clock: 13MHz */ | ||
20 | #define BASE_CLK 13000000 | ||
21 | |||
22 | /* Ring Oscillator Clock: 60MHz */ | ||
23 | #define RO_CLK 60000000 | ||
24 | |||
25 | #define ACCR_D0CS (1 << 26) | ||
26 | #define ACCR_PCCE (1 << 11) | ||
27 | |||
28 | /* crystal frequency to HSIO bus frequency multiplier (HSS) */ | ||
29 | static unsigned char hss_mult[4] = { 8, 12, 16, 24 }; | ||
30 | |||
31 | /* | ||
32 | * Get the clock frequency as reflected by CCSR and the turbo flag. | ||
33 | * We assume these values have been applied via a fcs. | ||
34 | * If info is not 0 we also display the current settings. | ||
35 | */ | ||
36 | unsigned int pxa3xx_get_clk_frequency_khz(int info) | ||
37 | { | ||
38 | unsigned long acsr, xclkcfg; | ||
39 | unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS; | ||
40 | |||
41 | /* Read XCLKCFG register turbo bit */ | ||
42 | __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg)); | ||
43 | t = xclkcfg & 0x1; | ||
44 | |||
45 | acsr = ACSR; | ||
46 | |||
47 | xl = acsr & 0x1f; | ||
48 | xn = (acsr >> 8) & 0x7; | ||
49 | hss = (acsr >> 14) & 0x3; | ||
50 | |||
51 | XL = xl * BASE_CLK; | ||
52 | XN = xn * XL; | ||
53 | |||
54 | ro = acsr & ACCR_D0CS; | ||
55 | |||
56 | CLK = (ro) ? RO_CLK : ((t) ? XN : XL); | ||
57 | HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
58 | |||
59 | if (info) { | ||
60 | pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n", | ||
61 | RO_CLK / 1000000, (RO_CLK % 1000000) / 10000, | ||
62 | (ro) ? "" : "in"); | ||
63 | pr_info("Run Mode clock: %d.%02dMHz (*%d)\n", | ||
64 | XL / 1000000, (XL % 1000000) / 10000, xl); | ||
65 | pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n", | ||
66 | XN / 1000000, (XN % 1000000) / 10000, xn, | ||
67 | (t) ? "" : "in"); | ||
68 | pr_info("HSIO bus clock: %d.%02dMHz\n", | ||
69 | HSS / 1000000, (HSS % 1000000) / 10000); | ||
70 | } | ||
71 | |||
72 | return CLK / 1000; | ||
73 | } | ||
74 | |||
75 | /* | ||
76 | * Return the current AC97 clock frequency. | ||
77 | */ | ||
78 | static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk) | ||
79 | { | ||
80 | unsigned long rate = 312000000; | ||
81 | unsigned long ac97_div; | ||
82 | |||
83 | ac97_div = AC97_DIV; | ||
84 | |||
85 | /* This may loose precision for some rates but won't for the | ||
86 | * standard 24.576MHz. | ||
87 | */ | ||
88 | rate /= (ac97_div >> 12) & 0x7fff; | ||
89 | rate *= (ac97_div & 0xfff); | ||
90 | |||
91 | return rate; | ||
92 | } | ||
93 | |||
94 | /* | ||
95 | * Return the current HSIO bus clock frequency | ||
96 | */ | ||
97 | static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk) | ||
98 | { | ||
99 | unsigned long acsr; | ||
100 | unsigned int hss, hsio_clk; | ||
101 | |||
102 | acsr = ACSR; | ||
103 | |||
104 | hss = (acsr >> 14) & 0x3; | ||
105 | hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
106 | |||
107 | return hsio_clk; | ||
108 | } | ||
109 | |||
110 | /* crystal frequency to static memory controller multiplier (SMCFS) */ | ||
111 | static unsigned int smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; | ||
112 | static unsigned int df_clkdiv[4] = { 1, 2, 4, 1 }; | ||
113 | |||
114 | static unsigned long clk_pxa3xx_smemc_getrate(struct clk *clk) | ||
115 | { | ||
116 | unsigned long acsr = ACSR; | ||
117 | unsigned long memclkcfg = __raw_readl(MEMCLKCFG); | ||
118 | unsigned int smcfs = (acsr >> 23) & 0x7; | ||
119 | |||
120 | return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] / | ||
121 | df_clkdiv[(memclkcfg >> 16) & 0x3]; | ||
122 | } | ||
123 | |||
124 | void clk_pxa3xx_cken_enable(struct clk *clk) | ||
125 | { | ||
126 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
127 | |||
128 | if (clk->cken < 32) | ||
129 | CKENA |= mask; | ||
130 | else | ||
131 | CKENB |= mask; | ||
132 | } | ||
133 | |||
134 | void clk_pxa3xx_cken_disable(struct clk *clk) | ||
135 | { | ||
136 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
137 | |||
138 | if (clk->cken < 32) | ||
139 | CKENA &= ~mask; | ||
140 | else | ||
141 | CKENB &= ~mask; | ||
142 | } | ||
143 | |||
144 | const struct clkops clk_pxa3xx_cken_ops = { | ||
145 | .enable = clk_pxa3xx_cken_enable, | ||
146 | .disable = clk_pxa3xx_cken_disable, | ||
147 | }; | ||
148 | |||
149 | const struct clkops clk_pxa3xx_hsio_ops = { | ||
150 | .enable = clk_pxa3xx_cken_enable, | ||
151 | .disable = clk_pxa3xx_cken_disable, | ||
152 | .getrate = clk_pxa3xx_hsio_getrate, | ||
153 | }; | ||
154 | |||
155 | const struct clkops clk_pxa3xx_ac97_ops = { | ||
156 | .enable = clk_pxa3xx_cken_enable, | ||
157 | .disable = clk_pxa3xx_cken_disable, | ||
158 | .getrate = clk_pxa3xx_ac97_getrate, | ||
159 | }; | ||
160 | |||
161 | const struct clkops clk_pxa3xx_smemc_ops = { | ||
162 | .enable = clk_pxa3xx_cken_enable, | ||
163 | .disable = clk_pxa3xx_cken_disable, | ||
164 | .getrate = clk_pxa3xx_smemc_getrate, | ||
165 | }; | ||
166 | |||
167 | static void clk_pout_enable(struct clk *clk) | ||
168 | { | ||
169 | OSCC |= OSCC_PEN; | ||
170 | } | ||
171 | |||
172 | static void clk_pout_disable(struct clk *clk) | ||
173 | { | ||
174 | OSCC &= ~OSCC_PEN; | ||
175 | } | ||
176 | |||
177 | const struct clkops clk_pxa3xx_pout_ops = { | ||
178 | .enable = clk_pout_enable, | ||
179 | .disable = clk_pout_disable, | ||
180 | }; | ||
181 | |||
182 | #ifdef CONFIG_PM | ||
183 | static uint32_t cken[2]; | ||
184 | static uint32_t accr; | ||
185 | |||
186 | static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state) | ||
187 | { | ||
188 | cken[0] = CKENA; | ||
189 | cken[1] = CKENB; | ||
190 | accr = ACCR; | ||
191 | return 0; | ||
192 | } | ||
193 | |||
194 | static int pxa3xx_clock_resume(struct sys_device *d) | ||
195 | { | ||
196 | ACCR = accr; | ||
197 | CKENA = cken[0]; | ||
198 | CKENB = cken[1]; | ||
199 | return 0; | ||
200 | } | ||
201 | #else | ||
202 | #define pxa3xx_clock_suspend NULL | ||
203 | #define pxa3xx_clock_resume NULL | ||
204 | #endif | ||
205 | |||
206 | struct sysdev_class pxa3xx_clock_sysclass = { | ||
207 | .name = "pxa3xx-clock", | ||
208 | .suspend = pxa3xx_clock_suspend, | ||
209 | .resume = pxa3xx_clock_resume, | ||
210 | }; | ||
211 | |||
212 | static int __init pxa3xx_clock_init(void) | ||
213 | { | ||
214 | if (cpu_is_pxa3xx() || cpu_is_pxa95x()) | ||
215 | return sysdev_class_register(&pxa3xx_clock_sysclass); | ||
216 | return 0; | ||
217 | } | ||
218 | postcore_initcall(pxa3xx_clock_init); | ||
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c index abba0089a2ae..d5152220ce94 100644 --- a/arch/arm/mach-pxa/clock.c +++ b/arch/arm/mach-pxa/clock.c | |||
@@ -3,21 +3,11 @@ | |||
3 | */ | 3 | */ |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/list.h> | ||
7 | #include <linux/errno.h> | ||
8 | #include <linux/err.h> | ||
9 | #include <linux/string.h> | ||
10 | #include <linux/clk.h> | 6 | #include <linux/clk.h> |
11 | #include <linux/spinlock.h> | 7 | #include <linux/spinlock.h> |
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/delay.h> | 8 | #include <linux/delay.h> |
9 | #include <linux/clkdev.h> | ||
14 | 10 | ||
15 | #include <asm/clkdev.h> | ||
16 | #include <mach/pxa2xx-regs.h> | ||
17 | #include <mach/hardware.h> | ||
18 | |||
19 | #include "devices.h" | ||
20 | #include "generic.h" | ||
21 | #include "clock.h" | 11 | #include "clock.h" |
22 | 12 | ||
23 | static DEFINE_SPINLOCK(clocks_lock); | 13 | static DEFINE_SPINLOCK(clocks_lock); |
@@ -63,18 +53,19 @@ unsigned long clk_get_rate(struct clk *clk) | |||
63 | } | 53 | } |
64 | EXPORT_SYMBOL(clk_get_rate); | 54 | EXPORT_SYMBOL(clk_get_rate); |
65 | 55 | ||
66 | 56 | void clk_dummy_enable(struct clk *clk) | |
67 | void clk_cken_enable(struct clk *clk) | ||
68 | { | 57 | { |
69 | CKEN |= 1 << clk->cken; | ||
70 | } | 58 | } |
71 | 59 | ||
72 | void clk_cken_disable(struct clk *clk) | 60 | void clk_dummy_disable(struct clk *clk) |
73 | { | 61 | { |
74 | CKEN &= ~(1 << clk->cken); | ||
75 | } | 62 | } |
76 | 63 | ||
77 | const struct clkops clk_cken_ops = { | 64 | const struct clkops clk_dummy_ops = { |
78 | .enable = clk_cken_enable, | 65 | .enable = clk_dummy_enable, |
79 | .disable = clk_cken_disable, | 66 | .disable = clk_dummy_disable, |
67 | }; | ||
68 | |||
69 | struct clk clk_dummy = { | ||
70 | .ops = &clk_dummy_ops, | ||
80 | }; | 71 | }; |
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h index d8488742b807..f9f349a21b54 100644 --- a/arch/arm/mach-pxa/clock.h +++ b/arch/arm/mach-pxa/clock.h | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <asm/clkdev.h> | 1 | #include <linux/clkdev.h> |
2 | #include <linux/sysdev.h> | ||
2 | 3 | ||
3 | struct clkops { | 4 | struct clkops { |
4 | void (*enable)(struct clk *); | 5 | void (*enable)(struct clk *); |
@@ -14,6 +15,12 @@ struct clk { | |||
14 | unsigned int enabled; | 15 | unsigned int enabled; |
15 | }; | 16 | }; |
16 | 17 | ||
18 | void clk_dummy_enable(struct clk *); | ||
19 | void clk_dummy_disable(struct clk *); | ||
20 | |||
21 | extern const struct clkops clk_dummy_ops; | ||
22 | extern struct clk clk_dummy; | ||
23 | |||
17 | #define INIT_CLKREG(_clk,_devname,_conname) \ | 24 | #define INIT_CLKREG(_clk,_devname,_conname) \ |
18 | { \ | 25 | { \ |
19 | .clk = _clk, \ | 26 | .clk = _clk, \ |
@@ -21,14 +28,6 @@ struct clk { | |||
21 | .con_id = _conname, \ | 28 | .con_id = _conname, \ |
22 | } | 29 | } |
23 | 30 | ||
24 | #define DEFINE_CKEN(_name, _cken, _rate, _delay) \ | ||
25 | struct clk clk_##_name = { \ | ||
26 | .ops = &clk_cken_ops, \ | ||
27 | .rate = _rate, \ | ||
28 | .cken = CKEN_##_cken, \ | ||
29 | .delay = _delay, \ | ||
30 | } | ||
31 | |||
32 | #define DEFINE_CK(_name, _cken, _ops) \ | 31 | #define DEFINE_CK(_name, _cken, _ops) \ |
33 | struct clk clk_##_name = { \ | 32 | struct clk clk_##_name = { \ |
34 | .ops = _ops, \ | 33 | .ops = _ops, \ |
@@ -42,28 +41,38 @@ struct clk clk_##_name = { \ | |||
42 | .delay = _delay, \ | 41 | .delay = _delay, \ |
43 | } | 42 | } |
44 | 43 | ||
45 | extern const struct clkops clk_cken_ops; | 44 | #define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \ |
46 | |||
47 | void clk_cken_enable(struct clk *clk); | ||
48 | void clk_cken_disable(struct clk *clk); | ||
49 | |||
50 | #ifdef CONFIG_PXA3xx | ||
51 | #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ | ||
52 | struct clk clk_##_name = { \ | 45 | struct clk clk_##_name = { \ |
53 | .ops = &clk_pxa3xx_cken_ops, \ | 46 | .ops = &clk_pxa2xx_cken_ops, \ |
54 | .rate = _rate, \ | 47 | .rate = _rate, \ |
55 | .cken = CKEN_##_cken, \ | 48 | .cken = CKEN_##_cken, \ |
56 | .delay = _delay, \ | 49 | .delay = _delay, \ |
57 | } | 50 | } |
58 | 51 | ||
59 | #define DEFINE_PXA3_CK(_name, _cken, _ops) \ | 52 | extern const struct clkops clk_pxa2xx_cken_ops; |
53 | |||
54 | void clk_pxa2xx_cken_enable(struct clk *clk); | ||
55 | void clk_pxa2xx_cken_disable(struct clk *clk); | ||
56 | |||
57 | extern struct sysdev_class pxa2xx_clock_sysclass; | ||
58 | |||
59 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) | ||
60 | #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ | ||
60 | struct clk clk_##_name = { \ | 61 | struct clk clk_##_name = { \ |
61 | .ops = _ops, \ | 62 | .ops = &clk_pxa3xx_cken_ops, \ |
63 | .rate = _rate, \ | ||
62 | .cken = CKEN_##_cken, \ | 64 | .cken = CKEN_##_cken, \ |
65 | .delay = _delay, \ | ||
63 | } | 66 | } |
64 | 67 | ||
65 | extern const struct clkops clk_pxa3xx_cken_ops; | 68 | extern const struct clkops clk_pxa3xx_cken_ops; |
69 | extern const struct clkops clk_pxa3xx_hsio_ops; | ||
70 | extern const struct clkops clk_pxa3xx_ac97_ops; | ||
71 | extern const struct clkops clk_pxa3xx_pout_ops; | ||
72 | extern const struct clkops clk_pxa3xx_smemc_ops; | ||
73 | |||
66 | extern void clk_pxa3xx_cken_enable(struct clk *); | 74 | extern void clk_pxa3xx_cken_enable(struct clk *); |
67 | extern void clk_pxa3xx_cken_disable(struct clk *); | 75 | extern void clk_pxa3xx_cken_disable(struct clk *); |
68 | #endif | ||
69 | 76 | ||
77 | extern struct sysdev_class pxa3xx_clock_sysclass; | ||
78 | #endif | ||
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index d34b99febeb9..b734d8468168 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <mach/pxa2xx-regs.h> | 24 | #include <mach/pxa2xx-regs.h> |
25 | #include <mach/audio.h> | 25 | #include <mach/audio.h> |
26 | #include <mach/pxafb.h> | 26 | #include <mach/pxafb.h> |
27 | #include <mach/smemc.h> | ||
27 | 28 | ||
28 | #include <asm/hardware/it8152.h> | 29 | #include <asm/hardware/it8152.h> |
29 | 30 | ||
@@ -392,9 +393,9 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state) | |||
392 | cmx2xx_pci_suspend(); | 393 | cmx2xx_pci_suspend(); |
393 | 394 | ||
394 | /* save MSC registers */ | 395 | /* save MSC registers */ |
395 | sleep_save_msc[0] = MSC0; | 396 | sleep_save_msc[0] = __raw_readl(MSC0); |
396 | sleep_save_msc[1] = MSC1; | 397 | sleep_save_msc[1] = __raw_readl(MSC1); |
397 | sleep_save_msc[2] = MSC2; | 398 | sleep_save_msc[2] = __raw_readl(MSC2); |
398 | 399 | ||
399 | /* setup power saving mode registers */ | 400 | /* setup power saving mode registers */ |
400 | PCFR = 0x0; | 401 | PCFR = 0x0; |
@@ -416,9 +417,9 @@ static int cmx2xx_resume(struct sys_device *dev) | |||
416 | cmx2xx_pci_resume(); | 417 | cmx2xx_pci_resume(); |
417 | 418 | ||
418 | /* restore MSC registers */ | 419 | /* restore MSC registers */ |
419 | MSC0 = sleep_save_msc[0]; | 420 | __raw_writel(sleep_save_msc[0], MSC0); |
420 | MSC1 = sleep_save_msc[1]; | 421 | __raw_writel(sleep_save_msc[1], MSC1); |
421 | MSC2 = sleep_save_msc[2]; | 422 | __raw_writel(sleep_save_msc[2], MSC2); |
422 | 423 | ||
423 | return 0; | 424 | return 0; |
424 | } | 425 | } |
@@ -498,7 +499,12 @@ static struct map_desc cmx2xx_io_desc[] __initdata = { | |||
498 | 499 | ||
499 | static void __init cmx2xx_map_io(void) | 500 | static void __init cmx2xx_map_io(void) |
500 | { | 501 | { |
501 | pxa_map_io(); | 502 | if (cpu_is_pxa25x()) |
503 | pxa25x_map_io(); | ||
504 | |||
505 | if (cpu_is_pxa27x()) | ||
506 | pxa27x_map_io(); | ||
507 | |||
502 | iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc)); | 508 | iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc)); |
503 | 509 | ||
504 | it8152_base_address = CMX2XX_IT8152_VIRT; | 510 | it8152_base_address = CMX2XX_IT8152_VIRT; |
@@ -506,7 +512,11 @@ static void __init cmx2xx_map_io(void) | |||
506 | #else | 512 | #else |
507 | static void __init cmx2xx_map_io(void) | 513 | static void __init cmx2xx_map_io(void) |
508 | { | 514 | { |
509 | pxa_map_io(); | 515 | if (cpu_is_pxa25x()) |
516 | pxa25x_map_io(); | ||
517 | |||
518 | if (cpu_is_pxa27x()) | ||
519 | pxa27x_map_io(); | ||
510 | } | 520 | } |
511 | #endif | 521 | #endif |
512 | 522 | ||
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 922b1075b9de..7984268508b6 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -857,7 +857,7 @@ static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, | |||
857 | 857 | ||
858 | MACHINE_START(CM_X300, "CM-X300 module") | 858 | MACHINE_START(CM_X300, "CM-X300 module") |
859 | .boot_params = 0xa0000100, | 859 | .boot_params = 0xa0000100, |
860 | .map_io = pxa_map_io, | 860 | .map_io = pxa3xx_map_io, |
861 | .init_irq = pxa3xx_init_irq, | 861 | .init_irq = pxa3xx_init_irq, |
862 | .timer = &pxa_timer, | 862 | .timer = &pxa_timer, |
863 | .init_machine = cm_x300_init, | 863 | .init_machine = cm_x300_init, |
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c index 0f3b632c3b14..6b2c800a1133 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c +++ b/arch/arm/mach-pxa/colibri-evalboard.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 2 | * linux/arch/arm/mach-pxa/colibri-evalboard.c |
3 | * | 3 | * |
4 | * Support for Toradex PXA270 based Colibri Evaluation Carrier Board | 4 | * Support for Toradex Colibri Evaluation Carrier Board |
5 | * Daniel Mack <daniel@caiaq.de> | 5 | * Daniel Mack <daniel@caiaq.de> |
6 | * Marek Vasut <marek.vasut@gmail.com> | 6 | * Marek Vasut <marek.vasut@gmail.com> |
7 | * | 7 | * |
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
21 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
22 | #include <linux/i2c.h> | ||
22 | 23 | ||
23 | #include <mach/pxa27x.h> | 24 | #include <mach/pxa27x.h> |
24 | #include <mach/colibri.h> | 25 | #include <mach/colibri.h> |
@@ -26,86 +27,95 @@ | |||
26 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
27 | #include <mach/pxa27x-udc.h> | 28 | #include <mach/pxa27x-udc.h> |
28 | 29 | ||
30 | #include <plat/i2c.h> | ||
31 | |||
29 | #include "generic.h" | 32 | #include "generic.h" |
30 | #include "devices.h" | 33 | #include "devices.h" |
31 | 34 | ||
32 | /****************************************************************************** | 35 | /****************************************************************************** |
33 | * Pin configuration | ||
34 | ******************************************************************************/ | ||
35 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { | ||
36 | /* MMC */ | ||
37 | GPIO32_MMC_CLK, | ||
38 | GPIO92_MMC_DAT_0, | ||
39 | GPIO109_MMC_DAT_1, | ||
40 | GPIO110_MMC_DAT_2, | ||
41 | GPIO111_MMC_DAT_3, | ||
42 | GPIO112_MMC_CMD, | ||
43 | GPIO0_GPIO, /* SD detect */ | ||
44 | |||
45 | /* FFUART */ | ||
46 | GPIO39_FFUART_TXD, | ||
47 | GPIO34_FFUART_RXD, | ||
48 | |||
49 | /* UHC */ | ||
50 | GPIO88_USBH1_PWR, | ||
51 | GPIO89_USBH1_PEN, | ||
52 | GPIO119_USBH2_PWR, | ||
53 | GPIO120_USBH2_PEN, | ||
54 | }; | ||
55 | |||
56 | /****************************************************************************** | ||
57 | * SD/MMC card controller | 36 | * SD/MMC card controller |
58 | ******************************************************************************/ | 37 | ******************************************************************************/ |
59 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 38 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
60 | static struct pxamci_platform_data colibri_pxa270_mci_platform_data = { | 39 | static struct pxamci_platform_data colibri_mci_platform_data = { |
61 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 40 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
62 | .gpio_power = -1, | 41 | .gpio_power = -1, |
63 | .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT, | ||
64 | .gpio_card_ro = -1, | 42 | .gpio_card_ro = -1, |
65 | .detect_delay_ms = 200, | 43 | .detect_delay_ms = 200, |
66 | }; | 44 | }; |
67 | 45 | ||
68 | static void __init colibri_pxa270_mmc_init(void) | 46 | static void __init colibri_mmc_init(void) |
69 | { | 47 | { |
70 | pxa_set_mci_info(&colibri_pxa270_mci_platform_data); | 48 | if (machine_is_colibri()) /* PXA270 Colibri */ |
49 | colibri_mci_platform_data.gpio_card_detect = | ||
50 | GPIO0_COLIBRI_PXA270_SD_DETECT; | ||
51 | if (machine_is_colibri300()) /* PXA300 Colibri */ | ||
52 | colibri_mci_platform_data.gpio_card_detect = | ||
53 | GPIO39_COLIBRI_PXA300_SD_DETECT; | ||
54 | else /* PXA320 Colibri */ | ||
55 | colibri_mci_platform_data.gpio_card_detect = | ||
56 | GPIO28_COLIBRI_PXA320_SD_DETECT; | ||
57 | |||
58 | pxa_set_mci_info(&colibri_mci_platform_data); | ||
71 | } | 59 | } |
72 | #else | 60 | #else |
73 | static inline void colibri_pxa270_mmc_init(void) {} | 61 | static inline void colibri_mmc_init(void) {} |
74 | #endif | 62 | #endif |
75 | 63 | ||
76 | /****************************************************************************** | 64 | /****************************************************************************** |
77 | * USB Host | 65 | * USB Host |
78 | ******************************************************************************/ | 66 | ******************************************************************************/ |
79 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 67 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
80 | static int colibri_pxa270_ohci_init(struct device *dev) | 68 | static int colibri_ohci_init(struct device *dev) |
81 | { | 69 | { |
82 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; | 70 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; |
83 | return 0; | 71 | return 0; |
84 | } | 72 | } |
85 | 73 | ||
86 | static struct pxaohci_platform_data colibri_pxa270_ohci_info = { | 74 | static struct pxaohci_platform_data colibri_ohci_info = { |
87 | .port_mode = PMM_PERPORT_MODE, | 75 | .port_mode = PMM_PERPORT_MODE, |
88 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | | 76 | .flags = ENABLE_PORT1 | |
89 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | 77 | POWER_CONTROL_LOW | POWER_SENSE_LOW, |
90 | .init = colibri_pxa270_ohci_init, | 78 | .init = colibri_ohci_init, |
91 | }; | 79 | }; |
92 | 80 | ||
93 | static void __init colibri_pxa270_uhc_init(void) | 81 | static void __init colibri_uhc_init(void) |
94 | { | 82 | { |
95 | pxa_set_ohci_info(&colibri_pxa270_ohci_info); | 83 | /* Colibri PXA270 has two usb ports, TBA for 320 */ |
84 | if (machine_is_colibri()) | ||
85 | colibri_ohci_info.flags |= ENABLE_PORT2; | ||
86 | |||
87 | pxa_set_ohci_info(&colibri_ohci_info); | ||
96 | } | 88 | } |
97 | #else | 89 | #else |
98 | static inline void colibri_pxa270_uhc_init(void) {} | 90 | static inline void colibri_uhc_init(void) {} |
99 | #endif | 91 | #endif |
100 | 92 | ||
101 | void __init colibri_pxa270_evalboard_init(void) | 93 | /****************************************************************************** |
94 | * I2C RTC | ||
95 | ******************************************************************************/ | ||
96 | #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE) | ||
97 | static struct i2c_board_info __initdata colibri_i2c_devs[] = { | ||
98 | { | ||
99 | I2C_BOARD_INFO("m41t00", 0x68), | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | static void __init colibri_rtc_init(void) | ||
104 | { | ||
105 | pxa_set_i2c_info(NULL); | ||
106 | i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_i2c_devs)); | ||
107 | } | ||
108 | #else | ||
109 | static inline void colibri_rtc_init(void) {} | ||
110 | #endif | ||
111 | |||
112 | void __init colibri_evalboard_init(void) | ||
102 | { | 113 | { |
103 | pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config)); | ||
104 | pxa_set_ffuart_info(NULL); | 114 | pxa_set_ffuart_info(NULL); |
105 | pxa_set_btuart_info(NULL); | 115 | pxa_set_btuart_info(NULL); |
106 | pxa_set_stuart_info(NULL); | 116 | pxa_set_stuart_info(NULL); |
107 | 117 | ||
108 | colibri_pxa270_mmc_init(); | 118 | colibri_mmc_init(); |
109 | colibri_pxa270_uhc_init(); | 119 | colibri_uhc_init(); |
120 | colibri_rtc_init(); | ||
110 | } | 121 | } |
111 | |||
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c index 37f0f3ed7c61..07b62a096f17 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-income.c +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c | |||
@@ -46,52 +46,6 @@ | |||
46 | #define GPIO113_INCOME_TS_IRQ (113) | 46 | #define GPIO113_INCOME_TS_IRQ (113) |
47 | 47 | ||
48 | /****************************************************************************** | 48 | /****************************************************************************** |
49 | * Pin configuration | ||
50 | ******************************************************************************/ | ||
51 | static mfp_cfg_t income_pin_config[] __initdata = { | ||
52 | /* MMC */ | ||
53 | GPIO32_MMC_CLK, | ||
54 | GPIO92_MMC_DAT_0, | ||
55 | GPIO109_MMC_DAT_1, | ||
56 | GPIO110_MMC_DAT_2, | ||
57 | GPIO111_MMC_DAT_3, | ||
58 | GPIO112_MMC_CMD, | ||
59 | GPIO0_GPIO, /* SD detect */ | ||
60 | GPIO1_GPIO, /* SD read-only */ | ||
61 | |||
62 | /* FFUART */ | ||
63 | GPIO39_FFUART_TXD, | ||
64 | GPIO34_FFUART_RXD, | ||
65 | |||
66 | /* BFUART */ | ||
67 | GPIO42_BTUART_RXD, | ||
68 | GPIO43_BTUART_TXD, | ||
69 | GPIO45_BTUART_RTS, | ||
70 | |||
71 | /* STUART */ | ||
72 | GPIO46_STUART_RXD, | ||
73 | GPIO47_STUART_TXD, | ||
74 | |||
75 | /* UHC */ | ||
76 | GPIO88_USBH1_PWR, | ||
77 | GPIO89_USBH1_PEN, | ||
78 | |||
79 | /* LCD */ | ||
80 | GPIOxx_LCD_TFT_16BPP, | ||
81 | |||
82 | /* PWM */ | ||
83 | GPIO16_PWM0_OUT, | ||
84 | |||
85 | /* I2C */ | ||
86 | GPIO117_I2C_SCL, | ||
87 | GPIO118_I2C_SDA, | ||
88 | |||
89 | /* LED */ | ||
90 | GPIO54_GPIO, /* LED A */ | ||
91 | GPIO55_GPIO, /* LED B */ | ||
92 | }; | ||
93 | |||
94 | /****************************************************************************** | ||
95 | * SD/MMC card controller | 49 | * SD/MMC card controller |
96 | ******************************************************************************/ | 50 | ******************************************************************************/ |
97 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 51 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
@@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {} | |||
257 | 211 | ||
258 | void __init colibri_pxa270_income_boardinit(void) | 212 | void __init colibri_pxa270_income_boardinit(void) |
259 | { | 213 | { |
260 | pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); | ||
261 | pxa_set_ffuart_info(NULL); | 214 | pxa_set_ffuart_info(NULL); |
262 | pxa_set_btuart_info(NULL); | 215 | pxa_set_btuart_info(NULL); |
263 | pxa_set_stuart_info(NULL); | 216 | pxa_set_stuart_info(NULL); |
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index bc045100ec15..6fc5d328ba7f 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c | |||
@@ -33,6 +33,103 @@ | |||
33 | #include "generic.h" | 33 | #include "generic.h" |
34 | 34 | ||
35 | /****************************************************************************** | 35 | /****************************************************************************** |
36 | * Evaluation board MFP | ||
37 | ******************************************************************************/ | ||
38 | #ifdef CONFIG_MACH_COLIBRI_EVALBOARD | ||
39 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { | ||
40 | /* MMC */ | ||
41 | GPIO32_MMC_CLK, | ||
42 | GPIO92_MMC_DAT_0, | ||
43 | GPIO109_MMC_DAT_1, | ||
44 | GPIO110_MMC_DAT_2, | ||
45 | GPIO111_MMC_DAT_3, | ||
46 | GPIO112_MMC_CMD, | ||
47 | GPIO0_GPIO, /* SD detect */ | ||
48 | |||
49 | /* FFUART */ | ||
50 | GPIO39_FFUART_TXD, | ||
51 | GPIO34_FFUART_RXD, | ||
52 | |||
53 | /* UHC */ | ||
54 | GPIO88_USBH1_PWR, | ||
55 | GPIO89_USBH1_PEN, | ||
56 | GPIO119_USBH2_PWR, | ||
57 | GPIO120_USBH2_PEN, | ||
58 | |||
59 | /* PCMCIA */ | ||
60 | GPIO85_nPCE_1, | ||
61 | GPIO54_nPCE_2, | ||
62 | GPIO55_nPREG, | ||
63 | GPIO50_nPIOR, | ||
64 | GPIO51_nPIOW, | ||
65 | GPIO49_nPWE, | ||
66 | GPIO48_nPOE, | ||
67 | GPIO57_nIOIS16, | ||
68 | GPIO56_nPWAIT, | ||
69 | GPIO104_PSKTSEL, | ||
70 | GPIO53_GPIO, /* RESET */ | ||
71 | GPIO83_GPIO, /* BVD1 */ | ||
72 | GPIO82_GPIO, /* BVD2 */ | ||
73 | GPIO1_GPIO, /* READY */ | ||
74 | GPIO84_GPIO, /* DETECT */ | ||
75 | GPIO107_GPIO, /* PPEN */ | ||
76 | |||
77 | /* I2C */ | ||
78 | GPIO117_I2C_SCL, | ||
79 | GPIO118_I2C_SDA, | ||
80 | }; | ||
81 | #else | ||
82 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {}; | ||
83 | #endif | ||
84 | |||
85 | #ifdef CONFIG_MACH_COLIBRI_PXA270_INCOME | ||
86 | static mfp_cfg_t income_pin_config[] __initdata = { | ||
87 | /* MMC */ | ||
88 | GPIO32_MMC_CLK, | ||
89 | GPIO92_MMC_DAT_0, | ||
90 | GPIO109_MMC_DAT_1, | ||
91 | GPIO110_MMC_DAT_2, | ||
92 | GPIO111_MMC_DAT_3, | ||
93 | GPIO112_MMC_CMD, | ||
94 | GPIO0_GPIO, /* SD detect */ | ||
95 | GPIO1_GPIO, /* SD read-only */ | ||
96 | |||
97 | /* FFUART */ | ||
98 | GPIO39_FFUART_TXD, | ||
99 | GPIO34_FFUART_RXD, | ||
100 | |||
101 | /* BFUART */ | ||
102 | GPIO42_BTUART_RXD, | ||
103 | GPIO43_BTUART_TXD, | ||
104 | GPIO45_BTUART_RTS, | ||
105 | |||
106 | /* STUART */ | ||
107 | GPIO46_STUART_RXD, | ||
108 | GPIO47_STUART_TXD, | ||
109 | |||
110 | /* UHC */ | ||
111 | GPIO88_USBH1_PWR, | ||
112 | GPIO89_USBH1_PEN, | ||
113 | |||
114 | /* LCD */ | ||
115 | GPIOxx_LCD_TFT_16BPP, | ||
116 | |||
117 | /* PWM */ | ||
118 | GPIO16_PWM0_OUT, | ||
119 | |||
120 | /* I2C */ | ||
121 | GPIO117_I2C_SCL, | ||
122 | GPIO118_I2C_SDA, | ||
123 | |||
124 | /* LED */ | ||
125 | GPIO54_GPIO, /* LED A */ | ||
126 | GPIO55_GPIO, /* LED B */ | ||
127 | }; | ||
128 | #else | ||
129 | static mfp_cfg_t income_pin_config[] __initdata = {}; | ||
130 | #endif | ||
131 | |||
132 | /****************************************************************************** | ||
36 | * Pin configuration | 133 | * Pin configuration |
37 | ******************************************************************************/ | 134 | ******************************************************************************/ |
38 | static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { | 135 | static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { |
@@ -184,10 +281,13 @@ static void __init colibri_pxa270_init(void) | |||
184 | colibri_pxa270_tsc_init(); | 281 | colibri_pxa270_tsc_init(); |
185 | 282 | ||
186 | switch (colibri_pxa270_baseboard) { | 283 | switch (colibri_pxa270_baseboard) { |
187 | case COLIBRI_PXA270_EVALBOARD: | 284 | case COLIBRI_EVALBOARD: |
188 | colibri_pxa270_evalboard_init(); | 285 | pxa2xx_mfp_config(ARRAY_AND_SIZE( |
286 | colibri_pxa270_evalboard_pin_config)); | ||
287 | colibri_evalboard_init(); | ||
189 | break; | 288 | break; |
190 | case COLIBRI_PXA270_INCOME: | 289 | case COLIBRI_PXA270_INCOME: |
290 | pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); | ||
191 | colibri_pxa270_income_boardinit(); | 291 | colibri_pxa270_income_boardinit(); |
192 | break; | 292 | break; |
193 | default: | 293 | default: |
@@ -209,7 +309,7 @@ static void __init colibri_pxa270_income_init(void) | |||
209 | MACHINE_START(COLIBRI, "Toradex Colibri PXA270") | 309 | MACHINE_START(COLIBRI, "Toradex Colibri PXA270") |
210 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, | 310 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, |
211 | .init_machine = colibri_pxa270_init, | 311 | .init_machine = colibri_pxa270_init, |
212 | .map_io = pxa_map_io, | 312 | .map_io = pxa27x_map_io, |
213 | .init_irq = pxa27x_init_irq, | 313 | .init_irq = pxa27x_init_irq, |
214 | .timer = &pxa_timer, | 314 | .timer = &pxa_timer, |
215 | MACHINE_END | 315 | MACHINE_END |
@@ -217,7 +317,7 @@ MACHINE_END | |||
217 | MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") | 317 | MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") |
218 | .boot_params = 0xa0000100, | 318 | .boot_params = 0xa0000100, |
219 | .init_machine = colibri_pxa270_income_init, | 319 | .init_machine = colibri_pxa270_income_init, |
220 | .map_io = pxa_map_io, | 320 | .map_io = pxa27x_map_io, |
221 | .init_irq = pxa27x_init_irq, | 321 | .init_irq = pxa27x_init_irq, |
222 | .timer = &pxa_timer, | 322 | .timer = &pxa_timer, |
223 | MACHINE_END | 323 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index a70b256591e6..fddb16d07eb0 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -31,9 +31,38 @@ | |||
31 | #include "generic.h" | 31 | #include "generic.h" |
32 | #include "devices.h" | 32 | #include "devices.h" |
33 | 33 | ||
34 | |||
35 | #ifdef CONFIG_MACH_COLIBRI_EVALBOARD | ||
36 | static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = { | ||
37 | /* MMC */ | ||
38 | GPIO7_MMC1_CLK, | ||
39 | GPIO14_MMC1_CMD, | ||
40 | GPIO3_MMC1_DAT0, | ||
41 | GPIO4_MMC1_DAT1, | ||
42 | GPIO5_MMC1_DAT2, | ||
43 | GPIO6_MMC1_DAT3, | ||
44 | GPIO39_GPIO, /* SD detect */ | ||
45 | |||
46 | /* UHC */ | ||
47 | GPIO0_2_USBH_PEN, | ||
48 | GPIO1_2_USBH_PWR, | ||
49 | GPIO77_USB_P3_1, | ||
50 | GPIO78_USB_P3_2, | ||
51 | GPIO79_USB_P3_3, | ||
52 | GPIO80_USB_P3_4, | ||
53 | GPIO81_USB_P3_5, | ||
54 | GPIO82_USB_P3_6, | ||
55 | |||
56 | /* I2C */ | ||
57 | GPIO21_I2C_SCL, | ||
58 | GPIO22_I2C_SDA, | ||
59 | }; | ||
60 | #else | ||
61 | static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {}; | ||
62 | #endif | ||
63 | |||
34 | #if defined(CONFIG_AX88796) | 64 | #if defined(CONFIG_AX88796) |
35 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) | 65 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) |
36 | |||
37 | /* | 66 | /* |
38 | * Asix AX88796 Ethernet | 67 | * Asix AX88796 Ethernet |
39 | */ | 68 | */ |
@@ -80,35 +109,6 @@ static void __init colibri_pxa300_init_eth(void) | |||
80 | static inline void __init colibri_pxa300_init_eth(void) {} | 109 | static inline void __init colibri_pxa300_init_eth(void) {} |
81 | #endif /* CONFIG_AX88796 */ | 110 | #endif /* CONFIG_AX88796 */ |
82 | 111 | ||
83 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
84 | static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = { | ||
85 | GPIO0_2_USBH_PEN, | ||
86 | GPIO1_2_USBH_PWR, | ||
87 | }; | ||
88 | |||
89 | static struct pxaohci_platform_data colibri_pxa300_ohci_info = { | ||
90 | .port_mode = PMM_GLOBAL_MODE, | ||
91 | .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | ||
92 | }; | ||
93 | |||
94 | void __init colibri_pxa300_init_ohci(void) | ||
95 | { | ||
96 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config)); | ||
97 | pxa_set_ohci_info(&colibri_pxa300_ohci_info); | ||
98 | } | ||
99 | #else | ||
100 | static inline void colibri_pxa300_init_ohci(void) {} | ||
101 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ | ||
102 | |||
103 | static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = { | ||
104 | GPIO7_MMC1_CLK, | ||
105 | GPIO14_MMC1_CMD, | ||
106 | GPIO3_MMC1_DAT0, | ||
107 | GPIO4_MMC1_DAT1, | ||
108 | GPIO5_MMC1_DAT2, | ||
109 | GPIO6_MMC1_DAT3, | ||
110 | }; | ||
111 | |||
112 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 112 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
113 | static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { | 113 | static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { |
114 | GPIO54_LCD_LDD_0, | 114 | GPIO54_LCD_LDD_0, |
@@ -171,24 +171,21 @@ static inline void colibri_pxa310_init_ac97(void) {} | |||
171 | 171 | ||
172 | void __init colibri_pxa300_init(void) | 172 | void __init colibri_pxa300_init(void) |
173 | { | 173 | { |
174 | pxa_set_ffuart_info(NULL); | ||
175 | pxa_set_btuart_info(NULL); | ||
176 | pxa_set_stuart_info(NULL); | ||
177 | |||
178 | colibri_pxa300_init_eth(); | 174 | colibri_pxa300_init_eth(); |
179 | colibri_pxa300_init_ohci(); | ||
180 | colibri_pxa3xx_init_nand(); | 175 | colibri_pxa3xx_init_nand(); |
181 | colibri_pxa300_init_lcd(); | 176 | colibri_pxa300_init_lcd(); |
182 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); | 177 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); |
183 | colibri_pxa310_init_ac97(); | 178 | colibri_pxa310_init_ac97(); |
184 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), | 179 | |
185 | mfp_to_gpio(MFP_PIN_GPIO13)); | 180 | /* Evalboard init */ |
181 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config)); | ||
182 | colibri_evalboard_init(); | ||
186 | } | 183 | } |
187 | 184 | ||
188 | MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") | 185 | MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") |
189 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, | 186 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, |
190 | .init_machine = colibri_pxa300_init, | 187 | .init_machine = colibri_pxa300_init, |
191 | .map_io = pxa_map_io, | 188 | .map_io = pxa3xx_map_io, |
192 | .init_irq = pxa3xx_init_irq, | 189 | .init_irq = pxa3xx_init_irq, |
193 | .timer = &pxa_timer, | 190 | .timer = &pxa_timer, |
194 | MACHINE_END | 191 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index ca5f29e2e9cd..ff9ff5f4fc47 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c | |||
@@ -35,9 +35,72 @@ | |||
35 | #include "generic.h" | 35 | #include "generic.h" |
36 | #include "devices.h" | 36 | #include "devices.h" |
37 | 37 | ||
38 | #ifdef CONFIG_MACH_COLIBRI_EVALBOARD | ||
39 | static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = { | ||
40 | /* MMC */ | ||
41 | GPIO22_MMC1_CLK, | ||
42 | GPIO23_MMC1_CMD, | ||
43 | GPIO18_MMC1_DAT0, | ||
44 | GPIO19_MMC1_DAT1, | ||
45 | GPIO20_MMC1_DAT2, | ||
46 | GPIO21_MMC1_DAT3, | ||
47 | GPIO28_GPIO, /* SD detect */ | ||
48 | |||
49 | /* UART 1 configuration (may be set by bootloader) */ | ||
50 | GPIO99_UART1_CTS, | ||
51 | GPIO104_UART1_RTS, | ||
52 | GPIO97_UART1_RXD, | ||
53 | GPIO98_UART1_TXD, | ||
54 | GPIO101_UART1_DTR, | ||
55 | GPIO103_UART1_DSR, | ||
56 | GPIO100_UART1_DCD, | ||
57 | GPIO102_UART1_RI, | ||
58 | |||
59 | /* UART 2 configuration */ | ||
60 | GPIO109_UART2_CTS, | ||
61 | GPIO112_UART2_RTS, | ||
62 | GPIO110_UART2_RXD, | ||
63 | GPIO111_UART2_TXD, | ||
64 | |||
65 | /* UART 3 configuration */ | ||
66 | GPIO30_UART3_RXD, | ||
67 | GPIO31_UART3_TXD, | ||
68 | |||
69 | /* UHC */ | ||
70 | GPIO2_2_USBH_PEN, | ||
71 | GPIO3_2_USBH_PWR, | ||
72 | |||
73 | /* I2C */ | ||
74 | GPIO32_I2C_SCL, | ||
75 | GPIO33_I2C_SDA, | ||
76 | |||
77 | /* PCMCIA */ | ||
78 | MFP_CFG(GPIO59, AF7), /* PRST ; AF7 to tristate */ | ||
79 | MFP_CFG(GPIO61, AF7), /* PCE1 ; AF7 to tristate */ | ||
80 | MFP_CFG(GPIO60, AF7), /* PCE2 ; AF7 to tristate */ | ||
81 | MFP_CFG(GPIO62, AF7), /* PCD ; AF7 to tristate */ | ||
82 | MFP_CFG(GPIO56, AF7), /* PSKTSEL ; AF7 to tristate */ | ||
83 | GPIO27_GPIO, /* RDnWR ; input/tristate */ | ||
84 | GPIO50_GPIO, /* PREG ; input/tristate */ | ||
85 | GPIO2_RDY, | ||
86 | GPIO5_NPIOR, | ||
87 | GPIO6_NPIOW, | ||
88 | GPIO7_NPIOS16, | ||
89 | GPIO8_NPWAIT, | ||
90 | GPIO29_GPIO, /* PRDY (READY GPIO) */ | ||
91 | GPIO57_GPIO, /* PPEN (POWER GPIO) */ | ||
92 | GPIO81_GPIO, /* PCD (DETECT GPIO) */ | ||
93 | GPIO77_GPIO, /* PRST (RESET GPIO) */ | ||
94 | GPIO53_GPIO, /* PBVD1 */ | ||
95 | GPIO79_GPIO, /* PBVD2 */ | ||
96 | GPIO54_GPIO, /* POE */ | ||
97 | }; | ||
98 | #else | ||
99 | static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {}; | ||
100 | #endif | ||
101 | |||
38 | #if defined(CONFIG_AX88796) | 102 | #if defined(CONFIG_AX88796) |
39 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) | 103 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) |
40 | |||
41 | /* | 104 | /* |
42 | * Asix AX88796 Ethernet | 105 | * Asix AX88796 Ethernet |
43 | */ | 106 | */ |
@@ -84,26 +147,6 @@ static void __init colibri_pxa320_init_eth(void) | |||
84 | static inline void __init colibri_pxa320_init_eth(void) {} | 147 | static inline void __init colibri_pxa320_init_eth(void) {} |
85 | #endif /* CONFIG_AX88796 */ | 148 | #endif /* CONFIG_AX88796 */ |
86 | 149 | ||
87 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
88 | static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = { | ||
89 | GPIO2_2_USBH_PEN, | ||
90 | GPIO3_2_USBH_PWR, | ||
91 | }; | ||
92 | |||
93 | static struct pxaohci_platform_data colibri_pxa320_ohci_info = { | ||
94 | .port_mode = PMM_GLOBAL_MODE, | ||
95 | .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | ||
96 | }; | ||
97 | |||
98 | void __init colibri_pxa320_init_ohci(void) | ||
99 | { | ||
100 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config)); | ||
101 | pxa_set_ohci_info(&colibri_pxa320_ohci_info); | ||
102 | } | ||
103 | #else | ||
104 | static inline void colibri_pxa320_init_ohci(void) {} | ||
105 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ | ||
106 | |||
107 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) | 150 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) |
108 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { | 151 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { |
109 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), | 152 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), |
@@ -140,15 +183,6 @@ static void __init colibri_pxa320_init_udc(void) | |||
140 | static inline void colibri_pxa320_init_udc(void) {} | 183 | static inline void colibri_pxa320_init_udc(void) {} |
141 | #endif | 184 | #endif |
142 | 185 | ||
143 | static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { | ||
144 | GPIO22_MMC1_CLK, | ||
145 | GPIO23_MMC1_CMD, | ||
146 | GPIO18_MMC1_DAT0, | ||
147 | GPIO19_MMC1_DAT1, | ||
148 | GPIO20_MMC1_DAT2, | ||
149 | GPIO21_MMC1_DAT3 | ||
150 | }; | ||
151 | |||
152 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 186 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
153 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { | 187 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { |
154 | GPIO6_2_LCD_LDD_0, | 188 | GPIO6_2_LCD_LDD_0, |
@@ -205,59 +239,24 @@ static inline void __init colibri_pxa320_init_ac97(void) | |||
205 | static inline void colibri_pxa320_init_ac97(void) {} | 239 | static inline void colibri_pxa320_init_ac97(void) {} |
206 | #endif | 240 | #endif |
207 | 241 | ||
208 | /* | ||
209 | * The following configuration is verified to work with the Toradex Orchid | ||
210 | * carrier board | ||
211 | */ | ||
212 | static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = { | ||
213 | /* UART 1 configuration (may be set by bootloader) */ | ||
214 | GPIO99_UART1_CTS, | ||
215 | GPIO104_UART1_RTS, | ||
216 | GPIO97_UART1_RXD, | ||
217 | GPIO98_UART1_TXD, | ||
218 | GPIO101_UART1_DTR, | ||
219 | GPIO103_UART1_DSR, | ||
220 | GPIO100_UART1_DCD, | ||
221 | GPIO102_UART1_RI, | ||
222 | |||
223 | /* UART 2 configuration */ | ||
224 | GPIO109_UART2_CTS, | ||
225 | GPIO112_UART2_RTS, | ||
226 | GPIO110_UART2_RXD, | ||
227 | GPIO111_UART2_TXD, | ||
228 | |||
229 | /* UART 3 configuration */ | ||
230 | GPIO30_UART3_RXD, | ||
231 | GPIO31_UART3_TXD, | ||
232 | }; | ||
233 | |||
234 | static void __init colibri_pxa320_init_uart(void) | ||
235 | { | ||
236 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config)); | ||
237 | } | ||
238 | |||
239 | void __init colibri_pxa320_init(void) | 242 | void __init colibri_pxa320_init(void) |
240 | { | 243 | { |
241 | pxa_set_ffuart_info(NULL); | ||
242 | pxa_set_btuart_info(NULL); | ||
243 | pxa_set_stuart_info(NULL); | ||
244 | |||
245 | colibri_pxa320_init_eth(); | 244 | colibri_pxa320_init_eth(); |
246 | colibri_pxa320_init_ohci(); | ||
247 | colibri_pxa3xx_init_nand(); | 245 | colibri_pxa3xx_init_nand(); |
248 | colibri_pxa320_init_lcd(); | 246 | colibri_pxa320_init_lcd(); |
249 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); | 247 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); |
250 | colibri_pxa320_init_ac97(); | 248 | colibri_pxa320_init_ac97(); |
251 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), | ||
252 | mfp_to_gpio(MFP_PIN_GPIO28)); | ||
253 | colibri_pxa320_init_uart(); | ||
254 | colibri_pxa320_init_udc(); | 249 | colibri_pxa320_init_udc(); |
250 | |||
251 | /* Evalboard init */ | ||
252 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config)); | ||
253 | colibri_evalboard_init(); | ||
255 | } | 254 | } |
256 | 255 | ||
257 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") | 256 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") |
258 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, | 257 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, |
259 | .init_machine = colibri_pxa320_init, | 258 | .init_machine = colibri_pxa320_init, |
260 | .map_io = pxa_map_io, | 259 | .map_io = pxa3xx_map_io, |
261 | .init_irq = pxa3xx_init_irq, | 260 | .init_irq = pxa3xx_init_irq, |
262 | .timer = &pxa_timer, | 261 | .timer = &pxa_timer, |
263 | MACHINE_END | 262 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c index 199afa2ae303..96b2d9fbfef0 100644 --- a/arch/arm/mach-pxa/colibri-pxa3xx.c +++ b/arch/arm/mach-pxa/colibri-pxa3xx.c | |||
@@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data) | |||
64 | } | 64 | } |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
68 | static int mmc_detect_pin; | ||
69 | |||
70 | static int colibri_pxa3xx_mci_init(struct device *dev, | ||
71 | irq_handler_t colibri_mmc_detect_int, | ||
72 | void *data) | ||
73 | { | ||
74 | int ret; | ||
75 | |||
76 | ret = gpio_request(mmc_detect_pin, "mmc card detect"); | ||
77 | if (ret) | ||
78 | return ret; | ||
79 | |||
80 | gpio_direction_input(mmc_detect_pin); | ||
81 | ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int, | ||
82 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
83 | "MMC card detect", data); | ||
84 | if (ret) { | ||
85 | gpio_free(mmc_detect_pin); | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static void colibri_pxa3xx_mci_exit(struct device *dev, void *data) | ||
93 | { | ||
94 | free_irq(mmc_detect_pin, data); | ||
95 | gpio_free(gpio_to_irq(mmc_detect_pin)); | ||
96 | } | ||
97 | |||
98 | static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = { | ||
99 | .detect_delay_ms = 200, | ||
100 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
101 | .init = colibri_pxa3xx_mci_init, | ||
102 | .exit = colibri_pxa3xx_mci_exit, | ||
103 | .gpio_card_detect = -1, | ||
104 | .gpio_card_ro = -1, | ||
105 | .gpio_power = -1, | ||
106 | }; | ||
107 | |||
108 | void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin) | ||
109 | { | ||
110 | pxa3xx_mfp_config(pins, len); | ||
111 | mmc_detect_pin = detect_pin; | ||
112 | pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data); | ||
113 | } | ||
114 | #endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ | ||
115 | |||
116 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 67 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
117 | static int lcd_bl_pin; | 68 | static int lcd_bl_pin; |
118 | 69 | ||
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 821229acabe6..9f3e5af0a0db 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -721,7 +721,7 @@ static void __init fixup_corgi(struct machine_desc *desc, | |||
721 | #ifdef CONFIG_MACH_CORGI | 721 | #ifdef CONFIG_MACH_CORGI |
722 | MACHINE_START(CORGI, "SHARP Corgi") | 722 | MACHINE_START(CORGI, "SHARP Corgi") |
723 | .fixup = fixup_corgi, | 723 | .fixup = fixup_corgi, |
724 | .map_io = pxa_map_io, | 724 | .map_io = pxa25x_map_io, |
725 | .init_irq = pxa25x_init_irq, | 725 | .init_irq = pxa25x_init_irq, |
726 | .init_machine = corgi_init, | 726 | .init_machine = corgi_init, |
727 | .timer = &pxa_timer, | 727 | .timer = &pxa_timer, |
@@ -731,7 +731,7 @@ MACHINE_END | |||
731 | #ifdef CONFIG_MACH_SHEPHERD | 731 | #ifdef CONFIG_MACH_SHEPHERD |
732 | MACHINE_START(SHEPHERD, "SHARP Shepherd") | 732 | MACHINE_START(SHEPHERD, "SHARP Shepherd") |
733 | .fixup = fixup_corgi, | 733 | .fixup = fixup_corgi, |
734 | .map_io = pxa_map_io, | 734 | .map_io = pxa25x_map_io, |
735 | .init_irq = pxa25x_init_irq, | 735 | .init_irq = pxa25x_init_irq, |
736 | .init_machine = corgi_init, | 736 | .init_machine = corgi_init, |
737 | .timer = &pxa_timer, | 737 | .timer = &pxa_timer, |
@@ -741,7 +741,7 @@ MACHINE_END | |||
741 | #ifdef CONFIG_MACH_HUSKY | 741 | #ifdef CONFIG_MACH_HUSKY |
742 | MACHINE_START(HUSKY, "SHARP Husky") | 742 | MACHINE_START(HUSKY, "SHARP Husky") |
743 | .fixup = fixup_corgi, | 743 | .fixup = fixup_corgi, |
744 | .map_io = pxa_map_io, | 744 | .map_io = pxa25x_map_io, |
745 | .init_irq = pxa25x_init_irq, | 745 | .init_irq = pxa25x_init_irq, |
746 | .init_machine = corgi_init, | 746 | .init_machine = corgi_init, |
747 | .timer = &pxa_timer, | 747 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 58093d9e07be..6a7aeab42f6c 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
@@ -38,8 +38,10 @@ | |||
38 | #include <linux/cpufreq.h> | 38 | #include <linux/cpufreq.h> |
39 | #include <linux/err.h> | 39 | #include <linux/err.h> |
40 | #include <linux/regulator/consumer.h> | 40 | #include <linux/regulator/consumer.h> |
41 | #include <linux/io.h> | ||
41 | 42 | ||
42 | #include <mach/pxa2xx-regs.h> | 43 | #include <mach/pxa2xx-regs.h> |
44 | #include <mach/smemc.h> | ||
43 | 45 | ||
44 | #ifdef DEBUG | 46 | #ifdef DEBUG |
45 | static unsigned int freq_debug; | 47 | static unsigned int freq_debug; |
@@ -242,7 +244,7 @@ static void pxa27x_guess_max_freq(void) | |||
242 | 244 | ||
243 | static void init_sdram_rows(void) | 245 | static void init_sdram_rows(void) |
244 | { | 246 | { |
245 | uint32_t mdcnfg = MDCNFG; | 247 | uint32_t mdcnfg = __raw_readl(MDCNFG); |
246 | unsigned int drac2 = 0, drac0 = 0; | 248 | unsigned int drac2 = 0, drac0 = 0; |
247 | 249 | ||
248 | if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3)) | 250 | if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3)) |
@@ -331,8 +333,8 @@ static int pxa_set_target(struct cpufreq_policy *policy, | |||
331 | * we need to preset the smaller DRI before the change. If we're | 333 | * we need to preset the smaller DRI before the change. If we're |
332 | * speeding up we need to set the larger DRI value after the change. | 334 | * speeding up we need to set the larger DRI value after the change. |
333 | */ | 335 | */ |
334 | preset_mdrefr = postset_mdrefr = MDREFR; | 336 | preset_mdrefr = postset_mdrefr = __raw_readl(MDREFR); |
335 | if ((MDREFR & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) { | 337 | if ((preset_mdrefr & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) { |
336 | preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK); | 338 | preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK); |
337 | preset_mdrefr |= mdrefr_dri(new_freq_mem); | 339 | preset_mdrefr |= mdrefr_dri(new_freq_mem); |
338 | } | 340 | } |
@@ -370,7 +372,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, | |||
370 | 3: nop \n\ | 372 | 3: nop \n\ |
371 | " | 373 | " |
372 | : "=&r" (unused) | 374 | : "=&r" (unused) |
373 | : "r" (&MDREFR), "r" (cclkcfg), | 375 | : "r" (MDREFR), "r" (cclkcfg), |
374 | "r" (preset_mdrefr), "r" (postset_mdrefr) | 376 | "r" (preset_mdrefr), "r" (postset_mdrefr) |
375 | : "r4", "r5"); | 377 | : "r4", "r5"); |
376 | local_irq_restore(flags); | 378 | local_irq_restore(flags); |
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c index 57cacaff194d..a305424a967d 100644 --- a/arch/arm/mach-pxa/csb726.c +++ b/arch/arm/mach-pxa/csb726.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
28 | #include <mach/pxa2xx-regs.h> | 28 | #include <mach/pxa2xx-regs.h> |
29 | #include <mach/audio.h> | 29 | #include <mach/audio.h> |
30 | #include <mach/smemc.h> | ||
30 | 31 | ||
31 | #include "generic.h" | 32 | #include "generic.h" |
32 | #include "devices.h" | 33 | #include "devices.h" |
@@ -255,9 +256,9 @@ static struct platform_device *devices[] __initdata = { | |||
255 | static void __init csb726_init(void) | 256 | static void __init csb726_init(void) |
256 | { | 257 | { |
257 | pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config)); | 258 | pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config)); |
258 | /* MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */ | 259 | /* __raw_writel(0x7ffc3ffc, MSC1); *//* LAN9215/EXP_CS */ |
259 | /* MSC2 = 0x06697ff4; *//* none/SM501 */ | 260 | /* __raw_writel(0x06697ff4, MSC2); *//* none/SM501 */ |
260 | MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */ | 261 | __raw_writel((__raw_readl(MSC2) & ~0xffff) | 0x7ff4, MSC2); /* SM501 */ |
261 | 262 | ||
262 | pxa_set_ffuart_info(NULL); | 263 | pxa_set_ffuart_info(NULL); |
263 | pxa_set_btuart_info(NULL); | 264 | pxa_set_btuart_info(NULL); |
@@ -273,7 +274,7 @@ static void __init csb726_init(void) | |||
273 | 274 | ||
274 | MACHINE_START(CSB726, "Cogent CSB726") | 275 | MACHINE_START(CSB726, "Cogent CSB726") |
275 | .boot_params = 0xa0000100, | 276 | .boot_params = 0xa0000100, |
276 | .map_io = pxa_map_io, | 277 | .map_io = pxa27x_map_io, |
277 | .init_irq = pxa27x_init_irq, | 278 | .init_irq = pxa27x_init_irq, |
278 | .init_machine = csb726_init, | 279 | .init_machine = csb726_init, |
279 | .timer = &pxa_timer, | 280 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index aaa1166df964..022c2fa4af04 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -342,27 +342,6 @@ struct platform_device pxa27x_device_i2c_power = { | |||
342 | }; | 342 | }; |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | #ifdef CONFIG_PXA3xx | ||
346 | static struct resource pxa3xx_resources_i2c_power[] = { | ||
347 | { | ||
348 | .start = 0x40f500c0, | ||
349 | .end = 0x40f500d3, | ||
350 | .flags = IORESOURCE_MEM, | ||
351 | }, { | ||
352 | .start = IRQ_PWRI2C, | ||
353 | .end = IRQ_PWRI2C, | ||
354 | .flags = IORESOURCE_IRQ, | ||
355 | }, | ||
356 | }; | ||
357 | |||
358 | struct platform_device pxa3xx_device_i2c_power = { | ||
359 | .name = "pxa3xx-pwri2c", | ||
360 | .id = 1, | ||
361 | .resource = pxa3xx_resources_i2c_power, | ||
362 | .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), | ||
363 | }; | ||
364 | #endif | ||
365 | |||
366 | static struct resource pxai2s_resources[] = { | 345 | static struct resource pxai2s_resources[] = { |
367 | { | 346 | { |
368 | .start = 0x40400000, | 347 | .start = 0x40400000, |
@@ -633,30 +612,35 @@ struct platform_device pxa25x_device_assp = { | |||
633 | #endif /* CONFIG_PXA25x */ | 612 | #endif /* CONFIG_PXA25x */ |
634 | 613 | ||
635 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | 614 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) |
636 | 615 | static struct resource pxa27x_resource_camera[] = { | |
637 | static struct resource pxa27x_resource_keypad[] = { | ||
638 | [0] = { | 616 | [0] = { |
639 | .start = 0x41500000, | 617 | .start = 0x50000000, |
640 | .end = 0x4150004c, | 618 | .end = 0x50000fff, |
641 | .flags = IORESOURCE_MEM, | 619 | .flags = IORESOURCE_MEM, |
642 | }, | 620 | }, |
643 | [1] = { | 621 | [1] = { |
644 | .start = IRQ_KEYPAD, | 622 | .start = IRQ_CAMERA, |
645 | .end = IRQ_KEYPAD, | 623 | .end = IRQ_CAMERA, |
646 | .flags = IORESOURCE_IRQ, | 624 | .flags = IORESOURCE_IRQ, |
647 | }, | 625 | }, |
648 | }; | 626 | }; |
649 | 627 | ||
650 | struct platform_device pxa27x_device_keypad = { | 628 | static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32); |
651 | .name = "pxa27x-keypad", | 629 | |
652 | .id = -1, | 630 | static struct platform_device pxa27x_device_camera = { |
653 | .resource = pxa27x_resource_keypad, | 631 | .name = "pxa27x-camera", |
654 | .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), | 632 | .id = 0, /* This is used to put cameras on this interface */ |
633 | .dev = { | ||
634 | .dma_mask = &pxa27x_dma_mask_camera, | ||
635 | .coherent_dma_mask = 0xffffffff, | ||
636 | }, | ||
637 | .num_resources = ARRAY_SIZE(pxa27x_resource_camera), | ||
638 | .resource = pxa27x_resource_camera, | ||
655 | }; | 639 | }; |
656 | 640 | ||
657 | void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) | 641 | void __init pxa_set_camera_info(struct pxacamera_platform_data *info) |
658 | { | 642 | { |
659 | pxa_register_device(&pxa27x_device_keypad, info); | 643 | pxa_register_device(&pxa27x_device_camera, info); |
660 | } | 644 | } |
661 | 645 | ||
662 | static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); | 646 | static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); |
@@ -689,6 +673,33 @@ void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) | |||
689 | { | 673 | { |
690 | pxa_register_device(&pxa27x_device_ohci, info); | 674 | pxa_register_device(&pxa27x_device_ohci, info); |
691 | } | 675 | } |
676 | #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ | ||
677 | |||
678 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) | ||
679 | static struct resource pxa27x_resource_keypad[] = { | ||
680 | [0] = { | ||
681 | .start = 0x41500000, | ||
682 | .end = 0x4150004c, | ||
683 | .flags = IORESOURCE_MEM, | ||
684 | }, | ||
685 | [1] = { | ||
686 | .start = IRQ_KEYPAD, | ||
687 | .end = IRQ_KEYPAD, | ||
688 | .flags = IORESOURCE_IRQ, | ||
689 | }, | ||
690 | }; | ||
691 | |||
692 | struct platform_device pxa27x_device_keypad = { | ||
693 | .name = "pxa27x-keypad", | ||
694 | .id = -1, | ||
695 | .resource = pxa27x_resource_keypad, | ||
696 | .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), | ||
697 | }; | ||
698 | |||
699 | void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) | ||
700 | { | ||
701 | pxa_register_device(&pxa27x_device_keypad, info); | ||
702 | } | ||
692 | 703 | ||
693 | static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); | 704 | static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); |
694 | 705 | ||
@@ -833,79 +844,9 @@ struct platform_device pxa27x_device_pwm1 = { | |||
833 | .resource = pxa27x_resource_pwm1, | 844 | .resource = pxa27x_resource_pwm1, |
834 | .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), | 845 | .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), |
835 | }; | 846 | }; |
836 | 847 | #endif /* CONFIG_PXA27x || CONFIG_PXA3xx || CONFIG_PXA95x*/ | |
837 | static struct resource pxa27x_resource_camera[] = { | ||
838 | [0] = { | ||
839 | .start = 0x50000000, | ||
840 | .end = 0x50000fff, | ||
841 | .flags = IORESOURCE_MEM, | ||
842 | }, | ||
843 | [1] = { | ||
844 | .start = IRQ_CAMERA, | ||
845 | .end = IRQ_CAMERA, | ||
846 | .flags = IORESOURCE_IRQ, | ||
847 | }, | ||
848 | }; | ||
849 | |||
850 | static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32); | ||
851 | |||
852 | static struct platform_device pxa27x_device_camera = { | ||
853 | .name = "pxa27x-camera", | ||
854 | .id = 0, /* This is used to put cameras on this interface */ | ||
855 | .dev = { | ||
856 | .dma_mask = &pxa27x_dma_mask_camera, | ||
857 | .coherent_dma_mask = 0xffffffff, | ||
858 | }, | ||
859 | .num_resources = ARRAY_SIZE(pxa27x_resource_camera), | ||
860 | .resource = pxa27x_resource_camera, | ||
861 | }; | ||
862 | |||
863 | void __init pxa_set_camera_info(struct pxacamera_platform_data *info) | ||
864 | { | ||
865 | pxa_register_device(&pxa27x_device_camera, info); | ||
866 | } | ||
867 | #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ | ||
868 | 848 | ||
869 | #ifdef CONFIG_PXA3xx | 849 | #ifdef CONFIG_PXA3xx |
870 | static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32); | ||
871 | |||
872 | static struct resource pxa3xx_resource_ssp4[] = { | ||
873 | [0] = { | ||
874 | .start = 0x41a00000, | ||
875 | .end = 0x41a0003f, | ||
876 | .flags = IORESOURCE_MEM, | ||
877 | }, | ||
878 | [1] = { | ||
879 | .start = IRQ_SSP4, | ||
880 | .end = IRQ_SSP4, | ||
881 | .flags = IORESOURCE_IRQ, | ||
882 | }, | ||
883 | [2] = { | ||
884 | /* DRCMR for RX */ | ||
885 | .start = 2, | ||
886 | .end = 2, | ||
887 | .flags = IORESOURCE_DMA, | ||
888 | }, | ||
889 | [3] = { | ||
890 | /* DRCMR for TX */ | ||
891 | .start = 3, | ||
892 | .end = 3, | ||
893 | .flags = IORESOURCE_DMA, | ||
894 | }, | ||
895 | }; | ||
896 | |||
897 | struct platform_device pxa3xx_device_ssp4 = { | ||
898 | /* PXA3xx SSP is basically equivalent to PXA27x */ | ||
899 | .name = "pxa27x-ssp", | ||
900 | .id = 3, | ||
901 | .dev = { | ||
902 | .dma_mask = &pxa3xx_ssp4_dma_mask, | ||
903 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
904 | }, | ||
905 | .resource = pxa3xx_resource_ssp4, | ||
906 | .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4), | ||
907 | }; | ||
908 | |||
909 | static struct resource pxa3xx_resources_mci2[] = { | 850 | static struct resource pxa3xx_resources_mci2[] = { |
910 | [0] = { | 851 | [0] = { |
911 | .start = 0x42000000, | 852 | .start = 0x42000000, |
@@ -984,6 +925,54 @@ void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info) | |||
984 | pxa_register_device(&pxa3xx_device_mci3, info); | 925 | pxa_register_device(&pxa3xx_device_mci3, info); |
985 | } | 926 | } |
986 | 927 | ||
928 | static struct resource pxa3xx_resources_gcu[] = { | ||
929 | { | ||
930 | .start = 0x54000000, | ||
931 | .end = 0x54000fff, | ||
932 | .flags = IORESOURCE_MEM, | ||
933 | }, | ||
934 | { | ||
935 | .start = IRQ_GCU, | ||
936 | .end = IRQ_GCU, | ||
937 | .flags = IORESOURCE_IRQ, | ||
938 | }, | ||
939 | }; | ||
940 | |||
941 | static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); | ||
942 | |||
943 | struct platform_device pxa3xx_device_gcu = { | ||
944 | .name = "pxa3xx-gcu", | ||
945 | .id = -1, | ||
946 | .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu), | ||
947 | .resource = pxa3xx_resources_gcu, | ||
948 | .dev = { | ||
949 | .dma_mask = &pxa3xx_gcu_dmamask, | ||
950 | .coherent_dma_mask = 0xffffffff, | ||
951 | }, | ||
952 | }; | ||
953 | |||
954 | #endif /* CONFIG_PXA3xx */ | ||
955 | |||
956 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) | ||
957 | static struct resource pxa3xx_resources_i2c_power[] = { | ||
958 | { | ||
959 | .start = 0x40f500c0, | ||
960 | .end = 0x40f500d3, | ||
961 | .flags = IORESOURCE_MEM, | ||
962 | }, { | ||
963 | .start = IRQ_PWRI2C, | ||
964 | .end = IRQ_PWRI2C, | ||
965 | .flags = IORESOURCE_IRQ, | ||
966 | }, | ||
967 | }; | ||
968 | |||
969 | struct platform_device pxa3xx_device_i2c_power = { | ||
970 | .name = "pxa3xx-pwri2c", | ||
971 | .id = 1, | ||
972 | .resource = pxa3xx_resources_i2c_power, | ||
973 | .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), | ||
974 | }; | ||
975 | |||
987 | static struct resource pxa3xx_resources_nand[] = { | 976 | static struct resource pxa3xx_resources_nand[] = { |
988 | [0] = { | 977 | [0] = { |
989 | .start = 0x43100000, | 978 | .start = 0x43100000, |
@@ -1027,33 +1016,45 @@ void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info) | |||
1027 | pxa_register_device(&pxa3xx_device_nand, info); | 1016 | pxa_register_device(&pxa3xx_device_nand, info); |
1028 | } | 1017 | } |
1029 | 1018 | ||
1030 | static struct resource pxa3xx_resources_gcu[] = { | 1019 | static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32); |
1031 | { | 1020 | |
1032 | .start = 0x54000000, | 1021 | static struct resource pxa3xx_resource_ssp4[] = { |
1033 | .end = 0x54000fff, | 1022 | [0] = { |
1023 | .start = 0x41a00000, | ||
1024 | .end = 0x41a0003f, | ||
1034 | .flags = IORESOURCE_MEM, | 1025 | .flags = IORESOURCE_MEM, |
1035 | }, | 1026 | }, |
1036 | { | 1027 | [1] = { |
1037 | .start = IRQ_GCU, | 1028 | .start = IRQ_SSP4, |
1038 | .end = IRQ_GCU, | 1029 | .end = IRQ_SSP4, |
1039 | .flags = IORESOURCE_IRQ, | 1030 | .flags = IORESOURCE_IRQ, |
1040 | }, | 1031 | }, |
1032 | [2] = { | ||
1033 | /* DRCMR for RX */ | ||
1034 | .start = 2, | ||
1035 | .end = 2, | ||
1036 | .flags = IORESOURCE_DMA, | ||
1037 | }, | ||
1038 | [3] = { | ||
1039 | /* DRCMR for TX */ | ||
1040 | .start = 3, | ||
1041 | .end = 3, | ||
1042 | .flags = IORESOURCE_DMA, | ||
1043 | }, | ||
1041 | }; | 1044 | }; |
1042 | 1045 | ||
1043 | static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); | 1046 | struct platform_device pxa3xx_device_ssp4 = { |
1044 | 1047 | /* PXA3xx SSP is basically equivalent to PXA27x */ | |
1045 | struct platform_device pxa3xx_device_gcu = { | 1048 | .name = "pxa27x-ssp", |
1046 | .name = "pxa3xx-gcu", | 1049 | .id = 3, |
1047 | .id = -1, | ||
1048 | .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu), | ||
1049 | .resource = pxa3xx_resources_gcu, | ||
1050 | .dev = { | 1050 | .dev = { |
1051 | .dma_mask = &pxa3xx_gcu_dmamask, | 1051 | .dma_mask = &pxa3xx_ssp4_dma_mask, |
1052 | .coherent_dma_mask = 0xffffffff, | 1052 | .coherent_dma_mask = DMA_BIT_MASK(32), |
1053 | }, | 1053 | }, |
1054 | .resource = pxa3xx_resource_ssp4, | ||
1055 | .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4), | ||
1054 | }; | 1056 | }; |
1055 | 1057 | #endif /* CONFIG_PXA3xx || CONFIG_PXA95x */ | |
1056 | #endif /* CONFIG_PXA3xx */ | ||
1057 | 1058 | ||
1058 | /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. | 1059 | /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. |
1059 | * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ | 1060 | * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index ed0dbfdb22ed..4cefd1d18afd 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -1300,7 +1300,7 @@ static void __init em_x270_init(void) | |||
1300 | 1300 | ||
1301 | MACHINE_START(EM_X270, "Compulab EM-X270") | 1301 | MACHINE_START(EM_X270, "Compulab EM-X270") |
1302 | .boot_params = 0xa0000100, | 1302 | .boot_params = 0xa0000100, |
1303 | .map_io = pxa_map_io, | 1303 | .map_io = pxa27x_map_io, |
1304 | .init_irq = pxa27x_init_irq, | 1304 | .init_irq = pxa27x_init_irq, |
1305 | .timer = &pxa_timer, | 1305 | .timer = &pxa_timer, |
1306 | .init_machine = em_x270_init, | 1306 | .init_machine = em_x270_init, |
@@ -1308,7 +1308,7 @@ MACHINE_END | |||
1308 | 1308 | ||
1309 | MACHINE_START(EXEDA, "Compulab eXeda") | 1309 | MACHINE_START(EXEDA, "Compulab eXeda") |
1310 | .boot_params = 0xa0000100, | 1310 | .boot_params = 0xa0000100, |
1311 | .map_io = pxa_map_io, | 1311 | .map_io = pxa27x_map_io, |
1312 | .init_irq = pxa27x_init_irq, | 1312 | .init_irq = pxa27x_init_irq, |
1313 | .timer = &pxa_timer, | 1313 | .timer = &pxa_timer, |
1314 | .init_machine = em_x270_init, | 1314 | .init_machine = em_x270_init, |
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index b25690ccadc4..edca0a043293 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
@@ -181,7 +181,7 @@ static void __init e330_init(void) | |||
181 | MACHINE_START(E330, "Toshiba e330") | 181 | MACHINE_START(E330, "Toshiba e330") |
182 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 182 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
183 | .boot_params = 0xa0000100, | 183 | .boot_params = 0xa0000100, |
184 | .map_io = pxa_map_io, | 184 | .map_io = pxa25x_map_io, |
185 | .nr_irqs = ESERIES_NR_IRQS, | 185 | .nr_irqs = ESERIES_NR_IRQS, |
186 | .init_irq = pxa25x_init_irq, | 186 | .init_irq = pxa25x_init_irq, |
187 | .fixup = eseries_fixup, | 187 | .fixup = eseries_fixup, |
@@ -230,7 +230,7 @@ static void __init e350_init(void) | |||
230 | MACHINE_START(E350, "Toshiba e350") | 230 | MACHINE_START(E350, "Toshiba e350") |
231 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 231 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
232 | .boot_params = 0xa0000100, | 232 | .boot_params = 0xa0000100, |
233 | .map_io = pxa_map_io, | 233 | .map_io = pxa25x_map_io, |
234 | .nr_irqs = ESERIES_NR_IRQS, | 234 | .nr_irqs = ESERIES_NR_IRQS, |
235 | .init_irq = pxa25x_init_irq, | 235 | .init_irq = pxa25x_init_irq, |
236 | .fixup = eseries_fixup, | 236 | .fixup = eseries_fixup, |
@@ -352,7 +352,7 @@ static void __init e400_init(void) | |||
352 | MACHINE_START(E400, "Toshiba e400") | 352 | MACHINE_START(E400, "Toshiba e400") |
353 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 353 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
354 | .boot_params = 0xa0000100, | 354 | .boot_params = 0xa0000100, |
355 | .map_io = pxa_map_io, | 355 | .map_io = pxa25x_map_io, |
356 | .nr_irqs = ESERIES_NR_IRQS, | 356 | .nr_irqs = ESERIES_NR_IRQS, |
357 | .init_irq = pxa25x_init_irq, | 357 | .init_irq = pxa25x_init_irq, |
358 | .fixup = eseries_fixup, | 358 | .fixup = eseries_fixup, |
@@ -540,7 +540,7 @@ static void __init e740_init(void) | |||
540 | MACHINE_START(E740, "Toshiba e740") | 540 | MACHINE_START(E740, "Toshiba e740") |
541 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 541 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
542 | .boot_params = 0xa0000100, | 542 | .boot_params = 0xa0000100, |
543 | .map_io = pxa_map_io, | 543 | .map_io = pxa25x_map_io, |
544 | .nr_irqs = ESERIES_NR_IRQS, | 544 | .nr_irqs = ESERIES_NR_IRQS, |
545 | .init_irq = pxa25x_init_irq, | 545 | .init_irq = pxa25x_init_irq, |
546 | .fixup = eseries_fixup, | 546 | .fixup = eseries_fixup, |
@@ -731,7 +731,7 @@ static void __init e750_init(void) | |||
731 | MACHINE_START(E750, "Toshiba e750") | 731 | MACHINE_START(E750, "Toshiba e750") |
732 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 732 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
733 | .boot_params = 0xa0000100, | 733 | .boot_params = 0xa0000100, |
734 | .map_io = pxa_map_io, | 734 | .map_io = pxa25x_map_io, |
735 | .nr_irqs = ESERIES_NR_IRQS, | 735 | .nr_irqs = ESERIES_NR_IRQS, |
736 | .init_irq = pxa25x_init_irq, | 736 | .init_irq = pxa25x_init_irq, |
737 | .fixup = eseries_fixup, | 737 | .fixup = eseries_fixup, |
@@ -926,7 +926,7 @@ static void __init e800_init(void) | |||
926 | MACHINE_START(E800, "Toshiba e800") | 926 | MACHINE_START(E800, "Toshiba e800") |
927 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 927 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
928 | .boot_params = 0xa0000100, | 928 | .boot_params = 0xa0000100, |
929 | .map_io = pxa_map_io, | 929 | .map_io = pxa25x_map_io, |
930 | .nr_irqs = ESERIES_NR_IRQS, | 930 | .nr_irqs = ESERIES_NR_IRQS, |
931 | .init_irq = pxa25x_init_irq, | 931 | .init_irq = pxa25x_init_irq, |
932 | .fixup = eseries_fixup, | 932 | .fixup = eseries_fixup, |
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index 142c711f4cda..87cec0abe5b0 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c | |||
@@ -798,7 +798,7 @@ static void __init a780_init(void) | |||
798 | 798 | ||
799 | MACHINE_START(EZX_A780, "Motorola EZX A780") | 799 | MACHINE_START(EZX_A780, "Motorola EZX A780") |
800 | .boot_params = 0xa0000100, | 800 | .boot_params = 0xa0000100, |
801 | .map_io = pxa_map_io, | 801 | .map_io = pxa27x_map_io, |
802 | .nr_irqs = EZX_NR_IRQS, | 802 | .nr_irqs = EZX_NR_IRQS, |
803 | .init_irq = pxa27x_init_irq, | 803 | .init_irq = pxa27x_init_irq, |
804 | .timer = &pxa_timer, | 804 | .timer = &pxa_timer, |
@@ -863,7 +863,7 @@ static void __init e680_init(void) | |||
863 | 863 | ||
864 | MACHINE_START(EZX_E680, "Motorola EZX E680") | 864 | MACHINE_START(EZX_E680, "Motorola EZX E680") |
865 | .boot_params = 0xa0000100, | 865 | .boot_params = 0xa0000100, |
866 | .map_io = pxa_map_io, | 866 | .map_io = pxa27x_map_io, |
867 | .nr_irqs = EZX_NR_IRQS, | 867 | .nr_irqs = EZX_NR_IRQS, |
868 | .init_irq = pxa27x_init_irq, | 868 | .init_irq = pxa27x_init_irq, |
869 | .timer = &pxa_timer, | 869 | .timer = &pxa_timer, |
@@ -928,7 +928,7 @@ static void __init a1200_init(void) | |||
928 | 928 | ||
929 | MACHINE_START(EZX_A1200, "Motorola EZX A1200") | 929 | MACHINE_START(EZX_A1200, "Motorola EZX A1200") |
930 | .boot_params = 0xa0000100, | 930 | .boot_params = 0xa0000100, |
931 | .map_io = pxa_map_io, | 931 | .map_io = pxa27x_map_io, |
932 | .nr_irqs = EZX_NR_IRQS, | 932 | .nr_irqs = EZX_NR_IRQS, |
933 | .init_irq = pxa27x_init_irq, | 933 | .init_irq = pxa27x_init_irq, |
934 | .timer = &pxa_timer, | 934 | .timer = &pxa_timer, |
@@ -1118,7 +1118,7 @@ static void __init a910_init(void) | |||
1118 | 1118 | ||
1119 | MACHINE_START(EZX_A910, "Motorola EZX A910") | 1119 | MACHINE_START(EZX_A910, "Motorola EZX A910") |
1120 | .boot_params = 0xa0000100, | 1120 | .boot_params = 0xa0000100, |
1121 | .map_io = pxa_map_io, | 1121 | .map_io = pxa27x_map_io, |
1122 | .nr_irqs = EZX_NR_IRQS, | 1122 | .nr_irqs = EZX_NR_IRQS, |
1123 | .init_irq = pxa27x_init_irq, | 1123 | .init_irq = pxa27x_init_irq, |
1124 | .timer = &pxa_timer, | 1124 | .timer = &pxa_timer, |
@@ -1183,7 +1183,7 @@ static void __init e6_init(void) | |||
1183 | 1183 | ||
1184 | MACHINE_START(EZX_E6, "Motorola EZX E6") | 1184 | MACHINE_START(EZX_E6, "Motorola EZX E6") |
1185 | .boot_params = 0xa0000100, | 1185 | .boot_params = 0xa0000100, |
1186 | .map_io = pxa_map_io, | 1186 | .map_io = pxa27x_map_io, |
1187 | .nr_irqs = EZX_NR_IRQS, | 1187 | .nr_irqs = EZX_NR_IRQS, |
1188 | .init_irq = pxa27x_init_irq, | 1188 | .init_irq = pxa27x_init_irq, |
1189 | .timer = &pxa_timer, | 1189 | .timer = &pxa_timer, |
@@ -1222,7 +1222,7 @@ static void __init e2_init(void) | |||
1222 | 1222 | ||
1223 | MACHINE_START(EZX_E2, "Motorola EZX E2") | 1223 | MACHINE_START(EZX_E2, "Motorola EZX E2") |
1224 | .boot_params = 0xa0000100, | 1224 | .boot_params = 0xa0000100, |
1225 | .map_io = pxa_map_io, | 1225 | .map_io = pxa27x_map_io, |
1226 | .nr_irqs = EZX_NR_IRQS, | 1226 | .nr_irqs = EZX_NR_IRQS, |
1227 | .init_irq = pxa27x_init_irq, | 1227 | .init_irq = pxa27x_init_irq, |
1228 | .timer = &pxa_timer, | 1228 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 6451e9c3a93f..d6e15f71fc09 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | #include <mach/reset.h> | 29 | #include <mach/reset.h> |
30 | #include <mach/gpio.h> | 30 | #include <mach/gpio.h> |
31 | #include <mach/smemc.h> | ||
32 | #include <mach/pxa3xx-regs.h> | ||
31 | 33 | ||
32 | #include "generic.h" | 34 | #include "generic.h" |
33 | 35 | ||
@@ -35,9 +37,10 @@ void clear_reset_status(unsigned int mask) | |||
35 | { | 37 | { |
36 | if (cpu_is_pxa2xx()) | 38 | if (cpu_is_pxa2xx()) |
37 | pxa2xx_clear_reset_status(mask); | 39 | pxa2xx_clear_reset_status(mask); |
38 | 40 | else { | |
39 | if (cpu_is_pxa3xx()) | 41 | /* RESET_STATUS_* has a 1:1 mapping with ARSR */ |
40 | pxa3xx_clear_reset_status(mask); | 42 | ARSR = mask; |
43 | } | ||
41 | } | 44 | } |
42 | 45 | ||
43 | unsigned long get_clock_tick_rate(void) | 46 | unsigned long get_clock_tick_rate(void) |
@@ -71,47 +74,17 @@ unsigned int get_clk_frequency_khz(int info) | |||
71 | EXPORT_SYMBOL(get_clk_frequency_khz); | 74 | EXPORT_SYMBOL(get_clk_frequency_khz); |
72 | 75 | ||
73 | /* | 76 | /* |
74 | * Return the current memory clock frequency in units of 10kHz | ||
75 | */ | ||
76 | unsigned int get_memclk_frequency_10khz(void) | ||
77 | { | ||
78 | if (cpu_is_pxa25x()) | ||
79 | return pxa25x_get_memclk_frequency_10khz(); | ||
80 | else if (cpu_is_pxa27x()) | ||
81 | return pxa27x_get_memclk_frequency_10khz(); | ||
82 | return 0; | ||
83 | } | ||
84 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | ||
85 | |||
86 | /* | ||
87 | * Intel PXA2xx internal register mapping. | 77 | * Intel PXA2xx internal register mapping. |
88 | * | 78 | * |
89 | * Note 1: not all PXA2xx variants implement all those addresses. | 79 | * Note: virtual 0xfffe0000-0xffffffff is reserved for the vector table |
90 | * | 80 | * and cache flush area. |
91 | * Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table | ||
92 | * and cache flush area. | ||
93 | */ | 81 | */ |
94 | static struct map_desc standard_io_desc[] __initdata = { | 82 | static struct map_desc common_io_desc[] __initdata = { |
95 | { /* Devs */ | 83 | { /* Devs */ |
96 | .virtual = 0xf2000000, | 84 | .virtual = 0xf2000000, |
97 | .pfn = __phys_to_pfn(0x40000000), | 85 | .pfn = __phys_to_pfn(0x40000000), |
98 | .length = 0x02000000, | 86 | .length = 0x02000000, |
99 | .type = MT_DEVICE | 87 | .type = MT_DEVICE |
100 | }, { /* Mem Ctl */ | ||
101 | .virtual = 0xf6000000, | ||
102 | .pfn = __phys_to_pfn(0x48000000), | ||
103 | .length = 0x00200000, | ||
104 | .type = MT_DEVICE | ||
105 | }, { /* Camera */ | ||
106 | .virtual = 0xfa000000, | ||
107 | .pfn = __phys_to_pfn(0x50000000), | ||
108 | .length = 0x00100000, | ||
109 | .type = MT_DEVICE | ||
110 | }, { /* IMem ctl */ | ||
111 | .virtual = 0xfe000000, | ||
112 | .pfn = __phys_to_pfn(0x58000000), | ||
113 | .length = 0x00100000, | ||
114 | .type = MT_DEVICE | ||
115 | }, { /* UNCACHED_PHYS_0 */ | 88 | }, { /* UNCACHED_PHYS_0 */ |
116 | .virtual = 0xff000000, | 89 | .virtual = 0xff000000, |
117 | .pfn = __phys_to_pfn(0x00000000), | 90 | .pfn = __phys_to_pfn(0x00000000), |
@@ -122,6 +95,5 @@ static struct map_desc standard_io_desc[] __initdata = { | |||
122 | 95 | ||
123 | void __init pxa_map_io(void) | 96 | void __init pxa_map_io(void) |
124 | { | 97 | { |
125 | iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); | 98 | iotable_init(ARRAY_AND_SIZE(common_io_desc)); |
126 | get_clk_frequency_khz(1); | ||
127 | } | 99 | } |
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index 4b1ad2769ed7..6205dc9a2b9d 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -20,7 +20,12 @@ extern void __init pxa26x_init_irq(void); | |||
20 | #endif | 20 | #endif |
21 | extern void __init pxa27x_init_irq(void); | 21 | extern void __init pxa27x_init_irq(void); |
22 | extern void __init pxa3xx_init_irq(void); | 22 | extern void __init pxa3xx_init_irq(void); |
23 | extern void __init pxa95x_init_irq(void); | ||
24 | |||
23 | extern void __init pxa_map_io(void); | 25 | extern void __init pxa_map_io(void); |
26 | extern void __init pxa25x_map_io(void); | ||
27 | extern void __init pxa27x_map_io(void); | ||
28 | extern void __init pxa3xx_map_io(void); | ||
24 | 29 | ||
25 | extern unsigned int get_clk_frequency_khz(int info); | 30 | extern unsigned int get_clk_frequency_khz(int info); |
26 | 31 | ||
@@ -32,18 +37,14 @@ extern unsigned int get_clk_frequency_khz(int info); | |||
32 | 37 | ||
33 | #ifdef CONFIG_PXA25x | 38 | #ifdef CONFIG_PXA25x |
34 | extern unsigned pxa25x_get_clk_frequency_khz(int); | 39 | extern unsigned pxa25x_get_clk_frequency_khz(int); |
35 | extern unsigned pxa25x_get_memclk_frequency_10khz(void); | ||
36 | #else | 40 | #else |
37 | #define pxa25x_get_clk_frequency_khz(x) (0) | 41 | #define pxa25x_get_clk_frequency_khz(x) (0) |
38 | #define pxa25x_get_memclk_frequency_10khz() (0) | ||
39 | #endif | 42 | #endif |
40 | 43 | ||
41 | #ifdef CONFIG_PXA27x | 44 | #ifdef CONFIG_PXA27x |
42 | extern unsigned pxa27x_get_clk_frequency_khz(int); | 45 | extern unsigned pxa27x_get_clk_frequency_khz(int); |
43 | extern unsigned pxa27x_get_memclk_frequency_10khz(void); | ||
44 | #else | 46 | #else |
45 | #define pxa27x_get_clk_frequency_khz(x) (0) | 47 | #define pxa27x_get_clk_frequency_khz(x) (0) |
46 | #define pxa27x_get_memclk_frequency_10khz() (0) | ||
47 | #endif | 48 | #endif |
48 | 49 | ||
49 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | 50 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) |
@@ -54,10 +55,8 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {} | |||
54 | 55 | ||
55 | #ifdef CONFIG_PXA3xx | 56 | #ifdef CONFIG_PXA3xx |
56 | extern unsigned pxa3xx_get_clk_frequency_khz(int); | 57 | extern unsigned pxa3xx_get_clk_frequency_khz(int); |
57 | extern void pxa3xx_clear_reset_status(unsigned int); | ||
58 | #else | 58 | #else |
59 | #define pxa3xx_get_clk_frequency_khz(x) (0) | 59 | #define pxa3xx_get_clk_frequency_khz(x) (0) |
60 | static inline void pxa3xx_clear_reset_status(unsigned int mask) {} | ||
61 | #endif | 60 | #endif |
62 | 61 | ||
63 | extern struct sysdev_class pxa_irq_sysclass; | 62 | extern struct sysdev_class pxa_irq_sysclass; |
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index 1e2a9a13aec1..6fd319ea5284 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c | |||
@@ -225,7 +225,7 @@ static void __init gumstix_init(void) | |||
225 | 225 | ||
226 | MACHINE_START(GUMSTIX, "Gumstix") | 226 | MACHINE_START(GUMSTIX, "Gumstix") |
227 | .boot_params = 0xa0000100, /* match u-boot bi_boot_params */ | 227 | .boot_params = 0xa0000100, /* match u-boot bi_boot_params */ |
228 | .map_io = pxa_map_io, | 228 | .map_io = pxa25x_map_io, |
229 | .init_irq = pxa25x_init_irq, | 229 | .init_irq = pxa25x_init_irq, |
230 | .timer = &pxa_timer, | 230 | .timer = &pxa_timer, |
231 | .init_machine = gumstix_init, | 231 | .init_machine = gumstix_init, |
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c index 7057a1f46db4..657db469de1f 100644 --- a/arch/arm/mach-pxa/h5000.c +++ b/arch/arm/mach-pxa/h5000.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <mach/pxa25x.h> | 32 | #include <mach/pxa25x.h> |
33 | #include <mach/h5000.h> | 33 | #include <mach/h5000.h> |
34 | #include <mach/udc.h> | 34 | #include <mach/udc.h> |
35 | #include <mach/smemc.h> | ||
35 | 36 | ||
36 | #include "generic.h" | 37 | #include "generic.h" |
37 | 38 | ||
@@ -172,11 +173,11 @@ static unsigned long h5000_pin_config[] __initdata = { | |||
172 | 173 | ||
173 | static void fix_msc(void) | 174 | static void fix_msc(void) |
174 | { | 175 | { |
175 | MSC0 = 0x129c24f2; | 176 | __raw_writel(0x129c24f2, MSC0); |
176 | MSC1 = 0x7ff424fa; | 177 | __raw_writel(0x7ff424fa, MSC1); |
177 | MSC2 = 0x7ff47ff4; | 178 | __raw_writel(0x7ff47ff4, MSC2); |
178 | 179 | ||
179 | MDREFR |= 0x02080000; | 180 | __raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR); |
180 | } | 181 | } |
181 | 182 | ||
182 | /* | 183 | /* |
@@ -202,7 +203,7 @@ static void __init h5000_init(void) | |||
202 | 203 | ||
203 | MACHINE_START(H5400, "HP iPAQ H5000") | 204 | MACHINE_START(H5400, "HP iPAQ H5000") |
204 | .boot_params = 0xa0000100, | 205 | .boot_params = 0xa0000100, |
205 | .map_io = pxa_map_io, | 206 | .map_io = pxa25x_map_io, |
206 | .init_irq = pxa25x_init_irq, | 207 | .init_irq = pxa25x_init_irq, |
207 | .timer = &pxa_timer, | 208 | .timer = &pxa_timer, |
208 | .init_machine = h5000_init, | 209 | .init_machine = h5000_init, |
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c index 01b7f07ebad2..e8603eba54bd 100644 --- a/arch/arm/mach-pxa/himalaya.c +++ b/arch/arm/mach-pxa/himalaya.c | |||
@@ -160,7 +160,7 @@ static void __init himalaya_init(void) | |||
160 | 160 | ||
161 | MACHINE_START(HIMALAYA, "HTC Himalaya") | 161 | MACHINE_START(HIMALAYA, "HTC Himalaya") |
162 | .boot_params = 0xa0000100, | 162 | .boot_params = 0xa0000100, |
163 | .map_io = pxa_map_io, | 163 | .map_io = pxa25x_map_io, |
164 | .init_irq = pxa25x_init_irq, | 164 | .init_irq = pxa25x_init_irq, |
165 | .init_machine = himalaya_init, | 165 | .init_machine = himalaya_init, |
166 | .timer = &pxa_timer, | 166 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 76d93a25bab6..cacb21b7014d 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -871,7 +871,7 @@ static void __init hx4700_init(void) | |||
871 | 871 | ||
872 | MACHINE_START(H4700, "HP iPAQ HX4700") | 872 | MACHINE_START(H4700, "HP iPAQ HX4700") |
873 | .boot_params = 0xa0000100, | 873 | .boot_params = 0xa0000100, |
874 | .map_io = pxa_map_io, | 874 | .map_io = pxa27x_map_io, |
875 | .nr_irqs = HX4700_NR_IRQS, | 875 | .nr_irqs = HX4700_NR_IRQS, |
876 | .init_irq = pxa27x_init_irq, | 876 | .init_irq = pxa27x_init_irq, |
877 | .init_machine = hx4700_init, | 877 | .init_machine = hx4700_init, |
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c index d51ee3d25e70..ac6ee12e400e 100644 --- a/arch/arm/mach-pxa/icontrol.c +++ b/arch/arm/mach-pxa/icontrol.c | |||
@@ -192,7 +192,7 @@ static void __init icontrol_init(void) | |||
192 | 192 | ||
193 | MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM") | 193 | MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM") |
194 | .boot_params = 0xa0000100, | 194 | .boot_params = 0xa0000100, |
195 | .map_io = pxa_map_io, | 195 | .map_io = pxa3xx_map_io, |
196 | .init_irq = pxa3xx_init_irq, | 196 | .init_irq = pxa3xx_init_irq, |
197 | .timer = &pxa_timer, | 197 | .timer = &pxa_timer, |
198 | .init_machine = icontrol_init | 198 | .init_machine = icontrol_init |
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index e773dceeabc6..dd40e4a9291c 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c | |||
@@ -187,7 +187,7 @@ static struct map_desc idp_io_desc[] __initdata = { | |||
187 | 187 | ||
188 | static void __init idp_map_io(void) | 188 | static void __init idp_map_io(void) |
189 | { | 189 | { |
190 | pxa_map_io(); | 190 | pxa25x_map_io(); |
191 | iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); | 191 | iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); |
192 | } | 192 | } |
193 | 193 | ||
diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h new file mode 100644 index 000000000000..f4c03659168c --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/addr-map.h | |||
@@ -0,0 +1,48 @@ | |||
1 | #ifndef __ASM_MACH_ADDR_MAP_H | ||
2 | #define __ASM_MACH_ADDR_MAP_H | ||
3 | |||
4 | /* | ||
5 | * Chip Selects | ||
6 | */ | ||
7 | #define PXA_CS0_PHYS 0x00000000 | ||
8 | #define PXA_CS1_PHYS 0x04000000 | ||
9 | #define PXA_CS2_PHYS 0x08000000 | ||
10 | #define PXA_CS3_PHYS 0x0C000000 | ||
11 | #define PXA_CS4_PHYS 0x10000000 | ||
12 | #define PXA_CS5_PHYS 0x14000000 | ||
13 | |||
14 | #define PXA300_CS0_PHYS 0x00000000 /* PXA300/PXA310 _only_ */ | ||
15 | #define PXA300_CS1_PHYS 0x30000000 /* PXA300/PXA310 _only_ */ | ||
16 | #define PXA3xx_CS2_PHYS 0x10000000 | ||
17 | #define PXA3xx_CS3_PHYS 0x14000000 | ||
18 | |||
19 | /* | ||
20 | * Peripheral Bus | ||
21 | */ | ||
22 | #define PERIPH_PHYS 0x40000000 | ||
23 | #define PERIPH_VIRT 0xf2000000 | ||
24 | #define PERIPH_SIZE 0x02000000 | ||
25 | |||
26 | /* | ||
27 | * Static Memory Controller (w/ SDRAM controls on PXA25x/PXA27x) | ||
28 | */ | ||
29 | #define PXA2XX_SMEMC_PHYS 0x48000000 | ||
30 | #define PXA3XX_SMEMC_PHYS 0x4a000000 | ||
31 | #define SMEMC_VIRT 0xf6000000 | ||
32 | #define SMEMC_SIZE 0x00100000 | ||
33 | |||
34 | /* | ||
35 | * Dynamic Memory Controller (only on PXA3xx) | ||
36 | */ | ||
37 | #define DMEMC_PHYS 0x48100000 | ||
38 | #define DMEMC_VIRT 0xf6100000 | ||
39 | #define DMEMC_SIZE 0x00100000 | ||
40 | |||
41 | /* | ||
42 | * Internal Memory Controller (PXA27x and later) | ||
43 | */ | ||
44 | #define IMEMC_PHYS 0x58000000 | ||
45 | #define IMEMC_VIRT 0xfe000000 | ||
46 | #define IMEMC_SIZE 0x00100000 | ||
47 | |||
48 | #endif /* __ASM_MACH_ADDR_MAP_H */ | ||
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h index 561562b4360b..7074e76146c9 100644 --- a/arch/arm/mach-pxa/include/mach/balloon3.h +++ b/arch/arm/mach-pxa/include/mach/balloon3.h | |||
@@ -26,6 +26,8 @@ enum balloon3_features { | |||
26 | #define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */ | 26 | #define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */ |
27 | #define BALLOON3_FPGA_LENGTH 0x01000000 | 27 | #define BALLOON3_FPGA_LENGTH 0x01000000 |
28 | 28 | ||
29 | #define BALLOON3_FPGA_SETnCLR (0x1000) | ||
30 | |||
29 | /* FPGA / CPLD registers for CF socket */ | 31 | /* FPGA / CPLD registers for CF socket */ |
30 | #define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008) | 32 | #define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008) |
31 | #define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008) | 33 | #define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008) |
@@ -35,7 +37,7 @@ enum balloon3_features { | |||
35 | #define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000) | 37 | #define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000) |
36 | #define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000) | 38 | #define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000) |
37 | #define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010) | 39 | #define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010) |
38 | #define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00010) | 40 | #define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00014) |
39 | #define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014) | 41 | #define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014) |
40 | 42 | ||
41 | /* fpga/cpld interrupt control register */ | 43 | /* fpga/cpld interrupt control register */ |
@@ -174,7 +176,7 @@ enum balloon3_features { | |||
174 | #define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) | 176 | #define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) |
175 | #define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) | 177 | #define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) |
176 | 178 | ||
177 | #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 4) | 179 | #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 16) |
178 | 180 | ||
179 | extern int balloon3_has(enum balloon3_features feature); | 181 | extern int balloon3_has(enum balloon3_features feature); |
180 | 182 | ||
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h index 58dada11054f..388a96f1ef93 100644 --- a/arch/arm/mach-pxa/include/mach/colibri.h +++ b/arch/arm/mach-pxa/include/mach/colibri.h | |||
@@ -9,14 +9,14 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | enum { | 11 | enum { |
12 | COLIBRI_PXA270_EVALBOARD = 0, | 12 | COLIBRI_EVALBOARD = 0, |
13 | COLIBRI_PXA270_INCOME, | 13 | COLIBRI_PXA270_INCOME, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | #if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) | 16 | #if defined(CONFIG_MACH_COLIBRI_EVALBOARD) |
17 | extern void colibri_pxa270_evalboard_init(void); | 17 | extern void colibri_evalboard_init(void); |
18 | #else | 18 | #else |
19 | static inline void colibri_pxa270_evalboard_init(void) {} | 19 | static inline void colibri_evalboard_init(void) {} |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME) | 22 | #if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME) |
@@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {} | |||
59 | #define GPIO0_COLIBRI_PXA270_SD_DETECT 0 | 59 | #define GPIO0_COLIBRI_PXA270_SD_DETECT 0 |
60 | #define GPIO113_COLIBRI_PXA270_TS_IRQ 113 | 60 | #define GPIO113_COLIBRI_PXA270_TS_IRQ 113 |
61 | 61 | ||
62 | /* GPIO definitions for Colibri PXA300/310 */ | ||
63 | #define GPIO39_COLIBRI_PXA300_SD_DETECT 39 | ||
64 | |||
65 | /* GPIO definitions for Colibri PXA320 */ | ||
66 | #define GPIO28_COLIBRI_PXA320_SD_DETECT 28 | ||
67 | |||
62 | #endif /* _COLIBRI_H_ */ | 68 | #endif /* _COLIBRI_H_ */ |
63 | 69 | ||
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index 814f1458a06a..6957ba56025b 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __ASM_ARCH_HARDWARE_H | 13 | #ifndef __ASM_ARCH_HARDWARE_H |
14 | #define __ASM_ARCH_HARDWARE_H | 14 | #define __ASM_ARCH_HARDWARE_H |
15 | 15 | ||
16 | #include <mach/addr-map.h> | ||
17 | |||
16 | /* | 18 | /* |
17 | * Workarounds for at least 2 errata so far require this. | 19 | * Workarounds for at least 2 errata so far require this. |
18 | * The mapping is set in mach-pxa/generic.c. | 20 | * The mapping is set in mach-pxa/generic.c. |
@@ -193,14 +195,15 @@ | |||
193 | #define __cpu_is_pxa935(id) (0) | 195 | #define __cpu_is_pxa935(id) (0) |
194 | #endif | 196 | #endif |
195 | 197 | ||
196 | #ifdef CONFIG_CPU_PXA950 | 198 | #ifdef CONFIG_CPU_PXA955 |
197 | #define __cpu_is_pxa950(id) \ | 199 | #define __cpu_is_pxa955(id) \ |
198 | ({ \ | 200 | ({ \ |
199 | unsigned int _id = (id) >> 4 & 0xfff; \ | 201 | unsigned int _id = (id) >> 4 & 0xfff; \ |
200 | _id == 0x697; \ | 202 | _id == 0x581 || _id == 0xc08 \ |
201 | }) | 203 | || _id == 0xb76; \ |
204 | }) | ||
202 | #else | 205 | #else |
203 | #define __cpu_is_pxa950(id) (0) | 206 | #define __cpu_is_pxa955(id) (0) |
204 | #endif | 207 | #endif |
205 | 208 | ||
206 | #define cpu_is_pxa210() \ | 209 | #define cpu_is_pxa210() \ |
@@ -253,16 +256,15 @@ | |||
253 | __cpu_is_pxa935(read_cpuid_id()); \ | 256 | __cpu_is_pxa935(read_cpuid_id()); \ |
254 | }) | 257 | }) |
255 | 258 | ||
256 | #define cpu_is_pxa950() \ | 259 | #define cpu_is_pxa955() \ |
257 | ({ \ | 260 | ({ \ |
258 | __cpu_is_pxa950(read_cpuid_id()); \ | 261 | __cpu_is_pxa955(read_cpuid_id()); \ |
259 | }) | 262 | }) |
260 | 263 | ||
261 | 264 | ||
262 | /* | 265 | /* |
263 | * CPUID Core Generation Bit | 266 | * CPUID Core Generation Bit |
264 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x | 267 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x |
265 | * == 0x3 for pxa300/pxa310/pxa320 | ||
266 | */ | 268 | */ |
267 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | 269 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) |
268 | #define __cpu_is_pxa2xx(id) \ | 270 | #define __cpu_is_pxa2xx(id) \ |
@@ -277,8 +279,10 @@ | |||
277 | #ifdef CONFIG_PXA3xx | 279 | #ifdef CONFIG_PXA3xx |
278 | #define __cpu_is_pxa3xx(id) \ | 280 | #define __cpu_is_pxa3xx(id) \ |
279 | ({ \ | 281 | ({ \ |
280 | unsigned int _id = (id) >> 13 & 0x7; \ | 282 | __cpu_is_pxa300(id) \ |
281 | _id == 0x3; \ | 283 | || __cpu_is_pxa310(id) \ |
284 | || __cpu_is_pxa320(id) \ | ||
285 | || __cpu_is_pxa93x(id); \ | ||
282 | }) | 286 | }) |
283 | #else | 287 | #else |
284 | #define __cpu_is_pxa3xx(id) (0) | 288 | #define __cpu_is_pxa3xx(id) (0) |
@@ -287,13 +291,22 @@ | |||
287 | #if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) | 291 | #if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) |
288 | #define __cpu_is_pxa93x(id) \ | 292 | #define __cpu_is_pxa93x(id) \ |
289 | ({ \ | 293 | ({ \ |
290 | unsigned int _id = (id) >> 4 & 0xfff; \ | 294 | __cpu_is_pxa930(id) \ |
291 | _id == 0x683 || _id == 0x693; \ | 295 | || __cpu_is_pxa935(id); \ |
292 | }) | 296 | }) |
293 | #else | 297 | #else |
294 | #define __cpu_is_pxa93x(id) (0) | 298 | #define __cpu_is_pxa93x(id) (0) |
295 | #endif | 299 | #endif |
296 | 300 | ||
301 | #ifdef CONFIG_PXA95x | ||
302 | #define __cpu_is_pxa95x(id) \ | ||
303 | ({ \ | ||
304 | __cpu_is_pxa955(id); \ | ||
305 | }) | ||
306 | #else | ||
307 | #define __cpu_is_pxa95x(id) (0) | ||
308 | #endif | ||
309 | |||
297 | #define cpu_is_pxa2xx() \ | 310 | #define cpu_is_pxa2xx() \ |
298 | ({ \ | 311 | ({ \ |
299 | __cpu_is_pxa2xx(read_cpuid_id()); \ | 312 | __cpu_is_pxa2xx(read_cpuid_id()); \ |
@@ -308,6 +321,12 @@ | |||
308 | ({ \ | 321 | ({ \ |
309 | __cpu_is_pxa93x(read_cpuid_id()); \ | 322 | __cpu_is_pxa93x(read_cpuid_id()); \ |
310 | }) | 323 | }) |
324 | |||
325 | #define cpu_is_pxa95x() \ | ||
326 | ({ \ | ||
327 | __cpu_is_pxa95x(read_cpuid_id()); \ | ||
328 | }) | ||
329 | |||
311 | /* | 330 | /* |
312 | * return current memory and LCD clock frequency in units of 10kHz | 331 | * return current memory and LCD clock frequency in units of 10kHz |
313 | */ | 332 | */ |
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h index d372caa75dc7..a4285fc00878 100644 --- a/arch/arm/mach-pxa/include/mach/irqs.h +++ b/arch/arm/mach-pxa/include/mach/irqs.h | |||
@@ -21,16 +21,14 @@ | |||
21 | 21 | ||
22 | #define PXA_IRQ(x) (PXA_ISA_IRQ_NUM + (x)) | 22 | #define PXA_IRQ(x) (PXA_ISA_IRQ_NUM + (x)) |
23 | 23 | ||
24 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
25 | #define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */ | 24 | #define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */ |
26 | #define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */ | 25 | #define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */ |
27 | #define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI) */ | 26 | #define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI,PXA27x) */ |
28 | #define IRQ_USBH1 PXA_IRQ(3) /* USB Host interrupt 2 (non-OHCI) */ | 27 | #define IRQ_USBH1 PXA_IRQ(3) /* USB Host interrupt 2 (non-OHCI,PXA27x) */ |
29 | #define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */ | 28 | #define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */ |
30 | #define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt */ | 29 | #define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt (PXA27x) */ |
30 | #define IRQ_ACIPC0 PXA_IRQ(5) /* AP-CP Communication (PXA930) */ | ||
31 | #define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */ | 31 | #define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */ |
32 | #endif | ||
33 | |||
34 | #define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */ | 32 | #define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */ |
35 | #define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */ | 33 | #define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */ |
36 | #define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ | 34 | #define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ |
@@ -38,7 +36,8 @@ | |||
38 | #define IRQ_GPIO_2_x PXA_IRQ(10) /* GPIO[2-x] Edge Detect */ | 36 | #define IRQ_GPIO_2_x PXA_IRQ(10) /* GPIO[2-x] Edge Detect */ |
39 | #define IRQ_USB PXA_IRQ(11) /* USB Service */ | 37 | #define IRQ_USB PXA_IRQ(11) /* USB Service */ |
40 | #define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */ | 38 | #define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */ |
41 | #define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt */ | 39 | #define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt (PXA27x) */ |
40 | #define IRQ_SSP4 PXA_IRQ(13) /* SSP4 service request (PXA3xx) */ | ||
42 | #define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */ | 41 | #define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */ |
43 | #define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request (PXA25x) */ | 42 | #define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request (PXA25x) */ |
44 | #define IRQ_USIM PXA_IRQ(15) /* Smart Card interface interrupt (PXA27x) */ | 43 | #define IRQ_USIM PXA_IRQ(15) /* Smart Card interface interrupt (PXA27x) */ |
@@ -47,6 +46,7 @@ | |||
47 | #define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */ | 46 | #define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */ |
48 | #define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */ | 47 | #define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */ |
49 | #define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */ | 48 | #define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */ |
49 | #define IRQ_ACIPC2 PXA_IRQ(19) /* AP-CP Communication (PXA930) */ | ||
50 | #define IRQ_STUART PXA_IRQ(20) /* STUART Transmit/Receive/Error */ | 50 | #define IRQ_STUART PXA_IRQ(20) /* STUART Transmit/Receive/Error */ |
51 | #define IRQ_BTUART PXA_IRQ(21) /* BTUART Transmit/Receive/Error */ | 51 | #define IRQ_BTUART PXA_IRQ(21) /* BTUART Transmit/Receive/Error */ |
52 | #define IRQ_FFUART PXA_IRQ(22) /* FFUART Transmit/Receive/Error*/ | 52 | #define IRQ_FFUART PXA_IRQ(22) /* FFUART Transmit/Receive/Error*/ |
@@ -60,19 +60,17 @@ | |||
60 | #define IRQ_RTC1Hz PXA_IRQ(30) /* RTC HZ Clock Tick */ | 60 | #define IRQ_RTC1Hz PXA_IRQ(30) /* RTC HZ Clock Tick */ |
61 | #define IRQ_RTCAlrm PXA_IRQ(31) /* RTC Alarm */ | 61 | #define IRQ_RTCAlrm PXA_IRQ(31) /* RTC Alarm */ |
62 | 62 | ||
63 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
64 | #define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ | 63 | #define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ |
65 | #define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ | 64 | #define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ |
66 | #endif | ||
67 | |||
68 | #ifdef CONFIG_PXA3xx | ||
69 | #define IRQ_SSP4 PXA_IRQ(13) /* SSP4 service request */ | ||
70 | #define IRQ_CIR PXA_IRQ(34) /* Consumer IR */ | 65 | #define IRQ_CIR PXA_IRQ(34) /* Consumer IR */ |
71 | #define IRQ_COMM_WDT PXA_IRQ(35) /* Comm WDT interrupt */ | 66 | #define IRQ_COMM_WDT PXA_IRQ(35) /* Comm WDT interrupt */ |
72 | #define IRQ_TSI PXA_IRQ(36) /* Touch Screen Interface (PXA320) */ | 67 | #define IRQ_TSI PXA_IRQ(36) /* Touch Screen Interface (PXA320) */ |
68 | #define IRQ_ENHROT PXA_IRQ(37) /* Enhanced Rotary (PXA930) */ | ||
73 | #define IRQ_USIM2 PXA_IRQ(38) /* USIM2 Controller */ | 69 | #define IRQ_USIM2 PXA_IRQ(38) /* USIM2 Controller */ |
74 | #define IRQ_GCU PXA_IRQ(39) /* Graphics Controller */ | 70 | #define IRQ_GCU PXA_IRQ(39) /* Graphics Controller (PXA3xx) */ |
71 | #define IRQ_ACIPC1 PXA_IRQ(40) /* AP-CP Communication (PXA930) */ | ||
75 | #define IRQ_MMC2 PXA_IRQ(41) /* MMC2 Controller */ | 72 | #define IRQ_MMC2 PXA_IRQ(41) /* MMC2 Controller */ |
73 | #define IRQ_TRKBALL PXA_IRQ(43) /* Track Ball (PXA930) */ | ||
76 | #define IRQ_1WIRE PXA_IRQ(44) /* 1-Wire Controller */ | 74 | #define IRQ_1WIRE PXA_IRQ(44) /* 1-Wire Controller */ |
77 | #define IRQ_NAND PXA_IRQ(45) /* NAND Controller */ | 75 | #define IRQ_NAND PXA_IRQ(45) /* NAND Controller */ |
78 | #define IRQ_USB2 PXA_IRQ(46) /* USB 2.0 Device Controller */ | 76 | #define IRQ_USB2 PXA_IRQ(46) /* USB 2.0 Device Controller */ |
@@ -80,30 +78,14 @@ | |||
80 | #define IRQ_WAKEUP1 PXA_IRQ(50) /* EXT_WAKEUP1 */ | 78 | #define IRQ_WAKEUP1 PXA_IRQ(50) /* EXT_WAKEUP1 */ |
81 | #define IRQ_DMEMC PXA_IRQ(51) /* Dynamic Memory Controller */ | 79 | #define IRQ_DMEMC PXA_IRQ(51) /* Dynamic Memory Controller */ |
82 | #define IRQ_MMC3 PXA_IRQ(55) /* MMC3 Controller (PXA310) */ | 80 | #define IRQ_MMC3 PXA_IRQ(55) /* MMC3 Controller (PXA310) */ |
83 | #endif | ||
84 | 81 | ||
85 | #ifdef CONFIG_CPU_PXA935 | ||
86 | #define IRQ_U2O PXA_IRQ(64) /* USB OTG 2.0 Controller (PXA935) */ | 82 | #define IRQ_U2O PXA_IRQ(64) /* USB OTG 2.0 Controller (PXA935) */ |
87 | #define IRQ_U2H PXA_IRQ(65) /* USB Host 2.0 Controller (PXA935) */ | 83 | #define IRQ_U2H PXA_IRQ(65) /* USB Host 2.0 Controller (PXA935) */ |
88 | 84 | #define IRQ_PXA935_MMC0 PXA_IRQ(72) /* MMC0 Controller (PXA935) */ | |
89 | #define IRQ_MMC3_PXA935 PXA_IRQ(72) /* MMC3 Controller (PXA935) */ | 85 | #define IRQ_PXA935_MMC1 PXA_IRQ(73) /* MMC1 Controller (PXA935) */ |
90 | #define IRQ_MMC4_PXA935 PXA_IRQ(73) /* MMC4 Controller (PXA935) */ | 86 | #define IRQ_PXA935_MMC2 PXA_IRQ(74) /* MMC2 Controller (PXA935) */ |
91 | #define IRQ_MMC5_PXA935 PXA_IRQ(74) /* MMC5 Controller (PXA935) */ | 87 | #define IRQ_PXA955_MMC3 PXA_IRQ(75) /* MMC3 Controller (PXA955) */ |
92 | |||
93 | #define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */ | 88 | #define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */ |
94 | #endif | ||
95 | |||
96 | #ifdef CONFIG_CPU_PXA930 | ||
97 | #define IRQ_ENHROT PXA_IRQ(37) /* Enhanced Rotary (PXA930) */ | ||
98 | #define IRQ_ACIPC0 PXA_IRQ(5) | ||
99 | #define IRQ_ACIPC1 PXA_IRQ(40) | ||
100 | #define IRQ_ACIPC2 PXA_IRQ(19) | ||
101 | #define IRQ_TRKBALL PXA_IRQ(43) /* Track Ball */ | ||
102 | #endif | ||
103 | |||
104 | #ifdef CONFIG_CPU_PXA950 | ||
105 | #define IRQ_GC500 PXA_IRQ(70) /* Graphics Controller (PXA950) */ | ||
106 | #endif | ||
107 | 89 | ||
108 | #define PXA_GPIO_IRQ_BASE PXA_IRQ(96) | 90 | #define PXA_GPIO_IRQ_BASE PXA_IRQ(96) |
109 | #define PXA_GPIO_IRQ_NUM (192) | 91 | #define PXA_GPIO_IRQ_NUM (192) |
diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h index 4fcddd9cab76..ee6ced1cea7f 100644 --- a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h +++ b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h | |||
@@ -17,72 +17,6 @@ | |||
17 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * PXA Chip selects | ||
21 | */ | ||
22 | |||
23 | #define PXA_CS0_PHYS 0x00000000 | ||
24 | #define PXA_CS1_PHYS 0x04000000 | ||
25 | #define PXA_CS2_PHYS 0x08000000 | ||
26 | #define PXA_CS3_PHYS 0x0C000000 | ||
27 | #define PXA_CS4_PHYS 0x10000000 | ||
28 | #define PXA_CS5_PHYS 0x14000000 | ||
29 | |||
30 | /* | ||
31 | * Memory controller | ||
32 | */ | ||
33 | |||
34 | #define MDCNFG __REG(0x48000000) /* SDRAM Configuration Register 0 */ | ||
35 | #define MDREFR __REG(0x48000004) /* SDRAM Refresh Control Register */ | ||
36 | #define MSC0 __REG(0x48000008) /* Static Memory Control Register 0 */ | ||
37 | #define MSC1 __REG(0x4800000C) /* Static Memory Control Register 1 */ | ||
38 | #define MSC2 __REG(0x48000010) /* Static Memory Control Register 2 */ | ||
39 | #define MECR __REG(0x48000014) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */ | ||
40 | #define SXLCR __REG(0x48000018) /* LCR value to be written to SDRAM-Timing Synchronous Flash */ | ||
41 | #define SXCNFG __REG(0x4800001C) /* Synchronous Static Memory Control Register */ | ||
42 | #define SXMRS __REG(0x48000024) /* MRS value to be written to Synchronous Flash or SMROM */ | ||
43 | #define MCMEM0 __REG(0x48000028) /* Card interface Common Memory Space Socket 0 Timing */ | ||
44 | #define MCMEM1 __REG(0x4800002C) /* Card interface Common Memory Space Socket 1 Timing */ | ||
45 | #define MCATT0 __REG(0x48000030) /* Card interface Attribute Space Socket 0 Timing Configuration */ | ||
46 | #define MCATT1 __REG(0x48000034) /* Card interface Attribute Space Socket 1 Timing Configuration */ | ||
47 | #define MCIO0 __REG(0x48000038) /* Card interface I/O Space Socket 0 Timing Configuration */ | ||
48 | #define MCIO1 __REG(0x4800003C) /* Card interface I/O Space Socket 1 Timing Configuration */ | ||
49 | #define MDMRS __REG(0x48000040) /* MRS value to be written to SDRAM */ | ||
50 | #define BOOT_DEF __REG(0x48000044) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */ | ||
51 | |||
52 | /* | ||
53 | * More handy macros for PCMCIA | ||
54 | * | ||
55 | * Arg is socket number | ||
56 | */ | ||
57 | #define MCMEM(s) __REG2(0x48000028, (s)<<2 ) /* Card interface Common Memory Space Socket s Timing */ | ||
58 | #define MCATT(s) __REG2(0x48000030, (s)<<2 ) /* Card interface Attribute Space Socket s Timing Configuration */ | ||
59 | #define MCIO(s) __REG2(0x48000038, (s)<<2 ) /* Card interface I/O Space Socket s Timing Configuration */ | ||
60 | |||
61 | /* MECR register defines */ | ||
62 | #define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ | ||
63 | #define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ | ||
64 | |||
65 | #define MDCNFG_DE0 (1 << 0) /* SDRAM Bank 0 Enable */ | ||
66 | #define MDCNFG_DE1 (1 << 1) /* SDRAM Bank 1 Enable */ | ||
67 | #define MDCNFG_DE2 (1 << 16) /* SDRAM Bank 2 Enable */ | ||
68 | #define MDCNFG_DE3 (1 << 17) /* SDRAM Bank 3 Enable */ | ||
69 | |||
70 | #define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */ | ||
71 | #define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ | ||
72 | #define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ | ||
73 | #define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ | ||
74 | #define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */ | ||
75 | #define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */ | ||
76 | #define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */ | ||
77 | #define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */ | ||
78 | #define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */ | ||
79 | #define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */ | ||
80 | #define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */ | ||
81 | #define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */ | ||
82 | #define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */ | ||
83 | #define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */ | ||
84 | |||
85 | /* | ||
86 | * Power Manager | 20 | * Power Manager |
87 | */ | 21 | */ |
88 | 22 | ||
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h index e91d63cfe811..e4fb4668c26e 100644 --- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h +++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h | |||
@@ -16,15 +16,6 @@ | |||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Static Chip Selects | ||
20 | */ | ||
21 | |||
22 | #define PXA300_CS0_PHYS (0x00000000) /* PXA300/PXA310 _only_ */ | ||
23 | #define PXA300_CS1_PHYS (0x30000000) /* PXA300/PXA310 _only_ */ | ||
24 | #define PXA3xx_CS2_PHYS (0x10000000) | ||
25 | #define PXA3xx_CS3_PHYS (0x14000000) | ||
26 | |||
27 | /* | ||
28 | * Oscillator Configuration Register (OSCC) | 19 | * Oscillator Configuration Register (OSCC) |
29 | */ | 20 | */ |
30 | #define OSCC __REG(0x41350000) /* Oscillator Configuration Register */ | 21 | #define OSCC __REG(0x41350000) /* Oscillator Configuration Register */ |
diff --git a/arch/arm/mach-pxa/include/mach/regs-intc.h b/arch/arm/mach-pxa/include/mach/regs-intc.h index 68464ce1c1ea..662288eb6f95 100644 --- a/arch/arm/mach-pxa/include/mach/regs-intc.h +++ b/arch/arm/mach-pxa/include/mach/regs-intc.h | |||
@@ -27,8 +27,4 @@ | |||
27 | #define ICFP3 __REG(0x40D0013C) /* Interrupt Controller FIQ Pending Register 3 */ | 27 | #define ICFP3 __REG(0x40D0013C) /* Interrupt Controller FIQ Pending Register 3 */ |
28 | #define ICPR3 __REG(0x40D00140) /* Interrupt Controller Pending Register 3 */ | 28 | #define ICPR3 __REG(0x40D00140) /* Interrupt Controller Pending Register 3 */ |
29 | 29 | ||
30 | #define IPR(x) __REG(0x40D0001C + (x < 32 ? (x << 2) \ | ||
31 | : (x < 64 ? (0x94 + ((x - 32) << 2)) \ | ||
32 | : (0x128 + ((x - 64) << 2))))) | ||
33 | |||
34 | #endif /* __ASM_MACH_REGS_INTC_H */ | 30 | #endif /* __ASM_MACH_REGS_INTC_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/smemc.h b/arch/arm/mach-pxa/include/mach/smemc.h new file mode 100644 index 000000000000..654adc90c9a0 --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/smemc.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * Static memory controller register definitions for PXA CPUs | ||
3 | * | ||
4 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> | ||
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 __SMEMC_REGS_H | ||
12 | #define __SMEMC_REGS_H | ||
13 | |||
14 | #define PXA2XX_SMEMC_BASE 0x48000000 | ||
15 | #define PXA3XX_SMEMC_BASE 0x4a000000 | ||
16 | #define SMEMC_VIRT 0xf6000000 | ||
17 | |||
18 | #define MDCNFG (SMEMC_VIRT + 0x00) /* SDRAM Configuration Register 0 */ | ||
19 | #define MDREFR (SMEMC_VIRT + 0x04) /* SDRAM Refresh Control Register */ | ||
20 | #define MSC0 (SMEMC_VIRT + 0x08) /* Static Memory Control Register 0 */ | ||
21 | #define MSC1 (SMEMC_VIRT + 0x0C) /* Static Memory Control Register 1 */ | ||
22 | #define MSC2 (SMEMC_VIRT + 0x10) /* Static Memory Control Register 2 */ | ||
23 | #define MECR (SMEMC_VIRT + 0x14) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */ | ||
24 | #define SXLCR (SMEMC_VIRT + 0x18) /* LCR value to be written to SDRAM-Timing Synchronous Flash */ | ||
25 | #define SXCNFG (SMEMC_VIRT + 0x1C) /* Synchronous Static Memory Control Register */ | ||
26 | #define SXMRS (SMEMC_VIRT + 0x24) /* MRS value to be written to Synchronous Flash or SMROM */ | ||
27 | #define MCMEM0 (SMEMC_VIRT + 0x28) /* Card interface Common Memory Space Socket 0 Timing */ | ||
28 | #define MCMEM1 (SMEMC_VIRT + 0x2C) /* Card interface Common Memory Space Socket 1 Timing */ | ||
29 | #define MCATT0 (SMEMC_VIRT + 0x30) /* Card interface Attribute Space Socket 0 Timing Configuration */ | ||
30 | #define MCATT1 (SMEMC_VIRT + 0x34) /* Card interface Attribute Space Socket 1 Timing Configuration */ | ||
31 | #define MCIO0 (SMEMC_VIRT + 0x38) /* Card interface I/O Space Socket 0 Timing Configuration */ | ||
32 | #define MCIO1 (SMEMC_VIRT + 0x3C) /* Card interface I/O Space Socket 1 Timing Configuration */ | ||
33 | #define MDMRS (SMEMC_VIRT + 0x40) /* MRS value to be written to SDRAM */ | ||
34 | #define BOOT_DEF (SMEMC_VIRT + 0x44) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */ | ||
35 | #define MEMCLKCFG (SMEMC_VIRT + 0x68) /* Clock Configuration */ | ||
36 | #define CSADRCFG0 (SMEMC_VIRT + 0x80) /* Address Configuration Register for CS0 */ | ||
37 | #define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */ | ||
38 | #define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */ | ||
39 | #define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */ | ||
40 | |||
41 | /* | ||
42 | * More handy macros for PCMCIA | ||
43 | * | ||
44 | * Arg is socket number | ||
45 | */ | ||
46 | #define MCMEM(s) (SMEMC_VIRT + 0x28 + ((s)<<2)) /* Card interface Common Memory Space Socket s Timing */ | ||
47 | #define MCATT(s) (SMEMC_VIRT + 0x30 + ((s)<<2)) /* Card interface Attribute Space Socket s Timing Configuration */ | ||
48 | #define MCIO(s) (SMEMC_VIRT + 0x38 + ((s)<<2)) /* Card interface I/O Space Socket s Timing Configuration */ | ||
49 | |||
50 | /* MECR register defines */ | ||
51 | #define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ | ||
52 | #define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ | ||
53 | |||
54 | #define MDCNFG_DE0 (1 << 0) /* SDRAM Bank 0 Enable */ | ||
55 | #define MDCNFG_DE1 (1 << 1) /* SDRAM Bank 1 Enable */ | ||
56 | #define MDCNFG_DE2 (1 << 16) /* SDRAM Bank 2 Enable */ | ||
57 | #define MDCNFG_DE3 (1 << 17) /* SDRAM Bank 3 Enable */ | ||
58 | |||
59 | #define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */ | ||
60 | #define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ | ||
61 | #define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ | ||
62 | #define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ | ||
63 | #define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */ | ||
64 | #define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */ | ||
65 | #define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */ | ||
66 | #define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */ | ||
67 | #define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */ | ||
68 | #define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */ | ||
69 | #define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */ | ||
70 | #define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */ | ||
71 | #define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */ | ||
72 | #define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */ | ||
73 | |||
74 | #endif | ||
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 1beb40f692fc..54e91c9e71c8 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c | |||
@@ -16,20 +16,31 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/sysdev.h> |
19 | #include <linux/io.h> | ||
20 | #include <linux/irq.h> | ||
19 | 21 | ||
20 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
21 | #include <asm/irq.h> | 23 | #include <mach/irqs.h> |
22 | #include <asm/mach/irq.h> | ||
23 | #include <mach/gpio.h> | 24 | #include <mach/gpio.h> |
24 | #include <mach/regs-intc.h> | ||
25 | 25 | ||
26 | #include "generic.h" | 26 | #include "generic.h" |
27 | 27 | ||
28 | #define MAX_INTERNAL_IRQS 128 | 28 | #define IRQ_BASE (void __iomem *)io_p2v(0x40d00000) |
29 | |||
30 | #define ICIP (0x000) | ||
31 | #define ICMR (0x004) | ||
32 | #define ICLR (0x008) | ||
33 | #define ICFR (0x00c) | ||
34 | #define ICPR (0x010) | ||
35 | #define ICCR (0x014) | ||
36 | #define ICHP (0x018) | ||
37 | #define IPR(i) (((i) < 32) ? (0x01c + ((i) << 2)) : \ | ||
38 | ((i) < 64) ? (0x0b0 + (((i) - 32) << 2)) : \ | ||
39 | (0x144 + (((i) - 64) << 2))) | ||
40 | #define IPR_VALID (1 << 31) | ||
41 | #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) | ||
29 | 42 | ||
30 | #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) | 43 | #define MAX_INTERNAL_IRQS 128 |
31 | #define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR)) | ||
32 | #define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR)) | ||
33 | 44 | ||
34 | /* | 45 | /* |
35 | * This is for peripheral IRQs internal to the PXA chip. | 46 | * This is for peripheral IRQs internal to the PXA chip. |
@@ -37,14 +48,27 @@ | |||
37 | 48 | ||
38 | static int pxa_internal_irq_nr; | 49 | static int pxa_internal_irq_nr; |
39 | 50 | ||
51 | static inline int cpu_has_ipr(void) | ||
52 | { | ||
53 | return !cpu_is_pxa25x(); | ||
54 | } | ||
55 | |||
40 | static void pxa_mask_irq(unsigned int irq) | 56 | static void pxa_mask_irq(unsigned int irq) |
41 | { | 57 | { |
42 | _ICMR(irq) &= ~(1 << IRQ_BIT(irq)); | 58 | void __iomem *base = get_irq_chip_data(irq); |
59 | uint32_t icmr = __raw_readl(base + ICMR); | ||
60 | |||
61 | icmr &= ~(1 << IRQ_BIT(irq)); | ||
62 | __raw_writel(icmr, base + ICMR); | ||
43 | } | 63 | } |
44 | 64 | ||
45 | static void pxa_unmask_irq(unsigned int irq) | 65 | static void pxa_unmask_irq(unsigned int irq) |
46 | { | 66 | { |
47 | _ICMR(irq) |= 1 << IRQ_BIT(irq); | 67 | void __iomem *base = get_irq_chip_data(irq); |
68 | uint32_t icmr = __raw_readl(base + ICMR); | ||
69 | |||
70 | icmr |= 1 << IRQ_BIT(irq); | ||
71 | __raw_writel(icmr, base + ICMR); | ||
48 | } | 72 | } |
49 | 73 | ||
50 | static struct irq_chip pxa_internal_irq_chip = { | 74 | static struct irq_chip pxa_internal_irq_chip = { |
@@ -86,12 +110,16 @@ static void pxa_ack_low_gpio(unsigned int irq) | |||
86 | 110 | ||
87 | static void pxa_mask_low_gpio(unsigned int irq) | 111 | static void pxa_mask_low_gpio(unsigned int irq) |
88 | { | 112 | { |
89 | ICMR &= ~(1 << (irq - PXA_IRQ(0))); | 113 | struct irq_desc *desc = irq_to_desc(irq); |
114 | |||
115 | desc->chip->mask(irq); | ||
90 | } | 116 | } |
91 | 117 | ||
92 | static void pxa_unmask_low_gpio(unsigned int irq) | 118 | static void pxa_unmask_low_gpio(unsigned int irq) |
93 | { | 119 | { |
94 | ICMR |= 1 << (irq - PXA_IRQ(0)); | 120 | struct irq_desc *desc = irq_to_desc(irq); |
121 | |||
122 | desc->chip->unmask(irq); | ||
95 | } | 123 | } |
96 | 124 | ||
97 | static struct irq_chip pxa_low_gpio_chip = { | 125 | static struct irq_chip pxa_low_gpio_chip = { |
@@ -120,33 +148,45 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn) | |||
120 | pxa_low_gpio_chip.set_wake = fn; | 148 | pxa_low_gpio_chip.set_wake = fn; |
121 | } | 149 | } |
122 | 150 | ||
151 | static inline void __iomem *irq_base(int i) | ||
152 | { | ||
153 | static unsigned long phys_base[] = { | ||
154 | 0x40d00000, | ||
155 | 0x40d0009c, | ||
156 | 0x40d00130, | ||
157 | }; | ||
158 | |||
159 | return (void __iomem *)io_p2v(phys_base[i >> 5]); | ||
160 | } | ||
161 | |||
123 | void __init pxa_init_irq(int irq_nr, set_wake_t fn) | 162 | void __init pxa_init_irq(int irq_nr, set_wake_t fn) |
124 | { | 163 | { |
125 | int irq, i; | 164 | int irq, i, n; |
126 | 165 | ||
127 | BUG_ON(irq_nr > MAX_INTERNAL_IRQS); | 166 | BUG_ON(irq_nr > MAX_INTERNAL_IRQS); |
128 | 167 | ||
129 | pxa_internal_irq_nr = irq_nr; | 168 | pxa_internal_irq_nr = irq_nr; |
130 | 169 | ||
131 | for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { | 170 | for (n = 0; n < irq_nr; n += 32) { |
132 | _ICMR(irq) = 0; /* disable all IRQs */ | 171 | void __iomem *base = irq_base(n); |
133 | _ICLR(irq) = 0; /* all IRQs are IRQ, not FIQ */ | 172 | |
134 | } | 173 | __raw_writel(0, base + ICMR); /* disable all IRQs */ |
135 | 174 | __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ | |
136 | /* initialize interrupt priority */ | 175 | for (i = n; (i < (n + 32)) && (i < irq_nr); i++) { |
137 | if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { | 176 | /* initialize interrupt priority */ |
138 | for (i = 0; i < irq_nr; i++) | 177 | if (cpu_has_ipr()) |
139 | IPR(i) = i | (1 << 31); | 178 | __raw_writel(i | IPR_VALID, IRQ_BASE + IPR(i)); |
179 | |||
180 | irq = PXA_IRQ(i); | ||
181 | set_irq_chip(irq, &pxa_internal_irq_chip); | ||
182 | set_irq_chip_data(irq, base); | ||
183 | set_irq_handler(irq, handle_level_irq); | ||
184 | set_irq_flags(irq, IRQF_VALID); | ||
185 | } | ||
140 | } | 186 | } |
141 | 187 | ||
142 | /* only unmasked interrupts kick us out of idle */ | 188 | /* only unmasked interrupts kick us out of idle */ |
143 | ICCR = 1; | 189 | __raw_writel(1, irq_base(0) + ICCR); |
144 | |||
145 | for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) { | ||
146 | set_irq_chip(irq, &pxa_internal_irq_chip); | ||
147 | set_irq_handler(irq, handle_level_irq); | ||
148 | set_irq_flags(irq, IRQF_VALID); | ||
149 | } | ||
150 | 190 | ||
151 | pxa_internal_irq_chip.set_wake = fn; | 191 | pxa_internal_irq_chip.set_wake = fn; |
152 | pxa_init_low_gpio_irq(fn); | 192 | pxa_init_low_gpio_irq(fn); |
@@ -158,16 +198,18 @@ static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; | |||
158 | 198 | ||
159 | static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) | 199 | static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) |
160 | { | 200 | { |
161 | int i, irq = PXA_IRQ(0); | 201 | int i; |
162 | 202 | ||
163 | for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) { | 203 | for (i = 0; i < pxa_internal_irq_nr; i += 32) { |
164 | saved_icmr[i] = _ICMR(irq); | 204 | void __iomem *base = irq_base(i); |
165 | _ICMR(irq) = 0; | 205 | |
206 | saved_icmr[i] = __raw_readl(base + ICMR); | ||
207 | __raw_writel(0, base + ICMR); | ||
166 | } | 208 | } |
167 | 209 | ||
168 | if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { | 210 | if (cpu_has_ipr()) { |
169 | for (i = 0; i < pxa_internal_irq_nr; i++) | 211 | for (i = 0; i < pxa_internal_irq_nr; i++) |
170 | saved_ipr[i] = IPR(i); | 212 | saved_ipr[i] = __raw_readl(IRQ_BASE + IPR(i)); |
171 | } | 213 | } |
172 | 214 | ||
173 | return 0; | 215 | return 0; |
@@ -175,19 +217,20 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) | |||
175 | 217 | ||
176 | static int pxa_irq_resume(struct sys_device *dev) | 218 | static int pxa_irq_resume(struct sys_device *dev) |
177 | { | 219 | { |
178 | int i, irq = PXA_IRQ(0); | 220 | int i; |
179 | 221 | ||
180 | if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { | 222 | for (i = 0; i < pxa_internal_irq_nr; i += 32) { |
181 | for (i = 0; i < pxa_internal_irq_nr; i++) | 223 | void __iomem *base = irq_base(i); |
182 | IPR(i) = saved_ipr[i]; | ||
183 | } | ||
184 | 224 | ||
185 | for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) { | 225 | __raw_writel(saved_icmr[i], base + ICMR); |
186 | _ICMR(irq) = saved_icmr[i]; | 226 | __raw_writel(0, base + ICLR); |
187 | _ICLR(irq) = 0; | ||
188 | } | 227 | } |
189 | 228 | ||
190 | ICCR = 1; | 229 | if (!cpu_is_pxa25x()) |
230 | for (i = 0; i < pxa_internal_irq_nr; i++) | ||
231 | __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); | ||
232 | |||
233 | __raw_writel(1, IRQ_BASE + ICCR); | ||
191 | return 0; | 234 | return 0; |
192 | } | 235 | } |
193 | #else | 236 | #else |
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index 41aa89e35772..719c260597e7 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -438,7 +438,7 @@ static void __init littleton_init(void) | |||
438 | 438 | ||
439 | MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") | 439 | MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") |
440 | .boot_params = 0xa0000100, | 440 | .boot_params = 0xa0000100, |
441 | .map_io = pxa_map_io, | 441 | .map_io = pxa3xx_map_io, |
442 | .nr_irqs = LITTLETON_NR_IRQS, | 442 | .nr_irqs = LITTLETON_NR_IRQS, |
443 | .init_irq = pxa3xx_init_irq, | 443 | .init_irq = pxa3xx_init_irq, |
444 | .timer = &pxa_timer, | 444 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index 623af0232a54..8ab62a677807 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <mach/mmc.h> | 46 | #include <mach/mmc.h> |
47 | #include <mach/irda.h> | 47 | #include <mach/irda.h> |
48 | #include <mach/ohci.h> | 48 | #include <mach/ohci.h> |
49 | #include <mach/smemc.h> | ||
49 | 50 | ||
50 | #include "generic.h" | 51 | #include "generic.h" |
51 | #include "devices.h" | 52 | #include "devices.h" |
@@ -463,7 +464,7 @@ static void __init lpd270_init(void) | |||
463 | pxa_set_btuart_info(NULL); | 464 | pxa_set_btuart_info(NULL); |
464 | pxa_set_stuart_info(NULL); | 465 | pxa_set_stuart_info(NULL); |
465 | 466 | ||
466 | lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; | 467 | lpd270_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4; |
467 | lpd270_flash_data[1].width = 4; | 468 | lpd270_flash_data[1].width = 4; |
468 | 469 | ||
469 | /* | 470 | /* |
@@ -495,7 +496,7 @@ static struct map_desc lpd270_io_desc[] __initdata = { | |||
495 | 496 | ||
496 | static void __init lpd270_map_io(void) | 497 | static void __init lpd270_map_io(void) |
497 | { | 498 | { |
498 | pxa_map_io(); | 499 | pxa27x_map_io(); |
499 | iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc)); | 500 | iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc)); |
500 | 501 | ||
501 | /* for use I SRAM as framebuffer. */ | 502 | /* for use I SRAM as framebuffer. */ |
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 1499493cd070..d3375486c8cd 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <mach/pxafb.h> | 50 | #include <mach/pxafb.h> |
51 | #include <mach/mmc.h> | 51 | #include <mach/mmc.h> |
52 | #include <mach/pm.h> | 52 | #include <mach/pm.h> |
53 | #include <mach/smemc.h> | ||
53 | 54 | ||
54 | #include "generic.h" | 55 | #include "generic.h" |
55 | #include "clock.h" | 56 | #include "clock.h" |
@@ -525,7 +526,7 @@ static void __init lubbock_init(void) | |||
525 | pxa_set_ac97_info(NULL); | 526 | pxa_set_ac97_info(NULL); |
526 | 527 | ||
527 | lubbock_flash_data[0].width = lubbock_flash_data[1].width = | 528 | lubbock_flash_data[0].width = lubbock_flash_data[1].width = |
528 | (BOOT_DEF & 1) ? 2 : 4; | 529 | (__raw_readl(BOOT_DEF) & 1) ? 2 : 4; |
529 | /* Compensate for the nROMBT switch which swaps the flash banks */ | 530 | /* Compensate for the nROMBT switch which swaps the flash banks */ |
530 | printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n", | 531 | printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n", |
531 | flashboot?"Flash":"ROM", flashboot); | 532 | flashboot?"Flash":"ROM", flashboot); |
@@ -549,7 +550,7 @@ static struct map_desc lubbock_io_desc[] __initdata = { | |||
549 | 550 | ||
550 | static void __init lubbock_map_io(void) | 551 | static void __init lubbock_map_io(void) |
551 | { | 552 | { |
552 | pxa_map_io(); | 553 | pxa25x_map_io(); |
553 | iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc)); | 554 | iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc)); |
554 | 555 | ||
555 | PCFR |= PCFR_OPDE; | 556 | PCFR |= PCFR_OPDE; |
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index 90663760307a..41198f0dc3ac 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c | |||
@@ -765,7 +765,7 @@ static void __init magician_init(void) | |||
765 | 765 | ||
766 | MACHINE_START(MAGICIAN, "HTC Magician") | 766 | MACHINE_START(MAGICIAN, "HTC Magician") |
767 | .boot_params = 0xa0000100, | 767 | .boot_params = 0xa0000100, |
768 | .map_io = pxa_map_io, | 768 | .map_io = pxa27x_map_io, |
769 | .nr_irqs = MAGICIAN_NR_IRQS, | 769 | .nr_irqs = MAGICIAN_NR_IRQS, |
770 | .init_irq = pxa27x_init_irq, | 770 | .init_irq = pxa27x_init_irq, |
771 | .init_machine = magician_init, | 771 | .init_machine = magician_init, |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index a980a5c93e49..740c03590e3b 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <mach/irda.h> | 51 | #include <mach/irda.h> |
52 | #include <mach/ohci.h> | 52 | #include <mach/ohci.h> |
53 | #include <plat/pxa27x_keypad.h> | 53 | #include <plat/pxa27x_keypad.h> |
54 | #include <mach/smemc.h> | ||
54 | 55 | ||
55 | #include "generic.h" | 56 | #include "generic.h" |
56 | #include "devices.h" | 57 | #include "devices.h" |
@@ -565,7 +566,7 @@ static void __init mainstone_init(void) | |||
565 | pxa_set_btuart_info(NULL); | 566 | pxa_set_btuart_info(NULL); |
566 | pxa_set_stuart_info(NULL); | 567 | pxa_set_stuart_info(NULL); |
567 | 568 | ||
568 | mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; | 569 | mst_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4; |
569 | mst_flash_data[1].width = 4; | 570 | mst_flash_data[1].width = 4; |
570 | 571 | ||
571 | /* Compensate for SW7 which swaps the flash banks */ | 572 | /* Compensate for SW7 which swaps the flash banks */ |
@@ -614,7 +615,7 @@ static struct map_desc mainstone_io_desc[] __initdata = { | |||
614 | 615 | ||
615 | static void __init mainstone_map_io(void) | 616 | static void __init mainstone_map_io(void) |
616 | { | 617 | { |
617 | pxa_map_io(); | 618 | pxa27x_map_io(); |
618 | iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc)); | 619 | iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc)); |
619 | 620 | ||
620 | /* for use I SRAM as framebuffer. */ | 621 | /* for use I SRAM as framebuffer. */ |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index f5fb915e1315..faafea3542fb 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -819,7 +819,7 @@ static void mioa701_machine_exit(void) | |||
819 | 819 | ||
820 | MACHINE_START(MIOA701, "MIO A701") | 820 | MACHINE_START(MIOA701, "MIO A701") |
821 | .boot_params = 0xa0000100, | 821 | .boot_params = 0xa0000100, |
822 | .map_io = &pxa_map_io, | 822 | .map_io = &pxa27x_map_io, |
823 | .init_irq = &pxa27x_init_irq, | 823 | .init_irq = &pxa27x_init_irq, |
824 | .init_machine = mioa701_machine_init, | 824 | .init_machine = mioa701_machine_init, |
825 | .timer = &pxa_timer, | 825 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c index 116167aaba68..59cce78aebd1 100644 --- a/arch/arm/mach-pxa/mp900.c +++ b/arch/arm/mach-pxa/mp900.c | |||
@@ -94,7 +94,7 @@ static void __init mp900c_init(void) | |||
94 | MACHINE_START(NEC_MP900, "MobilePro900/C") | 94 | MACHINE_START(NEC_MP900, "MobilePro900/C") |
95 | .boot_params = 0xa0220100, | 95 | .boot_params = 0xa0220100, |
96 | .timer = &pxa_timer, | 96 | .timer = &pxa_timer, |
97 | .map_io = pxa_map_io, | 97 | .map_io = pxa25x_map_io, |
98 | .init_irq = pxa25x_init_irq, | 98 | .init_irq = pxa25x_init_irq, |
99 | .init_machine = mp900c_init, | 99 | .init_machine = mp900c_init, |
100 | MACHINE_END | 100 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index ce092c521e6d..a6f898cbfac9 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c | |||
@@ -313,7 +313,7 @@ static struct map_desc palmld_io_desc[] __initdata = { | |||
313 | 313 | ||
314 | static void __init palmld_map_io(void) | 314 | static void __init palmld_map_io(void) |
315 | { | 315 | { |
316 | pxa_map_io(); | 316 | pxa27x_map_io(); |
317 | iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc)); | 317 | iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc)); |
318 | } | 318 | } |
319 | 319 | ||
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index 862da812cd10..df4d7d009fbb 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c | |||
@@ -203,7 +203,7 @@ static void __init palmt5_init(void) | |||
203 | 203 | ||
204 | MACHINE_START(PALMT5, "Palm Tungsten|T5") | 204 | MACHINE_START(PALMT5, "Palm Tungsten|T5") |
205 | .boot_params = 0xa0000100, | 205 | .boot_params = 0xa0000100, |
206 | .map_io = pxa_map_io, | 206 | .map_io = pxa27x_map_io, |
207 | .reserve = palmt5_reserve, | 207 | .reserve = palmt5_reserve, |
208 | .init_irq = pxa27x_init_irq, | 208 | .init_irq = pxa27x_init_irq, |
209 | .timer = &pxa_timer, | 209 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index 2131d5860919..a09a2374697b 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/power_supply.h> | 25 | #include <linux/power_supply.h> |
26 | #include <linux/gpio_keys.h> | 26 | #include <linux/gpio_keys.h> |
27 | #include <linux/mtd/physmap.h> | 27 | #include <linux/mtd/physmap.h> |
28 | #include <linux/usb/gpio_vbus.h> | ||
28 | 29 | ||
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
@@ -116,6 +117,7 @@ static unsigned long palmtc_pin_config[] __initdata = { | |||
116 | /****************************************************************************** | 117 | /****************************************************************************** |
117 | * SD/MMC card controller | 118 | * SD/MMC card controller |
118 | ******************************************************************************/ | 119 | ******************************************************************************/ |
120 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
119 | static struct pxamci_platform_data palmtc_mci_platform_data = { | 121 | static struct pxamci_platform_data palmtc_mci_platform_data = { |
120 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 122 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
121 | .gpio_power = GPIO_NR_PALMTC_SD_POWER, | 123 | .gpio_power = GPIO_NR_PALMTC_SD_POWER, |
@@ -124,9 +126,18 @@ static struct pxamci_platform_data palmtc_mci_platform_data = { | |||
124 | .detect_delay_ms = 200, | 126 | .detect_delay_ms = 200, |
125 | }; | 127 | }; |
126 | 128 | ||
129 | static void __init palmtc_mmc_init(void) | ||
130 | { | ||
131 | pxa_set_mci_info(&palmtc_mci_platform_data); | ||
132 | } | ||
133 | #else | ||
134 | static inline void palmtc_mmc_init(void) {} | ||
135 | #endif | ||
136 | |||
127 | /****************************************************************************** | 137 | /****************************************************************************** |
128 | * GPIO keys | 138 | * GPIO keys |
129 | ******************************************************************************/ | 139 | ******************************************************************************/ |
140 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
130 | static struct gpio_keys_button palmtc_pxa_buttons[] = { | 141 | static struct gpio_keys_button palmtc_pxa_buttons[] = { |
131 | {KEY_F8, GPIO_NR_PALMTC_HOTSYNC_BUTTON, 1, "HotSync Button", EV_KEY, 1}, | 142 | {KEY_F8, GPIO_NR_PALMTC_HOTSYNC_BUTTON, 1, "HotSync Button", EV_KEY, 1}, |
132 | }; | 143 | }; |
@@ -144,9 +155,18 @@ static struct platform_device palmtc_pxa_keys = { | |||
144 | }, | 155 | }, |
145 | }; | 156 | }; |
146 | 157 | ||
158 | static void __init palmtc_keys_init(void) | ||
159 | { | ||
160 | platform_device_register(&palmtc_pxa_keys); | ||
161 | } | ||
162 | #else | ||
163 | static inline void palmtc_keys_init(void) {} | ||
164 | #endif | ||
165 | |||
147 | /****************************************************************************** | 166 | /****************************************************************************** |
148 | * Backlight | 167 | * Backlight |
149 | ******************************************************************************/ | 168 | ******************************************************************************/ |
169 | #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) | ||
150 | static int palmtc_backlight_init(struct device *dev) | 170 | static int palmtc_backlight_init(struct device *dev) |
151 | { | 171 | { |
152 | int ret; | 172 | int ret; |
@@ -196,17 +216,35 @@ static struct platform_device palmtc_backlight = { | |||
196 | }, | 216 | }, |
197 | }; | 217 | }; |
198 | 218 | ||
219 | static void __init palmtc_pwm_init(void) | ||
220 | { | ||
221 | platform_device_register(&palmtc_backlight); | ||
222 | } | ||
223 | #else | ||
224 | static inline void palmtc_pwm_init(void) {} | ||
225 | #endif | ||
226 | |||
199 | /****************************************************************************** | 227 | /****************************************************************************** |
200 | * IrDA | 228 | * IrDA |
201 | ******************************************************************************/ | 229 | ******************************************************************************/ |
230 | #if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE) | ||
202 | static struct pxaficp_platform_data palmtc_ficp_platform_data = { | 231 | static struct pxaficp_platform_data palmtc_ficp_platform_data = { |
203 | .gpio_pwdown = GPIO_NR_PALMTC_IR_DISABLE, | 232 | .gpio_pwdown = GPIO_NR_PALMTC_IR_DISABLE, |
204 | .transceiver_cap = IR_SIRMODE | IR_OFF, | 233 | .transceiver_cap = IR_SIRMODE | IR_OFF, |
205 | }; | 234 | }; |
206 | 235 | ||
236 | static void __init palmtc_irda_init(void) | ||
237 | { | ||
238 | pxa_set_ficp_info(&palmtc_ficp_platform_data); | ||
239 | } | ||
240 | #else | ||
241 | static inline void palmtc_irda_init(void) {} | ||
242 | #endif | ||
243 | |||
207 | /****************************************************************************** | 244 | /****************************************************************************** |
208 | * Keyboard | 245 | * Keyboard |
209 | ******************************************************************************/ | 246 | ******************************************************************************/ |
247 | #if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE) | ||
210 | static const uint32_t palmtc_matrix_keys[] = { | 248 | static const uint32_t palmtc_matrix_keys[] = { |
211 | KEY(0, 0, KEY_F1), | 249 | KEY(0, 0, KEY_F1), |
212 | KEY(0, 1, KEY_X), | 250 | KEY(0, 1, KEY_X), |
@@ -290,27 +328,103 @@ static struct platform_device palmtc_keyboard = { | |||
290 | .platform_data = &palmtc_keypad_platform_data, | 328 | .platform_data = &palmtc_keypad_platform_data, |
291 | }, | 329 | }, |
292 | }; | 330 | }; |
331 | static void __init palmtc_mkp_init(void) | ||
332 | { | ||
333 | platform_device_register(&palmtc_keyboard); | ||
334 | } | ||
335 | #else | ||
336 | static inline void palmtc_mkp_init(void) {} | ||
337 | #endif | ||
293 | 338 | ||
294 | /****************************************************************************** | 339 | /****************************************************************************** |
295 | * UDC | 340 | * UDC |
296 | ******************************************************************************/ | 341 | ******************************************************************************/ |
297 | static struct pxa2xx_udc_mach_info palmtc_udc_info __initdata = { | 342 | #if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE) |
343 | static struct gpio_vbus_mach_info palmtc_udc_info = { | ||
298 | .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N, | 344 | .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N, |
299 | .gpio_vbus_inverted = 1, | 345 | .gpio_vbus_inverted = 1, |
300 | .gpio_pullup = GPIO_NR_PALMTC_USB_POWER, | 346 | .gpio_pullup = GPIO_NR_PALMTC_USB_POWER, |
301 | }; | 347 | }; |
302 | 348 | ||
349 | static struct platform_device palmtc_gpio_vbus = { | ||
350 | .name = "gpio-vbus", | ||
351 | .id = -1, | ||
352 | .dev = { | ||
353 | .platform_data = &palmtc_udc_info, | ||
354 | }, | ||
355 | }; | ||
356 | |||
357 | static void __init palmtc_udc_init(void) | ||
358 | { | ||
359 | platform_device_register(&palmtc_gpio_vbus); | ||
360 | }; | ||
361 | #else | ||
362 | static inline void palmtc_udc_init(void) {} | ||
363 | #endif | ||
364 | |||
303 | /****************************************************************************** | 365 | /****************************************************************************** |
304 | * Touchscreen / Battery / GPIO-extender | 366 | * Touchscreen / Battery / GPIO-extender |
305 | ******************************************************************************/ | 367 | ******************************************************************************/ |
306 | static struct platform_device palmtc_ucb1400_core = { | 368 | #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \ |
369 | defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) | ||
370 | static struct platform_device palmtc_ucb1400_device = { | ||
307 | .name = "ucb1400_core", | 371 | .name = "ucb1400_core", |
308 | .id = -1, | 372 | .id = -1, |
309 | }; | 373 | }; |
310 | 374 | ||
375 | static void __init palmtc_ts_init(void) | ||
376 | { | ||
377 | pxa_set_ac97_info(NULL); | ||
378 | platform_device_register(&palmtc_ucb1400_device); | ||
379 | } | ||
380 | #else | ||
381 | static inline void palmtc_ts_init(void) {} | ||
382 | #endif | ||
383 | |||
384 | /****************************************************************************** | ||
385 | * LEDs | ||
386 | ******************************************************************************/ | ||
387 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | ||
388 | struct gpio_led palmtc_gpio_leds[] = { | ||
389 | { | ||
390 | .name = "palmtc:green:user", | ||
391 | .default_trigger = "none", | ||
392 | .gpio = GPIO_NR_PALMTC_LED_POWER, | ||
393 | .active_low = 1, | ||
394 | }, { | ||
395 | .name = "palmtc:vibra:vibra", | ||
396 | .default_trigger = "none", | ||
397 | .gpio = GPIO_NR_PALMTC_VIBRA_POWER, | ||
398 | .active_low = 1, | ||
399 | } | ||
400 | |||
401 | }; | ||
402 | |||
403 | static struct gpio_led_platform_data palmtc_gpio_led_info = { | ||
404 | .leds = palmtc_gpio_leds, | ||
405 | .num_leds = ARRAY_SIZE(palmtc_gpio_leds), | ||
406 | }; | ||
407 | |||
408 | static struct platform_device palmtc_leds = { | ||
409 | .name = "leds-gpio", | ||
410 | .id = -1, | ||
411 | .dev = { | ||
412 | .platform_data = &palmtc_gpio_led_info, | ||
413 | } | ||
414 | }; | ||
415 | |||
416 | static void __init palmtc_leds_init(void) | ||
417 | { | ||
418 | platform_device_register(&palmtc_leds); | ||
419 | } | ||
420 | #else | ||
421 | static inline void palmtc_leds_init(void) {} | ||
422 | #endif | ||
423 | |||
311 | /****************************************************************************** | 424 | /****************************************************************************** |
312 | * NOR Flash | 425 | * NOR Flash |
313 | ******************************************************************************/ | 426 | ******************************************************************************/ |
427 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
314 | static struct resource palmtc_flash_resource = { | 428 | static struct resource palmtc_flash_resource = { |
315 | .start = PXA_CS0_PHYS, | 429 | .start = PXA_CS0_PHYS, |
316 | .end = PXA_CS0_PHYS + SZ_16M - 1, | 430 | .end = PXA_CS0_PHYS + SZ_16M - 1, |
@@ -356,24 +470,33 @@ static struct platform_device palmtc_flash = { | |||
356 | }, | 470 | }, |
357 | }; | 471 | }; |
358 | 472 | ||
473 | static void __init palmtc_nor_init(void) | ||
474 | { | ||
475 | platform_device_register(&palmtc_flash); | ||
476 | } | ||
477 | #else | ||
478 | static inline void palmtc_nor_init(void) {} | ||
479 | #endif | ||
480 | |||
359 | /****************************************************************************** | 481 | /****************************************************************************** |
360 | * Framebuffer | 482 | * Framebuffer |
361 | ******************************************************************************/ | 483 | ******************************************************************************/ |
484 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
362 | static struct pxafb_mode_info palmtc_lcd_modes[] = { | 485 | static struct pxafb_mode_info palmtc_lcd_modes[] = { |
363 | { | 486 | { |
364 | .pixclock = 115384, | 487 | .pixclock = 115384, |
365 | .xres = 320, | 488 | .xres = 320, |
366 | .yres = 320, | 489 | .yres = 320, |
367 | .bpp = 16, | 490 | .bpp = 16, |
368 | 491 | ||
369 | .left_margin = 27, | 492 | .left_margin = 27, |
370 | .right_margin = 7, | 493 | .right_margin = 7, |
371 | .upper_margin = 7, | 494 | .upper_margin = 7, |
372 | .lower_margin = 8, | 495 | .lower_margin = 8, |
373 | 496 | ||
374 | .hsync_len = 6, | 497 | .hsync_len = 6, |
375 | .vsync_len = 1, | 498 | .vsync_len = 1, |
376 | }, | 499 | }, |
377 | }; | 500 | }; |
378 | 501 | ||
379 | static struct pxafb_mach_info palmtc_lcd_screen = { | 502 | static struct pxafb_mach_info palmtc_lcd_screen = { |
@@ -382,17 +505,17 @@ static struct pxafb_mach_info palmtc_lcd_screen = { | |||
382 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 505 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
383 | }; | 506 | }; |
384 | 507 | ||
508 | static void __init palmtc_lcd_init(void) | ||
509 | { | ||
510 | set_pxa_fb_info(&palmtc_lcd_screen); | ||
511 | } | ||
512 | #else | ||
513 | static inline void palmtc_lcd_init(void) {} | ||
514 | #endif | ||
515 | |||
385 | /****************************************************************************** | 516 | /****************************************************************************** |
386 | * Machine init | 517 | * Machine init |
387 | ******************************************************************************/ | 518 | ******************************************************************************/ |
388 | static struct platform_device *devices[] __initdata = { | ||
389 | &palmtc_backlight, | ||
390 | &palmtc_ucb1400_core, | ||
391 | &palmtc_keyboard, | ||
392 | &palmtc_pxa_keys, | ||
393 | &palmtc_flash, | ||
394 | }; | ||
395 | |||
396 | static void __init palmtc_init(void) | 519 | static void __init palmtc_init(void) |
397 | { | 520 | { |
398 | pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config)); | 521 | pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config)); |
@@ -402,18 +525,21 @@ static void __init palmtc_init(void) | |||
402 | pxa_set_stuart_info(NULL); | 525 | pxa_set_stuart_info(NULL); |
403 | pxa_set_hwuart_info(NULL); | 526 | pxa_set_hwuart_info(NULL); |
404 | 527 | ||
405 | set_pxa_fb_info(&palmtc_lcd_screen); | 528 | palmtc_mmc_init(); |
406 | pxa_set_mci_info(&palmtc_mci_platform_data); | 529 | palmtc_keys_init(); |
407 | pxa_set_udc_info(&palmtc_udc_info); | 530 | palmtc_pwm_init(); |
408 | pxa_set_ac97_info(NULL); | 531 | palmtc_irda_init(); |
409 | pxa_set_ficp_info(&palmtc_ficp_platform_data); | 532 | palmtc_mkp_init(); |
410 | 533 | palmtc_udc_init(); | |
411 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 534 | palmtc_ts_init(); |
535 | palmtc_nor_init(); | ||
536 | palmtc_lcd_init(); | ||
537 | palmtc_leds_init(); | ||
412 | }; | 538 | }; |
413 | 539 | ||
414 | MACHINE_START(PALMTC, "Palm Tungsten|C") | 540 | MACHINE_START(PALMTC, "Palm Tungsten|C") |
415 | .boot_params = 0xa0000100, | 541 | .boot_params = 0xa0000100, |
416 | .map_io = pxa_map_io, | 542 | .map_io = pxa25x_map_io, |
417 | .init_irq = pxa25x_init_irq, | 543 | .init_irq = pxa25x_init_irq, |
418 | .timer = &pxa_timer, | 544 | .timer = &pxa_timer, |
419 | .init_machine = palmtc_init | 545 | .init_machine = palmtc_init |
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c index a9dae7bc35d9..3f25014a136c 100644 --- a/arch/arm/mach-pxa/palmte2.c +++ b/arch/arm/mach-pxa/palmte2.c | |||
@@ -374,7 +374,7 @@ static void __init palmte2_init(void) | |||
374 | 374 | ||
375 | MACHINE_START(PALMTE2, "Palm Tungsten|E2") | 375 | MACHINE_START(PALMTE2, "Palm Tungsten|E2") |
376 | .boot_params = 0xa0000100, | 376 | .boot_params = 0xa0000100, |
377 | .map_io = pxa_map_io, | 377 | .map_io = pxa25x_map_io, |
378 | .init_irq = pxa25x_init_irq, | 378 | .init_irq = pxa25x_init_irq, |
379 | .timer = &pxa_timer, | 379 | .timer = &pxa_timer, |
380 | .init_machine = palmte2_init | 380 | .init_machine = palmte2_init |
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index 00e2d7ba84ed..8aadad55fbe4 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c | |||
@@ -442,7 +442,7 @@ static void __init centro_init(void) | |||
442 | 442 | ||
443 | MACHINE_START(TREO680, "Palm Treo 680") | 443 | MACHINE_START(TREO680, "Palm Treo 680") |
444 | .boot_params = 0xa0000100, | 444 | .boot_params = 0xa0000100, |
445 | .map_io = pxa_map_io, | 445 | .map_io = pxa27x_map_io, |
446 | .reserve = treo_reserve, | 446 | .reserve = treo_reserve, |
447 | .init_irq = pxa27x_init_irq, | 447 | .init_irq = pxa27x_init_irq, |
448 | .timer = &pxa_timer, | 448 | .timer = &pxa_timer, |
@@ -451,7 +451,7 @@ MACHINE_END | |||
451 | 451 | ||
452 | MACHINE_START(CENTRO, "Palm Centro 685") | 452 | MACHINE_START(CENTRO, "Palm Centro 685") |
453 | .boot_params = 0xa0000100, | 453 | .boot_params = 0xa0000100, |
454 | .map_io = pxa_map_io, | 454 | .map_io = pxa27x_map_io, |
455 | .reserve = treo_reserve, | 455 | .reserve = treo_reserve, |
456 | .init_irq = pxa27x_init_irq, | 456 | .init_irq = pxa27x_init_irq, |
457 | .timer = &pxa_timer, | 457 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index e5c9932b7588..595f002066cc 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c | |||
@@ -334,7 +334,7 @@ static struct map_desc palmtx_io_desc[] __initdata = { | |||
334 | 334 | ||
335 | static void __init palmtx_map_io(void) | 335 | static void __init palmtx_map_io(void) |
336 | { | 336 | { |
337 | pxa_map_io(); | 337 | pxa27x_map_io(); |
338 | iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); | 338 | iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); |
339 | } | 339 | } |
340 | 340 | ||
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index af6203fbca9c..7bf4017326e3 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c | |||
@@ -280,7 +280,7 @@ static void __init palmz72_init(void) | |||
280 | 280 | ||
281 | MACHINE_START(PALMZ72, "Palm Zire72") | 281 | MACHINE_START(PALMZ72, "Palm Zire72") |
282 | .boot_params = 0xa0000100, | 282 | .boot_params = 0xa0000100, |
283 | .map_io = pxa_map_io, | 283 | .map_io = pxa27x_map_io, |
284 | .init_irq = pxa27x_init_irq, | 284 | .init_irq = pxa27x_init_irq, |
285 | .timer = &pxa_timer, | 285 | .timer = &pxa_timer, |
286 | .init_machine = palmz72_init | 286 | .init_machine = palmz72_init |
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c index c77e8f30a439..8547c9abc40a 100644 --- a/arch/arm/mach-pxa/pcm027.c +++ b/arch/arm/mach-pxa/pcm027.c | |||
@@ -244,7 +244,7 @@ static void __init pcm027_init(void) | |||
244 | 244 | ||
245 | static void __init pcm027_map_io(void) | 245 | static void __init pcm027_map_io(void) |
246 | { | 246 | { |
247 | pxa_map_io(); | 247 | pxa27x_map_io(); |
248 | 248 | ||
249 | /* initialize sleep mode regs (wake-up sources, etc) */ | 249 | /* initialize sleep mode regs (wake-up sources, etc) */ |
250 | PGSR0 = 0x01308000; | 250 | PGSR0 = 0x01308000; |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 93a191c889df..8451790cb48d 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -466,7 +466,7 @@ static void __init fixup_poodle(struct machine_desc *desc, | |||
466 | 466 | ||
467 | MACHINE_START(POODLE, "SHARP Poodle") | 467 | MACHINE_START(POODLE, "SHARP Poodle") |
468 | .fixup = fixup_poodle, | 468 | .fixup = fixup_poodle, |
469 | .map_io = pxa_map_io, | 469 | .map_io = pxa25x_map_io, |
470 | .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ | 470 | .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ |
471 | .init_irq = pxa25x_init_irq, | 471 | .init_irq = pxa25x_init_irq, |
472 | .timer = &pxa_timer, | 472 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index de53f2e4aa39..3f5241c84894 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/suspend.h> | 23 | #include <linux/suspend.h> |
24 | #include <linux/sysdev.h> | 24 | #include <linux/sysdev.h> |
25 | 25 | ||
26 | #include <asm/mach/map.h> | ||
26 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
27 | #include <mach/irqs.h> | 28 | #include <mach/irqs.h> |
28 | #include <mach/gpio.h> | 29 | #include <mach/gpio.h> |
@@ -30,6 +31,7 @@ | |||
30 | #include <mach/reset.h> | 31 | #include <mach/reset.h> |
31 | #include <mach/pm.h> | 32 | #include <mach/pm.h> |
32 | #include <mach/dma.h> | 33 | #include <mach/dma.h> |
34 | #include <mach/smemc.h> | ||
33 | 35 | ||
34 | #include "generic.h" | 36 | #include "generic.h" |
35 | #include "devices.h" | 37 | #include "devices.h" |
@@ -90,23 +92,21 @@ unsigned int pxa25x_get_clk_frequency_khz(int info) | |||
90 | return (turbo & 1) ? (N/1000) : (M/1000); | 92 | return (turbo & 1) ? (N/1000) : (M/1000); |
91 | } | 93 | } |
92 | 94 | ||
93 | /* | 95 | static unsigned long clk_pxa25x_mem_getrate(struct clk *clk) |
94 | * Return the current memory clock frequency in units of 10kHz | ||
95 | */ | ||
96 | unsigned int pxa25x_get_memclk_frequency_10khz(void) | ||
97 | { | 96 | { |
98 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000; | 97 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK; |
99 | } | 98 | } |
100 | 99 | ||
101 | static unsigned long clk_pxa25x_lcd_getrate(struct clk *clk) | 100 | static const struct clkops clk_pxa25x_mem_ops = { |
102 | { | 101 | .enable = clk_dummy_enable, |
103 | return pxa25x_get_memclk_frequency_10khz() * 10000; | 102 | .disable = clk_dummy_disable, |
104 | } | 103 | .getrate = clk_pxa25x_mem_getrate, |
104 | }; | ||
105 | 105 | ||
106 | static const struct clkops clk_pxa25x_lcd_ops = { | 106 | static const struct clkops clk_pxa25x_lcd_ops = { |
107 | .enable = clk_cken_enable, | 107 | .enable = clk_pxa2xx_cken_enable, |
108 | .disable = clk_cken_disable, | 108 | .disable = clk_pxa2xx_cken_disable, |
109 | .getrate = clk_pxa25x_lcd_getrate, | 109 | .getrate = clk_pxa25x_mem_getrate, |
110 | }; | 110 | }; |
111 | 111 | ||
112 | static unsigned long gpio12_config_32k[] = { | 112 | static unsigned long gpio12_config_32k[] = { |
@@ -160,31 +160,30 @@ static const struct clkops clk_pxa25x_gpio11_ops = { | |||
160 | * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz | 160 | * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz |
161 | * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly) | 161 | * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly) |
162 | */ | 162 | */ |
163 | static DEFINE_CKEN(pxa25x_hwuart, HWUART, 14745600, 1); | ||
164 | |||
165 | static struct clk_lookup pxa25x_hwuart_clkreg = | ||
166 | INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL); | ||
167 | 163 | ||
168 | /* | 164 | /* |
169 | * PXA 2xx clock declarations. | 165 | * PXA 2xx clock declarations. |
170 | */ | 166 | */ |
167 | static DEFINE_PXA2_CKEN(pxa25x_hwuart, HWUART, 14745600, 1); | ||
168 | static DEFINE_PXA2_CKEN(pxa25x_ffuart, FFUART, 14745600, 1); | ||
169 | static DEFINE_PXA2_CKEN(pxa25x_btuart, BTUART, 14745600, 1); | ||
170 | static DEFINE_PXA2_CKEN(pxa25x_stuart, STUART, 14745600, 1); | ||
171 | static DEFINE_PXA2_CKEN(pxa25x_usb, USB, 47923000, 5); | ||
172 | static DEFINE_PXA2_CKEN(pxa25x_mmc, MMC, 19169000, 0); | ||
173 | static DEFINE_PXA2_CKEN(pxa25x_i2c, I2C, 31949000, 0); | ||
174 | static DEFINE_PXA2_CKEN(pxa25x_ssp, SSP, 3686400, 0); | ||
175 | static DEFINE_PXA2_CKEN(pxa25x_nssp, NSSP, 3686400, 0); | ||
176 | static DEFINE_PXA2_CKEN(pxa25x_assp, ASSP, 3686400, 0); | ||
177 | static DEFINE_PXA2_CKEN(pxa25x_pwm0, PWM0, 3686400, 0); | ||
178 | static DEFINE_PXA2_CKEN(pxa25x_pwm1, PWM1, 3686400, 0); | ||
179 | static DEFINE_PXA2_CKEN(pxa25x_ac97, AC97, 24576000, 0); | ||
180 | static DEFINE_PXA2_CKEN(pxa25x_i2s, I2S, 14745600, 0); | ||
181 | static DEFINE_PXA2_CKEN(pxa25x_ficp, FICP, 47923000, 0); | ||
182 | |||
171 | static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops); | 183 | static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops); |
172 | static DEFINE_CKEN(pxa25x_ffuart, FFUART, 14745600, 1); | ||
173 | static DEFINE_CKEN(pxa25x_btuart, BTUART, 14745600, 1); | ||
174 | static DEFINE_CKEN(pxa25x_stuart, STUART, 14745600, 1); | ||
175 | static DEFINE_CKEN(pxa25x_usb, USB, 47923000, 5); | ||
176 | static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0); | 184 | static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0); |
177 | static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0); | 185 | static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0); |
178 | static DEFINE_CKEN(pxa25x_mmc, MMC, 19169000, 0); | 186 | static DEFINE_CLK(pxa25x_mem, &clk_pxa25x_mem_ops, 0, 0); |
179 | static DEFINE_CKEN(pxa25x_i2c, I2C, 31949000, 0); | ||
180 | static DEFINE_CKEN(pxa25x_ssp, SSP, 3686400, 0); | ||
181 | static DEFINE_CKEN(pxa25x_nssp, NSSP, 3686400, 0); | ||
182 | static DEFINE_CKEN(pxa25x_assp, ASSP, 3686400, 0); | ||
183 | static DEFINE_CKEN(pxa25x_pwm0, PWM0, 3686400, 0); | ||
184 | static DEFINE_CKEN(pxa25x_pwm1, PWM1, 3686400, 0); | ||
185 | static DEFINE_CKEN(pxa25x_ac97, AC97, 24576000, 0); | ||
186 | static DEFINE_CKEN(pxa25x_i2s, I2S, 14745600, 0); | ||
187 | static DEFINE_CKEN(pxa25x_ficp, FICP, 47923000, 0); | ||
188 | 187 | ||
189 | static struct clk_lookup pxa25x_clkregs[] = { | 188 | static struct clk_lookup pxa25x_clkregs[] = { |
190 | INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL), | 189 | INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL), |
@@ -205,8 +204,12 @@ static struct clk_lookup pxa25x_clkregs[] = { | |||
205 | INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"), | 204 | INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"), |
206 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), | 205 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), |
207 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), | 206 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), |
207 | INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL), | ||
208 | }; | 208 | }; |
209 | 209 | ||
210 | static struct clk_lookup pxa25x_hwuart_clkreg = | ||
211 | INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL); | ||
212 | |||
210 | #ifdef CONFIG_PM | 213 | #ifdef CONFIG_PM |
211 | 214 | ||
212 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | 215 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x |
@@ -219,20 +222,17 @@ static struct clk_lookup pxa25x_clkregs[] = { | |||
219 | */ | 222 | */ |
220 | enum { | 223 | enum { |
221 | SLEEP_SAVE_PSTR, | 224 | SLEEP_SAVE_PSTR, |
222 | SLEEP_SAVE_CKEN, | ||
223 | SLEEP_SAVE_COUNT | 225 | SLEEP_SAVE_COUNT |
224 | }; | 226 | }; |
225 | 227 | ||
226 | 228 | ||
227 | static void pxa25x_cpu_pm_save(unsigned long *sleep_save) | 229 | static void pxa25x_cpu_pm_save(unsigned long *sleep_save) |
228 | { | 230 | { |
229 | SAVE(CKEN); | ||
230 | SAVE(PSTR); | 231 | SAVE(PSTR); |
231 | } | 232 | } |
232 | 233 | ||
233 | static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) | 234 | static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) |
234 | { | 235 | { |
235 | RESTORE(CKEN); | ||
236 | RESTORE(PSTR); | 236 | RESTORE(PSTR); |
237 | } | 237 | } |
238 | 238 | ||
@@ -320,6 +320,22 @@ void __init pxa26x_init_irq(void) | |||
320 | } | 320 | } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | static struct map_desc pxa25x_io_desc[] __initdata = { | ||
324 | { /* Mem Ctl */ | ||
325 | .virtual = SMEMC_VIRT, | ||
326 | .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE), | ||
327 | .length = 0x00200000, | ||
328 | .type = MT_DEVICE | ||
329 | }, | ||
330 | }; | ||
331 | |||
332 | void __init pxa25x_map_io(void) | ||
333 | { | ||
334 | pxa_map_io(); | ||
335 | iotable_init(ARRAY_AND_SIZE(pxa25x_io_desc)); | ||
336 | pxa25x_get_clk_frequency_khz(1); | ||
337 | } | ||
338 | |||
323 | static struct platform_device *pxa25x_devices[] __initdata = { | 339 | static struct platform_device *pxa25x_devices[] __initdata = { |
324 | &pxa25x_device_udc, | 340 | &pxa25x_device_udc, |
325 | &pxa_device_pmu, | 341 | &pxa_device_pmu, |
@@ -339,7 +355,9 @@ static struct sys_device pxa25x_sysdev[] = { | |||
339 | .cls = &pxa2xx_mfp_sysclass, | 355 | .cls = &pxa2xx_mfp_sysclass, |
340 | }, { | 356 | }, { |
341 | .cls = &pxa_gpio_sysclass, | 357 | .cls = &pxa_gpio_sysclass, |
342 | }, | 358 | }, { |
359 | .cls = &pxa2xx_clock_sysclass, | ||
360 | } | ||
343 | }; | 361 | }; |
344 | 362 | ||
345 | static int __init pxa25x_init(void) | 363 | static int __init pxa25x_init(void) |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index d1fbf29d561c..b2130b7a7b52 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <linux/suspend.h> | 17 | #include <linux/suspend.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
20 | #include <linux/io.h> | ||
20 | 21 | ||
22 | #include <asm/mach/map.h> | ||
21 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
22 | #include <asm/irq.h> | 24 | #include <asm/irq.h> |
23 | #include <mach/irqs.h> | 25 | #include <mach/irqs.h> |
@@ -27,6 +29,8 @@ | |||
27 | #include <mach/ohci.h> | 29 | #include <mach/ohci.h> |
28 | #include <mach/pm.h> | 30 | #include <mach/pm.h> |
29 | #include <mach/dma.h> | 31 | #include <mach/dma.h> |
32 | #include <mach/smemc.h> | ||
33 | |||
30 | #include <plat/i2c.h> | 34 | #include <plat/i2c.h> |
31 | 35 | ||
32 | #include "generic.h" | 36 | #include "generic.h" |
@@ -107,10 +111,9 @@ unsigned int pxa27x_get_clk_frequency_khz(int info) | |||
107 | } | 111 | } |
108 | 112 | ||
109 | /* | 113 | /* |
110 | * Return the current mem clock frequency in units of 10kHz as | 114 | * Return the current mem clock frequency as reflected by CCCR[A], B, and L |
111 | * reflected by CCCR[A], B, and L | ||
112 | */ | 115 | */ |
113 | unsigned int pxa27x_get_memclk_frequency_10khz(void) | 116 | static unsigned long clk_pxa27x_mem_getrate(struct clk *clk) |
114 | { | 117 | { |
115 | unsigned long ccsr, clkcfg; | 118 | unsigned long ccsr, clkcfg; |
116 | unsigned int l, L, m, M; | 119 | unsigned int l, L, m, M; |
@@ -129,9 +132,15 @@ unsigned int pxa27x_get_memclk_frequency_10khz(void) | |||
129 | L = l * BASE_CLK; | 132 | L = l * BASE_CLK; |
130 | M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2)); | 133 | M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2)); |
131 | 134 | ||
132 | return (M / 10000); | 135 | return M; |
133 | } | 136 | } |
134 | 137 | ||
138 | static const struct clkops clk_pxa27x_mem_ops = { | ||
139 | .enable = clk_dummy_enable, | ||
140 | .disable = clk_dummy_disable, | ||
141 | .getrate = clk_pxa27x_mem_getrate, | ||
142 | }; | ||
143 | |||
135 | /* | 144 | /* |
136 | * Return the current LCD clock frequency in units of 10kHz as | 145 | * Return the current LCD clock frequency in units of 10kHz as |
137 | */ | 146 | */ |
@@ -157,36 +166,38 @@ static unsigned long clk_pxa27x_lcd_getrate(struct clk *clk) | |||
157 | } | 166 | } |
158 | 167 | ||
159 | static const struct clkops clk_pxa27x_lcd_ops = { | 168 | static const struct clkops clk_pxa27x_lcd_ops = { |
160 | .enable = clk_cken_enable, | 169 | .enable = clk_pxa2xx_cken_enable, |
161 | .disable = clk_cken_disable, | 170 | .disable = clk_pxa2xx_cken_disable, |
162 | .getrate = clk_pxa27x_lcd_getrate, | 171 | .getrate = clk_pxa27x_lcd_getrate, |
163 | }; | 172 | }; |
164 | 173 | ||
174 | static DEFINE_PXA2_CKEN(pxa27x_ffuart, FFUART, 14857000, 1); | ||
175 | static DEFINE_PXA2_CKEN(pxa27x_btuart, BTUART, 14857000, 1); | ||
176 | static DEFINE_PXA2_CKEN(pxa27x_stuart, STUART, 14857000, 1); | ||
177 | static DEFINE_PXA2_CKEN(pxa27x_i2s, I2S, 14682000, 0); | ||
178 | static DEFINE_PXA2_CKEN(pxa27x_i2c, I2C, 32842000, 0); | ||
179 | static DEFINE_PXA2_CKEN(pxa27x_usb, USB, 48000000, 5); | ||
180 | static DEFINE_PXA2_CKEN(pxa27x_mmc, MMC, 19500000, 0); | ||
181 | static DEFINE_PXA2_CKEN(pxa27x_ficp, FICP, 48000000, 0); | ||
182 | static DEFINE_PXA2_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0); | ||
183 | static DEFINE_PXA2_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0); | ||
184 | static DEFINE_PXA2_CKEN(pxa27x_keypad, KEYPAD, 32768, 0); | ||
185 | static DEFINE_PXA2_CKEN(pxa27x_ssp1, SSP1, 13000000, 0); | ||
186 | static DEFINE_PXA2_CKEN(pxa27x_ssp2, SSP2, 13000000, 0); | ||
187 | static DEFINE_PXA2_CKEN(pxa27x_ssp3, SSP3, 13000000, 0); | ||
188 | static DEFINE_PXA2_CKEN(pxa27x_pwm0, PWM0, 13000000, 0); | ||
189 | static DEFINE_PXA2_CKEN(pxa27x_pwm1, PWM1, 13000000, 0); | ||
190 | static DEFINE_PXA2_CKEN(pxa27x_ac97, AC97, 24576000, 0); | ||
191 | static DEFINE_PXA2_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0); | ||
192 | static DEFINE_PXA2_CKEN(pxa27x_msl, MSL, 48000000, 0); | ||
193 | static DEFINE_PXA2_CKEN(pxa27x_usim, USIM, 48000000, 0); | ||
194 | static DEFINE_PXA2_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0); | ||
195 | static DEFINE_PXA2_CKEN(pxa27x_im, IM, 0, 0); | ||
196 | static DEFINE_PXA2_CKEN(pxa27x_memc, MEMC, 0, 0); | ||
197 | |||
165 | static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); | 198 | static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); |
166 | static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); | 199 | static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); |
167 | static DEFINE_CKEN(pxa27x_ffuart, FFUART, 14857000, 1); | 200 | static DEFINE_CLK(pxa27x_mem, &clk_pxa27x_mem_ops, 0, 0); |
168 | static DEFINE_CKEN(pxa27x_btuart, BTUART, 14857000, 1); | ||
169 | static DEFINE_CKEN(pxa27x_stuart, STUART, 14857000, 1); | ||
170 | static DEFINE_CKEN(pxa27x_i2s, I2S, 14682000, 0); | ||
171 | static DEFINE_CKEN(pxa27x_i2c, I2C, 32842000, 0); | ||
172 | static DEFINE_CKEN(pxa27x_usb, USB, 48000000, 5); | ||
173 | static DEFINE_CKEN(pxa27x_mmc, MMC, 19500000, 0); | ||
174 | static DEFINE_CKEN(pxa27x_ficp, FICP, 48000000, 0); | ||
175 | static DEFINE_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0); | ||
176 | static DEFINE_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0); | ||
177 | static DEFINE_CKEN(pxa27x_keypad, KEYPAD, 32768, 0); | ||
178 | static DEFINE_CKEN(pxa27x_ssp1, SSP1, 13000000, 0); | ||
179 | static DEFINE_CKEN(pxa27x_ssp2, SSP2, 13000000, 0); | ||
180 | static DEFINE_CKEN(pxa27x_ssp3, SSP3, 13000000, 0); | ||
181 | static DEFINE_CKEN(pxa27x_pwm0, PWM0, 13000000, 0); | ||
182 | static DEFINE_CKEN(pxa27x_pwm1, PWM1, 13000000, 0); | ||
183 | static DEFINE_CKEN(pxa27x_ac97, AC97, 24576000, 0); | ||
184 | static DEFINE_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0); | ||
185 | static DEFINE_CKEN(pxa27x_msl, MSL, 48000000, 0); | ||
186 | static DEFINE_CKEN(pxa27x_usim, USIM, 48000000, 0); | ||
187 | static DEFINE_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0); | ||
188 | static DEFINE_CKEN(pxa27x_im, IM, 0, 0); | ||
189 | static DEFINE_CKEN(pxa27x_memc, MEMC, 0, 0); | ||
190 | 201 | ||
191 | static struct clk_lookup pxa27x_clkregs[] = { | 202 | static struct clk_lookup pxa27x_clkregs[] = { |
192 | INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), | 203 | INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), |
@@ -215,6 +226,7 @@ static struct clk_lookup pxa27x_clkregs[] = { | |||
215 | INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), | 226 | INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), |
216 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), | 227 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), |
217 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), | 228 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), |
229 | INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL), | ||
218 | }; | 230 | }; |
219 | 231 | ||
220 | #ifdef CONFIG_PM | 232 | #ifdef CONFIG_PM |
@@ -246,7 +258,6 @@ int __init pxa27x_set_pwrmode(unsigned int mode) | |||
246 | */ | 258 | */ |
247 | enum { | 259 | enum { |
248 | SLEEP_SAVE_PSTR, | 260 | SLEEP_SAVE_PSTR, |
249 | SLEEP_SAVE_CKEN, | ||
250 | SLEEP_SAVE_MDREFR, | 261 | SLEEP_SAVE_MDREFR, |
251 | SLEEP_SAVE_PCFR, | 262 | SLEEP_SAVE_PCFR, |
252 | SLEEP_SAVE_COUNT | 263 | SLEEP_SAVE_COUNT |
@@ -254,21 +265,19 @@ enum { | |||
254 | 265 | ||
255 | void pxa27x_cpu_pm_save(unsigned long *sleep_save) | 266 | void pxa27x_cpu_pm_save(unsigned long *sleep_save) |
256 | { | 267 | { |
257 | SAVE(MDREFR); | 268 | sleep_save[SLEEP_SAVE_MDREFR] = __raw_readl(MDREFR); |
258 | SAVE(PCFR); | 269 | SAVE(PCFR); |
259 | 270 | ||
260 | SAVE(CKEN); | ||
261 | SAVE(PSTR); | 271 | SAVE(PSTR); |
262 | } | 272 | } |
263 | 273 | ||
264 | void pxa27x_cpu_pm_restore(unsigned long *sleep_save) | 274 | void pxa27x_cpu_pm_restore(unsigned long *sleep_save) |
265 | { | 275 | { |
266 | RESTORE(MDREFR); | 276 | __raw_writel(sleep_save[SLEEP_SAVE_MDREFR], MDREFR); |
267 | RESTORE(PCFR); | 277 | RESTORE(PCFR); |
268 | 278 | ||
269 | PSSR = PSSR_RDH | PSSR_PH; | 279 | PSSR = PSSR_RDH | PSSR_PH; |
270 | 280 | ||
271 | RESTORE(CKEN); | ||
272 | RESTORE(PSTR); | 281 | RESTORE(PSTR); |
273 | } | 282 | } |
274 | 283 | ||
@@ -370,6 +379,27 @@ void __init pxa27x_init_irq(void) | |||
370 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake); | 379 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake); |
371 | } | 380 | } |
372 | 381 | ||
382 | static struct map_desc pxa27x_io_desc[] __initdata = { | ||
383 | { /* Mem Ctl */ | ||
384 | .virtual = SMEMC_VIRT, | ||
385 | .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE), | ||
386 | .length = 0x00200000, | ||
387 | .type = MT_DEVICE | ||
388 | }, { /* IMem ctl */ | ||
389 | .virtual = 0xfe000000, | ||
390 | .pfn = __phys_to_pfn(0x58000000), | ||
391 | .length = 0x00100000, | ||
392 | .type = MT_DEVICE | ||
393 | }, | ||
394 | }; | ||
395 | |||
396 | void __init pxa27x_map_io(void) | ||
397 | { | ||
398 | pxa_map_io(); | ||
399 | iotable_init(ARRAY_AND_SIZE(pxa27x_io_desc)); | ||
400 | pxa27x_get_clk_frequency_khz(1); | ||
401 | } | ||
402 | |||
373 | /* | 403 | /* |
374 | * device registration specific to PXA27x. | 404 | * device registration specific to PXA27x. |
375 | */ | 405 | */ |
@@ -405,7 +435,9 @@ static struct sys_device pxa27x_sysdev[] = { | |||
405 | .cls = &pxa2xx_mfp_sysclass, | 435 | .cls = &pxa2xx_mfp_sysclass, |
406 | }, { | 436 | }, { |
407 | .cls = &pxa_gpio_sysclass, | 437 | .cls = &pxa_gpio_sysclass, |
408 | }, | 438 | }, { |
439 | .cls = &pxa2xx_clock_sysclass, | ||
440 | } | ||
409 | }; | 441 | }; |
410 | 442 | ||
411 | static int __init pxa27x_init(void) | 443 | static int __init pxa27x_init(void) |
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index d1c747cdacf8..e14818f5d950 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/sysdev.h> | 23 | #include <linux/sysdev.h> |
24 | 24 | ||
25 | #include <asm/mach/map.h> | ||
25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
26 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
27 | #include <mach/pxa3xx-regs.h> | 28 | #include <mach/pxa3xx-regs.h> |
@@ -30,193 +31,16 @@ | |||
30 | #include <mach/pm.h> | 31 | #include <mach/pm.h> |
31 | #include <mach/dma.h> | 32 | #include <mach/dma.h> |
32 | #include <mach/regs-intc.h> | 33 | #include <mach/regs-intc.h> |
34 | #include <mach/smemc.h> | ||
33 | #include <plat/i2c.h> | 35 | #include <plat/i2c.h> |
34 | 36 | ||
35 | #include "generic.h" | 37 | #include "generic.h" |
36 | #include "devices.h" | 38 | #include "devices.h" |
37 | #include "clock.h" | 39 | #include "clock.h" |
38 | 40 | ||
39 | /* Crystal clock: 13MHz */ | ||
40 | #define BASE_CLK 13000000 | ||
41 | |||
42 | /* Ring Oscillator Clock: 60MHz */ | ||
43 | #define RO_CLK 60000000 | ||
44 | |||
45 | #define ACCR_D0CS (1 << 26) | ||
46 | #define ACCR_PCCE (1 << 11) | ||
47 | |||
48 | #define PECR_IE(n) ((1 << ((n) * 2)) << 28) | 41 | #define PECR_IE(n) ((1 << ((n) * 2)) << 28) |
49 | #define PECR_IS(n) ((1 << ((n) * 2)) << 29) | 42 | #define PECR_IS(n) ((1 << ((n) * 2)) << 29) |
50 | 43 | ||
51 | /* crystal frequency to static memory controller multiplier (SMCFS) */ | ||
52 | static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; | ||
53 | |||
54 | /* crystal frequency to HSIO bus frequency multiplier (HSS) */ | ||
55 | static unsigned char hss_mult[4] = { 8, 12, 16, 24 }; | ||
56 | |||
57 | /* | ||
58 | * Get the clock frequency as reflected by CCSR and the turbo flag. | ||
59 | * We assume these values have been applied via a fcs. | ||
60 | * If info is not 0 we also display the current settings. | ||
61 | */ | ||
62 | unsigned int pxa3xx_get_clk_frequency_khz(int info) | ||
63 | { | ||
64 | unsigned long acsr, xclkcfg; | ||
65 | unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS; | ||
66 | |||
67 | /* Read XCLKCFG register turbo bit */ | ||
68 | __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg)); | ||
69 | t = xclkcfg & 0x1; | ||
70 | |||
71 | acsr = ACSR; | ||
72 | |||
73 | xl = acsr & 0x1f; | ||
74 | xn = (acsr >> 8) & 0x7; | ||
75 | hss = (acsr >> 14) & 0x3; | ||
76 | |||
77 | XL = xl * BASE_CLK; | ||
78 | XN = xn * XL; | ||
79 | |||
80 | ro = acsr & ACCR_D0CS; | ||
81 | |||
82 | CLK = (ro) ? RO_CLK : ((t) ? XN : XL); | ||
83 | HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
84 | |||
85 | if (info) { | ||
86 | pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n", | ||
87 | RO_CLK / 1000000, (RO_CLK % 1000000) / 10000, | ||
88 | (ro) ? "" : "in"); | ||
89 | pr_info("Run Mode clock: %d.%02dMHz (*%d)\n", | ||
90 | XL / 1000000, (XL % 1000000) / 10000, xl); | ||
91 | pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n", | ||
92 | XN / 1000000, (XN % 1000000) / 10000, xn, | ||
93 | (t) ? "" : "in"); | ||
94 | pr_info("HSIO bus clock: %d.%02dMHz\n", | ||
95 | HSS / 1000000, (HSS % 1000000) / 10000); | ||
96 | } | ||
97 | |||
98 | return CLK / 1000; | ||
99 | } | ||
100 | |||
101 | void pxa3xx_clear_reset_status(unsigned int mask) | ||
102 | { | ||
103 | /* RESET_STATUS_* has a 1:1 mapping with ARSR */ | ||
104 | ARSR = mask; | ||
105 | } | ||
106 | |||
107 | /* | ||
108 | * Return the current AC97 clock frequency. | ||
109 | */ | ||
110 | static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk) | ||
111 | { | ||
112 | unsigned long rate = 312000000; | ||
113 | unsigned long ac97_div; | ||
114 | |||
115 | ac97_div = AC97_DIV; | ||
116 | |||
117 | /* This may loose precision for some rates but won't for the | ||
118 | * standard 24.576MHz. | ||
119 | */ | ||
120 | rate /= (ac97_div >> 12) & 0x7fff; | ||
121 | rate *= (ac97_div & 0xfff); | ||
122 | |||
123 | return rate; | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * Return the current HSIO bus clock frequency | ||
128 | */ | ||
129 | static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk) | ||
130 | { | ||
131 | unsigned long acsr; | ||
132 | unsigned int hss, hsio_clk; | ||
133 | |||
134 | acsr = ACSR; | ||
135 | |||
136 | hss = (acsr >> 14) & 0x3; | ||
137 | hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
138 | |||
139 | return hsio_clk; | ||
140 | } | ||
141 | |||
142 | void clk_pxa3xx_cken_enable(struct clk *clk) | ||
143 | { | ||
144 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
145 | |||
146 | if (clk->cken < 32) | ||
147 | CKENA |= mask; | ||
148 | else | ||
149 | CKENB |= mask; | ||
150 | } | ||
151 | |||
152 | void clk_pxa3xx_cken_disable(struct clk *clk) | ||
153 | { | ||
154 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
155 | |||
156 | if (clk->cken < 32) | ||
157 | CKENA &= ~mask; | ||
158 | else | ||
159 | CKENB &= ~mask; | ||
160 | } | ||
161 | |||
162 | const struct clkops clk_pxa3xx_cken_ops = { | ||
163 | .enable = clk_pxa3xx_cken_enable, | ||
164 | .disable = clk_pxa3xx_cken_disable, | ||
165 | }; | ||
166 | |||
167 | static const struct clkops clk_pxa3xx_hsio_ops = { | ||
168 | .enable = clk_pxa3xx_cken_enable, | ||
169 | .disable = clk_pxa3xx_cken_disable, | ||
170 | .getrate = clk_pxa3xx_hsio_getrate, | ||
171 | }; | ||
172 | |||
173 | static const struct clkops clk_pxa3xx_ac97_ops = { | ||
174 | .enable = clk_pxa3xx_cken_enable, | ||
175 | .disable = clk_pxa3xx_cken_disable, | ||
176 | .getrate = clk_pxa3xx_ac97_getrate, | ||
177 | }; | ||
178 | |||
179 | static void clk_pout_enable(struct clk *clk) | ||
180 | { | ||
181 | OSCC |= OSCC_PEN; | ||
182 | } | ||
183 | |||
184 | static void clk_pout_disable(struct clk *clk) | ||
185 | { | ||
186 | OSCC &= ~OSCC_PEN; | ||
187 | } | ||
188 | |||
189 | static const struct clkops clk_pout_ops = { | ||
190 | .enable = clk_pout_enable, | ||
191 | .disable = clk_pout_disable, | ||
192 | }; | ||
193 | |||
194 | static void clk_dummy_enable(struct clk *clk) | ||
195 | { | ||
196 | } | ||
197 | |||
198 | static void clk_dummy_disable(struct clk *clk) | ||
199 | { | ||
200 | } | ||
201 | |||
202 | static const struct clkops clk_dummy_ops = { | ||
203 | .enable = clk_dummy_enable, | ||
204 | .disable = clk_dummy_disable, | ||
205 | }; | ||
206 | |||
207 | static struct clk clk_pxa3xx_pout = { | ||
208 | .ops = &clk_pout_ops, | ||
209 | .rate = 13000000, | ||
210 | .delay = 70, | ||
211 | }; | ||
212 | |||
213 | static struct clk clk_dummy = { | ||
214 | .ops = &clk_dummy_ops, | ||
215 | }; | ||
216 | |||
217 | static DEFINE_PXA3_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops); | ||
218 | static DEFINE_PXA3_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops); | ||
219 | static DEFINE_PXA3_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops); | ||
220 | static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1); | 44 | static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1); |
221 | static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1); | 45 | static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1); |
222 | static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); | 46 | static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); |
@@ -234,6 +58,12 @@ static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0); | |||
234 | static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0); | 58 | static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0); |
235 | static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0); | 59 | static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0); |
236 | 60 | ||
61 | static DEFINE_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops); | ||
62 | static DEFINE_CK(pxa3xx_smemc, SMC, &clk_pxa3xx_smemc_ops); | ||
63 | static DEFINE_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops); | ||
64 | static DEFINE_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops); | ||
65 | static DEFINE_CLK(pxa3xx_pout, &clk_pxa3xx_pout_ops, 13000000, 70); | ||
66 | |||
237 | static struct clk_lookup pxa3xx_clkregs[] = { | 67 | static struct clk_lookup pxa3xx_clkregs[] = { |
238 | INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), | 68 | INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), |
239 | /* Power I2C clock is always on */ | 69 | /* Power I2C clock is always on */ |
@@ -258,6 +88,7 @@ static struct clk_lookup pxa3xx_clkregs[] = { | |||
258 | INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL), | 88 | INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL), |
259 | INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), | 89 | INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), |
260 | INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), | 90 | INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), |
91 | INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL), | ||
261 | }; | 92 | }; |
262 | 93 | ||
263 | #ifdef CONFIG_PM | 94 | #ifdef CONFIG_PM |
@@ -268,30 +99,6 @@ static struct clk_lookup pxa3xx_clkregs[] = { | |||
268 | static void __iomem *sram; | 99 | static void __iomem *sram; |
269 | static unsigned long wakeup_src; | 100 | static unsigned long wakeup_src; |
270 | 101 | ||
271 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | ||
272 | #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] | ||
273 | |||
274 | enum { SLEEP_SAVE_CKENA, | ||
275 | SLEEP_SAVE_CKENB, | ||
276 | SLEEP_SAVE_ACCR, | ||
277 | |||
278 | SLEEP_SAVE_COUNT, | ||
279 | }; | ||
280 | |||
281 | static void pxa3xx_cpu_pm_save(unsigned long *sleep_save) | ||
282 | { | ||
283 | SAVE(CKENA); | ||
284 | SAVE(CKENB); | ||
285 | SAVE(ACCR); | ||
286 | } | ||
287 | |||
288 | static void pxa3xx_cpu_pm_restore(unsigned long *sleep_save) | ||
289 | { | ||
290 | RESTORE(ACCR); | ||
291 | RESTORE(CKENA); | ||
292 | RESTORE(CKENB); | ||
293 | } | ||
294 | |||
295 | /* | 102 | /* |
296 | * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic | 103 | * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic |
297 | * memory controller has to be reinitialised, so we place some code | 104 | * memory controller has to be reinitialised, so we place some code |
@@ -390,9 +197,6 @@ static int pxa3xx_cpu_pm_valid(suspend_state_t state) | |||
390 | } | 197 | } |
391 | 198 | ||
392 | static struct pxa_cpu_pm_fns pxa3xx_cpu_pm_fns = { | 199 | static struct pxa_cpu_pm_fns pxa3xx_cpu_pm_fns = { |
393 | .save_count = SLEEP_SAVE_COUNT, | ||
394 | .save = pxa3xx_cpu_pm_save, | ||
395 | .restore = pxa3xx_cpu_pm_restore, | ||
396 | .valid = pxa3xx_cpu_pm_valid, | 200 | .valid = pxa3xx_cpu_pm_valid, |
397 | .enter = pxa3xx_cpu_pm_enter, | 201 | .enter = pxa3xx_cpu_pm_enter, |
398 | }; | 202 | }; |
@@ -580,6 +384,22 @@ void __init pxa3xx_init_irq(void) | |||
580 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); | 384 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); |
581 | } | 385 | } |
582 | 386 | ||
387 | static struct map_desc pxa3xx_io_desc[] __initdata = { | ||
388 | { /* Mem Ctl */ | ||
389 | .virtual = SMEMC_VIRT, | ||
390 | .pfn = __phys_to_pfn(PXA3XX_SMEMC_BASE), | ||
391 | .length = 0x00200000, | ||
392 | .type = MT_DEVICE | ||
393 | } | ||
394 | }; | ||
395 | |||
396 | void __init pxa3xx_map_io(void) | ||
397 | { | ||
398 | pxa_map_io(); | ||
399 | iotable_init(ARRAY_AND_SIZE(pxa3xx_io_desc)); | ||
400 | pxa3xx_get_clk_frequency_khz(1); | ||
401 | } | ||
402 | |||
583 | /* | 403 | /* |
584 | * device registration specific to PXA3xx. | 404 | * device registration specific to PXA3xx. |
585 | */ | 405 | */ |
@@ -615,7 +435,9 @@ static struct sys_device pxa3xx_sysdev[] = { | |||
615 | .cls = &pxa3xx_mfp_sysclass, | 435 | .cls = &pxa3xx_mfp_sysclass, |
616 | }, { | 436 | }, { |
617 | .cls = &pxa_gpio_sysclass, | 437 | .cls = &pxa_gpio_sysclass, |
618 | }, | 438 | }, { |
439 | .cls = &pxa3xx_clock_sysclass, | ||
440 | } | ||
619 | }; | 441 | }; |
620 | 442 | ||
621 | static int __init pxa3xx_init(void) | 443 | static int __init pxa3xx_init(void) |
diff --git a/arch/arm/mach-pxa/pxa930.c b/arch/arm/mach-pxa/pxa930.c index 7d29dd3af79d..8aeacf908784 100644 --- a/arch/arm/mach-pxa/pxa930.c +++ b/arch/arm/mach-pxa/pxa930.c | |||
@@ -192,7 +192,7 @@ static struct mfp_addr_map pxa935_mfp_addr_map[] __initdata = { | |||
192 | 192 | ||
193 | static int __init pxa930_init(void) | 193 | static int __init pxa930_init(void) |
194 | { | 194 | { |
195 | if (cpu_is_pxa930() || cpu_is_pxa935() || cpu_is_pxa950()) { | 195 | if (cpu_is_pxa93x()) { |
196 | mfp_init_base(io_p2v(MFPR_BASE)); | 196 | mfp_init_base(io_p2v(MFPR_BASE)); |
197 | mfp_init_addr(pxa930_mfp_addr_map); | 197 | mfp_init_addr(pxa930_mfp_addr_map); |
198 | } | 198 | } |
diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c new file mode 100644 index 000000000000..437980f72710 --- /dev/null +++ b/arch/arm/mach-pxa/pxa95x.c | |||
@@ -0,0 +1,308 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/pxa95x.c | ||
3 | * | ||
4 | * code specific to PXA95x aka MGx | ||
5 | * | ||
6 | * Copyright (C) 2009-2010 Marvell International Ltd. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/module.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/pm.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <linux/sysdev.h> | ||
21 | |||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/gpio.h> | ||
24 | #include <mach/pxa3xx-regs.h> | ||
25 | #include <mach/pxa930.h> | ||
26 | #include <mach/reset.h> | ||
27 | #include <mach/pm.h> | ||
28 | #include <mach/dma.h> | ||
29 | #include <mach/regs-intc.h> | ||
30 | #include <plat/i2c.h> | ||
31 | |||
32 | #include "generic.h" | ||
33 | #include "devices.h" | ||
34 | #include "clock.h" | ||
35 | |||
36 | static struct mfp_addr_map pxa95x_mfp_addr_map[] __initdata = { | ||
37 | |||
38 | MFP_ADDR(GPIO0, 0x02e0), | ||
39 | MFP_ADDR(GPIO1, 0x02dc), | ||
40 | MFP_ADDR(GPIO2, 0x02e8), | ||
41 | MFP_ADDR(GPIO3, 0x02d8), | ||
42 | MFP_ADDR(GPIO4, 0x02e4), | ||
43 | MFP_ADDR(GPIO5, 0x02ec), | ||
44 | MFP_ADDR(GPIO6, 0x02f8), | ||
45 | MFP_ADDR(GPIO7, 0x02fc), | ||
46 | MFP_ADDR(GPIO8, 0x0300), | ||
47 | MFP_ADDR(GPIO9, 0x02d4), | ||
48 | MFP_ADDR(GPIO10, 0x02f4), | ||
49 | MFP_ADDR(GPIO11, 0x02f0), | ||
50 | MFP_ADDR(GPIO12, 0x0304), | ||
51 | MFP_ADDR(GPIO13, 0x0310), | ||
52 | MFP_ADDR(GPIO14, 0x0308), | ||
53 | MFP_ADDR(GPIO15, 0x030c), | ||
54 | MFP_ADDR(GPIO16, 0x04e8), | ||
55 | MFP_ADDR(GPIO17, 0x04f4), | ||
56 | MFP_ADDR(GPIO18, 0x04f8), | ||
57 | MFP_ADDR(GPIO19, 0x04fc), | ||
58 | MFP_ADDR(GPIO20, 0x0518), | ||
59 | MFP_ADDR(GPIO21, 0x051c), | ||
60 | MFP_ADDR(GPIO22, 0x04ec), | ||
61 | MFP_ADDR(GPIO23, 0x0500), | ||
62 | MFP_ADDR(GPIO24, 0x04f0), | ||
63 | MFP_ADDR(GPIO25, 0x0504), | ||
64 | MFP_ADDR(GPIO26, 0x0510), | ||
65 | MFP_ADDR(GPIO27, 0x0514), | ||
66 | MFP_ADDR(GPIO28, 0x0520), | ||
67 | MFP_ADDR(GPIO29, 0x0600), | ||
68 | MFP_ADDR(GPIO30, 0x0618), | ||
69 | MFP_ADDR(GPIO31, 0x0610), | ||
70 | MFP_ADDR(GPIO32, 0x060c), | ||
71 | MFP_ADDR(GPIO33, 0x061c), | ||
72 | MFP_ADDR(GPIO34, 0x0620), | ||
73 | MFP_ADDR(GPIO35, 0x0628), | ||
74 | MFP_ADDR(GPIO36, 0x062c), | ||
75 | MFP_ADDR(GPIO37, 0x0630), | ||
76 | MFP_ADDR(GPIO38, 0x0634), | ||
77 | MFP_ADDR(GPIO39, 0x0638), | ||
78 | MFP_ADDR(GPIO40, 0x063c), | ||
79 | MFP_ADDR(GPIO41, 0x0614), | ||
80 | MFP_ADDR(GPIO42, 0x0624), | ||
81 | MFP_ADDR(GPIO43, 0x0608), | ||
82 | MFP_ADDR(GPIO44, 0x0604), | ||
83 | MFP_ADDR(GPIO45, 0x050c), | ||
84 | MFP_ADDR(GPIO46, 0x0508), | ||
85 | MFP_ADDR(GPIO47, 0x02bc), | ||
86 | MFP_ADDR(GPIO48, 0x02b4), | ||
87 | MFP_ADDR(GPIO49, 0x02b8), | ||
88 | MFP_ADDR(GPIO50, 0x02c8), | ||
89 | MFP_ADDR(GPIO51, 0x02c0), | ||
90 | MFP_ADDR(GPIO52, 0x02c4), | ||
91 | MFP_ADDR(GPIO53, 0x02d0), | ||
92 | MFP_ADDR(GPIO54, 0x02cc), | ||
93 | MFP_ADDR(GPIO55, 0x029c), | ||
94 | MFP_ADDR(GPIO56, 0x02a0), | ||
95 | MFP_ADDR(GPIO57, 0x0294), | ||
96 | MFP_ADDR(GPIO58, 0x0298), | ||
97 | MFP_ADDR(GPIO59, 0x02a4), | ||
98 | MFP_ADDR(GPIO60, 0x02a8), | ||
99 | MFP_ADDR(GPIO61, 0x02b0), | ||
100 | MFP_ADDR(GPIO62, 0x02ac), | ||
101 | MFP_ADDR(GPIO63, 0x0640), | ||
102 | MFP_ADDR(GPIO64, 0x065c), | ||
103 | MFP_ADDR(GPIO65, 0x0648), | ||
104 | MFP_ADDR(GPIO66, 0x0644), | ||
105 | MFP_ADDR(GPIO67, 0x0674), | ||
106 | MFP_ADDR(GPIO68, 0x0658), | ||
107 | MFP_ADDR(GPIO69, 0x0654), | ||
108 | MFP_ADDR(GPIO70, 0x0660), | ||
109 | MFP_ADDR(GPIO71, 0x0668), | ||
110 | MFP_ADDR(GPIO72, 0x0664), | ||
111 | MFP_ADDR(GPIO73, 0x0650), | ||
112 | MFP_ADDR(GPIO74, 0x066c), | ||
113 | MFP_ADDR(GPIO75, 0x064c), | ||
114 | MFP_ADDR(GPIO76, 0x0670), | ||
115 | MFP_ADDR(GPIO77, 0x0678), | ||
116 | MFP_ADDR(GPIO78, 0x067c), | ||
117 | MFP_ADDR(GPIO79, 0x0694), | ||
118 | MFP_ADDR(GPIO80, 0x069c), | ||
119 | MFP_ADDR(GPIO81, 0x06a0), | ||
120 | MFP_ADDR(GPIO82, 0x06a4), | ||
121 | MFP_ADDR(GPIO83, 0x0698), | ||
122 | MFP_ADDR(GPIO84, 0x06bc), | ||
123 | MFP_ADDR(GPIO85, 0x06b4), | ||
124 | MFP_ADDR(GPIO86, 0x06b0), | ||
125 | MFP_ADDR(GPIO87, 0x06c0), | ||
126 | MFP_ADDR(GPIO88, 0x06c4), | ||
127 | MFP_ADDR(GPIO89, 0x06ac), | ||
128 | MFP_ADDR(GPIO90, 0x0680), | ||
129 | MFP_ADDR(GPIO91, 0x0684), | ||
130 | MFP_ADDR(GPIO92, 0x0688), | ||
131 | MFP_ADDR(GPIO93, 0x0690), | ||
132 | MFP_ADDR(GPIO94, 0x068c), | ||
133 | MFP_ADDR(GPIO95, 0x06a8), | ||
134 | MFP_ADDR(GPIO96, 0x06b8), | ||
135 | MFP_ADDR(GPIO97, 0x0410), | ||
136 | MFP_ADDR(GPIO98, 0x0418), | ||
137 | MFP_ADDR(GPIO99, 0x041c), | ||
138 | MFP_ADDR(GPIO100, 0x0414), | ||
139 | MFP_ADDR(GPIO101, 0x0408), | ||
140 | MFP_ADDR(GPIO102, 0x0324), | ||
141 | MFP_ADDR(GPIO103, 0x040c), | ||
142 | MFP_ADDR(GPIO104, 0x0400), | ||
143 | MFP_ADDR(GPIO105, 0x0328), | ||
144 | MFP_ADDR(GPIO106, 0x0404), | ||
145 | |||
146 | MFP_ADDR(GPIO159, 0x0524), | ||
147 | MFP_ADDR(GPIO163, 0x0534), | ||
148 | MFP_ADDR(GPIO167, 0x0544), | ||
149 | MFP_ADDR(GPIO168, 0x0548), | ||
150 | MFP_ADDR(GPIO169, 0x054c), | ||
151 | MFP_ADDR(GPIO170, 0x0550), | ||
152 | MFP_ADDR(GPIO171, 0x0554), | ||
153 | MFP_ADDR(GPIO172, 0x0558), | ||
154 | MFP_ADDR(GPIO173, 0x055c), | ||
155 | |||
156 | MFP_ADDR(nXCVREN, 0x0204), | ||
157 | MFP_ADDR(DF_CLE_nOE, 0x020c), | ||
158 | MFP_ADDR(DF_nADV1_ALE, 0x0218), | ||
159 | MFP_ADDR(DF_SCLK_E, 0x0214), | ||
160 | MFP_ADDR(DF_SCLK_S, 0x0210), | ||
161 | MFP_ADDR(nBE0, 0x021c), | ||
162 | MFP_ADDR(nBE1, 0x0220), | ||
163 | MFP_ADDR(DF_nADV2_ALE, 0x0224), | ||
164 | MFP_ADDR(DF_INT_RnB, 0x0228), | ||
165 | MFP_ADDR(DF_nCS0, 0x022c), | ||
166 | MFP_ADDR(DF_nCS1, 0x0230), | ||
167 | MFP_ADDR(nLUA, 0x0254), | ||
168 | MFP_ADDR(nLLA, 0x0258), | ||
169 | MFP_ADDR(DF_nWE, 0x0234), | ||
170 | MFP_ADDR(DF_nRE_nOE, 0x0238), | ||
171 | MFP_ADDR(DF_ADDR0, 0x024c), | ||
172 | MFP_ADDR(DF_ADDR1, 0x0250), | ||
173 | MFP_ADDR(DF_ADDR2, 0x025c), | ||
174 | MFP_ADDR(DF_ADDR3, 0x0260), | ||
175 | MFP_ADDR(DF_IO0, 0x023c), | ||
176 | MFP_ADDR(DF_IO1, 0x0240), | ||
177 | MFP_ADDR(DF_IO2, 0x0244), | ||
178 | MFP_ADDR(DF_IO3, 0x0248), | ||
179 | MFP_ADDR(DF_IO4, 0x0264), | ||
180 | MFP_ADDR(DF_IO5, 0x0268), | ||
181 | MFP_ADDR(DF_IO6, 0x026c), | ||
182 | MFP_ADDR(DF_IO7, 0x0270), | ||
183 | MFP_ADDR(DF_IO8, 0x0274), | ||
184 | MFP_ADDR(DF_IO9, 0x0278), | ||
185 | MFP_ADDR(DF_IO10, 0x027c), | ||
186 | MFP_ADDR(DF_IO11, 0x0280), | ||
187 | MFP_ADDR(DF_IO12, 0x0284), | ||
188 | MFP_ADDR(DF_IO13, 0x0288), | ||
189 | MFP_ADDR(DF_IO14, 0x028c), | ||
190 | MFP_ADDR(DF_IO15, 0x0290), | ||
191 | |||
192 | MFP_ADDR(GSIM_UIO, 0x0314), | ||
193 | MFP_ADDR(GSIM_UCLK, 0x0318), | ||
194 | MFP_ADDR(GSIM_UDET, 0x031c), | ||
195 | MFP_ADDR(GSIM_nURST, 0x0320), | ||
196 | |||
197 | MFP_ADDR(PMIC_INT, 0x06c8), | ||
198 | |||
199 | MFP_ADDR(RDY, 0x0200), | ||
200 | |||
201 | MFP_ADDR_END, | ||
202 | }; | ||
203 | |||
204 | static DEFINE_CK(pxa95x_lcd, LCD, &clk_pxa3xx_hsio_ops); | ||
205 | static DEFINE_CLK(pxa95x_pout, &clk_pxa3xx_pout_ops, 13000000, 70); | ||
206 | static DEFINE_PXA3_CKEN(pxa95x_ffuart, FFUART, 14857000, 1); | ||
207 | static DEFINE_PXA3_CKEN(pxa95x_btuart, BTUART, 14857000, 1); | ||
208 | static DEFINE_PXA3_CKEN(pxa95x_stuart, STUART, 14857000, 1); | ||
209 | static DEFINE_PXA3_CKEN(pxa95x_i2c, I2C, 32842000, 0); | ||
210 | static DEFINE_PXA3_CKEN(pxa95x_keypad, KEYPAD, 32768, 0); | ||
211 | static DEFINE_PXA3_CKEN(pxa95x_ssp1, SSP1, 13000000, 0); | ||
212 | static DEFINE_PXA3_CKEN(pxa95x_ssp2, SSP2, 13000000, 0); | ||
213 | static DEFINE_PXA3_CKEN(pxa95x_ssp3, SSP3, 13000000, 0); | ||
214 | static DEFINE_PXA3_CKEN(pxa95x_ssp4, SSP4, 13000000, 0); | ||
215 | static DEFINE_PXA3_CKEN(pxa95x_pwm0, PWM0, 13000000, 0); | ||
216 | static DEFINE_PXA3_CKEN(pxa95x_pwm1, PWM1, 13000000, 0); | ||
217 | |||
218 | static struct clk_lookup pxa95x_clkregs[] = { | ||
219 | INIT_CLKREG(&clk_pxa95x_pout, NULL, "CLK_POUT"), | ||
220 | /* Power I2C clock is always on */ | ||
221 | INIT_CLKREG(&clk_dummy, "pxa3xx-pwri2c.1", NULL), | ||
222 | INIT_CLKREG(&clk_pxa95x_lcd, "pxa2xx-fb", NULL), | ||
223 | INIT_CLKREG(&clk_pxa95x_ffuart, "pxa2xx-uart.0", NULL), | ||
224 | INIT_CLKREG(&clk_pxa95x_btuart, "pxa2xx-uart.1", NULL), | ||
225 | INIT_CLKREG(&clk_pxa95x_stuart, "pxa2xx-uart.2", NULL), | ||
226 | INIT_CLKREG(&clk_pxa95x_stuart, "pxa2xx-ir", "UARTCLK"), | ||
227 | INIT_CLKREG(&clk_pxa95x_i2c, "pxa2xx-i2c.0", NULL), | ||
228 | INIT_CLKREG(&clk_pxa95x_keypad, "pxa27x-keypad", NULL), | ||
229 | INIT_CLKREG(&clk_pxa95x_ssp1, "pxa27x-ssp.0", NULL), | ||
230 | INIT_CLKREG(&clk_pxa95x_ssp2, "pxa27x-ssp.1", NULL), | ||
231 | INIT_CLKREG(&clk_pxa95x_ssp3, "pxa27x-ssp.2", NULL), | ||
232 | INIT_CLKREG(&clk_pxa95x_ssp4, "pxa27x-ssp.3", NULL), | ||
233 | INIT_CLKREG(&clk_pxa95x_pwm0, "pxa27x-pwm.0", NULL), | ||
234 | INIT_CLKREG(&clk_pxa95x_pwm1, "pxa27x-pwm.1", NULL), | ||
235 | }; | ||
236 | |||
237 | void __init pxa95x_init_irq(void) | ||
238 | { | ||
239 | pxa_init_irq(96, NULL); | ||
240 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); | ||
241 | } | ||
242 | |||
243 | /* | ||
244 | * device registration specific to PXA93x. | ||
245 | */ | ||
246 | |||
247 | void __init pxa95x_set_i2c_power_info(struct i2c_pxa_platform_data *info) | ||
248 | { | ||
249 | pxa_register_device(&pxa3xx_device_i2c_power, info); | ||
250 | } | ||
251 | |||
252 | static struct platform_device *devices[] __initdata = { | ||
253 | &sa1100_device_rtc, | ||
254 | &pxa_device_rtc, | ||
255 | &pxa27x_device_ssp1, | ||
256 | &pxa27x_device_ssp2, | ||
257 | &pxa27x_device_ssp3, | ||
258 | &pxa3xx_device_ssp4, | ||
259 | &pxa27x_device_pwm0, | ||
260 | &pxa27x_device_pwm1, | ||
261 | }; | ||
262 | |||
263 | static struct sys_device pxa95x_sysdev[] = { | ||
264 | { | ||
265 | .cls = &pxa_irq_sysclass, | ||
266 | }, { | ||
267 | .cls = &pxa_gpio_sysclass, | ||
268 | }, { | ||
269 | .cls = &pxa3xx_clock_sysclass, | ||
270 | } | ||
271 | }; | ||
272 | |||
273 | static int __init pxa95x_init(void) | ||
274 | { | ||
275 | int ret = 0, i; | ||
276 | |||
277 | if (cpu_is_pxa95x()) { | ||
278 | mfp_init_base(io_p2v(MFPR_BASE)); | ||
279 | mfp_init_addr(pxa95x_mfp_addr_map); | ||
280 | |||
281 | reset_status = ARSR; | ||
282 | |||
283 | /* | ||
284 | * clear RDH bit every time after reset | ||
285 | * | ||
286 | * Note: the last 3 bits DxS are write-1-to-clear so carefully | ||
287 | * preserve them here in case they will be referenced later | ||
288 | */ | ||
289 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); | ||
290 | |||
291 | clkdev_add_table(pxa95x_clkregs, ARRAY_SIZE(pxa95x_clkregs)); | ||
292 | |||
293 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) | ||
294 | return ret; | ||
295 | |||
296 | for (i = 0; i < ARRAY_SIZE(pxa95x_sysdev); i++) { | ||
297 | ret = sysdev_register(&pxa95x_sysdev[i]); | ||
298 | if (ret) | ||
299 | pr_err("failed to register sysdev[%d]\n", i); | ||
300 | } | ||
301 | |||
302 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
303 | } | ||
304 | |||
305 | return ret; | ||
306 | } | ||
307 | |||
308 | postcore_initcall(pxa95x_init); | ||
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index 4121d03ea2c3..8361151be054 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -588,6 +588,9 @@ static struct pxafb_mach_info raumfeld_sharp_lcd_info = { | |||
588 | .num_modes = 1, | 588 | .num_modes = 1, |
589 | .video_mem_size = 0x400000, | 589 | .video_mem_size = 0x400000, |
590 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 590 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
591 | #ifdef CONFIG_PXA3XX_GCU | ||
592 | .acceleration_enabled = 1, | ||
593 | #endif | ||
591 | }; | 594 | }; |
592 | 595 | ||
593 | static void __init raumfeld_lcd_init(void) | 596 | static void __init raumfeld_lcd_init(void) |
@@ -616,6 +619,8 @@ static void __init raumfeld_lcd_init(void) | |||
616 | pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); | 619 | pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); |
617 | else | 620 | else |
618 | gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); | 621 | gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); |
622 | |||
623 | platform_device_register(&pxa3xx_device_gcu); | ||
619 | } | 624 | } |
620 | 625 | ||
621 | /** | 626 | /** |
@@ -1085,7 +1090,7 @@ static void __init raumfeld_speaker_init(void) | |||
1085 | MACHINE_START(RAUMFELD_RC, "Raumfeld Controller") | 1090 | MACHINE_START(RAUMFELD_RC, "Raumfeld Controller") |
1086 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, | 1091 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, |
1087 | .init_machine = raumfeld_controller_init, | 1092 | .init_machine = raumfeld_controller_init, |
1088 | .map_io = pxa_map_io, | 1093 | .map_io = pxa3xx_map_io, |
1089 | .init_irq = pxa3xx_init_irq, | 1094 | .init_irq = pxa3xx_init_irq, |
1090 | .timer = &pxa_timer, | 1095 | .timer = &pxa_timer, |
1091 | MACHINE_END | 1096 | MACHINE_END |
@@ -1095,7 +1100,7 @@ MACHINE_END | |||
1095 | MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector") | 1100 | MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector") |
1096 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, | 1101 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, |
1097 | .init_machine = raumfeld_connector_init, | 1102 | .init_machine = raumfeld_connector_init, |
1098 | .map_io = pxa_map_io, | 1103 | .map_io = pxa3xx_map_io, |
1099 | .init_irq = pxa3xx_init_irq, | 1104 | .init_irq = pxa3xx_init_irq, |
1100 | .timer = &pxa_timer, | 1105 | .timer = &pxa_timer, |
1101 | MACHINE_END | 1106 | MACHINE_END |
@@ -1105,7 +1110,7 @@ MACHINE_END | |||
1105 | MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker") | 1110 | MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker") |
1106 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, | 1111 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, |
1107 | .init_machine = raumfeld_speaker_init, | 1112 | .init_machine = raumfeld_speaker_init, |
1108 | .map_io = pxa_map_io, | 1113 | .map_io = pxa3xx_map_io, |
1109 | .init_irq = pxa3xx_init_irq, | 1114 | .init_irq = pxa3xx_init_irq, |
1110 | .timer = &pxa_timer, | 1115 | .timer = &pxa_timer, |
1111 | MACHINE_END | 1116 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c index ffa50e633ee6..c1ca8cb467fc 100644 --- a/arch/arm/mach-pxa/saar.c +++ b/arch/arm/mach-pxa/saar.c | |||
@@ -597,7 +597,7 @@ static void __init saar_init(void) | |||
597 | MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") | 597 | MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") |
598 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ | 598 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ |
599 | .boot_params = 0xa0000100, | 599 | .boot_params = 0xa0000100, |
600 | .map_io = pxa_map_io, | 600 | .map_io = pxa3xx_map_io, |
601 | .init_irq = pxa3xx_init_irq, | 601 | .init_irq = pxa3xx_init_irq, |
602 | .timer = &pxa_timer, | 602 | .timer = &pxa_timer, |
603 | .init_machine = saar_init, | 603 | .init_machine = saar_init, |
diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c new file mode 100644 index 000000000000..e497922f761a --- /dev/null +++ b/arch/arm/mach-pxa/saarb.c | |||
@@ -0,0 +1,114 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/saarb.c | ||
3 | * | ||
4 | * Support for the Marvell Handheld Platform (aka SAARB) | ||
5 | * | ||
6 | * Copyright (C) 2007-2010 Marvell International Ltd. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * publishhed by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/i2c.h> | ||
16 | #include <linux/mfd/88pm860x.h> | ||
17 | |||
18 | #include <asm/mach-types.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | |||
21 | #include <mach/irqs.h> | ||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/mfp.h> | ||
24 | #include <mach/mfp-pxa930.h> | ||
25 | #include <mach/gpio.h> | ||
26 | |||
27 | #include <plat/i2c.h> | ||
28 | |||
29 | #include "generic.h" | ||
30 | |||
31 | #define SAARB_NR_IRQS (IRQ_BOARD_START + 40) | ||
32 | |||
33 | static struct pm860x_touch_pdata saarb_touch = { | ||
34 | .gpadc_prebias = 1, | ||
35 | .slot_cycle = 1, | ||
36 | .tsi_prebias = 6, | ||
37 | .pen_prebias = 16, | ||
38 | .pen_prechg = 2, | ||
39 | .res_x = 300, | ||
40 | }; | ||
41 | |||
42 | static struct pm860x_backlight_pdata saarb_backlight[] = { | ||
43 | { | ||
44 | .id = PM8606_ID_BACKLIGHT, | ||
45 | .iset = PM8606_WLED_CURRENT(24), | ||
46 | .flags = PM8606_BACKLIGHT1, | ||
47 | }, | ||
48 | {}, | ||
49 | }; | ||
50 | |||
51 | static struct pm860x_led_pdata saarb_led[] = { | ||
52 | { | ||
53 | .id = PM8606_ID_LED, | ||
54 | .iset = PM8606_LED_CURRENT(12), | ||
55 | .flags = PM8606_LED1_RED, | ||
56 | }, { | ||
57 | .id = PM8606_ID_LED, | ||
58 | .iset = PM8606_LED_CURRENT(12), | ||
59 | .flags = PM8606_LED1_GREEN, | ||
60 | }, { | ||
61 | .id = PM8606_ID_LED, | ||
62 | .iset = PM8606_LED_CURRENT(12), | ||
63 | .flags = PM8606_LED1_BLUE, | ||
64 | }, { | ||
65 | .id = PM8606_ID_LED, | ||
66 | .iset = PM8606_LED_CURRENT(12), | ||
67 | .flags = PM8606_LED2_RED, | ||
68 | }, { | ||
69 | .id = PM8606_ID_LED, | ||
70 | .iset = PM8606_LED_CURRENT(12), | ||
71 | .flags = PM8606_LED2_GREEN, | ||
72 | }, { | ||
73 | .id = PM8606_ID_LED, | ||
74 | .iset = PM8606_LED_CURRENT(12), | ||
75 | .flags = PM8606_LED2_BLUE, | ||
76 | }, | ||
77 | }; | ||
78 | |||
79 | static struct pm860x_platform_data saarb_pm8607_info = { | ||
80 | .touch = &saarb_touch, | ||
81 | .backlight = &saarb_backlight[0], | ||
82 | .led = &saarb_led[0], | ||
83 | .companion_addr = 0x10, | ||
84 | .irq_mode = 0, | ||
85 | .irq_base = IRQ_BOARD_START, | ||
86 | |||
87 | .i2c_port = GI2C_PORT, | ||
88 | }; | ||
89 | |||
90 | static struct i2c_board_info saarb_i2c_info[] = { | ||
91 | { | ||
92 | .type = "88PM860x", | ||
93 | .addr = 0x34, | ||
94 | .platform_data = &saarb_pm8607_info, | ||
95 | .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)), | ||
96 | }, | ||
97 | }; | ||
98 | |||
99 | static void __init saarb_init(void) | ||
100 | { | ||
101 | pxa_set_ffuart_info(NULL); | ||
102 | pxa_set_i2c_info(NULL); | ||
103 | i2c_register_board_info(0, ARRAY_AND_SIZE(saarb_i2c_info)); | ||
104 | } | ||
105 | |||
106 | MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)") | ||
107 | .boot_params = 0xa0000100, | ||
108 | .map_io = pxa_map_io, | ||
109 | .nr_irqs = SAARB_NR_IRQS, | ||
110 | .init_irq = pxa95x_init_irq, | ||
111 | .timer = &pxa_timer, | ||
112 | .init_machine = saarb_init, | ||
113 | MACHINE_END | ||
114 | |||
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S index ae008110db4e..c551da86baf6 100644 --- a/arch/arm/mach-pxa/sleep.S +++ b/arch/arm/mach-pxa/sleep.S | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | #include <asm/assembler.h> | 15 | #include <asm/assembler.h> |
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | #include <mach/smemc.h> | |
18 | #include <mach/pxa2xx-regs.h> | 18 | #include <mach/pxa2xx-regs.h> |
19 | 19 | ||
20 | #define MDREFR_KDIV 0x200a4000 // all banks | 20 | #define MDREFR_KDIV 0x200a4000 // all banks |
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c index d6f6904132a6..232b7316ec08 100644 --- a/arch/arm/mach-pxa/smemc.c +++ b/arch/arm/mach-pxa/smemc.c | |||
@@ -9,50 +9,37 @@ | |||
9 | #include <linux/sysdev.h> | 9 | #include <linux/sysdev.h> |
10 | 10 | ||
11 | #include <mach/hardware.h> | 11 | #include <mach/hardware.h> |
12 | 12 | #include <mach/smemc.h> | |
13 | #define SMEMC_PHYS_BASE (0x4A000000) | ||
14 | #define SMEMC_PHYS_SIZE (0x90) | ||
15 | |||
16 | #define MSC0 (0x08) /* Static Memory Controller Register 0 */ | ||
17 | #define MSC1 (0x0C) /* Static Memory Controller Register 1 */ | ||
18 | #define SXCNFG (0x1C) /* Synchronous Static Memory Control Register */ | ||
19 | #define MEMCLKCFG (0x68) /* Clock Configuration */ | ||
20 | #define CSADRCFG0 (0x80) /* Address Configuration Register for CS0 */ | ||
21 | #define CSADRCFG1 (0x84) /* Address Configuration Register for CS1 */ | ||
22 | #define CSADRCFG2 (0x88) /* Address Configuration Register for CS2 */ | ||
23 | #define CSADRCFG3 (0x8C) /* Address Configuration Register for CS3 */ | ||
24 | 13 | ||
25 | #ifdef CONFIG_PM | 14 | #ifdef CONFIG_PM |
26 | static void __iomem *smemc_mmio_base; | ||
27 | |||
28 | static unsigned long msc[2]; | 15 | static unsigned long msc[2]; |
29 | static unsigned long sxcnfg, memclkcfg; | 16 | static unsigned long sxcnfg, memclkcfg; |
30 | static unsigned long csadrcfg[4]; | 17 | static unsigned long csadrcfg[4]; |
31 | 18 | ||
32 | static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) | 19 | static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) |
33 | { | 20 | { |
34 | msc[0] = __raw_readl(smemc_mmio_base + MSC0); | 21 | msc[0] = __raw_readl(MSC0); |
35 | msc[1] = __raw_readl(smemc_mmio_base + MSC1); | 22 | msc[1] = __raw_readl(MSC1); |
36 | sxcnfg = __raw_readl(smemc_mmio_base + SXCNFG); | 23 | sxcnfg = __raw_readl(SXCNFG); |
37 | memclkcfg = __raw_readl(smemc_mmio_base + MEMCLKCFG); | 24 | memclkcfg = __raw_readl(MEMCLKCFG); |
38 | csadrcfg[0] = __raw_readl(smemc_mmio_base + CSADRCFG0); | 25 | csadrcfg[0] = __raw_readl(CSADRCFG0); |
39 | csadrcfg[1] = __raw_readl(smemc_mmio_base + CSADRCFG1); | 26 | csadrcfg[1] = __raw_readl(CSADRCFG1); |
40 | csadrcfg[2] = __raw_readl(smemc_mmio_base + CSADRCFG2); | 27 | csadrcfg[2] = __raw_readl(CSADRCFG2); |
41 | csadrcfg[3] = __raw_readl(smemc_mmio_base + CSADRCFG3); | 28 | csadrcfg[3] = __raw_readl(CSADRCFG3); |
42 | 29 | ||
43 | return 0; | 30 | return 0; |
44 | } | 31 | } |
45 | 32 | ||
46 | static int pxa3xx_smemc_resume(struct sys_device *dev) | 33 | static int pxa3xx_smemc_resume(struct sys_device *dev) |
47 | { | 34 | { |
48 | __raw_writel(msc[0], smemc_mmio_base + MSC0); | 35 | __raw_writel(msc[0], MSC0); |
49 | __raw_writel(msc[1], smemc_mmio_base + MSC1); | 36 | __raw_writel(msc[1], MSC1); |
50 | __raw_writel(sxcnfg, smemc_mmio_base + SXCNFG); | 37 | __raw_writel(sxcnfg, SXCNFG); |
51 | __raw_writel(memclkcfg, smemc_mmio_base + MEMCLKCFG); | 38 | __raw_writel(memclkcfg, MEMCLKCFG); |
52 | __raw_writel(csadrcfg[0], smemc_mmio_base + CSADRCFG0); | 39 | __raw_writel(csadrcfg[0], CSADRCFG0); |
53 | __raw_writel(csadrcfg[1], smemc_mmio_base + CSADRCFG1); | 40 | __raw_writel(csadrcfg[1], CSADRCFG1); |
54 | __raw_writel(csadrcfg[2], smemc_mmio_base + CSADRCFG2); | 41 | __raw_writel(csadrcfg[2], CSADRCFG2); |
55 | __raw_writel(csadrcfg[3], smemc_mmio_base + CSADRCFG3); | 42 | __raw_writel(csadrcfg[3], CSADRCFG3); |
56 | 43 | ||
57 | return 0; | 44 | return 0; |
58 | } | 45 | } |
@@ -73,10 +60,6 @@ static int __init smemc_init(void) | |||
73 | int ret = 0; | 60 | int ret = 0; |
74 | 61 | ||
75 | if (cpu_is_pxa3xx()) { | 62 | if (cpu_is_pxa3xx()) { |
76 | smemc_mmio_base = ioremap(SMEMC_PHYS_BASE, SMEMC_PHYS_SIZE); | ||
77 | if (smemc_mmio_base == NULL) | ||
78 | return -ENODEV; | ||
79 | |||
80 | ret = sysdev_class_register(&smemc_sysclass); | 63 | ret = sysdev_class_register(&smemc_sysclass); |
81 | if (ret) | 64 | if (ret) |
82 | return ret; | 65 | return ret; |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index f736119f1ebf..0499a69e7673 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/mtd/sharpsl.h> | 27 | #include <linux/mtd/sharpsl.h> |
28 | #include <linux/input/matrix_keypad.h> | 28 | #include <linux/input/matrix_keypad.h> |
29 | #include <linux/regulator/machine.h> | 29 | #include <linux/regulator/machine.h> |
30 | #include <linux/io.h> | ||
30 | 31 | ||
31 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
@@ -44,6 +45,7 @@ | |||
44 | #include <mach/pxa2xx_spi.h> | 45 | #include <mach/pxa2xx_spi.h> |
45 | #include <mach/spitz.h> | 46 | #include <mach/spitz.h> |
46 | #include <mach/sharpsl_pm.h> | 47 | #include <mach/sharpsl_pm.h> |
48 | #include <mach/smemc.h> | ||
47 | 49 | ||
48 | #include <plat/i2c.h> | 50 | #include <plat/i2c.h> |
49 | 51 | ||
@@ -929,9 +931,10 @@ static void spitz_poweroff(void) | |||
929 | 931 | ||
930 | static void spitz_restart(char mode, const char *cmd) | 932 | static void spitz_restart(char mode, const char *cmd) |
931 | { | 933 | { |
934 | uint32_t msc0 = __raw_readl(MSC0); | ||
932 | /* Bootloader magic for a reboot */ | 935 | /* Bootloader magic for a reboot */ |
933 | if ((MSC0 & 0xffff0000) == 0x7ff00000) | 936 | if ((msc0 & 0xffff0000) == 0x7ff00000) |
934 | MSC0 = (MSC0 & 0xffff) | 0x7ee00000; | 937 | __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0); |
935 | 938 | ||
936 | spitz_poweroff(); | 939 | spitz_poweroff(); |
937 | } | 940 | } |
@@ -980,7 +983,7 @@ static void __init spitz_fixup(struct machine_desc *desc, | |||
980 | #ifdef CONFIG_MACH_SPITZ | 983 | #ifdef CONFIG_MACH_SPITZ |
981 | MACHINE_START(SPITZ, "SHARP Spitz") | 984 | MACHINE_START(SPITZ, "SHARP Spitz") |
982 | .fixup = spitz_fixup, | 985 | .fixup = spitz_fixup, |
983 | .map_io = pxa_map_io, | 986 | .map_io = pxa27x_map_io, |
984 | .init_irq = pxa27x_init_irq, | 987 | .init_irq = pxa27x_init_irq, |
985 | .init_machine = spitz_init, | 988 | .init_machine = spitz_init, |
986 | .timer = &pxa_timer, | 989 | .timer = &pxa_timer, |
@@ -990,7 +993,7 @@ MACHINE_END | |||
990 | #ifdef CONFIG_MACH_BORZOI | 993 | #ifdef CONFIG_MACH_BORZOI |
991 | MACHINE_START(BORZOI, "SHARP Borzoi") | 994 | MACHINE_START(BORZOI, "SHARP Borzoi") |
992 | .fixup = spitz_fixup, | 995 | .fixup = spitz_fixup, |
993 | .map_io = pxa_map_io, | 996 | .map_io = pxa27x_map_io, |
994 | .init_irq = pxa27x_init_irq, | 997 | .init_irq = pxa27x_init_irq, |
995 | .init_machine = spitz_init, | 998 | .init_machine = spitz_init, |
996 | .timer = &pxa_timer, | 999 | .timer = &pxa_timer, |
@@ -1000,7 +1003,7 @@ MACHINE_END | |||
1000 | #ifdef CONFIG_MACH_AKITA | 1003 | #ifdef CONFIG_MACH_AKITA |
1001 | MACHINE_START(AKITA, "SHARP Akita") | 1004 | MACHINE_START(AKITA, "SHARP Akita") |
1002 | .fixup = spitz_fixup, | 1005 | .fixup = spitz_fixup, |
1003 | .map_io = pxa_map_io, | 1006 | .map_io = pxa27x_map_io, |
1004 | .init_irq = pxa27x_init_irq, | 1007 | .init_irq = pxa27x_init_irq, |
1005 | .init_machine = spitz_init, | 1008 | .init_machine = spitz_init, |
1006 | .timer = &pxa_timer, | 1009 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index 738adc1773fd..3498a1423943 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <mach/udc.h> | 48 | #include <mach/udc.h> |
49 | #include <mach/pxa2xx_spi.h> | 49 | #include <mach/pxa2xx_spi.h> |
50 | #include <mach/pxa27x-udc.h> | 50 | #include <mach/pxa27x-udc.h> |
51 | #include <mach/smemc.h> | ||
51 | 52 | ||
52 | #include <linux/spi/spi.h> | 53 | #include <linux/spi/spi.h> |
53 | #include <linux/mfd/da903x.h> | 54 | #include <linux/mfd/da903x.h> |
@@ -976,7 +977,7 @@ static void __init stargate2_init(void) | |||
976 | { | 977 | { |
977 | /* This is probably a board specific hack as this must be set | 978 | /* This is probably a board specific hack as this must be set |
978 | prior to connecting the MFP stuff up. */ | 979 | prior to connecting the MFP stuff up. */ |
979 | MECR &= ~MECR_NOS; | 980 | __raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR); |
980 | 981 | ||
981 | pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); | 982 | pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); |
982 | 983 | ||
@@ -998,7 +999,7 @@ static void __init stargate2_init(void) | |||
998 | 999 | ||
999 | #ifdef CONFIG_MACH_INTELMOTE2 | 1000 | #ifdef CONFIG_MACH_INTELMOTE2 |
1000 | MACHINE_START(INTELMOTE2, "IMOTE 2") | 1001 | MACHINE_START(INTELMOTE2, "IMOTE 2") |
1001 | .map_io = pxa_map_io, | 1002 | .map_io = pxa27x_map_io, |
1002 | .init_irq = pxa27x_init_irq, | 1003 | .init_irq = pxa27x_init_irq, |
1003 | .timer = &pxa_timer, | 1004 | .timer = &pxa_timer, |
1004 | .init_machine = imote2_init, | 1005 | .init_machine = imote2_init, |
@@ -1008,7 +1009,7 @@ MACHINE_END | |||
1008 | 1009 | ||
1009 | #ifdef CONFIG_MACH_STARGATE2 | 1010 | #ifdef CONFIG_MACH_STARGATE2 |
1010 | MACHINE_START(STARGATE2, "Stargate 2") | 1011 | MACHINE_START(STARGATE2, "Stargate 2") |
1011 | .map_io = pxa_map_io, | 1012 | .map_io = pxa27x_map_io, |
1012 | .nr_irqs = STARGATE_NR_IRQS, | 1013 | .nr_irqs = STARGATE_NR_IRQS, |
1013 | .init_irq = pxa27x_init_irq, | 1014 | .init_irq = pxa27x_init_irq, |
1014 | .timer = &pxa_timer, | 1015 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c index 2ea7545273ad..9cecf8366db8 100644 --- a/arch/arm/mach-pxa/tavorevb.c +++ b/arch/arm/mach-pxa/tavorevb.c | |||
@@ -490,7 +490,7 @@ static void __init tavorevb_init(void) | |||
490 | MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") | 490 | MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") |
491 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ | 491 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ |
492 | .boot_params = 0xa0000100, | 492 | .boot_params = 0xa0000100, |
493 | .map_io = pxa_map_io, | 493 | .map_io = pxa3xx_map_io, |
494 | .init_irq = pxa3xx_init_irq, | 494 | .init_irq = pxa3xx_init_irq, |
495 | .timer = &pxa_timer, | 495 | .timer = &pxa_timer, |
496 | .init_machine = tavorevb_init, | 496 | .init_machine = tavorevb_init, |
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c index dc3011697bbf..70191a9450eb 100644 --- a/arch/arm/mach-pxa/tavorevb3.c +++ b/arch/arm/mach-pxa/tavorevb3.c | |||
@@ -127,7 +127,7 @@ static void __init evb3_init(void) | |||
127 | 127 | ||
128 | MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)") | 128 | MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)") |
129 | .boot_params = 0xa0000100, | 129 | .boot_params = 0xa0000100, |
130 | .map_io = pxa_map_io, | 130 | .map_io = pxa3xx_map_io, |
131 | .nr_irqs = TAVOREVB3_NR_IRQS, | 131 | .nr_irqs = TAVOREVB3_NR_IRQS, |
132 | .init_irq = pxa3xx_init_irq, | 132 | .init_irq = pxa3xx_init_irq, |
133 | .timer = &pxa_timer, | 133 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index 293e40aeaf29..e7f64d9b4f2d 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c | |||
@@ -17,11 +17,11 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/clockchips.h> | 18 | #include <linux/clockchips.h> |
19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
20 | #include <linux/cnt32_to_63.h> | ||
21 | 20 | ||
22 | #include <asm/div64.h> | 21 | #include <asm/div64.h> |
23 | #include <asm/mach/irq.h> | 22 | #include <asm/mach/irq.h> |
24 | #include <asm/mach/time.h> | 23 | #include <asm/mach/time.h> |
24 | #include <asm/sched_clock.h> | ||
25 | #include <mach/regs-ost.h> | 25 | #include <mach/regs-ost.h> |
26 | 26 | ||
27 | /* | 27 | /* |
@@ -32,29 +32,18 @@ | |||
32 | * long as there is always less than 582 seconds between successive | 32 | * long as there is always less than 582 seconds between successive |
33 | * calls to sched_clock() which should always be the case in practice. | 33 | * calls to sched_clock() which should always be the case in practice. |
34 | */ | 34 | */ |
35 | static DEFINE_CLOCK_DATA(cd); | ||
35 | 36 | ||
36 | #define OSCR2NS_SCALE_FACTOR 10 | 37 | unsigned long long notrace sched_clock(void) |
37 | |||
38 | static unsigned long oscr2ns_scale; | ||
39 | |||
40 | static void __init set_oscr2ns_scale(unsigned long oscr_rate) | ||
41 | { | 38 | { |
42 | unsigned long long v = 1000000000ULL << OSCR2NS_SCALE_FACTOR; | 39 | u32 cyc = OSCR; |
43 | do_div(v, oscr_rate); | 40 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
44 | oscr2ns_scale = v; | ||
45 | /* | ||
46 | * We want an even value to automatically clear the top bit | ||
47 | * returned by cnt32_to_63() without an additional run time | ||
48 | * instruction. So if the LSB is 1 then round it up. | ||
49 | */ | ||
50 | if (oscr2ns_scale & 1) | ||
51 | oscr2ns_scale++; | ||
52 | } | 41 | } |
53 | 42 | ||
54 | unsigned long long sched_clock(void) | 43 | static void notrace pxa_update_sched_clock(void) |
55 | { | 44 | { |
56 | unsigned long long v = cnt32_to_63(OSCR); | 45 | u32 cyc = OSCR; |
57 | return (v * oscr2ns_scale) >> OSCR2NS_SCALE_FACTOR; | 46 | update_sched_clock(&cd, cyc, (u32)~0); |
58 | } | 47 | } |
59 | 48 | ||
60 | 49 | ||
@@ -127,7 +116,6 @@ static struct clocksource cksrc_pxa_oscr0 = { | |||
127 | .rating = 200, | 116 | .rating = 200, |
128 | .read = pxa_read_oscr, | 117 | .read = pxa_read_oscr, |
129 | .mask = CLOCKSOURCE_MASK(32), | 118 | .mask = CLOCKSOURCE_MASK(32), |
130 | .shift = 20, | ||
131 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 119 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
132 | }; | 120 | }; |
133 | 121 | ||
@@ -145,7 +133,7 @@ static void __init pxa_timer_init(void) | |||
145 | OIER = 0; | 133 | OIER = 0; |
146 | OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3; | 134 | OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3; |
147 | 135 | ||
148 | set_oscr2ns_scale(clock_tick_rate); | 136 | init_sched_clock(&cd, pxa_update_sched_clock, 32, clock_tick_rate); |
149 | 137 | ||
150 | ckevt_pxa_osmr0.mult = | 138 | ckevt_pxa_osmr0.mult = |
151 | div_sc(clock_tick_rate, NSEC_PER_SEC, ckevt_pxa_osmr0.shift); | 139 | div_sc(clock_tick_rate, NSEC_PER_SEC, ckevt_pxa_osmr0.shift); |
@@ -155,12 +143,9 @@ static void __init pxa_timer_init(void) | |||
155 | clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1; | 143 | clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1; |
156 | ckevt_pxa_osmr0.cpumask = cpumask_of(0); | 144 | ckevt_pxa_osmr0.cpumask = cpumask_of(0); |
157 | 145 | ||
158 | cksrc_pxa_oscr0.mult = | ||
159 | clocksource_hz2mult(clock_tick_rate, cksrc_pxa_oscr0.shift); | ||
160 | |||
161 | setup_irq(IRQ_OST0, &pxa_ost0_irq); | 146 | setup_irq(IRQ_OST0, &pxa_ost0_irq); |
162 | 147 | ||
163 | clocksource_register(&cksrc_pxa_oscr0); | 148 | clocksource_register_hz(&cksrc_pxa_oscr0, clock_tick_rate); |
164 | clockevents_register_device(&ckevt_pxa_osmr0); | 149 | clockevents_register_device(&ckevt_pxa_osmr0); |
165 | } | 150 | } |
166 | 151 | ||
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 0ee1df49606d..57d61ee9b226 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <mach/tosa_bt.h> | 46 | #include <mach/tosa_bt.h> |
47 | #include <mach/pxa2xx_spi.h> | 47 | #include <mach/pxa2xx_spi.h> |
48 | #include <mach/audio.h> | 48 | #include <mach/audio.h> |
49 | #include <mach/smemc.h> | ||
49 | 50 | ||
50 | #include <asm/mach/arch.h> | 51 | #include <asm/mach/arch.h> |
51 | #include <mach/tosa.h> | 52 | #include <mach/tosa.h> |
@@ -893,9 +894,11 @@ static void tosa_poweroff(void) | |||
893 | 894 | ||
894 | static void tosa_restart(char mode, const char *cmd) | 895 | static void tosa_restart(char mode, const char *cmd) |
895 | { | 896 | { |
897 | uint32_t msc0 = __raw_readl(MSC0); | ||
898 | |||
896 | /* Bootloader magic for a reboot */ | 899 | /* Bootloader magic for a reboot */ |
897 | if((MSC0 & 0xffff0000) == 0x7ff00000) | 900 | if((msc0 & 0xffff0000) == 0x7ff00000) |
898 | MSC0 = (MSC0 & 0xffff) | 0x7ee00000; | 901 | __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0); |
899 | 902 | ||
900 | tosa_poweroff(); | 903 | tosa_poweroff(); |
901 | } | 904 | } |
@@ -953,7 +956,7 @@ static void __init fixup_tosa(struct machine_desc *desc, | |||
953 | 956 | ||
954 | MACHINE_START(TOSA, "SHARP Tosa") | 957 | MACHINE_START(TOSA, "SHARP Tosa") |
955 | .fixup = fixup_tosa, | 958 | .fixup = fixup_tosa, |
956 | .map_io = pxa_map_io, | 959 | .map_io = pxa25x_map_io, |
957 | .nr_irqs = TOSA_NR_IRQS, | 960 | .nr_irqs = TOSA_NR_IRQS, |
958 | .init_irq = pxa25x_init_irq, | 961 | .init_irq = pxa25x_init_irq, |
959 | .init_machine = tosa_init, | 962 | .init_machine = tosa_init, |
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index 565d062f51d5..43fc9ca14594 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <mach/mmc.h> | 47 | #include <mach/mmc.h> |
48 | #include <mach/irda.h> | 48 | #include <mach/irda.h> |
49 | #include <mach/ohci.h> | 49 | #include <mach/ohci.h> |
50 | #include <mach/smemc.h> | ||
50 | #include <plat/i2c.h> | 51 | #include <plat/i2c.h> |
51 | 52 | ||
52 | #include "generic.h" | 53 | #include "generic.h" |
@@ -539,10 +540,10 @@ static void __init trizeps4_init(void) | |||
539 | 540 | ||
540 | static void __init trizeps4_map_io(void) | 541 | static void __init trizeps4_map_io(void) |
541 | { | 542 | { |
542 | pxa_map_io(); | 543 | pxa27x_map_io(); |
543 | iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc)); | 544 | iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc)); |
544 | 545 | ||
545 | if ((MSC0 & 0x8) && (BOOT_DEF & 0x1)) { | 546 | if ((__raw_readl(MSC0) & 0x8) && (__raw_readl(BOOT_DEF) & 0x1)) { |
546 | /* if flash is 16 bit wide its a Trizeps4 WL */ | 547 | /* if flash is 16 bit wide its a Trizeps4 WL */ |
547 | __machine_arch_type = MACH_TYPE_TRIZEPS4WL; | 548 | __machine_arch_type = MACH_TYPE_TRIZEPS4WL; |
548 | trizeps4_flash_data[0].width = 2; | 549 | trizeps4_flash_data[0].width = 2; |
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index 438fc9a5ed59..de69b203afa7 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -983,7 +983,7 @@ static struct map_desc viper_io_desc[] __initdata = { | |||
983 | 983 | ||
984 | static void __init viper_map_io(void) | 984 | static void __init viper_map_io(void) |
985 | { | 985 | { |
986 | pxa_map_io(); | 986 | pxa25x_map_io(); |
987 | 987 | ||
988 | iotable_init(viper_io_desc, ARRAY_SIZE(viper_io_desc)); | 988 | iotable_init(viper_io_desc, ARRAY_SIZE(viper_io_desc)); |
989 | 989 | ||
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index f45ac0961778..b9b579715ff6 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -719,7 +719,7 @@ static void __init vpac270_init(void) | |||
719 | 719 | ||
720 | MACHINE_START(VPAC270, "Voipac PXA270") | 720 | MACHINE_START(VPAC270, "Voipac PXA270") |
721 | .boot_params = 0xa0000100, | 721 | .boot_params = 0xa0000100, |
722 | .map_io = pxa_map_io, | 722 | .map_io = pxa27x_map_io, |
723 | .init_irq = pxa27x_init_irq, | 723 | .init_irq = pxa27x_init_irq, |
724 | .timer = &pxa_timer, | 724 | .timer = &pxa_timer, |
725 | .init_machine = vpac270_init | 725 | .init_machine = vpac270_init |
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c index 3260ce73d327..51c0281c6e0a 100644 --- a/arch/arm/mach-pxa/xcep.c +++ b/arch/arm/mach-pxa/xcep.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
32 | #include <mach/pxa2xx-regs.h> | 32 | #include <mach/pxa2xx-regs.h> |
33 | #include <mach/mfp-pxa25x.h> | 33 | #include <mach/mfp-pxa25x.h> |
34 | #include <mach/smemc.h> | ||
34 | 35 | ||
35 | #include "generic.h" | 36 | #include "generic.h" |
36 | 37 | ||
@@ -172,9 +173,9 @@ static void __init xcep_init(void) | |||
172 | 173 | ||
173 | /* See Intel XScale Developer's Guide for details */ | 174 | /* See Intel XScale Developer's Guide for details */ |
174 | /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ | 175 | /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ |
175 | MSC1 = (MSC1 & 0xffff) | 0xD5540000; | 176 | __raw_writel((__raw_readl(MSC1) & 0xffff) | 0xD5540000, MSC1); |
176 | /* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */ | 177 | /* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */ |
177 | MSC2 = (MSC2 & 0xffff) | 0x72A00000; | 178 | __raw_writel((__raw_readl(MSC2) & 0xffff) | 0x72A00000, MSC2); |
178 | 179 | ||
179 | platform_add_devices(ARRAY_AND_SIZE(devices)); | 180 | platform_add_devices(ARRAY_AND_SIZE(devices)); |
180 | pxa_set_i2c_info(&xcep_i2c_platform_data); | 181 | pxa_set_i2c_info(&xcep_i2c_platform_data); |
@@ -183,7 +184,7 @@ static void __init xcep_init(void) | |||
183 | MACHINE_START(XCEP, "Iskratel XCEP") | 184 | MACHINE_START(XCEP, "Iskratel XCEP") |
184 | .boot_params = 0xa0000100, | 185 | .boot_params = 0xa0000100, |
185 | .init_machine = xcep_init, | 186 | .init_machine = xcep_init, |
186 | .map_io = pxa_map_io, | 187 | .map_io = pxa25x_map_io, |
187 | .init_irq = pxa25x_init_irq, | 188 | .init_irq = pxa25x_init_irq, |
188 | .timer = &pxa_timer, | 189 | .timer = &pxa_timer, |
189 | MACHINE_END | 190 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index fefde9848d82..527c2a1ed310 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c | |||
@@ -704,7 +704,7 @@ static void __init z2_init(void) | |||
704 | 704 | ||
705 | MACHINE_START(ZIPIT2, "Zipit Z2") | 705 | MACHINE_START(ZIPIT2, "Zipit Z2") |
706 | .boot_params = 0xa0000100, | 706 | .boot_params = 0xa0000100, |
707 | .map_io = pxa_map_io, | 707 | .map_io = pxa27x_map_io, |
708 | .init_irq = pxa27x_init_irq, | 708 | .init_irq = pxa27x_init_irq, |
709 | .timer = &pxa_timer, | 709 | .timer = &pxa_timer, |
710 | .init_machine = z2_init, | 710 | .init_machine = z2_init, |
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index dea46a2d089b..c87f2b35ee05 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <mach/audio.h> | 47 | #include <mach/audio.h> |
48 | #include <mach/arcom-pcmcia.h> | 48 | #include <mach/arcom-pcmcia.h> |
49 | #include <mach/zeus.h> | 49 | #include <mach/zeus.h> |
50 | #include <mach/smemc.h> | ||
50 | 51 | ||
51 | #include "generic.h" | 52 | #include "generic.h" |
52 | 53 | ||
@@ -823,13 +824,16 @@ static mfp_cfg_t zeus_pin_config[] __initdata = { | |||
823 | static void __init zeus_init(void) | 824 | static void __init zeus_init(void) |
824 | { | 825 | { |
825 | u16 dm9000_msc = DM9K_MSC_VALUE; | 826 | u16 dm9000_msc = DM9K_MSC_VALUE; |
827 | u32 msc0, msc1; | ||
826 | 828 | ||
827 | system_rev = __raw_readw(ZEUS_CPLD_VERSION); | 829 | system_rev = __raw_readw(ZEUS_CPLD_VERSION); |
828 | pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); | 830 | pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); |
829 | 831 | ||
830 | /* Fix timings for dm9000s (CS1/CS2)*/ | 832 | /* Fix timings for dm9000s (CS1/CS2)*/ |
831 | MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16); | 833 | msc0 = __raw_readl(MSC0) & 0x0000ffff | (dm9000_msc << 16); |
832 | MSC1 = (MSC1 & 0xffff0000) | dm9000_msc; | 834 | msc1 = __raw_readl(MSC1) & 0xffff0000 | dm9000_msc; |
835 | __raw_writel(msc0, MSC0); | ||
836 | __raw_writel(msc1, MSC1); | ||
833 | 837 | ||
834 | pm_power_off = zeus_power_off; | 838 | pm_power_off = zeus_power_off; |
835 | zeus_setup_apm(); | 839 | zeus_setup_apm(); |
@@ -883,7 +887,7 @@ static struct map_desc zeus_io_desc[] __initdata = { | |||
883 | 887 | ||
884 | static void __init zeus_map_io(void) | 888 | static void __init zeus_map_io(void) |
885 | { | 889 | { |
886 | pxa_map_io(); | 890 | pxa27x_map_io(); |
887 | 891 | ||
888 | iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc)); | 892 | iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc)); |
889 | 893 | ||
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 702f7a68e87d..a4c784aab764 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -423,7 +423,7 @@ static void __init zylonite_init(void) | |||
423 | 423 | ||
424 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") | 424 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") |
425 | .boot_params = 0xa0000100, | 425 | .boot_params = 0xa0000100, |
426 | .map_io = pxa_map_io, | 426 | .map_io = pxa3xx_map_io, |
427 | .nr_irqs = ZYLONITE_NR_IRQS, | 427 | .nr_irqs = ZYLONITE_NR_IRQS, |
428 | .init_irq = pxa3xx_init_irq, | 428 | .init_irq = pxa3xx_init_irq, |
429 | .timer = &pxa_timer, | 429 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 07c08151dfe6..1c6602cf50e4 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -30,8 +30,8 @@ | |||
30 | #include <linux/ata_platform.h> | 30 | #include <linux/ata_platform.h> |
31 | #include <linux/amba/mmci.h> | 31 | #include <linux/amba/mmci.h> |
32 | #include <linux/gfp.h> | 32 | #include <linux/gfp.h> |
33 | #include <linux/clkdev.h> | ||
33 | 34 | ||
34 | #include <asm/clkdev.h> | ||
35 | #include <asm/system.h> | 35 | #include <asm/system.h> |
36 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
@@ -47,15 +47,13 @@ | |||
47 | 47 | ||
48 | #include <asm/hardware/gic.h> | 48 | #include <asm/hardware/gic.h> |
49 | 49 | ||
50 | #include <mach/clkdev.h> | ||
51 | #include <mach/platform.h> | 50 | #include <mach/platform.h> |
52 | #include <mach/irqs.h> | 51 | #include <mach/irqs.h> |
53 | #include <plat/timer-sp.h> | 52 | #include <asm/hardware/timer-sp.h> |
54 | 53 | ||
55 | #include "core.h" | 54 | #include <plat/sched_clock.h> |
56 | 55 | ||
57 | /* used by entry-macro.S and platsmp.c */ | 56 | #include "core.h" |
58 | void __iomem *gic_cpu_base_addr; | ||
59 | 57 | ||
60 | #ifdef CONFIG_ZONE_DMA | 58 | #ifdef CONFIG_ZONE_DMA |
61 | /* | 59 | /* |
@@ -658,6 +656,12 @@ void realview_leds_event(led_event_t ledevt) | |||
658 | #endif /* CONFIG_LEDS */ | 656 | #endif /* CONFIG_LEDS */ |
659 | 657 | ||
660 | /* | 658 | /* |
659 | * The sched_clock counter | ||
660 | */ | ||
661 | #define REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + \ | ||
662 | REALVIEW_SYS_24MHz_OFFSET) | ||
663 | |||
664 | /* | ||
661 | * Where is the timer (VA)? | 665 | * Where is the timer (VA)? |
662 | */ | 666 | */ |
663 | void __iomem *timer0_va_base; | 667 | void __iomem *timer0_va_base; |
@@ -672,6 +676,8 @@ void __init realview_timer_init(unsigned int timer_irq) | |||
672 | { | 676 | { |
673 | u32 val; | 677 | u32 val; |
674 | 678 | ||
679 | versatile_sched_clock_init(REFCOUNTER, 24000000); | ||
680 | |||
675 | /* | 681 | /* |
676 | * set clock frequency: | 682 | * set clock frequency: |
677 | * REALVIEW_REFCLK is 32KHz | 683 | * REALVIEW_REFCLK is 32KHz |
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index 781bca68a9fa..693239ddc39e 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h | |||
@@ -53,7 +53,6 @@ extern struct platform_device realview_i2c_device; | |||
53 | extern struct mmci_platform_data realview_mmc0_plat_data; | 53 | extern struct mmci_platform_data realview_mmc0_plat_data; |
54 | extern struct mmci_platform_data realview_mmc1_plat_data; | 54 | extern struct mmci_platform_data realview_mmc1_plat_data; |
55 | extern struct clcd_board clcd_plat_data; | 55 | extern struct clcd_board clcd_plat_data; |
56 | extern void __iomem *gic_cpu_base_addr; | ||
57 | extern void __iomem *timer0_va_base; | 56 | extern void __iomem *timer0_va_base; |
58 | extern void __iomem *timer1_va_base; | 57 | extern void __iomem *timer1_va_base; |
59 | extern void __iomem *timer2_va_base; | 58 | extern void __iomem *timer2_va_base; |
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c index f95521a5e5ce..a87523d095e6 100644 --- a/arch/arm/mach-realview/hotplug.c +++ b/arch/arm/mach-realview/hotplug.c | |||
@@ -11,14 +11,11 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
14 | #include <linux/completion.h> | ||
15 | 14 | ||
16 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
17 | 16 | ||
18 | extern volatile int pen_release; | 17 | extern volatile int pen_release; |
19 | 18 | ||
20 | static DECLARE_COMPLETION(cpu_killed); | ||
21 | |||
22 | static inline void cpu_enter_lowpower(void) | 19 | static inline void cpu_enter_lowpower(void) |
23 | { | 20 | { |
24 | unsigned int v; | 21 | unsigned int v; |
@@ -34,10 +31,10 @@ static inline void cpu_enter_lowpower(void) | |||
34 | " bic %0, %0, #0x20\n" | 31 | " bic %0, %0, #0x20\n" |
35 | " mcr p15, 0, %0, c1, c0, 1\n" | 32 | " mcr p15, 0, %0, c1, c0, 1\n" |
36 | " mrc p15, 0, %0, c1, c0, 0\n" | 33 | " mrc p15, 0, %0, c1, c0, 0\n" |
37 | " bic %0, %0, #0x04\n" | 34 | " bic %0, %0, %2\n" |
38 | " mcr p15, 0, %0, c1, c0, 0\n" | 35 | " mcr p15, 0, %0, c1, c0, 0\n" |
39 | : "=&r" (v) | 36 | : "=&r" (v) |
40 | : "r" (0) | 37 | : "r" (0), "Ir" (CR_C) |
41 | : "cc"); | 38 | : "cc"); |
42 | } | 39 | } |
43 | 40 | ||
@@ -46,17 +43,17 @@ static inline void cpu_leave_lowpower(void) | |||
46 | unsigned int v; | 43 | unsigned int v; |
47 | 44 | ||
48 | asm volatile( "mrc p15, 0, %0, c1, c0, 0\n" | 45 | asm volatile( "mrc p15, 0, %0, c1, c0, 0\n" |
49 | " orr %0, %0, #0x04\n" | 46 | " orr %0, %0, %1\n" |
50 | " mcr p15, 0, %0, c1, c0, 0\n" | 47 | " mcr p15, 0, %0, c1, c0, 0\n" |
51 | " mrc p15, 0, %0, c1, c0, 1\n" | 48 | " mrc p15, 0, %0, c1, c0, 1\n" |
52 | " orr %0, %0, #0x20\n" | 49 | " orr %0, %0, #0x20\n" |
53 | " mcr p15, 0, %0, c1, c0, 1\n" | 50 | " mcr p15, 0, %0, c1, c0, 1\n" |
54 | : "=&r" (v) | 51 | : "=&r" (v) |
55 | : | 52 | : "Ir" (CR_C) |
56 | : "cc"); | 53 | : "cc"); |
57 | } | 54 | } |
58 | 55 | ||
59 | static inline void platform_do_lowpower(unsigned int cpu) | 56 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) |
60 | { | 57 | { |
61 | /* | 58 | /* |
62 | * there is no power-control hardware on this platform, so all | 59 | * there is no power-control hardware on this platform, so all |
@@ -80,22 +77,19 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
80 | } | 77 | } |
81 | 78 | ||
82 | /* | 79 | /* |
83 | * getting here, means that we have come out of WFI without | 80 | * Getting here, means that we have come out of WFI without |
84 | * having been woken up - this shouldn't happen | 81 | * having been woken up - this shouldn't happen |
85 | * | 82 | * |
86 | * The trouble is, letting people know about this is not really | 83 | * Just note it happening - when we're woken, we can report |
87 | * possible, since we are currently running incoherently, and | 84 | * its occurrence. |
88 | * therefore cannot safely call printk() or anything else | ||
89 | */ | 85 | */ |
90 | #ifdef DEBUG | 86 | (*spurious)++; |
91 | printk("CPU%u: spurious wakeup call\n", cpu); | ||
92 | #endif | ||
93 | } | 87 | } |
94 | } | 88 | } |
95 | 89 | ||
96 | int platform_cpu_kill(unsigned int cpu) | 90 | int platform_cpu_kill(unsigned int cpu) |
97 | { | 91 | { |
98 | return wait_for_completion_timeout(&cpu_killed, 5000); | 92 | return 1; |
99 | } | 93 | } |
100 | 94 | ||
101 | /* | 95 | /* |
@@ -105,30 +99,22 @@ int platform_cpu_kill(unsigned int cpu) | |||
105 | */ | 99 | */ |
106 | void platform_cpu_die(unsigned int cpu) | 100 | void platform_cpu_die(unsigned int cpu) |
107 | { | 101 | { |
108 | #ifdef DEBUG | 102 | int spurious = 0; |
109 | unsigned int this_cpu = hard_smp_processor_id(); | ||
110 | |||
111 | if (cpu != this_cpu) { | ||
112 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
113 | this_cpu, cpu); | ||
114 | BUG(); | ||
115 | } | ||
116 | #endif | ||
117 | |||
118 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
119 | complete(&cpu_killed); | ||
120 | 103 | ||
121 | /* | 104 | /* |
122 | * we're ready for shutdown now, so do it | 105 | * we're ready for shutdown now, so do it |
123 | */ | 106 | */ |
124 | cpu_enter_lowpower(); | 107 | cpu_enter_lowpower(); |
125 | platform_do_lowpower(cpu); | 108 | platform_do_lowpower(cpu, &spurious); |
126 | 109 | ||
127 | /* | 110 | /* |
128 | * bring this CPU back into the world of cache | 111 | * bring this CPU back into the world of cache |
129 | * coherency, and then restore interrupts | 112 | * coherency, and then restore interrupts |
130 | */ | 113 | */ |
131 | cpu_leave_lowpower(); | 114 | cpu_leave_lowpower(); |
115 | |||
116 | if (spurious) | ||
117 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
132 | } | 118 | } |
133 | 119 | ||
134 | int platform_cpu_disable(unsigned int cpu) | 120 | int platform_cpu_disable(unsigned int cpu) |
diff --git a/arch/arm/mach-realview/include/mach/entry-macro.S b/arch/arm/mach-realview/include/mach/entry-macro.S index 340a5c276946..4071164aebaa 100644 --- a/arch/arm/mach-realview/include/mach/entry-macro.S +++ b/arch/arm/mach-realview/include/mach/entry-macro.S | |||
@@ -8,74 +8,11 @@ | |||
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include <asm/hardware/gic.h> | 11 | #include <asm/hardware/entry-macro-gic.S> |
12 | 12 | ||
13 | .macro disable_fiq | 13 | .macro disable_fiq |
14 | .endm | 14 | .endm |
15 | 15 | ||
16 | .macro get_irqnr_preamble, base, tmp | ||
17 | ldr \base, =gic_cpu_base_addr | ||
18 | ldr \base, [\base] | ||
19 | .endm | ||
20 | |||
21 | .macro arch_ret_to_user, tmp1, tmp2 | 16 | .macro arch_ret_to_user, tmp1, tmp2 |
22 | .endm | 17 | .endm |
23 | 18 | ||
24 | /* | ||
25 | * The interrupt numbering scheme is defined in the | ||
26 | * interrupt controller spec. To wit: | ||
27 | * | ||
28 | * Interrupts 0-15 are IPI | ||
29 | * 16-28 are reserved | ||
30 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
31 | * 32-1020 are global | ||
32 | * 1021-1022 are reserved | ||
33 | * 1023 is "spurious" (no interrupt) | ||
34 | * | ||
35 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
36 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
37 | * | ||
38 | * A simple read from the controller will tell us the number of the highest | ||
39 | * priority enabled interrupt. We then just need to check whether it is in the | ||
40 | * valid range for an IRQ (30-1020 inclusive). | ||
41 | */ | ||
42 | |||
43 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
44 | |||
45 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ | ||
46 | |||
47 | ldr \tmp, =1021 | ||
48 | |||
49 | bic \irqnr, \irqstat, #0x1c00 | ||
50 | |||
51 | cmp \irqnr, #29 | ||
52 | cmpcc \irqnr, \irqnr | ||
53 | cmpne \irqnr, \tmp | ||
54 | cmpcs \irqnr, \irqnr | ||
55 | |||
56 | .endm | ||
57 | |||
58 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
59 | * register) is preserved from the macro above. | ||
60 | * If there is an IPI, we immediately signal end of interrupt on the | ||
61 | * controller, since this requires the original irqstat value which | ||
62 | * we won't easily be able to recreate later. | ||
63 | */ | ||
64 | |||
65 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
66 | bic \irqnr, \irqstat, #0x1c00 | ||
67 | cmp \irqnr, #16 | ||
68 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
69 | cmpcs \irqnr, \irqnr | ||
70 | .endm | ||
71 | |||
72 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
73 | |||
74 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
75 | bic \irqnr, \irqstat, #0x1c00 | ||
76 | mov \tmp, #0 | ||
77 | cmp \irqnr, #29 | ||
78 | moveq \tmp, #1 | ||
79 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
80 | cmp \tmp, #0 | ||
81 | .endm | ||
diff --git a/arch/arm/mach-realview/include/mach/smp.h b/arch/arm/mach-realview/include/mach/smp.h index d3cd265cb058..c8221b38ee7c 100644 --- a/arch/arm/mach-realview/include/mach/smp.h +++ b/arch/arm/mach-realview/include/mach/smp.h | |||
@@ -2,14 +2,13 @@ | |||
2 | #define ASMARM_ARCH_SMP_H | 2 | #define ASMARM_ARCH_SMP_H |
3 | 3 | ||
4 | #include <asm/hardware/gic.h> | 4 | #include <asm/hardware/gic.h> |
5 | #include <asm/smp_mpidr.h> | ||
6 | 5 | ||
7 | /* | 6 | /* |
8 | * We use IRQ1 as the IPI | 7 | * We use IRQ1 as the IPI |
9 | */ | 8 | */ |
10 | static inline void smp_cross_call(const struct cpumask *mask) | 9 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
11 | { | 10 | { |
12 | gic_raise_softirq(mask, 1); | 11 | gic_raise_softirq(mask, ipi); |
13 | } | 12 | } |
14 | 13 | ||
15 | #endif | 14 | #endif |
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index 009265818d55..a22bf67f2f78 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
21 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
22 | #include <asm/localtimer.h> | ||
23 | #include <asm/unified.h> | 22 | #include <asm/unified.h> |
24 | 23 | ||
25 | #include <mach/board-eb.h> | 24 | #include <mach/board-eb.h> |
@@ -37,6 +36,19 @@ extern void realview_secondary_startup(void); | |||
37 | */ | 36 | */ |
38 | volatile int __cpuinitdata pen_release = -1; | 37 | volatile int __cpuinitdata pen_release = -1; |
39 | 38 | ||
39 | /* | ||
40 | * Write pen_release in a way that is guaranteed to be visible to all | ||
41 | * observers, irrespective of whether they're taking part in coherency | ||
42 | * or not. This is necessary for the hotplug code to work reliably. | ||
43 | */ | ||
44 | static void write_pen_release(int val) | ||
45 | { | ||
46 | pen_release = val; | ||
47 | smp_wmb(); | ||
48 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
49 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
50 | } | ||
51 | |||
40 | static void __iomem *scu_base_addr(void) | 52 | static void __iomem *scu_base_addr(void) |
41 | { | 53 | { |
42 | if (machine_is_realview_eb_mp()) | 54 | if (machine_is_realview_eb_mp()) |
@@ -50,33 +62,22 @@ static void __iomem *scu_base_addr(void) | |||
50 | return (void __iomem *)0; | 62 | return (void __iomem *)0; |
51 | } | 63 | } |
52 | 64 | ||
53 | static inline unsigned int get_core_count(void) | ||
54 | { | ||
55 | void __iomem *scu_base = scu_base_addr(); | ||
56 | if (scu_base) | ||
57 | return scu_get_core_count(scu_base); | ||
58 | return 1; | ||
59 | } | ||
60 | |||
61 | static DEFINE_SPINLOCK(boot_lock); | 65 | static DEFINE_SPINLOCK(boot_lock); |
62 | 66 | ||
63 | void __cpuinit platform_secondary_init(unsigned int cpu) | 67 | void __cpuinit platform_secondary_init(unsigned int cpu) |
64 | { | 68 | { |
65 | trace_hardirqs_off(); | ||
66 | |||
67 | /* | 69 | /* |
68 | * if any interrupts are already enabled for the primary | 70 | * if any interrupts are already enabled for the primary |
69 | * core (e.g. timer irq), then they will not have been enabled | 71 | * core (e.g. timer irq), then they will not have been enabled |
70 | * for us: do so | 72 | * for us: do so |
71 | */ | 73 | */ |
72 | gic_cpu_init(0, gic_cpu_base_addr); | 74 | gic_secondary_init(0); |
73 | 75 | ||
74 | /* | 76 | /* |
75 | * let the primary processor know we're out of the | 77 | * let the primary processor know we're out of the |
76 | * pen, then head off into the C entry point | 78 | * pen, then head off into the C entry point |
77 | */ | 79 | */ |
78 | pen_release = -1; | 80 | write_pen_release(-1); |
79 | smp_wmb(); | ||
80 | 81 | ||
81 | /* | 82 | /* |
82 | * Synchronise with the boot thread. | 83 | * Synchronise with the boot thread. |
@@ -103,20 +104,14 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
103 | * Note that "pen_release" is the hardware CPU ID, whereas | 104 | * Note that "pen_release" is the hardware CPU ID, whereas |
104 | * "cpu" is Linux's internal ID. | 105 | * "cpu" is Linux's internal ID. |
105 | */ | 106 | */ |
106 | pen_release = cpu; | 107 | write_pen_release(cpu); |
107 | flush_cache_all(); | ||
108 | 108 | ||
109 | /* | 109 | /* |
110 | * XXX | 110 | * Send the secondary CPU a soft interrupt, thereby causing |
111 | * | 111 | * the boot monitor to read the system wide flags register, |
112 | * This is a later addition to the booting protocol: the | 112 | * and branch to the address found there. |
113 | * bootMonitor now puts secondary cores into WFI, so | ||
114 | * poke_milo() no longer gets the cores moving; we need | ||
115 | * to send a soft interrupt to wake the secondary core. | ||
116 | * Use smp_cross_call() for this, since there's little | ||
117 | * point duplicating the code here | ||
118 | */ | 113 | */ |
119 | smp_cross_call(cpumask_of(cpu)); | 114 | smp_cross_call(cpumask_of(cpu), 1); |
120 | 115 | ||
121 | timeout = jiffies + (1 * HZ); | 116 | timeout = jiffies + (1 * HZ); |
122 | while (time_before(jiffies, timeout)) { | 117 | while (time_before(jiffies, timeout)) { |
@@ -136,48 +131,18 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
136 | return pen_release != -1 ? -ENOSYS : 0; | 131 | return pen_release != -1 ? -ENOSYS : 0; |
137 | } | 132 | } |
138 | 133 | ||
139 | static void __init poke_milo(void) | ||
140 | { | ||
141 | /* nobody is to be released from the pen yet */ | ||
142 | pen_release = -1; | ||
143 | |||
144 | /* | ||
145 | * Write the address of secondary startup into the system-wide flags | ||
146 | * register. The BootMonitor waits for this register to become | ||
147 | * non-zero. | ||
148 | */ | ||
149 | __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), | ||
150 | __io_address(REALVIEW_SYS_FLAGSSET)); | ||
151 | |||
152 | mb(); | ||
153 | } | ||
154 | |||
155 | /* | 134 | /* |
156 | * Initialise the CPU possible map early - this describes the CPUs | 135 | * Initialise the CPU possible map early - this describes the CPUs |
157 | * which may be present or become present in the system. | 136 | * which may be present or become present in the system. |
158 | */ | 137 | */ |
159 | void __init smp_init_cpus(void) | 138 | void __init smp_init_cpus(void) |
160 | { | 139 | { |
161 | unsigned int i, ncores = get_core_count(); | 140 | void __iomem *scu_base = scu_base_addr(); |
141 | unsigned int i, ncores; | ||
162 | 142 | ||
163 | for (i = 0; i < ncores; i++) | 143 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; |
164 | set_cpu_possible(i, true); | ||
165 | } | ||
166 | |||
167 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
168 | { | ||
169 | unsigned int ncores = get_core_count(); | ||
170 | unsigned int cpu = smp_processor_id(); | ||
171 | int i; | ||
172 | 144 | ||
173 | /* sanity check */ | 145 | /* sanity check */ |
174 | if (ncores == 0) { | ||
175 | printk(KERN_ERR | ||
176 | "Realview: strange CM count of 0? Default to 1\n"); | ||
177 | |||
178 | ncores = 1; | ||
179 | } | ||
180 | |||
181 | if (ncores > NR_CPUS) { | 146 | if (ncores > NR_CPUS) { |
182 | printk(KERN_WARNING | 147 | printk(KERN_WARNING |
183 | "Realview: no. of cores (%d) greater than configured " | 148 | "Realview: no. of cores (%d) greater than configured " |
@@ -186,13 +151,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
186 | ncores = NR_CPUS; | 151 | ncores = NR_CPUS; |
187 | } | 152 | } |
188 | 153 | ||
189 | smp_store_cpu_info(cpu); | 154 | for (i = 0; i < ncores; i++) |
155 | set_cpu_possible(i, true); | ||
156 | } | ||
190 | 157 | ||
191 | /* | 158 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
192 | * are we trying to boot more cores than exist? | 159 | { |
193 | */ | 160 | int i; |
194 | if (max_cpus > ncores) | ||
195 | max_cpus = ncores; | ||
196 | 161 | ||
197 | /* | 162 | /* |
198 | * Initialise the present map, which describes the set of CPUs | 163 | * Initialise the present map, which describes the set of CPUs |
@@ -201,21 +166,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
201 | for (i = 0; i < max_cpus; i++) | 166 | for (i = 0; i < max_cpus; i++) |
202 | set_cpu_present(i, true); | 167 | set_cpu_present(i, true); |
203 | 168 | ||
169 | scu_enable(scu_base_addr()); | ||
170 | |||
204 | /* | 171 | /* |
205 | * Initialise the SCU if there are more than one CPU and let | 172 | * Write the address of secondary startup into the |
206 | * them know where to start. Note that, on modern versions of | 173 | * system-wide flags register. The BootMonitor waits |
207 | * MILO, the "poke" doesn't actually do anything until each | 174 | * until it receives a soft interrupt, and then the |
208 | * individual core is sent a soft interrupt to get it out of | 175 | * secondary CPU branches to this address. |
209 | * WFI | ||
210 | */ | 176 | */ |
211 | if (max_cpus > 1) { | 177 | __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), |
212 | /* | 178 | __io_address(REALVIEW_SYS_FLAGSSET)); |
213 | * Enable the local timer or broadcast device for the | ||
214 | * boot CPU, but only if we have more than one CPU. | ||
215 | */ | ||
216 | percpu_timer_setup(); | ||
217 | |||
218 | scu_enable(scu_base_addr()); | ||
219 | poke_milo(); | ||
220 | } | ||
221 | } | 179 | } |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index f2697106f809..6ef5c5e528b2 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -364,21 +364,19 @@ static void __init gic_init_irq(void) | |||
364 | writel(0x00000000, __io_address(REALVIEW_SYS_LOCK)); | 364 | writel(0x00000000, __io_address(REALVIEW_SYS_LOCK)); |
365 | 365 | ||
366 | /* core tile GIC, primary */ | 366 | /* core tile GIC, primary */ |
367 | gic_cpu_base_addr = __io_address(REALVIEW_EB11MP_GIC_CPU_BASE); | 367 | gic_init(0, 29, __io_address(REALVIEW_EB11MP_GIC_DIST_BASE), |
368 | gic_dist_init(0, __io_address(REALVIEW_EB11MP_GIC_DIST_BASE), 29); | 368 | __io_address(REALVIEW_EB11MP_GIC_CPU_BASE)); |
369 | gic_cpu_init(0, gic_cpu_base_addr); | ||
370 | 369 | ||
371 | #ifndef CONFIG_REALVIEW_EB_ARM11MP_REVB | 370 | #ifndef CONFIG_REALVIEW_EB_ARM11MP_REVB |
372 | /* board GIC, secondary */ | 371 | /* board GIC, secondary */ |
373 | gic_dist_init(1, __io_address(REALVIEW_EB_GIC_DIST_BASE), 64); | 372 | gic_init(1, 64, __io_address(REALVIEW_EB_GIC_DIST_BASE), |
374 | gic_cpu_init(1, __io_address(REALVIEW_EB_GIC_CPU_BASE)); | 373 | __io_address(REALVIEW_EB_GIC_CPU_BASE)); |
375 | gic_cascade_irq(1, IRQ_EB11MP_EB_IRQ1); | 374 | gic_cascade_irq(1, IRQ_EB11MP_EB_IRQ1); |
376 | #endif | 375 | #endif |
377 | } else { | 376 | } else { |
378 | /* board GIC, primary */ | 377 | /* board GIC, primary */ |
379 | gic_cpu_base_addr = __io_address(REALVIEW_EB_GIC_CPU_BASE); | 378 | gic_init(0, 29, __io_address(REALVIEW_EB_GIC_DIST_BASE), |
380 | gic_dist_init(0, __io_address(REALVIEW_EB_GIC_DIST_BASE), 29); | 379 | __io_address(REALVIEW_EB_GIC_CPU_BASE)); |
381 | gic_cpu_init(0, gic_cpu_base_addr); | ||
382 | } | 380 | } |
383 | } | 381 | } |
384 | 382 | ||
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index a4125619d71b..cbdc97a5685f 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -304,13 +304,14 @@ static struct platform_device char_lcd_device = { | |||
304 | static void __init gic_init_irq(void) | 304 | static void __init gic_init_irq(void) |
305 | { | 305 | { |
306 | /* ARM1176 DevChip GIC, primary */ | 306 | /* ARM1176 DevChip GIC, primary */ |
307 | gic_cpu_base_addr = __io_address(REALVIEW_DC1176_GIC_CPU_BASE); | 307 | gic_init(0, IRQ_DC1176_GIC_START, |
308 | gic_dist_init(0, __io_address(REALVIEW_DC1176_GIC_DIST_BASE), IRQ_DC1176_GIC_START); | 308 | __io_address(REALVIEW_DC1176_GIC_DIST_BASE), |
309 | gic_cpu_init(0, gic_cpu_base_addr); | 309 | __io_address(REALVIEW_DC1176_GIC_CPU_BASE)); |
310 | 310 | ||
311 | /* board GIC, secondary */ | 311 | /* board GIC, secondary */ |
312 | gic_dist_init(1, __io_address(REALVIEW_PB1176_GIC_DIST_BASE), IRQ_PB1176_GIC_START); | 312 | gic_init(1, IRQ_PB1176_GIC_START, |
313 | gic_cpu_init(1, __io_address(REALVIEW_PB1176_GIC_CPU_BASE)); | 313 | __io_address(REALVIEW_PB1176_GIC_DIST_BASE), |
314 | __io_address(REALVIEW_PB1176_GIC_CPU_BASE)); | ||
314 | gic_cascade_irq(1, IRQ_DC1176_PB_IRQ1); | 315 | gic_cascade_irq(1, IRQ_DC1176_PB_IRQ1); |
315 | } | 316 | } |
316 | 317 | ||
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 117b95b2ca15..8e8ab7d29a6a 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -309,13 +309,13 @@ static void __init gic_init_irq(void) | |||
309 | writel(0x00000000, __io_address(REALVIEW_SYS_LOCK)); | 309 | writel(0x00000000, __io_address(REALVIEW_SYS_LOCK)); |
310 | 310 | ||
311 | /* ARM11MPCore test chip GIC, primary */ | 311 | /* ARM11MPCore test chip GIC, primary */ |
312 | gic_cpu_base_addr = __io_address(REALVIEW_TC11MP_GIC_CPU_BASE); | 312 | gic_init(0, 29, __io_address(REALVIEW_TC11MP_GIC_DIST_BASE), |
313 | gic_dist_init(0, __io_address(REALVIEW_TC11MP_GIC_DIST_BASE), 29); | 313 | __io_address(REALVIEW_TC11MP_GIC_CPU_BASE)); |
314 | gic_cpu_init(0, gic_cpu_base_addr); | ||
315 | 314 | ||
316 | /* board GIC, secondary */ | 315 | /* board GIC, secondary */ |
317 | gic_dist_init(1, __io_address(REALVIEW_PB11MP_GIC_DIST_BASE), IRQ_PB11MP_GIC_START); | 316 | gic_init(1, IRQ_PB11MP_GIC_START, |
318 | gic_cpu_init(1, __io_address(REALVIEW_PB11MP_GIC_CPU_BASE)); | 317 | __io_address(REALVIEW_PB11MP_GIC_DIST_BASE), |
318 | __io_address(REALVIEW_PB11MP_GIC_CPU_BASE)); | ||
319 | gic_cascade_irq(1, IRQ_TC11MP_PB_IRQ1); | 319 | gic_cascade_irq(1, IRQ_TC11MP_PB_IRQ1); |
320 | } | 320 | } |
321 | 321 | ||
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 929b8dc12e81..841118e3e118 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -273,9 +273,9 @@ static struct platform_device pmu_device = { | |||
273 | static void __init gic_init_irq(void) | 273 | static void __init gic_init_irq(void) |
274 | { | 274 | { |
275 | /* ARM PB-A8 on-board GIC */ | 275 | /* ARM PB-A8 on-board GIC */ |
276 | gic_cpu_base_addr = __io_address(REALVIEW_PBA8_GIC_CPU_BASE); | 276 | gic_init(0, IRQ_PBA8_GIC_START, |
277 | gic_dist_init(0, __io_address(REALVIEW_PBA8_GIC_DIST_BASE), IRQ_PBA8_GIC_START); | 277 | __io_address(REALVIEW_PBA8_GIC_DIST_BASE), |
278 | gic_cpu_init(0, __io_address(REALVIEW_PBA8_GIC_CPU_BASE)); | 278 | __io_address(REALVIEW_PBA8_GIC_CPU_BASE)); |
279 | } | 279 | } |
280 | 280 | ||
281 | static void __init realview_pba8_timer_init(void) | 281 | static void __init realview_pba8_timer_init(void) |
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index b9f9e20031a7..02b755b009db 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -313,15 +313,12 @@ static void __init gic_init_irq(void) | |||
313 | { | 313 | { |
314 | /* ARM PBX on-board GIC */ | 314 | /* ARM PBX on-board GIC */ |
315 | if (core_tile_pbx11mp() || core_tile_pbxa9mp()) { | 315 | if (core_tile_pbx11mp() || core_tile_pbxa9mp()) { |
316 | gic_cpu_base_addr = __io_address(REALVIEW_PBX_TILE_GIC_CPU_BASE); | 316 | gic_init(0, 29, __io_address(REALVIEW_PBX_TILE_GIC_DIST_BASE), |
317 | gic_dist_init(0, __io_address(REALVIEW_PBX_TILE_GIC_DIST_BASE), | 317 | __io_address(REALVIEW_PBX_TILE_GIC_CPU_BASE)); |
318 | 29); | ||
319 | gic_cpu_init(0, __io_address(REALVIEW_PBX_TILE_GIC_CPU_BASE)); | ||
320 | } else { | 318 | } else { |
321 | gic_cpu_base_addr = __io_address(REALVIEW_PBX_GIC_CPU_BASE); | 319 | gic_init(0, IRQ_PBX_GIC_START, |
322 | gic_dist_init(0, __io_address(REALVIEW_PBX_GIC_DIST_BASE), | 320 | __io_address(REALVIEW_PBX_GIC_DIST_BASE), |
323 | IRQ_PBX_GIC_START); | 321 | __io_address(REALVIEW_PBX_GIC_CPU_BASE)); |
324 | gic_cpu_init(0, __io_address(REALVIEW_PBX_GIC_CPU_BASE)); | ||
325 | } | 322 | } |
326 | } | 323 | } |
327 | 324 | ||
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig index 6983cb4d4cae..e82ab4aa7ab9 100644 --- a/arch/arm/mach-s3c2412/Kconfig +++ b/arch/arm/mach-s3c2412/Kconfig | |||
@@ -59,7 +59,7 @@ config MACH_JIVE | |||
59 | Say Y here if you are using the Logitech Jive. | 59 | Say Y here if you are using the Logitech Jive. |
60 | 60 | ||
61 | config MACH_JIVE_SHOW_BOOTLOADER | 61 | config MACH_JIVE_SHOW_BOOTLOADER |
62 | bool "Allow access to bootloader partitions in MTD" | 62 | bool "Allow access to bootloader partitions in MTD (EXPERIMENTAL)" |
63 | depends on MACH_JIVE && EXPERIMENTAL | 63 | depends on MACH_JIVE && EXPERIMENTAL |
64 | 64 | ||
65 | config MACH_SMDK2413 | 65 | config MACH_SMDK2413 |
diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c index 82ce4aa6d61a..72ab289e7816 100644 --- a/arch/arm/mach-s5pv310/cpu.c +++ b/arch/arm/mach-s5pv310/cpu.c | |||
@@ -24,8 +24,6 @@ | |||
24 | 24 | ||
25 | #include <mach/regs-irq.h> | 25 | #include <mach/regs-irq.h> |
26 | 26 | ||
27 | void __iomem *gic_cpu_base_addr; | ||
28 | |||
29 | extern int combiner_init(unsigned int combiner_nr, void __iomem *base, | 27 | extern int combiner_init(unsigned int combiner_nr, void __iomem *base, |
30 | unsigned int irq_start); | 28 | unsigned int irq_start); |
31 | extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq); | 29 | extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq); |
@@ -122,9 +120,7 @@ void __init s5pv310_init_irq(void) | |||
122 | { | 120 | { |
123 | int irq; | 121 | int irq; |
124 | 122 | ||
125 | gic_cpu_base_addr = S5P_VA_GIC_CPU; | 123 | gic_init(0, IRQ_LOCALTIMER, S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); |
126 | gic_dist_init(0, S5P_VA_GIC_DIST, IRQ_LOCALTIMER); | ||
127 | gic_cpu_init(0, S5P_VA_GIC_CPU); | ||
128 | 124 | ||
129 | for (irq = 0; irq < MAX_COMBINER_NR; irq++) { | 125 | for (irq = 0; irq < MAX_COMBINER_NR; irq++) { |
130 | combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), | 126 | combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), |
diff --git a/arch/arm/mach-s5pv310/hotplug.c b/arch/arm/mach-s5pv310/hotplug.c index 03652c3605f6..afa5392d9fc0 100644 --- a/arch/arm/mach-s5pv310/hotplug.c +++ b/arch/arm/mach-s5pv310/hotplug.c | |||
@@ -13,14 +13,11 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <linux/completion.h> | ||
17 | 16 | ||
18 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
19 | 18 | ||
20 | extern volatile int pen_release; | 19 | extern volatile int pen_release; |
21 | 20 | ||
22 | static DECLARE_COMPLETION(cpu_killed); | ||
23 | |||
24 | static inline void cpu_enter_lowpower(void) | 21 | static inline void cpu_enter_lowpower(void) |
25 | { | 22 | { |
26 | unsigned int v; | 23 | unsigned int v; |
@@ -33,13 +30,13 @@ static inline void cpu_enter_lowpower(void) | |||
33 | * Turn off coherency | 30 | * Turn off coherency |
34 | */ | 31 | */ |
35 | " mrc p15, 0, %0, c1, c0, 1\n" | 32 | " mrc p15, 0, %0, c1, c0, 1\n" |
36 | " bic %0, %0, #0x20\n" | 33 | " bic %0, %0, %2\n" |
37 | " mcr p15, 0, %0, c1, c0, 1\n" | 34 | " mcr p15, 0, %0, c1, c0, 1\n" |
38 | " mrc p15, 0, %0, c1, c0, 0\n" | 35 | " mrc p15, 0, %0, c1, c0, 0\n" |
39 | " bic %0, %0, #0x04\n" | 36 | " bic %0, %0, #0x04\n" |
40 | " mcr p15, 0, %0, c1, c0, 0\n" | 37 | " mcr p15, 0, %0, c1, c0, 0\n" |
41 | : "=&r" (v) | 38 | : "=&r" (v) |
42 | : "r" (0) | 39 | : "r" (0), "Ir" (CR_C) |
43 | : "cc"); | 40 | : "cc"); |
44 | } | 41 | } |
45 | 42 | ||
@@ -49,17 +46,17 @@ static inline void cpu_leave_lowpower(void) | |||
49 | 46 | ||
50 | asm volatile( | 47 | asm volatile( |
51 | "mrc p15, 0, %0, c1, c0, 0\n" | 48 | "mrc p15, 0, %0, c1, c0, 0\n" |
52 | " orr %0, %0, #0x04\n" | 49 | " orr %0, %0, %1\n" |
53 | " mcr p15, 0, %0, c1, c0, 0\n" | 50 | " mcr p15, 0, %0, c1, c0, 0\n" |
54 | " mrc p15, 0, %0, c1, c0, 1\n" | 51 | " mrc p15, 0, %0, c1, c0, 1\n" |
55 | " orr %0, %0, #0x20\n" | 52 | " orr %0, %0, #0x20\n" |
56 | " mcr p15, 0, %0, c1, c0, 1\n" | 53 | " mcr p15, 0, %0, c1, c0, 1\n" |
57 | : "=&r" (v) | 54 | : "=&r" (v) |
58 | : | 55 | : "Ir" (CR_C) |
59 | : "cc"); | 56 | : "cc"); |
60 | } | 57 | } |
61 | 58 | ||
62 | static inline void platform_do_lowpower(unsigned int cpu) | 59 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) |
63 | { | 60 | { |
64 | /* | 61 | /* |
65 | * there is no power-control hardware on this platform, so all | 62 | * there is no power-control hardware on this platform, so all |
@@ -83,22 +80,19 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
83 | } | 80 | } |
84 | 81 | ||
85 | /* | 82 | /* |
86 | * getting here, means that we have come out of WFI without | 83 | * Getting here, means that we have come out of WFI without |
87 | * having been woken up - this shouldn't happen | 84 | * having been woken up - this shouldn't happen |
88 | * | 85 | * |
89 | * The trouble is, letting people know about this is not really | 86 | * Just note it happening - when we're woken, we can report |
90 | * possible, since we are currently running incoherently, and | 87 | * its occurrence. |
91 | * therefore cannot safely call printk() or anything else | ||
92 | */ | 88 | */ |
93 | #ifdef DEBUG | 89 | (*spurious)++; |
94 | printk(KERN_WARN "CPU%u: spurious wakeup call\n", cpu); | ||
95 | #endif | ||
96 | } | 90 | } |
97 | } | 91 | } |
98 | 92 | ||
99 | int platform_cpu_kill(unsigned int cpu) | 93 | int platform_cpu_kill(unsigned int cpu) |
100 | { | 94 | { |
101 | return wait_for_completion_timeout(&cpu_killed, 5000); | 95 | return 1; |
102 | } | 96 | } |
103 | 97 | ||
104 | /* | 98 | /* |
@@ -108,30 +102,22 @@ int platform_cpu_kill(unsigned int cpu) | |||
108 | */ | 102 | */ |
109 | void platform_cpu_die(unsigned int cpu) | 103 | void platform_cpu_die(unsigned int cpu) |
110 | { | 104 | { |
111 | #ifdef DEBUG | 105 | int spurious = 0; |
112 | unsigned int this_cpu = hard_smp_processor_id(); | ||
113 | |||
114 | if (cpu != this_cpu) { | ||
115 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
116 | this_cpu, cpu); | ||
117 | BUG(); | ||
118 | } | ||
119 | #endif | ||
120 | |||
121 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
122 | complete(&cpu_killed); | ||
123 | 106 | ||
124 | /* | 107 | /* |
125 | * we're ready for shutdown now, so do it | 108 | * we're ready for shutdown now, so do it |
126 | */ | 109 | */ |
127 | cpu_enter_lowpower(); | 110 | cpu_enter_lowpower(); |
128 | platform_do_lowpower(cpu); | 111 | platform_do_lowpower(cpu, &spurious); |
129 | 112 | ||
130 | /* | 113 | /* |
131 | * bring this CPU back into the world of cache | 114 | * bring this CPU back into the world of cache |
132 | * coherency, and then restore interrupts | 115 | * coherency, and then restore interrupts |
133 | */ | 116 | */ |
134 | cpu_leave_lowpower(); | 117 | cpu_leave_lowpower(); |
118 | |||
119 | if (spurious) | ||
120 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
135 | } | 121 | } |
136 | 122 | ||
137 | int platform_cpu_disable(unsigned int cpu) | 123 | int platform_cpu_disable(unsigned int cpu) |
diff --git a/arch/arm/mach-s5pv310/include/mach/smp.h b/arch/arm/mach-s5pv310/include/mach/smp.h index b7ec252384f4..393ccbd52c4a 100644 --- a/arch/arm/mach-s5pv310/include/mach/smp.h +++ b/arch/arm/mach-s5pv310/include/mach/smp.h | |||
@@ -7,16 +7,13 @@ | |||
7 | #define ASM_ARCH_SMP_H __FILE__ | 7 | #define ASM_ARCH_SMP_H __FILE__ |
8 | 8 | ||
9 | #include <asm/hardware/gic.h> | 9 | #include <asm/hardware/gic.h> |
10 | #include <asm/smp_mpidr.h> | ||
11 | |||
12 | extern void __iomem *gic_cpu_base_addr; | ||
13 | 10 | ||
14 | /* | 11 | /* |
15 | * We use IRQ1 as the IPI | 12 | * We use IRQ1 as the IPI |
16 | */ | 13 | */ |
17 | static inline void smp_cross_call(const struct cpumask *mask) | 14 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
18 | { | 15 | { |
19 | gic_raise_softirq(mask, 1); | 16 | gic_raise_softirq(mask, ipi); |
20 | } | 17 | } |
21 | 18 | ||
22 | #endif | 19 | #endif |
diff --git a/arch/arm/mach-s5pv310/platsmp.c b/arch/arm/mach-s5pv310/platsmp.c index d357c198edee..34093b069f67 100644 --- a/arch/arm/mach-s5pv310/platsmp.c +++ b/arch/arm/mach-s5pv310/platsmp.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | 23 | ||
24 | #include <asm/cacheflush.h> | 24 | #include <asm/cacheflush.h> |
25 | #include <asm/localtimer.h> | ||
26 | #include <asm/smp_scu.h> | 25 | #include <asm/smp_scu.h> |
27 | #include <asm/unified.h> | 26 | #include <asm/unified.h> |
28 | 27 | ||
@@ -38,6 +37,19 @@ extern void s5pv310_secondary_startup(void); | |||
38 | 37 | ||
39 | volatile int __cpuinitdata pen_release = -1; | 38 | volatile int __cpuinitdata pen_release = -1; |
40 | 39 | ||
40 | /* | ||
41 | * Write pen_release in a way that is guaranteed to be visible to all | ||
42 | * observers, irrespective of whether they're taking part in coherency | ||
43 | * or not. This is necessary for the hotplug code to work reliably. | ||
44 | */ | ||
45 | static void write_pen_release(int val) | ||
46 | { | ||
47 | pen_release = val; | ||
48 | smp_wmb(); | ||
49 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
50 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
51 | } | ||
52 | |||
41 | static void __iomem *scu_base_addr(void) | 53 | static void __iomem *scu_base_addr(void) |
42 | { | 54 | { |
43 | return (void __iomem *)(S5P_VA_SCU); | 55 | return (void __iomem *)(S5P_VA_SCU); |
@@ -47,21 +59,18 @@ static DEFINE_SPINLOCK(boot_lock); | |||
47 | 59 | ||
48 | void __cpuinit platform_secondary_init(unsigned int cpu) | 60 | void __cpuinit platform_secondary_init(unsigned int cpu) |
49 | { | 61 | { |
50 | trace_hardirqs_off(); | ||
51 | |||
52 | /* | 62 | /* |
53 | * if any interrupts are already enabled for the primary | 63 | * if any interrupts are already enabled for the primary |
54 | * core (e.g. timer irq), then they will not have been enabled | 64 | * core (e.g. timer irq), then they will not have been enabled |
55 | * for us: do so | 65 | * for us: do so |
56 | */ | 66 | */ |
57 | gic_cpu_init(0, gic_cpu_base_addr); | 67 | gic_secondary_init(0); |
58 | 68 | ||
59 | /* | 69 | /* |
60 | * let the primary processor know we're out of the | 70 | * let the primary processor know we're out of the |
61 | * pen, then head off into the C entry point | 71 | * pen, then head off into the C entry point |
62 | */ | 72 | */ |
63 | pen_release = -1; | 73 | write_pen_release(-1); |
64 | smp_wmb(); | ||
65 | 74 | ||
66 | /* | 75 | /* |
67 | * Synchronise with the boot thread. | 76 | * Synchronise with the boot thread. |
@@ -88,16 +97,14 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
88 | * Note that "pen_release" is the hardware CPU ID, whereas | 97 | * Note that "pen_release" is the hardware CPU ID, whereas |
89 | * "cpu" is Linux's internal ID. | 98 | * "cpu" is Linux's internal ID. |
90 | */ | 99 | */ |
91 | pen_release = cpu; | 100 | write_pen_release(cpu); |
92 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
93 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
94 | 101 | ||
95 | /* | 102 | /* |
96 | * Send the secondary CPU a soft interrupt, thereby causing | 103 | * Send the secondary CPU a soft interrupt, thereby causing |
97 | * the boot monitor to read the system wide flags register, | 104 | * the boot monitor to read the system wide flags register, |
98 | * and branch to the address found there. | 105 | * and branch to the address found there. |
99 | */ | 106 | */ |
100 | smp_cross_call(cpumask_of(cpu)); | 107 | smp_cross_call(cpumask_of(cpu), 1); |
101 | 108 | ||
102 | timeout = jiffies + (1 * HZ); | 109 | timeout = jiffies + (1 * HZ); |
103 | while (time_before(jiffies, timeout)) { | 110 | while (time_before(jiffies, timeout)) { |
@@ -130,13 +137,6 @@ void __init smp_init_cpus(void) | |||
130 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; | 137 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; |
131 | 138 | ||
132 | /* sanity check */ | 139 | /* sanity check */ |
133 | if (ncores == 0) { | ||
134 | printk(KERN_ERR | ||
135 | "S5PV310: strange CM count of 0? Default to 1\n"); | ||
136 | |||
137 | ncores = 1; | ||
138 | } | ||
139 | |||
140 | if (ncores > NR_CPUS) { | 140 | if (ncores > NR_CPUS) { |
141 | printk(KERN_WARNING | 141 | printk(KERN_WARNING |
142 | "S5PV310: no. of cores (%d) greater than configured " | 142 | "S5PV310: no. of cores (%d) greater than configured " |
@@ -149,18 +149,10 @@ void __init smp_init_cpus(void) | |||
149 | set_cpu_possible(i, true); | 149 | set_cpu_possible(i, true); |
150 | } | 150 | } |
151 | 151 | ||
152 | void __init smp_prepare_cpus(unsigned int max_cpus) | 152 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
153 | { | 153 | { |
154 | unsigned int ncores = num_possible_cpus(); | ||
155 | unsigned int cpu = smp_processor_id(); | ||
156 | int i; | 154 | int i; |
157 | 155 | ||
158 | smp_store_cpu_info(cpu); | ||
159 | |||
160 | /* are we trying to boot more cores than exist? */ | ||
161 | if (max_cpus > ncores) | ||
162 | max_cpus = ncores; | ||
163 | |||
164 | /* | 156 | /* |
165 | * Initialise the present map, which describes the set of CPUs | 157 | * Initialise the present map, which describes the set of CPUs |
166 | * actually populated at the present time. | 158 | * actually populated at the present time. |
@@ -168,25 +160,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
168 | for (i = 0; i < max_cpus; i++) | 160 | for (i = 0; i < max_cpus; i++) |
169 | set_cpu_present(i, true); | 161 | set_cpu_present(i, true); |
170 | 162 | ||
163 | scu_enable(scu_base_addr()); | ||
164 | |||
171 | /* | 165 | /* |
172 | * Initialise the SCU if there are more than one CPU and let | 166 | * Write the address of secondary startup into the |
173 | * them know where to start. | 167 | * system-wide flags register. The boot monitor waits |
168 | * until it receives a soft interrupt, and then the | ||
169 | * secondary CPU branches to this address. | ||
174 | */ | 170 | */ |
175 | if (max_cpus > 1) { | ||
176 | /* | ||
177 | * Enable the local timer or broadcast device for the | ||
178 | * boot CPU, but only if we have more than one CPU. | ||
179 | */ | ||
180 | percpu_timer_setup(); | ||
181 | |||
182 | scu_enable(scu_base_addr()); | ||
183 | |||
184 | /* | ||
185 | * Write the address of secondary startup into the | ||
186 | * system-wide flags register. The boot monitor waits | ||
187 | * until it receives a soft interrupt, and then the | ||
188 | * secondary CPU branches to this address. | ||
189 | */ | ||
190 | __raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)), S5P_VA_SYSRAM); | 171 | __raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)), S5P_VA_SYSRAM); |
191 | } | ||
192 | } | 172 | } |
diff --git a/arch/arm/mach-s5pv310/time.c b/arch/arm/mach-s5pv310/time.c index 01b012ad1bfd..b262d4615331 100644 --- a/arch/arm/mach-s5pv310/time.c +++ b/arch/arm/mach-s5pv310/time.c | |||
@@ -211,7 +211,6 @@ struct clocksource pwm_clocksource = { | |||
211 | .rating = 250, | 211 | .rating = 250, |
212 | .read = s5pv310_pwm4_read, | 212 | .read = s5pv310_pwm4_read, |
213 | .mask = CLOCKSOURCE_MASK(32), | 213 | .mask = CLOCKSOURCE_MASK(32), |
214 | .shift = 20, | ||
215 | .flags = CLOCK_SOURCE_IS_CONTINUOUS , | 214 | .flags = CLOCK_SOURCE_IS_CONTINUOUS , |
216 | }; | 215 | }; |
217 | 216 | ||
@@ -230,10 +229,7 @@ static void __init s5pv310_clocksource_init(void) | |||
230 | s5pv310_pwm_init(4, ~0); | 229 | s5pv310_pwm_init(4, ~0); |
231 | s5pv310_pwm_start(4, 1); | 230 | s5pv310_pwm_start(4, 1); |
232 | 231 | ||
233 | pwm_clocksource.mult = | 232 | if (clocksource_register_hz(&pwm_clocksource, clock_rate)) |
234 | clocksource_khz2mult(clock_rate/1000, pwm_clocksource.shift); | ||
235 | |||
236 | if (clocksource_register(&pwm_clocksource)) | ||
237 | panic("%s: can't register clocksource\n", pwm_clocksource.name); | 233 | panic("%s: can't register clocksource\n", pwm_clocksource.name); |
238 | } | 234 | } |
239 | 235 | ||
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig index 5da8c35aa0de..42625e4d949a 100644 --- a/arch/arm/mach-sa1100/Kconfig +++ b/arch/arm/mach-sa1100/Kconfig | |||
@@ -118,6 +118,16 @@ config SA1100_LART | |||
118 | (also known as the LART). See <http://www.lartmaker.nl/> for | 118 | (also known as the LART). See <http://www.lartmaker.nl/> for |
119 | information on the LART. | 119 | information on the LART. |
120 | 120 | ||
121 | config SA1100_NANOENGINE | ||
122 | bool "nanoEngine" | ||
123 | select CPU_FREQ_SA1110 | ||
124 | select PCI | ||
125 | select PCI_NANOENGINE | ||
126 | help | ||
127 | Say Y here if you are using the Bright Star Engineering nanoEngine. | ||
128 | See <http://www.brightstareng.com/arm/nanoeng.htm> for information | ||
129 | on the BSE nanoEngine. | ||
130 | |||
121 | config SA1100_PLEB | 131 | config SA1100_PLEB |
122 | bool "PLEB" | 132 | bool "PLEB" |
123 | select CPU_FREQ_SA1100 | 133 | select CPU_FREQ_SA1100 |
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile index 89349c1dd7a6..e697691eed28 100644 --- a/arch/arm/mach-sa1100/Makefile +++ b/arch/arm/mach-sa1100/Makefile | |||
@@ -37,6 +37,9 @@ obj-$(CONFIG_SA1100_JORNADA720_SSP) += jornada720_ssp.o | |||
37 | obj-$(CONFIG_SA1100_LART) += lart.o | 37 | obj-$(CONFIG_SA1100_LART) += lart.o |
38 | led-$(CONFIG_SA1100_LART) += leds-lart.o | 38 | led-$(CONFIG_SA1100_LART) += leds-lart.o |
39 | 39 | ||
40 | obj-$(CONFIG_SA1100_NANOENGINE) += nanoengine.o | ||
41 | obj-$(CONFIG_PCI_NANOENGINE) += pci-nanoengine.o | ||
42 | |||
40 | obj-$(CONFIG_SA1100_PLEB) += pleb.o | 43 | obj-$(CONFIG_SA1100_PLEB) += pleb.o |
41 | 44 | ||
42 | obj-$(CONFIG_SA1100_SHANNON) += shannon.o | 45 | obj-$(CONFIG_SA1100_SHANNON) += shannon.o |
diff --git a/arch/arm/mach-sa1100/cpu-sa1100.c b/arch/arm/mach-sa1100/cpu-sa1100.c index 96f7dc103b59..07d4e8ba3719 100644 --- a/arch/arm/mach-sa1100/cpu-sa1100.c +++ b/arch/arm/mach-sa1100/cpu-sa1100.c | |||
@@ -94,48 +94,47 @@ | |||
94 | 94 | ||
95 | #include "generic.h" | 95 | #include "generic.h" |
96 | 96 | ||
97 | typedef struct { | 97 | struct sa1100_dram_regs { |
98 | int speed; | 98 | int speed; |
99 | u32 mdcnfg; | 99 | u32 mdcnfg; |
100 | u32 mdcas0; | 100 | u32 mdcas0; |
101 | u32 mdcas1; | 101 | u32 mdcas1; |
102 | u32 mdcas2; | 102 | u32 mdcas2; |
103 | } sa1100_dram_regs_t; | 103 | }; |
104 | 104 | ||
105 | 105 | ||
106 | static struct cpufreq_driver sa1100_driver; | 106 | static struct cpufreq_driver sa1100_driver; |
107 | 107 | ||
108 | static sa1100_dram_regs_t sa1100_dram_settings[] = | 108 | static struct sa1100_dram_regs sa1100_dram_settings[] = { |
109 | { | 109 | /*speed, mdcnfg, mdcas0, mdcas1, mdcas2, clock freq */ |
110 | /* speed, mdcnfg, mdcas0, mdcas1, mdcas2 clock frequency */ | 110 | { 59000, 0x00dc88a3, 0xcccccccf, 0xfffffffc, 0xffffffff},/* 59.0 MHz */ |
111 | { 59000, 0x00dc88a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 59.0 MHz */ | 111 | { 73700, 0x011490a3, 0xcccccccf, 0xfffffffc, 0xffffffff},/* 73.7 MHz */ |
112 | { 73700, 0x011490a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 73.7 MHz */ | 112 | { 88500, 0x014e90a3, 0xcccccccf, 0xfffffffc, 0xffffffff},/* 88.5 MHz */ |
113 | { 88500, 0x014e90a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 88.5 MHz */ | 113 | {103200, 0x01889923, 0xcccccccf, 0xfffffffc, 0xffffffff},/* 103.2 MHz */ |
114 | { 103200, 0x01889923, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 103.2 MHz */ | 114 | {118000, 0x01c29923, 0x9999998f, 0xfffffff9, 0xffffffff},/* 118.0 MHz */ |
115 | { 118000, 0x01c29923, 0x9999998f, 0xfffffff9, 0xffffffff }, /* 118.0 MHz */ | 115 | {132700, 0x01fb2123, 0x9999998f, 0xfffffff9, 0xffffffff},/* 132.7 MHz */ |
116 | { 132700, 0x01fb2123, 0x9999998f, 0xfffffff9, 0xffffffff }, /* 132.7 MHz */ | 116 | {147500, 0x02352123, 0x3333330f, 0xfffffff3, 0xffffffff},/* 147.5 MHz */ |
117 | { 147500, 0x02352123, 0x3333330f, 0xfffffff3, 0xffffffff }, /* 147.5 MHz */ | 117 | {162200, 0x026b29a3, 0x38e38e1f, 0xfff8e38e, 0xffffffff},/* 162.2 MHz */ |
118 | { 162200, 0x026b29a3, 0x38e38e1f, 0xfff8e38e, 0xffffffff }, /* 162.2 MHz */ | 118 | {176900, 0x02a329a3, 0x71c71c1f, 0xfff1c71c, 0xffffffff},/* 176.9 MHz */ |
119 | { 176900, 0x02a329a3, 0x71c71c1f, 0xfff1c71c, 0xffffffff }, /* 176.9 MHz */ | 119 | {191700, 0x02dd31a3, 0xe38e383f, 0xffe38e38, 0xffffffff},/* 191.7 MHz */ |
120 | { 191700, 0x02dd31a3, 0xe38e383f, 0xffe38e38, 0xffffffff }, /* 191.7 MHz */ | 120 | {206400, 0x03153223, 0xc71c703f, 0xffc71c71, 0xffffffff},/* 206.4 MHz */ |
121 | { 206400, 0x03153223, 0xc71c703f, 0xffc71c71, 0xffffffff }, /* 206.4 MHz */ | 121 | {221200, 0x034fba23, 0xc71c703f, 0xffc71c71, 0xffffffff},/* 221.2 MHz */ |
122 | { 221200, 0x034fba23, 0xc71c703f, 0xffc71c71, 0xffffffff }, /* 221.2 MHz */ | 122 | {235900, 0x03853a23, 0xe1e1e07f, 0xe1e1e1e1, 0xffffffe1},/* 235.9 MHz */ |
123 | { 235900, 0x03853a23, 0xe1e1e07f, 0xe1e1e1e1, 0xffffffe1 }, /* 235.9 MHz */ | 123 | {250700, 0x03bf3aa3, 0xc3c3c07f, 0xc3c3c3c3, 0xffffffc3},/* 250.7 MHz */ |
124 | { 250700, 0x03bf3aa3, 0xc3c3c07f, 0xc3c3c3c3, 0xffffffc3 }, /* 250.7 MHz */ | 124 | {265400, 0x03f7c2a3, 0xc3c3c07f, 0xc3c3c3c3, 0xffffffc3},/* 265.4 MHz */ |
125 | { 265400, 0x03f7c2a3, 0xc3c3c07f, 0xc3c3c3c3, 0xffffffc3 }, /* 265.4 MHz */ | 125 | {280200, 0x0431c2a3, 0x878780ff, 0x87878787, 0xffffff87},/* 280.2 MHz */ |
126 | { 280200, 0x0431c2a3, 0x878780ff, 0x87878787, 0xffffff87 }, /* 280.2 MHz */ | ||
127 | { 0, 0, 0, 0, 0 } /* last entry */ | 126 | { 0, 0, 0, 0, 0 } /* last entry */ |
128 | }; | 127 | }; |
129 | 128 | ||
130 | static void sa1100_update_dram_timings(int current_speed, int new_speed) | 129 | static void sa1100_update_dram_timings(int current_speed, int new_speed) |
131 | { | 130 | { |
132 | sa1100_dram_regs_t *settings = sa1100_dram_settings; | 131 | struct sa1100_dram_regs *settings = sa1100_dram_settings; |
133 | 132 | ||
134 | /* find speed */ | 133 | /* find speed */ |
135 | while (settings->speed != 0) { | 134 | while (settings->speed != 0) { |
136 | if(new_speed == settings->speed) | 135 | if (new_speed == settings->speed) |
137 | break; | 136 | break; |
138 | 137 | ||
139 | settings++; | 138 | settings++; |
140 | } | 139 | } |
141 | 140 | ||
@@ -149,7 +148,7 @@ static void sa1100_update_dram_timings(int current_speed, int new_speed) | |||
149 | /* We're going FASTER, so first relax the memory | 148 | /* We're going FASTER, so first relax the memory |
150 | * timings before changing the core frequency | 149 | * timings before changing the core frequency |
151 | */ | 150 | */ |
152 | 151 | ||
153 | /* Half the memory access clock */ | 152 | /* Half the memory access clock */ |
154 | MDCNFG |= MDCNFG_CDB2; | 153 | MDCNFG |= MDCNFG_CDB2; |
155 | 154 | ||
@@ -187,7 +186,7 @@ static int sa1100_target(struct cpufreq_policy *policy, | |||
187 | struct cpufreq_freqs freqs; | 186 | struct cpufreq_freqs freqs; |
188 | 187 | ||
189 | new_ppcr = sa11x0_freq_to_ppcr(target_freq); | 188 | new_ppcr = sa11x0_freq_to_ppcr(target_freq); |
190 | switch(relation){ | 189 | switch (relation) { |
191 | case CPUFREQ_RELATION_L: | 190 | case CPUFREQ_RELATION_L: |
192 | if (sa11x0_ppcr_to_freq(new_ppcr) > policy->max) | 191 | if (sa11x0_ppcr_to_freq(new_ppcr) > policy->max) |
193 | new_ppcr--; | 192 | new_ppcr--; |
diff --git a/arch/arm/mach-sa1100/cpu-sa1110.c b/arch/arm/mach-sa1100/cpu-sa1110.c index 7252874d328b..675bf8ef97e8 100644 --- a/arch/arm/mach-sa1100/cpu-sa1110.c +++ b/arch/arm/mach-sa1100/cpu-sa1110.c | |||
@@ -16,28 +16,24 @@ | |||
16 | * | 16 | * |
17 | * The SDRAM type can be passed on the command line as cpu_sa1110.sdram=type | 17 | * The SDRAM type can be passed on the command line as cpu_sa1110.sdram=type |
18 | */ | 18 | */ |
19 | #include <linux/moduleparam.h> | ||
20 | #include <linux/types.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/sched.h> | ||
23 | #include <linux/cpufreq.h> | 19 | #include <linux/cpufreq.h> |
24 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
25 | #include <linux/init.h> | 21 | #include <linux/init.h> |
26 | #include <linux/io.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/moduleparam.h> | ||
24 | #include <linux/types.h> | ||
27 | 25 | ||
28 | #include <mach/hardware.h> | ||
29 | #include <asm/cputype.h> | 26 | #include <asm/cputype.h> |
30 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
31 | #include <asm/system.h> | 28 | |
29 | #include <mach/hardware.h> | ||
32 | 30 | ||
33 | #include "generic.h" | 31 | #include "generic.h" |
34 | 32 | ||
35 | #undef DEBUG | 33 | #undef DEBUG |
36 | 34 | ||
37 | static struct cpufreq_driver sa1110_driver; | ||
38 | |||
39 | struct sdram_params { | 35 | struct sdram_params { |
40 | const char name[16]; | 36 | const char name[20]; |
41 | u_char rows; /* bits */ | 37 | u_char rows; /* bits */ |
42 | u_char cas_latency; /* cycles */ | 38 | u_char cas_latency; /* cycles */ |
43 | u_char tck; /* clock cycle time (ns) */ | 39 | u_char tck; /* clock cycle time (ns) */ |
@@ -107,6 +103,15 @@ static struct sdram_params sdram_tbl[] __initdata = { | |||
107 | .twr = 8, | 103 | .twr = 8, |
108 | .refresh = 64000, | 104 | .refresh = 64000, |
109 | .cas_latency = 3, | 105 | .cas_latency = 3, |
106 | }, { /* Micron MT48LC8M16A2TG-75 */ | ||
107 | .name = "MT48LC8M16A2TG-75", | ||
108 | .rows = 12, | ||
109 | .tck = 8, | ||
110 | .trcd = 20, | ||
111 | .trp = 20, | ||
112 | .twr = 8, | ||
113 | .refresh = 64000, | ||
114 | .cas_latency = 3, | ||
110 | }, | 115 | }, |
111 | }; | 116 | }; |
112 | 117 | ||
@@ -180,11 +185,13 @@ sdram_calculate_timing(struct sdram_info *sd, u_int cpu_khz, | |||
180 | sd->mdrefr |= MDREFR_K1DB2; | 185 | sd->mdrefr |= MDREFR_K1DB2; |
181 | 186 | ||
182 | /* initial number of '1's in MDCAS + 1 */ | 187 | /* initial number of '1's in MDCAS + 1 */ |
183 | set_mdcas(sd->mdcas, sd_khz >= 62000, ns_to_cycles(sdram->trcd, mem_khz)); | 188 | set_mdcas(sd->mdcas, sd_khz >= 62000, |
189 | ns_to_cycles(sdram->trcd, mem_khz)); | ||
184 | 190 | ||
185 | #ifdef DEBUG | 191 | #ifdef DEBUG |
186 | printk("MDCNFG: %08x MDREFR: %08x MDCAS0: %08x MDCAS1: %08x MDCAS2: %08x\n", | 192 | printk(KERN_DEBUG "MDCNFG: %08x MDREFR: %08x MDCAS0: %08x MDCAS1: %08x MDCAS2: %08x\n", |
187 | sd->mdcnfg, sd->mdrefr, sd->mdcas[0], sd->mdcas[1], sd->mdcas[2]); | 193 | sd->mdcnfg, sd->mdrefr, sd->mdcas[0], sd->mdcas[1], |
194 | sd->mdcas[2]); | ||
188 | #endif | 195 | #endif |
189 | } | 196 | } |
190 | 197 | ||
@@ -213,7 +220,7 @@ sdram_update_refresh(u_int cpu_khz, struct sdram_params *sdram) | |||
213 | 220 | ||
214 | #ifdef DEBUG | 221 | #ifdef DEBUG |
215 | mdelay(250); | 222 | mdelay(250); |
216 | printk("new dri value = %d\n", dri); | 223 | printk(KERN_DEBUG "new dri value = %d\n", dri); |
217 | #endif | 224 | #endif |
218 | 225 | ||
219 | sdram_set_refresh(dri); | 226 | sdram_set_refresh(dri); |
@@ -232,7 +239,7 @@ static int sa1110_target(struct cpufreq_policy *policy, | |||
232 | unsigned long flags; | 239 | unsigned long flags; |
233 | unsigned int ppcr, unused; | 240 | unsigned int ppcr, unused; |
234 | 241 | ||
235 | switch(relation){ | 242 | switch (relation) { |
236 | case CPUFREQ_RELATION_L: | 243 | case CPUFREQ_RELATION_L: |
237 | ppcr = sa11x0_freq_to_ppcr(target_freq); | 244 | ppcr = sa11x0_freq_to_ppcr(target_freq); |
238 | if (sa11x0_ppcr_to_freq(ppcr) > policy->max) | 245 | if (sa11x0_ppcr_to_freq(ppcr) > policy->max) |
@@ -280,11 +287,10 @@ static int sa1110_target(struct cpufreq_policy *policy, | |||
280 | * We wait 20ms to be safe. | 287 | * We wait 20ms to be safe. |
281 | */ | 288 | */ |
282 | sdram_set_refresh(2); | 289 | sdram_set_refresh(2); |
283 | if (!irqs_disabled()) { | 290 | if (!irqs_disabled()) |
284 | msleep(20); | 291 | msleep(20); |
285 | } else { | 292 | else |
286 | mdelay(20); | 293 | mdelay(20); |
287 | } | ||
288 | 294 | ||
289 | /* | 295 | /* |
290 | * Reprogram the DRAM timings with interrupts disabled, and | 296 | * Reprogram the DRAM timings with interrupts disabled, and |
@@ -295,7 +301,7 @@ static int sa1110_target(struct cpufreq_policy *policy, | |||
295 | local_irq_save(flags); | 301 | local_irq_save(flags); |
296 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)); | 302 | asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)); |
297 | udelay(10); | 303 | udelay(10); |
298 | __asm__ __volatile__(" \n\ | 304 | __asm__ __volatile__("\n\ |
299 | b 2f \n\ | 305 | b 2f \n\ |
300 | .align 5 \n\ | 306 | .align 5 \n\ |
301 | 1: str %3, [%1, #0] @ MDCNFG \n\ | 307 | 1: str %3, [%1, #0] @ MDCNFG \n\ |
@@ -336,7 +342,9 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy) | |||
336 | return 0; | 342 | return 0; |
337 | } | 343 | } |
338 | 344 | ||
339 | static struct cpufreq_driver sa1110_driver = { | 345 | /* sa1110_driver needs __refdata because it must remain after init registers |
346 | * it with cpufreq_register_driver() */ | ||
347 | static struct cpufreq_driver sa1110_driver __refdata = { | ||
340 | .flags = CPUFREQ_STICKY, | 348 | .flags = CPUFREQ_STICKY, |
341 | .verify = sa11x0_verify_speed, | 349 | .verify = sa11x0_verify_speed, |
342 | .target = sa1110_target, | 350 | .target = sa1110_target, |
@@ -349,7 +357,8 @@ static struct sdram_params *sa1110_find_sdram(const char *name) | |||
349 | { | 357 | { |
350 | struct sdram_params *sdram; | 358 | struct sdram_params *sdram; |
351 | 359 | ||
352 | for (sdram = sdram_tbl; sdram < sdram_tbl + ARRAY_SIZE(sdram_tbl); sdram++) | 360 | for (sdram = sdram_tbl; sdram < sdram_tbl + ARRAY_SIZE(sdram_tbl); |
361 | sdram++) | ||
353 | if (strcmp(name, sdram->name) == 0) | 362 | if (strcmp(name, sdram->name) == 0) |
354 | return sdram; | 363 | return sdram; |
355 | 364 | ||
@@ -369,14 +378,14 @@ static int __init sa1110_clk_init(void) | |||
369 | if (!name[0]) { | 378 | if (!name[0]) { |
370 | if (machine_is_assabet()) | 379 | if (machine_is_assabet()) |
371 | name = "TC59SM716-CL3"; | 380 | name = "TC59SM716-CL3"; |
372 | |||
373 | if (machine_is_pt_system3()) | 381 | if (machine_is_pt_system3()) |
374 | name = "K4S641632D"; | 382 | name = "K4S641632D"; |
375 | |||
376 | if (machine_is_h3100()) | 383 | if (machine_is_h3100()) |
377 | name = "KM416S4030CT"; | 384 | name = "KM416S4030CT"; |
378 | if (machine_is_jornada720()) | 385 | if (machine_is_jornada720()) |
379 | name = "K4S281632B-1H"; | 386 | name = "K4S281632B-1H"; |
387 | if (machine_is_nanoengine()) | ||
388 | name = "MT48LC8M16A2TG-75"; | ||
380 | } | 389 | } |
381 | 390 | ||
382 | sdram = sa1110_find_sdram(name); | 391 | sdram = sa1110_find_sdram(name); |
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 3c1fcd696714..59d14f0fdcf8 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c | |||
@@ -16,9 +16,7 @@ | |||
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/cpufreq.h> | 17 | #include <linux/cpufreq.h> |
18 | #include <linux/ioport.h> | 18 | #include <linux/ioport.h> |
19 | #include <linux/sched.h> /* just for sched_clock() - funny that */ | ||
20 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
21 | #include <linux/cnt32_to_63.h> | ||
22 | 20 | ||
23 | #include <asm/div64.h> | 21 | #include <asm/div64.h> |
24 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
@@ -110,27 +108,6 @@ unsigned int sa11x0_getspeed(unsigned int cpu) | |||
110 | } | 108 | } |
111 | 109 | ||
112 | /* | 110 | /* |
113 | * This is the SA11x0 sched_clock implementation. This has | ||
114 | * a resolution of 271ns, and a maximum value of 32025597s (370 days). | ||
115 | * | ||
116 | * The return value is guaranteed to be monotonic in that range as | ||
117 | * long as there is always less than 582 seconds between successive | ||
118 | * calls to this function. | ||
119 | * | ||
120 | * ( * 1E9 / 3686400 => * 78125 / 288) | ||
121 | */ | ||
122 | unsigned long long sched_clock(void) | ||
123 | { | ||
124 | unsigned long long v = cnt32_to_63(OSCR); | ||
125 | |||
126 | /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */ | ||
127 | v *= 78125<<1; | ||
128 | do_div(v, 288<<1); | ||
129 | |||
130 | return v; | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * Default power-off for SA1100 | 111 | * Default power-off for SA1100 |
135 | */ | 112 | */ |
136 | static void sa1100_power_off(void) | 113 | static void sa1100_power_off(void) |
@@ -163,10 +140,15 @@ static void sa11x0_register_device(struct platform_device *dev, void *data) | |||
163 | 140 | ||
164 | static struct resource sa11x0udc_resources[] = { | 141 | static struct resource sa11x0udc_resources[] = { |
165 | [0] = { | 142 | [0] = { |
166 | .start = 0x80000000, | 143 | .start = __PREG(Ser0UDCCR), |
167 | .end = 0x8000ffff, | 144 | .end = __PREG(Ser0UDCCR) + 0xffff, |
168 | .flags = IORESOURCE_MEM, | 145 | .flags = IORESOURCE_MEM, |
169 | }, | 146 | }, |
147 | [1] = { | ||
148 | .start = IRQ_Ser0UDC, | ||
149 | .end = IRQ_Ser0UDC, | ||
150 | .flags = IORESOURCE_IRQ, | ||
151 | }, | ||
170 | }; | 152 | }; |
171 | 153 | ||
172 | static u64 sa11x0udc_dma_mask = 0xffffffffUL; | 154 | static u64 sa11x0udc_dma_mask = 0xffffffffUL; |
@@ -184,10 +166,15 @@ static struct platform_device sa11x0udc_device = { | |||
184 | 166 | ||
185 | static struct resource sa11x0uart1_resources[] = { | 167 | static struct resource sa11x0uart1_resources[] = { |
186 | [0] = { | 168 | [0] = { |
187 | .start = 0x80010000, | 169 | .start = __PREG(Ser1UTCR0), |
188 | .end = 0x8001ffff, | 170 | .end = __PREG(Ser1UTCR0) + 0xffff, |
189 | .flags = IORESOURCE_MEM, | 171 | .flags = IORESOURCE_MEM, |
190 | }, | 172 | }, |
173 | [1] = { | ||
174 | .start = IRQ_Ser1UART, | ||
175 | .end = IRQ_Ser1UART, | ||
176 | .flags = IORESOURCE_IRQ, | ||
177 | }, | ||
191 | }; | 178 | }; |
192 | 179 | ||
193 | static struct platform_device sa11x0uart1_device = { | 180 | static struct platform_device sa11x0uart1_device = { |
@@ -199,10 +186,15 @@ static struct platform_device sa11x0uart1_device = { | |||
199 | 186 | ||
200 | static struct resource sa11x0uart3_resources[] = { | 187 | static struct resource sa11x0uart3_resources[] = { |
201 | [0] = { | 188 | [0] = { |
202 | .start = 0x80050000, | 189 | .start = __PREG(Ser3UTCR0), |
203 | .end = 0x8005ffff, | 190 | .end = __PREG(Ser3UTCR0) + 0xffff, |
204 | .flags = IORESOURCE_MEM, | 191 | .flags = IORESOURCE_MEM, |
205 | }, | 192 | }, |
193 | [1] = { | ||
194 | .start = IRQ_Ser3UART, | ||
195 | .end = IRQ_Ser3UART, | ||
196 | .flags = IORESOURCE_IRQ, | ||
197 | }, | ||
206 | }; | 198 | }; |
207 | 199 | ||
208 | static struct platform_device sa11x0uart3_device = { | 200 | static struct platform_device sa11x0uart3_device = { |
@@ -214,10 +206,15 @@ static struct platform_device sa11x0uart3_device = { | |||
214 | 206 | ||
215 | static struct resource sa11x0mcp_resources[] = { | 207 | static struct resource sa11x0mcp_resources[] = { |
216 | [0] = { | 208 | [0] = { |
217 | .start = 0x80060000, | 209 | .start = __PREG(Ser4MCCR0), |
218 | .end = 0x8006ffff, | 210 | .end = __PREG(Ser4MCCR0) + 0xffff, |
219 | .flags = IORESOURCE_MEM, | 211 | .flags = IORESOURCE_MEM, |
220 | }, | 212 | }, |
213 | [1] = { | ||
214 | .start = IRQ_Ser4MCP, | ||
215 | .end = IRQ_Ser4MCP, | ||
216 | .flags = IORESOURCE_IRQ, | ||
217 | }, | ||
221 | }; | 218 | }; |
222 | 219 | ||
223 | static u64 sa11x0mcp_dma_mask = 0xffffffffUL; | 220 | static u64 sa11x0mcp_dma_mask = 0xffffffffUL; |
@@ -244,6 +241,11 @@ static struct resource sa11x0ssp_resources[] = { | |||
244 | .end = 0x8007ffff, | 241 | .end = 0x8007ffff, |
245 | .flags = IORESOURCE_MEM, | 242 | .flags = IORESOURCE_MEM, |
246 | }, | 243 | }, |
244 | [1] = { | ||
245 | .start = IRQ_Ser4SSP, | ||
246 | .end = IRQ_Ser4SSP, | ||
247 | .flags = IORESOURCE_IRQ, | ||
248 | }, | ||
247 | }; | 249 | }; |
248 | 250 | ||
249 | static u64 sa11x0ssp_dma_mask = 0xffffffffUL; | 251 | static u64 sa11x0ssp_dma_mask = 0xffffffffUL; |
diff --git a/arch/arm/mach-sa1100/include/mach/hardware.h b/arch/arm/mach-sa1100/include/mach/hardware.h index 99f5856d8de4..967ae7684390 100644 --- a/arch/arm/mach-sa1100/include/mach/hardware.h +++ b/arch/arm/mach-sa1100/include/mach/hardware.h | |||
@@ -76,4 +76,12 @@ static inline unsigned long get_clock_tick_rate(void) | |||
76 | #include "SA-1101.h" | 76 | #include "SA-1101.h" |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #if defined(CONFIG_ARCH_SA1100) && defined(CONFIG_PCI) | ||
80 | #define PCIBIOS_MIN_IO 0 | ||
81 | #define PCIBIOS_MIN_MEM 0 | ||
82 | #define pcibios_assign_all_busses() 1 | ||
83 | #define HAVE_ARCH_PCI_SET_DMA_MASK 1 | ||
84 | #endif | ||
85 | |||
86 | |||
79 | #endif /* _ASM_ARCH_HARDWARE_H */ | 87 | #endif /* _ASM_ARCH_HARDWARE_H */ |
diff --git a/arch/arm/mach-sa1100/include/mach/nanoengine.h b/arch/arm/mach-sa1100/include/mach/nanoengine.h new file mode 100644 index 000000000000..14f8382d0665 --- /dev/null +++ b/arch/arm/mach-sa1100/include/mach/nanoengine.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-sa1100/include/mach/nanoengine.h | ||
3 | * | ||
4 | * This file contains the hardware specific definitions for nanoEngine. | ||
5 | * Only include this file from SA1100-specific files. | ||
6 | * | ||
7 | * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | */ | ||
14 | #ifndef __ASM_ARCH_NANOENGINE_H | ||
15 | #define __ASM_ARCH_NANOENGINE_H | ||
16 | |||
17 | #include <mach/irqs.h> | ||
18 | |||
19 | #define GPIO_PC_READY0 GPIO_GPIO(11) /* ready for socket 0 (active high)*/ | ||
20 | #define GPIO_PC_READY1 GPIO_GPIO(12) /* ready for socket 1 (active high) */ | ||
21 | #define GPIO_PC_CD0 GPIO_GPIO(13) /* detect for socket 0 (active low) */ | ||
22 | #define GPIO_PC_CD1 GPIO_GPIO(14) /* detect for socket 1 (active low) */ | ||
23 | #define GPIO_PC_RESET0 GPIO_GPIO(15) /* reset socket 0 */ | ||
24 | #define GPIO_PC_RESET1 GPIO_GPIO(16) /* reset socket 1 */ | ||
25 | |||
26 | #define NANOENGINE_IRQ_GPIO_PCI IRQ_GPIO0 | ||
27 | #define NANOENGINE_IRQ_GPIO_PC_READY0 IRQ_GPIO11 | ||
28 | #define NANOENGINE_IRQ_GPIO_PC_READY1 IRQ_GPIO12 | ||
29 | #define NANOENGINE_IRQ_GPIO_PC_CD0 IRQ_GPIO13 | ||
30 | #define NANOENGINE_IRQ_GPIO_PC_CD1 IRQ_GPIO14 | ||
31 | |||
32 | /* | ||
33 | * nanoEngine Memory Map: | ||
34 | * | ||
35 | * 0000.0000 - 003F.0000 - 4 MB Flash | ||
36 | * C000.0000 - C1FF.FFFF - 32 MB SDRAM | ||
37 | * 1860.0000 - 186F.FFFF - 1 MB Internal PCI Memory Read/Write | ||
38 | * 18A1.0000 - 18A1.FFFF - 64 KB Internal PCI Config Space | ||
39 | * 4000.0000 - 47FF.FFFF - 128 MB External Bus I/O - Multiplexed Mode | ||
40 | * 4800.0000 - 4FFF.FFFF - 128 MB External Bus I/O - Non-Multiplexed Mode | ||
41 | * | ||
42 | */ | ||
43 | |||
44 | #define NANO_PCI_MEM_RW_PHYS 0x18600000 | ||
45 | #define NANO_PCI_MEM_RW_VIRT 0xf1000000 | ||
46 | #define NANO_PCI_MEM_RW_SIZE SZ_1M | ||
47 | #define NANO_PCI_CONFIG_SPACE_PHYS 0x18A10000 | ||
48 | #define NANO_PCI_CONFIG_SPACE_VIRT 0xf2000000 | ||
49 | #define NANO_PCI_CONFIG_SPACE_SIZE SZ_64K | ||
50 | |||
51 | #endif | ||
52 | |||
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c new file mode 100644 index 000000000000..72087f0658b7 --- /dev/null +++ b/arch/arm/mach-sa1100/nanoengine.c | |||
@@ -0,0 +1,119 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-sa1100/nanoengine.c | ||
3 | * | ||
4 | * Bright Star Engineering's nanoEngine board init code. | ||
5 | * | ||
6 | * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/mtd/mtd.h> | ||
17 | #include <linux/mtd/partitions.h> | ||
18 | #include <linux/root_dev.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/setup.h> | ||
22 | |||
23 | #include <asm/mach/arch.h> | ||
24 | #include <asm/mach/flash.h> | ||
25 | #include <asm/mach/map.h> | ||
26 | #include <asm/mach/serial_sa1100.h> | ||
27 | |||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/nanoengine.h> | ||
30 | |||
31 | #include "generic.h" | ||
32 | |||
33 | /* Flash bank 0 */ | ||
34 | static struct mtd_partition nanoengine_partitions[] = { | ||
35 | { | ||
36 | .name = "nanoEngine boot firmware and parameter table", | ||
37 | .size = 0x00010000, /* 32K */ | ||
38 | .offset = 0, | ||
39 | .mask_flags = MTD_WRITEABLE, | ||
40 | }, { | ||
41 | .name = "kernel/initrd reserved", | ||
42 | .size = 0x002f0000, | ||
43 | .offset = 0x00010000, | ||
44 | .mask_flags = MTD_WRITEABLE, | ||
45 | }, { | ||
46 | .name = "experimental filesystem allocation", | ||
47 | .size = 0x00100000, | ||
48 | .offset = 0x00300000, | ||
49 | .mask_flags = MTD_WRITEABLE, | ||
50 | } | ||
51 | }; | ||
52 | |||
53 | static struct flash_platform_data nanoengine_flash_data = { | ||
54 | .map_name = "jedec_probe", | ||
55 | .parts = nanoengine_partitions, | ||
56 | .nr_parts = ARRAY_SIZE(nanoengine_partitions), | ||
57 | }; | ||
58 | |||
59 | static struct resource nanoengine_flash_resources[] = { | ||
60 | { | ||
61 | .start = SA1100_CS0_PHYS, | ||
62 | .end = SA1100_CS0_PHYS + SZ_32M - 1, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | }, { | ||
65 | .start = SA1100_CS1_PHYS, | ||
66 | .end = SA1100_CS1_PHYS + SZ_32M - 1, | ||
67 | .flags = IORESOURCE_MEM, | ||
68 | } | ||
69 | }; | ||
70 | |||
71 | static struct map_desc nanoengine_io_desc[] __initdata = { | ||
72 | { | ||
73 | /* System Registers */ | ||
74 | .virtual = 0xf0000000, | ||
75 | .pfn = __phys_to_pfn(0x10000000), | ||
76 | .length = 0x00100000, | ||
77 | .type = MT_DEVICE | ||
78 | }, { | ||
79 | /* Internal PCI Memory Read/Write */ | ||
80 | .virtual = NANO_PCI_MEM_RW_VIRT, | ||
81 | .pfn = __phys_to_pfn(NANO_PCI_MEM_RW_PHYS), | ||
82 | .length = NANO_PCI_MEM_RW_SIZE, | ||
83 | .type = MT_DEVICE | ||
84 | }, { | ||
85 | /* Internal PCI Config Space */ | ||
86 | .virtual = NANO_PCI_CONFIG_SPACE_VIRT, | ||
87 | .pfn = __phys_to_pfn(NANO_PCI_CONFIG_SPACE_PHYS), | ||
88 | .length = NANO_PCI_CONFIG_SPACE_SIZE, | ||
89 | .type = MT_DEVICE | ||
90 | } | ||
91 | }; | ||
92 | |||
93 | static void __init nanoengine_map_io(void) | ||
94 | { | ||
95 | sa1100_map_io(); | ||
96 | iotable_init(nanoengine_io_desc, ARRAY_SIZE(nanoengine_io_desc)); | ||
97 | |||
98 | sa1100_register_uart(0, 1); | ||
99 | sa1100_register_uart(1, 2); | ||
100 | sa1100_register_uart(2, 3); | ||
101 | Ser1SDCR0 |= SDCR0_UART; | ||
102 | /* disable IRDA -- UART2 is used as a normal serial port */ | ||
103 | Ser2UTCR4 = 0; | ||
104 | Ser2HSCR0 = 0; | ||
105 | } | ||
106 | |||
107 | static void __init nanoengine_init(void) | ||
108 | { | ||
109 | sa11x0_register_mtd(&nanoengine_flash_data, nanoengine_flash_resources, | ||
110 | ARRAY_SIZE(nanoengine_flash_resources)); | ||
111 | } | ||
112 | |||
113 | MACHINE_START(NANOENGINE, "BSE nanoEngine") | ||
114 | .boot_params = 0xc0000000, | ||
115 | .map_io = nanoengine_map_io, | ||
116 | .init_irq = sa1100_init_irq, | ||
117 | .timer = &sa1100_timer, | ||
118 | .init_machine = nanoengine_init, | ||
119 | MACHINE_END | ||
diff --git a/arch/arm/mach-sa1100/pci-nanoengine.c b/arch/arm/mach-sa1100/pci-nanoengine.c new file mode 100644 index 000000000000..fba7a913f12b --- /dev/null +++ b/arch/arm/mach-sa1100/pci-nanoengine.c | |||
@@ -0,0 +1,284 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-sa1100/pci-nanoengine.c | ||
3 | * | ||
4 | * PCI functions for BSE nanoEngine PCI | ||
5 | * | ||
6 | * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/irq.h> | ||
24 | #include <linux/pci.h> | ||
25 | #include <linux/spinlock.h> | ||
26 | |||
27 | #include <asm/mach/pci.h> | ||
28 | #include <asm/mach-types.h> | ||
29 | |||
30 | #include <mach/nanoengine.h> | ||
31 | |||
32 | static DEFINE_SPINLOCK(nano_lock); | ||
33 | |||
34 | static int nanoengine_get_pci_address(struct pci_bus *bus, | ||
35 | unsigned int devfn, int where, unsigned long *address) | ||
36 | { | ||
37 | int ret = PCIBIOS_DEVICE_NOT_FOUND; | ||
38 | unsigned int busnr = bus->number; | ||
39 | |||
40 | *address = NANO_PCI_CONFIG_SPACE_VIRT + | ||
41 | ((bus->number << 16) | (devfn << 8) | (where & ~3)); | ||
42 | |||
43 | ret = (busnr > 255 || devfn > 255 || where > 255) ? | ||
44 | PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; | ||
45 | |||
46 | return ret; | ||
47 | } | ||
48 | |||
49 | static int nanoengine_read_config(struct pci_bus *bus, unsigned int devfn, int where, | ||
50 | int size, u32 *val) | ||
51 | { | ||
52 | int ret; | ||
53 | unsigned long address; | ||
54 | unsigned long flags; | ||
55 | u32 v; | ||
56 | |||
57 | /* nanoEngine PCI bridge does not return -1 for a non-existing | ||
58 | * device. We must fake the answer. We know that the only valid | ||
59 | * device is device zero at bus 0, which is the network chip. */ | ||
60 | if (bus->number != 0 || (devfn >> 3) != 0) { | ||
61 | v = -1; | ||
62 | nanoengine_get_pci_address(bus, devfn, where, &address); | ||
63 | goto exit_function; | ||
64 | } | ||
65 | |||
66 | spin_lock_irqsave(&nano_lock, flags); | ||
67 | |||
68 | ret = nanoengine_get_pci_address(bus, devfn, where, &address); | ||
69 | if (ret != PCIBIOS_SUCCESSFUL) | ||
70 | return ret; | ||
71 | v = __raw_readl(address); | ||
72 | |||
73 | spin_unlock_irqrestore(&nano_lock, flags); | ||
74 | |||
75 | v >>= ((where & 3) * 8); | ||
76 | v &= (unsigned long)(-1) >> ((4 - size) * 8); | ||
77 | |||
78 | exit_function: | ||
79 | *val = v; | ||
80 | return PCIBIOS_SUCCESSFUL; | ||
81 | } | ||
82 | |||
83 | static int nanoengine_write_config(struct pci_bus *bus, unsigned int devfn, int where, | ||
84 | int size, u32 val) | ||
85 | { | ||
86 | int ret; | ||
87 | unsigned long address; | ||
88 | unsigned long flags; | ||
89 | unsigned shift; | ||
90 | u32 v; | ||
91 | |||
92 | shift = (where & 3) * 8; | ||
93 | |||
94 | spin_lock_irqsave(&nano_lock, flags); | ||
95 | |||
96 | ret = nanoengine_get_pci_address(bus, devfn, where, &address); | ||
97 | if (ret != PCIBIOS_SUCCESSFUL) | ||
98 | return ret; | ||
99 | v = __raw_readl(address); | ||
100 | switch (size) { | ||
101 | case 1: | ||
102 | v &= ~(0xFF << shift); | ||
103 | v |= val << shift; | ||
104 | break; | ||
105 | case 2: | ||
106 | v &= ~(0xFFFF << shift); | ||
107 | v |= val << shift; | ||
108 | break; | ||
109 | case 4: | ||
110 | v = val; | ||
111 | break; | ||
112 | } | ||
113 | __raw_writel(v, address); | ||
114 | |||
115 | spin_unlock_irqrestore(&nano_lock, flags); | ||
116 | |||
117 | return PCIBIOS_SUCCESSFUL; | ||
118 | } | ||
119 | |||
120 | static struct pci_ops pci_nano_ops = { | ||
121 | .read = nanoengine_read_config, | ||
122 | .write = nanoengine_write_config, | ||
123 | }; | ||
124 | |||
125 | static int __init pci_nanoengine_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
126 | { | ||
127 | return NANOENGINE_IRQ_GPIO_PCI; | ||
128 | } | ||
129 | |||
130 | struct pci_bus * __init pci_nanoengine_scan_bus(int nr, struct pci_sys_data *sys) | ||
131 | { | ||
132 | return pci_scan_bus(sys->busnr, &pci_nano_ops, sys); | ||
133 | } | ||
134 | |||
135 | static struct resource pci_io_ports = { | ||
136 | .name = "PCI IO", | ||
137 | .start = 0x400, | ||
138 | .end = 0x7FF, | ||
139 | .flags = IORESOURCE_IO, | ||
140 | }; | ||
141 | |||
142 | static struct resource pci_non_prefetchable_memory = { | ||
143 | .name = "PCI non-prefetchable", | ||
144 | .start = NANO_PCI_MEM_RW_PHYS, | ||
145 | /* nanoEngine documentation says there is a 1 Megabyte window here, | ||
146 | * but PCI reports just 128 + 8 kbytes. */ | ||
147 | .end = NANO_PCI_MEM_RW_PHYS + NANO_PCI_MEM_RW_SIZE - 1, | ||
148 | /* .end = NANO_PCI_MEM_RW_PHYS + SZ_128K + SZ_8K - 1,*/ | ||
149 | .flags = IORESOURCE_MEM, | ||
150 | }; | ||
151 | |||
152 | /* | ||
153 | * nanoEngine PCI reports 1 Megabyte of prefetchable memory, but it | ||
154 | * overlaps with previously defined memory. | ||
155 | * | ||
156 | * Here is what happens: | ||
157 | * | ||
158 | # dmesg | ||
159 | ... | ||
160 | pci 0000:00:00.0: [8086:1209] type 0 class 0x000200 | ||
161 | pci 0000:00:00.0: reg 10: [mem 0x00021000-0x00021fff] | ||
162 | pci 0000:00:00.0: reg 14: [io 0x0000-0x003f] | ||
163 | pci 0000:00:00.0: reg 18: [mem 0x00000000-0x0001ffff] | ||
164 | pci 0000:00:00.0: reg 30: [mem 0x00000000-0x000fffff pref] | ||
165 | pci 0000:00:00.0: supports D1 D2 | ||
166 | pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot | ||
167 | pci 0000:00:00.0: PME# disabled | ||
168 | PCI: bus0: Fast back to back transfers enabled | ||
169 | pci 0000:00:00.0: BAR 6: can't assign mem pref (size 0x100000) | ||
170 | pci 0000:00:00.0: BAR 2: assigned [mem 0x18600000-0x1861ffff] | ||
171 | pci 0000:00:00.0: BAR 2: set to [mem 0x18600000-0x1861ffff] (PCI address [0x0-0x1ffff]) | ||
172 | pci 0000:00:00.0: BAR 0: assigned [mem 0x18620000-0x18620fff] | ||
173 | pci 0000:00:00.0: BAR 0: set to [mem 0x18620000-0x18620fff] (PCI address [0x20000-0x20fff]) | ||
174 | pci 0000:00:00.0: BAR 1: assigned [io 0x0400-0x043f] | ||
175 | pci 0000:00:00.0: BAR 1: set to [io 0x0400-0x043f] (PCI address [0x0-0x3f]) | ||
176 | * | ||
177 | * On the other hand, if we do not request the prefetchable memory resource, | ||
178 | * linux will alloc it first and the two non-prefetchable memory areas that | ||
179 | * are our real interest will not be mapped. So we choose to map it to an | ||
180 | * unused area. It gets recognized as expansion ROM, but becomes disabled. | ||
181 | * | ||
182 | * Here is what happens then: | ||
183 | * | ||
184 | # dmesg | ||
185 | ... | ||
186 | pci 0000:00:00.0: [8086:1209] type 0 class 0x000200 | ||
187 | pci 0000:00:00.0: reg 10: [mem 0x00021000-0x00021fff] | ||
188 | pci 0000:00:00.0: reg 14: [io 0x0000-0x003f] | ||
189 | pci 0000:00:00.0: reg 18: [mem 0x00000000-0x0001ffff] | ||
190 | pci 0000:00:00.0: reg 30: [mem 0x00000000-0x000fffff pref] | ||
191 | pci 0000:00:00.0: supports D1 D2 | ||
192 | pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot | ||
193 | pci 0000:00:00.0: PME# disabled | ||
194 | PCI: bus0: Fast back to back transfers enabled | ||
195 | pci 0000:00:00.0: BAR 6: assigned [mem 0x78000000-0x780fffff pref] | ||
196 | pci 0000:00:00.0: BAR 2: assigned [mem 0x18600000-0x1861ffff] | ||
197 | pci 0000:00:00.0: BAR 2: set to [mem 0x18600000-0x1861ffff] (PCI address [0x0-0x1ffff]) | ||
198 | pci 0000:00:00.0: BAR 0: assigned [mem 0x18620000-0x18620fff] | ||
199 | pci 0000:00:00.0: BAR 0: set to [mem 0x18620000-0x18620fff] (PCI address [0x20000-0x20fff]) | ||
200 | pci 0000:00:00.0: BAR 1: assigned [io 0x0400-0x043f] | ||
201 | pci 0000:00:00.0: BAR 1: set to [io 0x0400-0x043f] (PCI address [0x0-0x3f]) | ||
202 | |||
203 | # lspci -vv -s 0000:00:00.0 | ||
204 | 00:00.0 Class 0200: Device 8086:1209 (rev 09) | ||
205 | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx- | ||
206 | Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR+ <PERR+ INTx- | ||
207 | Latency: 0 (2000ns min, 14000ns max), Cache Line Size: 32 bytes | ||
208 | Interrupt: pin A routed to IRQ 0 | ||
209 | Region 0: Memory at 18620000 (32-bit, non-prefetchable) [size=4K] | ||
210 | Region 1: I/O ports at 0400 [size=64] | ||
211 | Region 2: [virtual] Memory at 18600000 (32-bit, non-prefetchable) [size=128K] | ||
212 | [virtual] Expansion ROM at 78000000 [disabled] [size=1M] | ||
213 | Capabilities: [dc] Power Management version 2 | ||
214 | Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-) | ||
215 | Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=2 PME- | ||
216 | Kernel driver in use: e100 | ||
217 | Kernel modules: e100 | ||
218 | * | ||
219 | */ | ||
220 | static struct resource pci_prefetchable_memory = { | ||
221 | .name = "PCI prefetchable", | ||
222 | .start = 0x78000000, | ||
223 | .end = 0x78000000 + NANO_PCI_MEM_RW_SIZE - 1, | ||
224 | .flags = IORESOURCE_MEM | IORESOURCE_PREFETCH, | ||
225 | }; | ||
226 | |||
227 | static int __init pci_nanoengine_setup_resources(struct resource **resource) | ||
228 | { | ||
229 | if (request_resource(&ioport_resource, &pci_io_ports)) { | ||
230 | printk(KERN_ERR "PCI: unable to allocate io port region\n"); | ||
231 | return -EBUSY; | ||
232 | } | ||
233 | if (request_resource(&iomem_resource, &pci_non_prefetchable_memory)) { | ||
234 | release_resource(&pci_io_ports); | ||
235 | printk(KERN_ERR "PCI: unable to allocate non prefetchable\n"); | ||
236 | return -EBUSY; | ||
237 | } | ||
238 | if (request_resource(&iomem_resource, &pci_prefetchable_memory)) { | ||
239 | release_resource(&pci_io_ports); | ||
240 | release_resource(&pci_non_prefetchable_memory); | ||
241 | printk(KERN_ERR "PCI: unable to allocate prefetchable\n"); | ||
242 | return -EBUSY; | ||
243 | } | ||
244 | resource[0] = &pci_io_ports; | ||
245 | resource[1] = &pci_non_prefetchable_memory; | ||
246 | resource[2] = &pci_prefetchable_memory; | ||
247 | |||
248 | return 1; | ||
249 | } | ||
250 | |||
251 | int __init pci_nanoengine_setup(int nr, struct pci_sys_data *sys) | ||
252 | { | ||
253 | int ret = 0; | ||
254 | |||
255 | if (nr == 0) { | ||
256 | sys->mem_offset = NANO_PCI_MEM_RW_PHYS; | ||
257 | sys->io_offset = 0x400; | ||
258 | ret = pci_nanoengine_setup_resources(sys->resource); | ||
259 | /* Enable alternate memory bus master mode, see | ||
260 | * "Intel StrongARM SA1110 Developer's Manual", | ||
261 | * section 10.8, "Alternate Memory Bus Master Mode". */ | ||
262 | GPDR = (GPDR & ~GPIO_MBREQ) | GPIO_MBGNT; | ||
263 | GAFR |= GPIO_MBGNT | GPIO_MBREQ; | ||
264 | TUCR |= TUCR_MBGPIO; | ||
265 | } | ||
266 | |||
267 | return ret; | ||
268 | } | ||
269 | |||
270 | static struct hw_pci nanoengine_pci __initdata = { | ||
271 | .map_irq = pci_nanoengine_map_irq, | ||
272 | .nr_controllers = 1, | ||
273 | .scan = pci_nanoengine_scan_bus, | ||
274 | .setup = pci_nanoengine_setup, | ||
275 | }; | ||
276 | |||
277 | static int __init nanoengine_pci_init(void) | ||
278 | { | ||
279 | if (machine_is_nanoengine()) | ||
280 | pci_common_init(&nanoengine_pci); | ||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | subsys_initcall(nanoengine_pci_init); | ||
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c index 27692d0ffbe8..cfb76077bd25 100644 --- a/arch/arm/mach-sa1100/simpad.c +++ b/arch/arm/mach-sa1100/simpad.c | |||
@@ -166,9 +166,6 @@ static void __init simpad_map_io(void) | |||
166 | PCFR = 0; | 166 | PCFR = 0; |
167 | PSDR = 0; | 167 | PSDR = 0; |
168 | 168 | ||
169 | sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources, | ||
170 | ARRAY_SIZE(simpad_flash_resources)); | ||
171 | sa11x0_register_mcp(&simpad_mcp_data); | ||
172 | } | 169 | } |
173 | 170 | ||
174 | static void simpad_power_off(void) | 171 | static void simpad_power_off(void) |
@@ -216,6 +213,10 @@ static int __init simpad_init(void) | |||
216 | 213 | ||
217 | pm_power_off = simpad_power_off; | 214 | pm_power_off = simpad_power_off; |
218 | 215 | ||
216 | sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources, | ||
217 | ARRAY_SIZE(simpad_flash_resources)); | ||
218 | sa11x0_register_mcp(&simpad_mcp_data); | ||
219 | |||
219 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 220 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
220 | if(ret) | 221 | if(ret) |
221 | printk(KERN_WARNING "simpad: Unable to register mq200 framebuffer device"); | 222 | printk(KERN_WARNING "simpad: Unable to register mq200 framebuffer device"); |
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index 74b6e0e570b6..ae4f3d80416f 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c | |||
@@ -12,12 +12,39 @@ | |||
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
15 | #include <linux/sched.h> /* just for sched_clock() - funny that */ | ||
15 | #include <linux/timex.h> | 16 | #include <linux/timex.h> |
16 | #include <linux/clockchips.h> | 17 | #include <linux/clockchips.h> |
17 | 18 | ||
18 | #include <asm/mach/time.h> | 19 | #include <asm/mach/time.h> |
20 | #include <asm/sched_clock.h> | ||
19 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
20 | 22 | ||
23 | /* | ||
24 | * This is the SA11x0 sched_clock implementation. | ||
25 | */ | ||
26 | static DEFINE_CLOCK_DATA(cd); | ||
27 | |||
28 | /* | ||
29 | * Constants generated by clocks_calc_mult_shift(m, s, 3.6864MHz, | ||
30 | * NSEC_PER_SEC, 60). | ||
31 | * This gives a resolution of about 271ns and a wrap period of about 19min. | ||
32 | */ | ||
33 | #define SC_MULT 2275555556u | ||
34 | #define SC_SHIFT 23 | ||
35 | |||
36 | unsigned long long notrace sched_clock(void) | ||
37 | { | ||
38 | u32 cyc = OSCR; | ||
39 | return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT); | ||
40 | } | ||
41 | |||
42 | static void notrace sa1100_update_sched_clock(void) | ||
43 | { | ||
44 | u32 cyc = OSCR; | ||
45 | update_sched_clock(&cd, cyc, (u32)~0); | ||
46 | } | ||
47 | |||
21 | #define MIN_OSCR_DELTA 2 | 48 | #define MIN_OSCR_DELTA 2 |
22 | 49 | ||
23 | static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id) | 50 | static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id) |
@@ -81,7 +108,6 @@ static struct clocksource cksrc_sa1100_oscr = { | |||
81 | .rating = 200, | 108 | .rating = 200, |
82 | .read = sa1100_read_oscr, | 109 | .read = sa1100_read_oscr, |
83 | .mask = CLOCKSOURCE_MASK(32), | 110 | .mask = CLOCKSOURCE_MASK(32), |
84 | .shift = 20, | ||
85 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 111 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
86 | }; | 112 | }; |
87 | 113 | ||
@@ -97,6 +123,9 @@ static void __init sa1100_timer_init(void) | |||
97 | OIER = 0; /* disable any timer interrupts */ | 123 | OIER = 0; /* disable any timer interrupts */ |
98 | OSSR = 0xf; /* clear status on all timers */ | 124 | OSSR = 0xf; /* clear status on all timers */ |
99 | 125 | ||
126 | init_fixed_sched_clock(&cd, sa1100_update_sched_clock, 32, | ||
127 | 3686400, SC_MULT, SC_SHIFT); | ||
128 | |||
100 | ckevt_sa1100_osmr0.mult = | 129 | ckevt_sa1100_osmr0.mult = |
101 | div_sc(3686400, NSEC_PER_SEC, ckevt_sa1100_osmr0.shift); | 130 | div_sc(3686400, NSEC_PER_SEC, ckevt_sa1100_osmr0.shift); |
102 | ckevt_sa1100_osmr0.max_delta_ns = | 131 | ckevt_sa1100_osmr0.max_delta_ns = |
@@ -105,12 +134,9 @@ static void __init sa1100_timer_init(void) | |||
105 | clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1; | 134 | clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1; |
106 | ckevt_sa1100_osmr0.cpumask = cpumask_of(0); | 135 | ckevt_sa1100_osmr0.cpumask = cpumask_of(0); |
107 | 136 | ||
108 | cksrc_sa1100_oscr.mult = | ||
109 | clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift); | ||
110 | |||
111 | setup_irq(IRQ_OST0, &sa1100_timer_irq); | 137 | setup_irq(IRQ_OST0, &sa1100_timer_irq); |
112 | 138 | ||
113 | clocksource_register(&cksrc_sa1100_oscr); | 139 | clocksource_register_hz(&cksrc_sa1100_oscr, CLOCK_TICK_RATE); |
114 | clockevents_register_device(&ckevt_sa1100_osmr0); | 140 | clockevents_register_device(&ckevt_sa1100_osmr0); |
115 | } | 141 | } |
116 | 142 | ||
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 51dcd59eda6a..632933357242 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -6,7 +6,7 @@ config ARCH_SH7367 | |||
6 | bool "SH-Mobile G3 (SH7367)" | 6 | bool "SH-Mobile G3 (SH7367)" |
7 | select CPU_V6 | 7 | select CPU_V6 |
8 | select HAVE_CLK | 8 | select HAVE_CLK |
9 | select COMMON_CLKDEV | 9 | select CLKDEV_LOOKUP |
10 | select SH_CLK_CPG | 10 | select SH_CLK_CPG |
11 | select GENERIC_CLOCKEVENTS | 11 | select GENERIC_CLOCKEVENTS |
12 | 12 | ||
@@ -14,7 +14,7 @@ config ARCH_SH7377 | |||
14 | bool "SH-Mobile G4 (SH7377)" | 14 | bool "SH-Mobile G4 (SH7377)" |
15 | select CPU_V7 | 15 | select CPU_V7 |
16 | select HAVE_CLK | 16 | select HAVE_CLK |
17 | select COMMON_CLKDEV | 17 | select CLKDEV_LOOKUP |
18 | select SH_CLK_CPG | 18 | select SH_CLK_CPG |
19 | select GENERIC_CLOCKEVENTS | 19 | select GENERIC_CLOCKEVENTS |
20 | 20 | ||
@@ -22,7 +22,7 @@ config ARCH_SH7372 | |||
22 | bool "SH-Mobile AP4 (SH7372)" | 22 | bool "SH-Mobile AP4 (SH7372)" |
23 | select CPU_V7 | 23 | select CPU_V7 |
24 | select HAVE_CLK | 24 | select HAVE_CLK |
25 | select COMMON_CLKDEV | 25 | select CLKDEV_LOOKUP |
26 | select SH_CLK_CPG | 26 | select SH_CLK_CPG |
27 | select GENERIC_CLOCKEVENTS | 27 | select GENERIC_CLOCKEVENTS |
28 | 28 | ||
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index b1222dc43380..f92dbd0c06d5 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <asm/mach/arch.h> | 61 | #include <asm/mach/arch.h> |
62 | #include <asm/mach/map.h> | 62 | #include <asm/mach/map.h> |
63 | #include <asm/mach/time.h> | 63 | #include <asm/mach/time.h> |
64 | #include <asm/setup.h> | ||
64 | 65 | ||
65 | /* | 66 | /* |
66 | * Address Interface BusWidth note | 67 | * Address Interface BusWidth note |
diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c index 9f78729098f2..6b186aefcbd6 100644 --- a/arch/arm/mach-shmobile/clock-sh7367.c +++ b/arch/arm/mach-shmobile/clock-sh7367.c | |||
@@ -20,8 +20,8 @@ | |||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/sh_clk.h> | 22 | #include <linux/sh_clk.h> |
23 | #include <linux/clkdev.h> | ||
23 | #include <mach/common.h> | 24 | #include <mach/common.h> |
24 | #include <asm/clkdev.h> | ||
25 | 25 | ||
26 | /* SH7367 registers */ | 26 | /* SH7367 registers */ |
27 | #define RTFRQCR 0xe6150000 | 27 | #define RTFRQCR 0xe6150000 |
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 66663adb21f8..9aa8d68d1a9c 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
@@ -20,8 +20,8 @@ | |||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/sh_clk.h> | 22 | #include <linux/sh_clk.h> |
23 | #include <linux/clkdev.h> | ||
23 | #include <mach/common.h> | 24 | #include <mach/common.h> |
24 | #include <asm/clkdev.h> | ||
25 | 25 | ||
26 | /* SH7372 registers */ | 26 | /* SH7372 registers */ |
27 | #define FRQCRA 0xe6150000 | 27 | #define FRQCRA 0xe6150000 |
diff --git a/arch/arm/mach-shmobile/clock-sh7377.c b/arch/arm/mach-shmobile/clock-sh7377.c index f91395aeb9ab..95942466e63f 100644 --- a/arch/arm/mach-shmobile/clock-sh7377.c +++ b/arch/arm/mach-shmobile/clock-sh7377.c | |||
@@ -20,8 +20,8 @@ | |||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/sh_clk.h> | 22 | #include <linux/sh_clk.h> |
23 | #include <linux/clkdev.h> | ||
23 | #include <mach/common.h> | 24 | #include <mach/common.h> |
24 | #include <asm/clkdev.h> | ||
25 | 25 | ||
26 | /* SH7377 registers */ | 26 | /* SH7377 registers */ |
27 | #define RTFRQCR 0xe6150000 | 27 | #define RTFRQCR 0xe6150000 |
diff --git a/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt b/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt new file mode 100644 index 000000000000..e3ebfa73956e --- /dev/null +++ b/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt | |||
@@ -0,0 +1,87 @@ | |||
1 | LIST "partner-jet-setup.txt" | ||
2 | LIST "(C) Copyright 2010 Renesas Solutions Corp" | ||
3 | LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>" | ||
4 | |||
5 | LIST "RWT Setting" | ||
6 | EW 0xE6020004, 0xA500 | ||
7 | EW 0xE6030004, 0xA500 | ||
8 | |||
9 | DD 0x01001000, 0x01001000 | ||
10 | |||
11 | LIST "GPIO Setting" | ||
12 | EB 0xE6051013, 0xA2 | ||
13 | |||
14 | LIST "CPG" | ||
15 | ED 0xE6150080, 0x00000180 | ||
16 | ED 0xE61500C0, 0x00000002 | ||
17 | |||
18 | WAIT 1, 0xFE40009C | ||
19 | |||
20 | LIST "FRQCR" | ||
21 | ED 0xE6150000, 0x2D1305C3 | ||
22 | ED 0xE61500E0, 0x9E40358E | ||
23 | ED 0xE6150004, 0x80331050 | ||
24 | |||
25 | WAIT 1, 0xFE40009C | ||
26 | |||
27 | ED 0xE61500E4, 0x00002000 | ||
28 | |||
29 | WAIT 1, 0xFE40009C | ||
30 | |||
31 | LIST "PLL" | ||
32 | ED 0xE6150028, 0x00004000 | ||
33 | |||
34 | WAIT 1, 0xFE40009C | ||
35 | |||
36 | ED 0xE615002C, 0x93000040 | ||
37 | |||
38 | WAIT 1, 0xFE40009C | ||
39 | |||
40 | LIST "BSC" | ||
41 | ED 0xFEC10000, 0x00E0001B | ||
42 | |||
43 | LIST "SBSC1" | ||
44 | ED 0xFE400354, 0x01AD8000 | ||
45 | ED 0xFE400354, 0x01AD8001 | ||
46 | |||
47 | WAIT 5, 0xFE40009C | ||
48 | |||
49 | ED 0xFE400008, 0xBCC90151 | ||
50 | ED 0xFE400040, 0x41774113 | ||
51 | ED 0xFE400044, 0x2712E229 | ||
52 | ED 0xFE400048, 0x20C18505 | ||
53 | ED 0xFE40004C, 0x00110209 | ||
54 | ED 0xFE400010, 0x00000087 | ||
55 | |||
56 | WAIT 10, 0xFE40009C | ||
57 | |||
58 | ED 0xFE400084, 0x0000003F | ||
59 | EB 0xFE500000, 0x00 | ||
60 | |||
61 | WAIT 5, 0xFE40009C | ||
62 | |||
63 | ED 0xFE400084, 0x0000FF0A | ||
64 | EB 0xFE500000, 0x00 | ||
65 | |||
66 | WAIT 1, 0xFE40009C | ||
67 | |||
68 | ED 0xFE400084, 0x00002201 | ||
69 | EB 0xFE500000, 0x00 | ||
70 | ED 0xFE400084, 0x00000302 | ||
71 | EB 0xFE500000, 0x00 | ||
72 | EB 0xFE5C0000, 0x00 | ||
73 | ED 0xFE400008, 0xBCC90159 | ||
74 | ED 0xFE40008C, 0x88800004 | ||
75 | ED 0xFE400094, 0x00000004 | ||
76 | ED 0xFE400028, 0xA55A0032 | ||
77 | ED 0xFE40002C, 0xA55A000C | ||
78 | ED 0xFE400020, 0xA55A2048 | ||
79 | ED 0xFE400008, 0xBCC90959 | ||
80 | |||
81 | LIST "Change CPGA setting" | ||
82 | ED 0xE61500E0, 0x9E40352E | ||
83 | ED 0xE6150004, 0x80331050 | ||
84 | |||
85 | WAIT 1, 0xFE40009C | ||
86 | |||
87 | ED 0xE6150354, 0x00000002 | ||
diff --git a/arch/arm/mach-shmobile/include/mach/zboot.h b/arch/arm/mach-shmobile/include/mach/zboot.h new file mode 100644 index 000000000000..3ad86b7708e9 --- /dev/null +++ b/arch/arm/mach-shmobile/include/mach/zboot.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef ZBOOT_H | ||
2 | #define ZBOOT_H | ||
3 | |||
4 | #include <asm/mach-types.h> | ||
5 | #include <mach/zboot_macros.h> | ||
6 | |||
7 | /************************************************** | ||
8 | * | ||
9 | * board specific settings | ||
10 | * | ||
11 | **************************************************/ | ||
12 | |||
13 | #ifdef CONFIG_MACH_AP4EVB | ||
14 | #define MACH_TYPE MACH_TYPE_AP4EVB | ||
15 | #include "mach/head-ap4evb.txt" | ||
16 | #else | ||
17 | #error "unsupported board." | ||
18 | #endif | ||
19 | |||
20 | #endif /* ZBOOT_H */ | ||
diff --git a/arch/arm/mach-shmobile/include/mach/zboot_macros.h b/arch/arm/mach-shmobile/include/mach/zboot_macros.h new file mode 100644 index 000000000000..aa6111fbc989 --- /dev/null +++ b/arch/arm/mach-shmobile/include/mach/zboot_macros.h | |||
@@ -0,0 +1,65 @@ | |||
1 | #ifndef __ZBOOT_MACRO_H | ||
2 | #define __ZBOOT_MACRO_H | ||
3 | |||
4 | /* The LIST command is used to include comments in the script */ | ||
5 | .macro LIST comment | ||
6 | .endm | ||
7 | |||
8 | /* The ED command is used to write a 32-bit word */ | ||
9 | .macro ED, addr, data | ||
10 | LDR r0, 1f | ||
11 | LDR r1, 2f | ||
12 | STR r1, [r0] | ||
13 | B 3f | ||
14 | 1 : .long \addr | ||
15 | 2 : .long \data | ||
16 | 3 : | ||
17 | .endm | ||
18 | |||
19 | /* The EW command is used to write a 16-bit word */ | ||
20 | .macro EW, addr, data | ||
21 | LDR r0, 1f | ||
22 | LDR r1, 2f | ||
23 | STRH r1, [r0] | ||
24 | B 3f | ||
25 | 1 : .long \addr | ||
26 | 2 : .long \data | ||
27 | 3 : | ||
28 | .endm | ||
29 | |||
30 | /* The EB command is used to write an 8-bit word */ | ||
31 | .macro EB, addr, data | ||
32 | LDR r0, 1f | ||
33 | LDR r1, 2f | ||
34 | STRB r1, [r0] | ||
35 | B 3f | ||
36 | 1 : .long \addr | ||
37 | 2 : .long \data | ||
38 | 3 : | ||
39 | .endm | ||
40 | |||
41 | /* The WAIT command is used to delay the execution */ | ||
42 | .macro WAIT, time, reg | ||
43 | LDR r1, 1f | ||
44 | LDR r0, 2f | ||
45 | STR r0, [r1] | ||
46 | 10 : | ||
47 | LDR r0, [r1] | ||
48 | CMP r0, #0x00000000 | ||
49 | BNE 10b | ||
50 | NOP | ||
51 | B 3f | ||
52 | 1 : .long \reg | ||
53 | 2 : .long \time * 100 | ||
54 | 3 : | ||
55 | .endm | ||
56 | |||
57 | /* The DD command is used to read a 32-bit word */ | ||
58 | .macro DD, start, end | ||
59 | LDR r1, 1f | ||
60 | B 2f | ||
61 | 1 : .long \start | ||
62 | 2 : | ||
63 | .endm | ||
64 | |||
65 | #endif /* __ZBOOT_MACRO_H */ | ||
diff --git a/arch/arm/mach-tcc8k/clock.c b/arch/arm/mach-tcc8k/clock.c index ba32a15127ab..3970a9cdce26 100644 --- a/arch/arm/mach-tcc8k/clock.c +++ b/arch/arm/mach-tcc8k/clock.c | |||
@@ -12,8 +12,7 @@ | |||
12 | #include <linux/io.h> | 12 | #include <linux/io.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
15 | 15 | #include <linux/clkdev.h> | |
16 | #include <asm/clkdev.h> | ||
17 | 16 | ||
18 | #include <mach/clock.h> | 17 | #include <mach/clock.h> |
19 | #include <mach/irqs.h> | 18 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-tcc8k/time.c b/arch/arm/mach-tcc8k/time.c index 78d06008841d..e0a8d609afe1 100644 --- a/arch/arm/mach-tcc8k/time.c +++ b/arch/arm/mach-tcc8k/time.c | |||
@@ -35,7 +35,6 @@ static struct clocksource clocksource_tcc = { | |||
35 | .rating = 200, | 35 | .rating = 200, |
36 | .read = tcc_get_cycles, | 36 | .read = tcc_get_cycles, |
37 | .mask = CLOCKSOURCE_MASK(32), | 37 | .mask = CLOCKSOURCE_MASK(32), |
38 | .shift = 28, | ||
39 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 38 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
40 | }; | 39 | }; |
41 | 40 | ||
@@ -103,9 +102,7 @@ static int __init tcc_clockevent_init(struct clk *clock) | |||
103 | { | 102 | { |
104 | unsigned int c = clk_get_rate(clock); | 103 | unsigned int c = clk_get_rate(clock); |
105 | 104 | ||
106 | clocksource_tcc.mult = clocksource_hz2mult(c, | 105 | clocksource_register_hz(&clocksource_tcc, c); |
107 | clocksource_tcc.shift); | ||
108 | clocksource_register(&clocksource_tcc); | ||
109 | 106 | ||
110 | clockevent_tcc.mult = div_sc(c, NSEC_PER_SEC, | 107 | clockevent_tcc.mult = div_sc(c, NSEC_PER_SEC, |
111 | clockevent_tcc.shift); | 108 | clockevent_tcc.shift); |
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c index ae19f95585be..77948e0f4909 100644 --- a/arch/arm/mach-tegra/clock.c +++ b/arch/arm/mach-tegra/clock.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/seq_file.h> | 26 | #include <linux/seq_file.h> |
27 | #include <linux/regulator/consumer.h> | 27 | #include <linux/regulator/consumer.h> |
28 | #include <asm/clkdev.h> | 28 | #include <linux/clkdev.h> |
29 | 29 | ||
30 | #include "clock.h" | 30 | #include "clock.h" |
31 | #include "board.h" | 31 | #include "board.h" |
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h index 94fd859770f1..083a4cfc6cf0 100644 --- a/arch/arm/mach-tegra/clock.h +++ b/arch/arm/mach-tegra/clock.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #define __MACH_TEGRA_CLOCK_H | 21 | #define __MACH_TEGRA_CLOCK_H |
22 | 22 | ||
23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
24 | #include <asm/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | 25 | ||
26 | #define DIV_BUS (1 << 0) | 26 | #define DIV_BUS (1 << 0) |
27 | #define DIV_U71 (1 << 1) | 27 | #define DIV_U71 (1 << 1) |
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c index 8e7f115aa21e..a5cb1ce76ff2 100644 --- a/arch/arm/mach-tegra/hotplug.c +++ b/arch/arm/mach-tegra/hotplug.c | |||
@@ -11,12 +11,9 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
14 | #include <linux/completion.h> | ||
15 | 14 | ||
16 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
17 | 16 | ||
18 | static DECLARE_COMPLETION(cpu_killed); | ||
19 | |||
20 | static inline void cpu_enter_lowpower(void) | 17 | static inline void cpu_enter_lowpower(void) |
21 | { | 18 | { |
22 | unsigned int v; | 19 | unsigned int v; |
@@ -29,13 +26,13 @@ static inline void cpu_enter_lowpower(void) | |||
29 | * Turn off coherency | 26 | * Turn off coherency |
30 | */ | 27 | */ |
31 | " mrc p15, 0, %0, c1, c0, 1\n" | 28 | " mrc p15, 0, %0, c1, c0, 1\n" |
32 | " bic %0, %0, #0x20\n" | 29 | " bic %0, %0, %2\n" |
33 | " mcr p15, 0, %0, c1, c0, 1\n" | 30 | " mcr p15, 0, %0, c1, c0, 1\n" |
34 | " mrc p15, 0, %0, c1, c0, 0\n" | 31 | " mrc p15, 0, %0, c1, c0, 0\n" |
35 | " bic %0, %0, #0x04\n" | 32 | " bic %0, %0, #0x04\n" |
36 | " mcr p15, 0, %0, c1, c0, 0\n" | 33 | " mcr p15, 0, %0, c1, c0, 0\n" |
37 | : "=&r" (v) | 34 | : "=&r" (v) |
38 | : "r" (0) | 35 | : "r" (0), "Ir" (CR_C) |
39 | : "cc"); | 36 | : "cc"); |
40 | } | 37 | } |
41 | 38 | ||
@@ -45,17 +42,17 @@ static inline void cpu_leave_lowpower(void) | |||
45 | 42 | ||
46 | asm volatile( | 43 | asm volatile( |
47 | "mrc p15, 0, %0, c1, c0, 0\n" | 44 | "mrc p15, 0, %0, c1, c0, 0\n" |
48 | " orr %0, %0, #0x04\n" | 45 | " orr %0, %0, %1\n" |
49 | " mcr p15, 0, %0, c1, c0, 0\n" | 46 | " mcr p15, 0, %0, c1, c0, 0\n" |
50 | " mrc p15, 0, %0, c1, c0, 1\n" | 47 | " mrc p15, 0, %0, c1, c0, 1\n" |
51 | " orr %0, %0, #0x20\n" | 48 | " orr %0, %0, #0x20\n" |
52 | " mcr p15, 0, %0, c1, c0, 1\n" | 49 | " mcr p15, 0, %0, c1, c0, 1\n" |
53 | : "=&r" (v) | 50 | : "=&r" (v) |
54 | : | 51 | : "Ir" (CR_C) |
55 | : "cc"); | 52 | : "cc"); |
56 | } | 53 | } |
57 | 54 | ||
58 | static inline void platform_do_lowpower(unsigned int cpu) | 55 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) |
59 | { | 56 | { |
60 | /* | 57 | /* |
61 | * there is no power-control hardware on this platform, so all | 58 | * there is no power-control hardware on this platform, so all |
@@ -79,22 +76,19 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
79 | /*}*/ | 76 | /*}*/ |
80 | 77 | ||
81 | /* | 78 | /* |
82 | * getting here, means that we have come out of WFI without | 79 | * Getting here, means that we have come out of WFI without |
83 | * having been woken up - this shouldn't happen | 80 | * having been woken up - this shouldn't happen |
84 | * | 81 | * |
85 | * The trouble is, letting people know about this is not really | 82 | * Just note it happening - when we're woken, we can report |
86 | * possible, since we are currently running incoherently, and | 83 | * its occurrence. |
87 | * therefore cannot safely call printk() or anything else | ||
88 | */ | 84 | */ |
89 | #ifdef DEBUG | 85 | (*spurious)++; |
90 | printk(KERN_WARN "CPU%u: spurious wakeup call\n", cpu); | ||
91 | #endif | ||
92 | } | 86 | } |
93 | } | 87 | } |
94 | 88 | ||
95 | int platform_cpu_kill(unsigned int cpu) | 89 | int platform_cpu_kill(unsigned int cpu) |
96 | { | 90 | { |
97 | return wait_for_completion_timeout(&cpu_killed, 5000); | 91 | return 1; |
98 | } | 92 | } |
99 | 93 | ||
100 | /* | 94 | /* |
@@ -104,30 +98,22 @@ int platform_cpu_kill(unsigned int cpu) | |||
104 | */ | 98 | */ |
105 | void platform_cpu_die(unsigned int cpu) | 99 | void platform_cpu_die(unsigned int cpu) |
106 | { | 100 | { |
107 | #ifdef DEBUG | 101 | int spurious = 0; |
108 | unsigned int this_cpu = hard_smp_processor_id(); | ||
109 | |||
110 | if (cpu != this_cpu) { | ||
111 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
112 | this_cpu, cpu); | ||
113 | BUG(); | ||
114 | } | ||
115 | #endif | ||
116 | |||
117 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
118 | complete(&cpu_killed); | ||
119 | 102 | ||
120 | /* | 103 | /* |
121 | * we're ready for shutdown now, so do it | 104 | * we're ready for shutdown now, so do it |
122 | */ | 105 | */ |
123 | cpu_enter_lowpower(); | 106 | cpu_enter_lowpower(); |
124 | platform_do_lowpower(cpu); | 107 | platform_do_lowpower(cpu, &spurious); |
125 | 108 | ||
126 | /* | 109 | /* |
127 | * bring this CPU back into the world of cache | 110 | * bring this CPU back into the world of cache |
128 | * coherency, and then restore interrupts | 111 | * coherency, and then restore interrupts |
129 | */ | 112 | */ |
130 | cpu_leave_lowpower(); | 113 | cpu_leave_lowpower(); |
114 | |||
115 | if (spurious) | ||
116 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
131 | } | 117 | } |
132 | 118 | ||
133 | int platform_cpu_disable(unsigned int cpu) | 119 | int platform_cpu_disable(unsigned int cpu) |
diff --git a/arch/arm/mach-tegra/include/mach/entry-macro.S b/arch/arm/mach-tegra/include/mach/entry-macro.S index 2ba9e5c9d2f6..dd165c53889d 100644 --- a/arch/arm/mach-tegra/include/mach/entry-macro.S +++ b/arch/arm/mach-tegra/include/mach/entry-macro.S | |||
@@ -16,8 +16,8 @@ | |||
16 | #include <mach/io.h> | 16 | #include <mach/io.h> |
17 | 17 | ||
18 | #if defined(CONFIG_ARM_GIC) | 18 | #if defined(CONFIG_ARM_GIC) |
19 | 19 | #define HAVE_GET_IRQNR_PREAMBLE | |
20 | #include <asm/hardware/gic.h> | 20 | #include <asm/hardware/entry-macro-gic.S> |
21 | 21 | ||
22 | /* Uses the GIC interrupt controller built into the cpu */ | 22 | /* Uses the GIC interrupt controller built into the cpu */ |
23 | #define ICTRL_BASE (IO_CPU_VIRT + 0x100) | 23 | #define ICTRL_BASE (IO_CPU_VIRT + 0x100) |
@@ -32,68 +32,6 @@ | |||
32 | 32 | ||
33 | .macro arch_ret_to_user, tmp1, tmp2 | 33 | .macro arch_ret_to_user, tmp1, tmp2 |
34 | .endm | 34 | .endm |
35 | |||
36 | /* | ||
37 | * The interrupt numbering scheme is defined in the | ||
38 | * interrupt controller spec. To wit: | ||
39 | * | ||
40 | * Interrupts 0-15 are IPI | ||
41 | * 16-28 are reserved | ||
42 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
43 | * 32-1020 are global | ||
44 | * 1021-1022 are reserved | ||
45 | * 1023 is "spurious" (no interrupt) | ||
46 | * | ||
47 | * For now, we ignore all local interrupts so only return an interrupt | ||
48 | * if it's between 30 and 1020. The test_for_ipi routine below will | ||
49 | * pick up on IPIs. | ||
50 | * | ||
51 | * A simple read from the controller will tell us the number of the | ||
52 | * highest priority enabled interrupt. We then just need to check | ||
53 | * whether it is in the valid range for an IRQ (30-1020 inclusive). | ||
54 | */ | ||
55 | |||
56 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
57 | |||
58 | /* bits 12-10 = src CPU, 9-0 = int # */ | ||
59 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
60 | |||
61 | ldr \tmp, =1021 | ||
62 | |||
63 | bic \irqnr, \irqstat, #0x1c00 | ||
64 | |||
65 | cmp \irqnr, #29 | ||
66 | cmpcc \irqnr, \irqnr | ||
67 | cmpne \irqnr, \tmp | ||
68 | cmpcs \irqnr, \irqnr | ||
69 | |||
70 | .endm | ||
71 | |||
72 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
73 | * register) is preserved from the macro above. | ||
74 | * If there is an IPI, we immediately signal end of interrupt on the | ||
75 | * controller, since this requires the original irqstat value which | ||
76 | * we won't easily be able to recreate later. | ||
77 | */ | ||
78 | |||
79 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
80 | bic \irqnr, \irqstat, #0x1c00 | ||
81 | cmp \irqnr, #16 | ||
82 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
83 | cmpcs \irqnr, \irqnr | ||
84 | .endm | ||
85 | |||
86 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
87 | |||
88 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
89 | bic \irqnr, \irqstat, #0x1c00 | ||
90 | mov \tmp, #0 | ||
91 | cmp \irqnr, #29 | ||
92 | moveq \tmp, #1 | ||
93 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
94 | cmp \tmp, #0 | ||
95 | .endm | ||
96 | |||
97 | #else | 35 | #else |
98 | /* legacy interrupt controller for AP16 */ | 36 | /* legacy interrupt controller for AP16 */ |
99 | .macro disable_fiq | 37 | .macro disable_fiq |
diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h index f0981b1ac59e..4cea2230c8dc 100644 --- a/arch/arm/mach-tegra/include/mach/io.h +++ b/arch/arm/mach-tegra/include/mach/io.h | |||
@@ -65,8 +65,8 @@ | |||
65 | 65 | ||
66 | #ifndef __ASSEMBLER__ | 66 | #ifndef __ASSEMBLER__ |
67 | 67 | ||
68 | #define __arch_ioremap(p, s, t) tegra_ioremap(p, s, t) | 68 | #define __arch_ioremap tegra_ioremap |
69 | #define __arch_iounmap(v) tegra_iounmap(v) | 69 | #define __arch_iounmap tegra_iounmap |
70 | 70 | ||
71 | void __iomem *tegra_ioremap(unsigned long phys, size_t size, unsigned int type); | 71 | void __iomem *tegra_ioremap(unsigned long phys, size_t size, unsigned int type); |
72 | void tegra_iounmap(volatile void __iomem *addr); | 72 | void tegra_iounmap(volatile void __iomem *addr); |
diff --git a/arch/arm/mach-tegra/include/mach/smp.h b/arch/arm/mach-tegra/include/mach/smp.h index e4a34a35a544..c8221b38ee7c 100644 --- a/arch/arm/mach-tegra/include/mach/smp.h +++ b/arch/arm/mach-tegra/include/mach/smp.h | |||
@@ -2,21 +2,13 @@ | |||
2 | #define ASMARM_ARCH_SMP_H | 2 | #define ASMARM_ARCH_SMP_H |
3 | 3 | ||
4 | #include <asm/hardware/gic.h> | 4 | #include <asm/hardware/gic.h> |
5 | #include <asm/smp_mpidr.h> | ||
6 | 5 | ||
7 | /* | 6 | /* |
8 | * We use IRQ1 as the IPI | 7 | * We use IRQ1 as the IPI |
9 | */ | 8 | */ |
10 | static inline void smp_cross_call(const struct cpumask *mask) | 9 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
11 | { | ||
12 | gic_raise_softirq(mask, 1); | ||
13 | } | ||
14 | |||
15 | /* | ||
16 | * Do nothing on MPcore. | ||
17 | */ | ||
18 | static inline void smp_cross_call_done(cpumask_t callmap) | ||
19 | { | 10 | { |
11 | gic_raise_softirq(mask, ipi); | ||
20 | } | 12 | } |
21 | 13 | ||
22 | #endif | 14 | #endif |
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c index 50a8dfb9a0cf..5407de01abf0 100644 --- a/arch/arm/mach-tegra/irq.c +++ b/arch/arm/mach-tegra/irq.c | |||
@@ -94,8 +94,8 @@ void __init tegra_init_irq(void) | |||
94 | writel(0, ictlr_to_virt(i) + ICTLR_CPU_IEP_CLASS); | 94 | writel(0, ictlr_to_virt(i) + ICTLR_CPU_IEP_CLASS); |
95 | } | 95 | } |
96 | 96 | ||
97 | gic_dist_init(0, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE), 29); | 97 | gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE), |
98 | gic_cpu_init(0, IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); | 98 | IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); |
99 | 99 | ||
100 | gic = get_irq_chip(29); | 100 | gic = get_irq_chip(29); |
101 | gic_unmask_irq = gic->unmask; | 101 | gic_unmask_irq = gic->unmask; |
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c index 1c0fd92cab39..ec1f68924edf 100644 --- a/arch/arm/mach-tegra/platsmp.c +++ b/arch/arm/mach-tegra/platsmp.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
25 | #include <asm/localtimer.h> | ||
26 | #include <asm/smp_scu.h> | 25 | #include <asm/smp_scu.h> |
27 | 26 | ||
28 | #include <mach/iomap.h> | 27 | #include <mach/iomap.h> |
@@ -41,14 +40,12 @@ static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE); | |||
41 | 40 | ||
42 | void __cpuinit platform_secondary_init(unsigned int cpu) | 41 | void __cpuinit platform_secondary_init(unsigned int cpu) |
43 | { | 42 | { |
44 | trace_hardirqs_off(); | ||
45 | |||
46 | /* | 43 | /* |
47 | * if any interrupts are already enabled for the primary | 44 | * if any interrupts are already enabled for the primary |
48 | * core (e.g. timer irq), then they will not have been enabled | 45 | * core (e.g. timer irq), then they will not have been enabled |
49 | * for us: do so | 46 | * for us: do so |
50 | */ | 47 | */ |
51 | gic_cpu_init(0, IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x100); | 48 | gic_secondary_init(0); |
52 | 49 | ||
53 | /* | 50 | /* |
54 | * Synchronise with the boot thread. | 51 | * Synchronise with the boot thread. |
@@ -117,24 +114,20 @@ void __init smp_init_cpus(void) | |||
117 | { | 114 | { |
118 | unsigned int i, ncores = scu_get_core_count(scu_base); | 115 | unsigned int i, ncores = scu_get_core_count(scu_base); |
119 | 116 | ||
117 | if (ncores > NR_CPUS) { | ||
118 | printk(KERN_ERR "Tegra: no. of cores (%u) greater than configured (%u), clipping\n", | ||
119 | ncores, NR_CPUS); | ||
120 | ncores = NR_CPUS; | ||
121 | } | ||
122 | |||
120 | for (i = 0; i < ncores; i++) | 123 | for (i = 0; i < ncores; i++) |
121 | cpu_set(i, cpu_possible_map); | 124 | cpu_set(i, cpu_possible_map); |
122 | } | 125 | } |
123 | 126 | ||
124 | void __init smp_prepare_cpus(unsigned int max_cpus) | 127 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
125 | { | 128 | { |
126 | unsigned int ncores = scu_get_core_count(scu_base); | ||
127 | unsigned int cpu = smp_processor_id(); | ||
128 | int i; | 129 | int i; |
129 | 130 | ||
130 | smp_store_cpu_info(cpu); | ||
131 | |||
132 | /* | ||
133 | * are we trying to boot more cores than exist? | ||
134 | */ | ||
135 | if (max_cpus > ncores) | ||
136 | max_cpus = ncores; | ||
137 | |||
138 | /* | 131 | /* |
139 | * Initialise the present map, which describes the set of CPUs | 132 | * Initialise the present map, which describes the set of CPUs |
140 | * actually populated at the present time. | 133 | * actually populated at the present time. |
@@ -142,15 +135,5 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
142 | for (i = 0; i < max_cpus; i++) | 135 | for (i = 0; i < max_cpus; i++) |
143 | set_cpu_present(i, true); | 136 | set_cpu_present(i, true); |
144 | 137 | ||
145 | /* | 138 | scu_enable(scu_base); |
146 | * Initialise the SCU if there are more than one CPU and let | ||
147 | * them know where to start. Note that, on modern versions of | ||
148 | * MILO, the "poke" doesn't actually do anything until each | ||
149 | * individual core is sent a soft interrupt to get it out of | ||
150 | * WFI | ||
151 | */ | ||
152 | if (max_cpus > 1) { | ||
153 | percpu_timer_setup(); | ||
154 | scu_enable(scu_base); | ||
155 | } | ||
156 | } | 139 | } |
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c index ae3b308e22a4..f0dae6d8ba52 100644 --- a/arch/arm/mach-tegra/tegra2_clocks.c +++ b/arch/arm/mach-tegra/tegra2_clocks.c | |||
@@ -24,8 +24,7 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/hrtimer.h> | 26 | #include <linux/hrtimer.h> |
27 | 27 | #include <linux/clkdev.h> | |
28 | #include <asm/clkdev.h> | ||
29 | 28 | ||
30 | #include <mach/iomap.h> | 29 | #include <mach/iomap.h> |
31 | 30 | ||
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c index 9057d6fd1d31..7b8ad1f98f44 100644 --- a/arch/arm/mach-tegra/timer.c +++ b/arch/arm/mach-tegra/timer.c | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/sched.h> | ||
21 | #include <linux/time.h> | 22 | #include <linux/time.h> |
22 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
23 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
@@ -25,10 +26,10 @@ | |||
25 | #include <linux/clocksource.h> | 26 | #include <linux/clocksource.h> |
26 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
27 | #include <linux/io.h> | 28 | #include <linux/io.h> |
28 | #include <linux/cnt32_to_63.h> | ||
29 | 29 | ||
30 | #include <asm/mach/time.h> | 30 | #include <asm/mach/time.h> |
31 | #include <asm/localtimer.h> | 31 | #include <asm/localtimer.h> |
32 | #include <asm/sched_clock.h> | ||
32 | 33 | ||
33 | #include <mach/iomap.h> | 34 | #include <mach/iomap.h> |
34 | #include <mach/irqs.h> | 35 | #include <mach/irqs.h> |
@@ -91,7 +92,7 @@ static void tegra_timer_set_mode(enum clock_event_mode mode, | |||
91 | 92 | ||
92 | static cycle_t tegra_clocksource_read(struct clocksource *cs) | 93 | static cycle_t tegra_clocksource_read(struct clocksource *cs) |
93 | { | 94 | { |
94 | return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)); | 95 | return timer_readl(TIMERUS_CNTR_1US); |
95 | } | 96 | } |
96 | 97 | ||
97 | static struct clock_event_device tegra_clockevent = { | 98 | static struct clock_event_device tegra_clockevent = { |
@@ -106,14 +107,29 @@ static struct clocksource tegra_clocksource = { | |||
106 | .name = "timer_us", | 107 | .name = "timer_us", |
107 | .rating = 300, | 108 | .rating = 300, |
108 | .read = tegra_clocksource_read, | 109 | .read = tegra_clocksource_read, |
109 | .mask = 0x7FFFFFFFFFFFFFFFULL, | 110 | .mask = CLOCKSOURCE_MASK(32), |
110 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 111 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
111 | }; | 112 | }; |
112 | 113 | ||
113 | unsigned long long sched_clock(void) | 114 | static DEFINE_CLOCK_DATA(cd); |
115 | |||
116 | /* | ||
117 | * Constants generated by clocks_calc_mult_shift(m, s, 1MHz, NSEC_PER_SEC, 60). | ||
118 | * This gives a resolution of about 1us and a wrap period of about 1h11min. | ||
119 | */ | ||
120 | #define SC_MULT 4194304000u | ||
121 | #define SC_SHIFT 22 | ||
122 | |||
123 | unsigned long long notrace sched_clock(void) | ||
114 | { | 124 | { |
115 | return clocksource_cyc2ns(tegra_clocksource.read(&tegra_clocksource), | 125 | u32 cyc = timer_readl(TIMERUS_CNTR_1US); |
116 | tegra_clocksource.mult, tegra_clocksource.shift); | 126 | return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT); |
127 | } | ||
128 | |||
129 | static void notrace tegra_update_sched_clock(void) | ||
130 | { | ||
131 | u32 cyc = timer_readl(TIMERUS_CNTR_1US); | ||
132 | update_sched_clock(&cd, cyc, (u32)~0); | ||
117 | } | 133 | } |
118 | 134 | ||
119 | static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id) | 135 | static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id) |
@@ -158,6 +174,9 @@ static void __init tegra_init_timer(void) | |||
158 | WARN(1, "Unknown clock rate"); | 174 | WARN(1, "Unknown clock rate"); |
159 | } | 175 | } |
160 | 176 | ||
177 | init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32, | ||
178 | 1000000, SC_MULT, SC_SHIFT); | ||
179 | |||
161 | if (clocksource_register_hz(&tegra_clocksource, 1000000)) { | 180 | if (clocksource_register_hz(&tegra_clocksource, 1000000)) { |
162 | printk(KERN_ERR "Failed to register clocksource\n"); | 181 | printk(KERN_ERR "Failed to register clocksource\n"); |
163 | BUG(); | 182 | BUG(); |
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c index 7458fc6df5c6..fabcc49abe80 100644 --- a/arch/arm/mach-u300/clock.c +++ b/arch/arm/mach-u300/clock.c | |||
@@ -25,8 +25,8 @@ | |||
25 | #include <linux/timer.h> | 25 | #include <linux/timer.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/seq_file.h> | 27 | #include <linux/seq_file.h> |
28 | #include <linux/clkdev.h> | ||
28 | 29 | ||
29 | #include <asm/clkdev.h> | ||
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/syscon.h> | 31 | #include <mach/syscon.h> |
32 | 32 | ||
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index 3fc4472719be..3ec58bd2d6e4 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
10 | */ | 10 | */ |
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <linux/sched.h> | ||
12 | #include <linux/time.h> | 13 | #include <linux/time.h> |
13 | #include <linux/timex.h> | 14 | #include <linux/timex.h> |
14 | #include <linux/clockchips.h> | 15 | #include <linux/clockchips.h> |
@@ -21,6 +22,7 @@ | |||
21 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
22 | 23 | ||
23 | /* Generic stuff */ | 24 | /* Generic stuff */ |
25 | #include <asm/sched_clock.h> | ||
24 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
25 | #include <asm/mach/time.h> | 27 | #include <asm/mach/time.h> |
26 | #include <asm/mach/irq.h> | 28 | #include <asm/mach/irq.h> |
@@ -352,12 +354,18 @@ static struct clocksource clocksource_u300_1mhz = { | |||
352 | * this wraps around for now, since it is just a relative time | 354 | * this wraps around for now, since it is just a relative time |
353 | * stamp. (Inspired by OMAP implementation.) | 355 | * stamp. (Inspired by OMAP implementation.) |
354 | */ | 356 | */ |
357 | static DEFINE_CLOCK_DATA(cd); | ||
358 | |||
355 | unsigned long long notrace sched_clock(void) | 359 | unsigned long long notrace sched_clock(void) |
356 | { | 360 | { |
357 | return clocksource_cyc2ns(clocksource_u300_1mhz.read( | 361 | u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); |
358 | &clocksource_u300_1mhz), | 362 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
359 | clocksource_u300_1mhz.mult, | 363 | } |
360 | clocksource_u300_1mhz.shift); | 364 | |
365 | static void notrace u300_update_sched_clock(void) | ||
366 | { | ||
367 | u32 cyc = readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); | ||
368 | update_sched_clock(&cd, cyc, (u32)~0); | ||
361 | } | 369 | } |
362 | 370 | ||
363 | 371 | ||
@@ -375,6 +383,8 @@ static void __init u300_timer_init(void) | |||
375 | clk_enable(clk); | 383 | clk_enable(clk); |
376 | rate = clk_get_rate(clk); | 384 | rate = clk_get_rate(clk); |
377 | 385 | ||
386 | init_sched_clock(&cd, u300_update_sched_clock, 32, rate); | ||
387 | |||
378 | /* | 388 | /* |
379 | * Disable the "OS" and "DD" timers - these are designed for Symbian! | 389 | * Disable the "OS" and "DD" timers - these are designed for Symbian! |
380 | * Example usage in cnh1601578 cpu subsystem pd_timer_app.c | 390 | * Example usage in cnh1601578 cpu subsystem pd_timer_app.c |
@@ -412,9 +422,7 @@ static void __init u300_timer_init(void) | |||
412 | writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE, | 422 | writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE, |
413 | U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2); | 423 | U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2); |
414 | 424 | ||
415 | clocksource_calc_mult_shift(&clocksource_u300_1mhz, | 425 | if (clocksource_register_hz(&clocksource_u300_1mhz, rate)) |
416 | rate, APPTIMER_MIN_RANGE); | ||
417 | if (clocksource_register(&clocksource_u300_1mhz)) | ||
418 | printk(KERN_ERR "timer: failed to initialize clock " | 426 | printk(KERN_ERR "timer: failed to initialize clock " |
419 | "source %s\n", clocksource_u300_1mhz.name); | 427 | "source %s\n", clocksource_u300_1mhz.name); |
420 | 428 | ||
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index 9e27a84433cb..12052e8e064c 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile | |||
@@ -2,14 +2,16 @@ | |||
2 | # Makefile for the linux kernel, U8500 machine. | 2 | # Makefile for the linux kernel, U8500 machine. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := clock.o cpu.o devices.o | 5 | obj-y := clock.o cpu.o devices.o devices-common.o |
6 | obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o devices-db5500.o | 6 | obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o |
7 | obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o prcmu.o | 7 | obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o prcmu.o |
8 | obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o board-mop500-sdi.o | 8 | obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o board-mop500-sdi.o \ |
9 | obj-$(CONFIG_MACH_U5500) += board-u5500.o | 9 | board-mop500-keypads.o |
10 | obj-$(CONFIG_MACH_U5500) += board-u5500.o board-u5500-sdi.o | ||
10 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 11 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
11 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 12 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
12 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o | 13 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o |
13 | obj-$(CONFIG_REGULATOR_AB8500) += board-mop500-regulators.o | 14 | obj-$(CONFIG_REGULATOR_AB8500) += board-mop500-regulators.o |
14 | obj-$(CONFIG_U5500_MODEM_IRQ) += modem_irq.o | 15 | obj-$(CONFIG_U5500_MODEM_IRQ) += modem-irq-db5500.o |
15 | obj-$(CONFIG_U5500_MBOX) += mbox.o | 16 | obj-$(CONFIG_U5500_MBOX) += mbox-db5500.o |
17 | obj-$(CONFIG_CPU_FREQ) += cpufreq.o | ||
diff --git a/arch/arm/mach-ux500/board-mop500-keypads.c b/arch/arm/mach-ux500/board-mop500-keypads.c new file mode 100644 index 000000000000..70318c354d32 --- /dev/null +++ b/arch/arm/mach-ux500/board-mop500-keypads.c | |||
@@ -0,0 +1,229 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * Keypad layouts for various boards | ||
7 | */ | ||
8 | |||
9 | #include <linux/i2c.h> | ||
10 | #include <linux/gpio.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/mfd/stmpe.h> | ||
14 | #include <linux/mfd/tc3589x.h> | ||
15 | #include <linux/input/matrix_keypad.h> | ||
16 | |||
17 | #include <plat/pincfg.h> | ||
18 | #include <plat/ske.h> | ||
19 | |||
20 | #include <mach/devices.h> | ||
21 | #include <mach/hardware.h> | ||
22 | |||
23 | #include "devices-db8500.h" | ||
24 | #include "board-mop500.h" | ||
25 | |||
26 | /* STMPE/SKE keypad use this key layout */ | ||
27 | static const unsigned int mop500_keymap[] = { | ||
28 | KEY(2, 5, KEY_END), | ||
29 | KEY(4, 1, KEY_POWER), | ||
30 | KEY(3, 5, KEY_VOLUMEDOWN), | ||
31 | KEY(1, 3, KEY_3), | ||
32 | KEY(5, 2, KEY_RIGHT), | ||
33 | KEY(5, 0, KEY_9), | ||
34 | |||
35 | KEY(0, 5, KEY_MENU), | ||
36 | KEY(7, 6, KEY_ENTER), | ||
37 | KEY(4, 5, KEY_0), | ||
38 | KEY(6, 7, KEY_2), | ||
39 | KEY(3, 4, KEY_UP), | ||
40 | KEY(3, 3, KEY_DOWN), | ||
41 | |||
42 | KEY(6, 4, KEY_SEND), | ||
43 | KEY(6, 2, KEY_BACK), | ||
44 | KEY(4, 2, KEY_VOLUMEUP), | ||
45 | KEY(5, 5, KEY_1), | ||
46 | KEY(4, 3, KEY_LEFT), | ||
47 | KEY(3, 2, KEY_7), | ||
48 | }; | ||
49 | |||
50 | static const struct matrix_keymap_data mop500_keymap_data = { | ||
51 | .keymap = mop500_keymap, | ||
52 | .keymap_size = ARRAY_SIZE(mop500_keymap), | ||
53 | }; | ||
54 | |||
55 | /* | ||
56 | * Nomadik SKE keypad | ||
57 | */ | ||
58 | #define ROW_PIN_I0 164 | ||
59 | #define ROW_PIN_I1 163 | ||
60 | #define ROW_PIN_I2 162 | ||
61 | #define ROW_PIN_I3 161 | ||
62 | #define ROW_PIN_I4 156 | ||
63 | #define ROW_PIN_I5 155 | ||
64 | #define ROW_PIN_I6 154 | ||
65 | #define ROW_PIN_I7 153 | ||
66 | #define COL_PIN_O0 168 | ||
67 | #define COL_PIN_O1 167 | ||
68 | #define COL_PIN_O2 166 | ||
69 | #define COL_PIN_O3 165 | ||
70 | #define COL_PIN_O4 160 | ||
71 | #define COL_PIN_O5 159 | ||
72 | #define COL_PIN_O6 158 | ||
73 | #define COL_PIN_O7 157 | ||
74 | |||
75 | #define SKE_KPD_MAX_ROWS 8 | ||
76 | #define SKE_KPD_MAX_COLS 8 | ||
77 | |||
78 | static int ske_kp_rows[] = { | ||
79 | ROW_PIN_I0, ROW_PIN_I1, ROW_PIN_I2, ROW_PIN_I3, | ||
80 | ROW_PIN_I4, ROW_PIN_I5, ROW_PIN_I6, ROW_PIN_I7, | ||
81 | }; | ||
82 | |||
83 | /* | ||
84 | * ske_set_gpio_row: request and set gpio rows | ||
85 | */ | ||
86 | static int ske_set_gpio_row(int gpio) | ||
87 | { | ||
88 | int ret; | ||
89 | |||
90 | ret = gpio_request(gpio, "ske-kp"); | ||
91 | if (ret < 0) { | ||
92 | pr_err("ske_set_gpio_row: gpio request failed\n"); | ||
93 | return ret; | ||
94 | } | ||
95 | |||
96 | ret = gpio_direction_output(gpio, 1); | ||
97 | if (ret < 0) { | ||
98 | pr_err("ske_set_gpio_row: gpio direction failed\n"); | ||
99 | gpio_free(gpio); | ||
100 | } | ||
101 | |||
102 | return ret; | ||
103 | } | ||
104 | |||
105 | /* | ||
106 | * ske_kp_init - enable the gpio configuration | ||
107 | */ | ||
108 | static int ske_kp_init(void) | ||
109 | { | ||
110 | int ret, i; | ||
111 | |||
112 | for (i = 0; i < SKE_KPD_MAX_ROWS; i++) { | ||
113 | ret = ske_set_gpio_row(ske_kp_rows[i]); | ||
114 | if (ret < 0) { | ||
115 | pr_err("ske_kp_init: failed init\n"); | ||
116 | return ret; | ||
117 | } | ||
118 | } | ||
119 | |||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | static struct ske_keypad_platform_data ske_keypad_board = { | ||
124 | .init = ske_kp_init, | ||
125 | .keymap_data = &mop500_keymap_data, | ||
126 | .no_autorepeat = true, | ||
127 | .krow = SKE_KPD_MAX_ROWS, /* 8x8 matrix */ | ||
128 | .kcol = SKE_KPD_MAX_COLS, | ||
129 | .debounce_ms = 40, /* in millisecs */ | ||
130 | }; | ||
131 | |||
132 | /* | ||
133 | * STMPE1601 | ||
134 | */ | ||
135 | static struct stmpe_keypad_platform_data stmpe1601_keypad_data = { | ||
136 | .debounce_ms = 64, | ||
137 | .scan_count = 8, | ||
138 | .no_autorepeat = true, | ||
139 | .keymap_data = &mop500_keymap_data, | ||
140 | }; | ||
141 | |||
142 | static struct stmpe_platform_data stmpe1601_data = { | ||
143 | .id = 1, | ||
144 | .blocks = STMPE_BLOCK_KEYPAD, | ||
145 | .irq_trigger = IRQF_TRIGGER_FALLING, | ||
146 | .irq_base = MOP500_STMPE1601_IRQ(0), | ||
147 | .keypad = &stmpe1601_keypad_data, | ||
148 | .autosleep = true, | ||
149 | .autosleep_timeout = 1024, | ||
150 | }; | ||
151 | |||
152 | static struct i2c_board_info mop500_i2c0_devices_stuib[] = { | ||
153 | { | ||
154 | I2C_BOARD_INFO("stmpe1601", 0x40), | ||
155 | .irq = NOMADIK_GPIO_TO_IRQ(218), | ||
156 | .platform_data = &stmpe1601_data, | ||
157 | .flags = I2C_CLIENT_WAKE, | ||
158 | }, | ||
159 | }; | ||
160 | |||
161 | /* | ||
162 | * TC35893 | ||
163 | */ | ||
164 | |||
165 | static const unsigned int uib_keymap[] = { | ||
166 | KEY(3, 1, KEY_END), | ||
167 | KEY(4, 1, KEY_POWER), | ||
168 | KEY(6, 4, KEY_VOLUMEDOWN), | ||
169 | KEY(4, 2, KEY_EMAIL), | ||
170 | KEY(3, 3, KEY_RIGHT), | ||
171 | KEY(2, 5, KEY_BACKSPACE), | ||
172 | |||
173 | KEY(6, 7, KEY_MENU), | ||
174 | KEY(5, 0, KEY_ENTER), | ||
175 | KEY(4, 3, KEY_0), | ||
176 | KEY(3, 4, KEY_DOT), | ||
177 | KEY(5, 2, KEY_UP), | ||
178 | KEY(3, 5, KEY_DOWN), | ||
179 | |||
180 | KEY(4, 5, KEY_SEND), | ||
181 | KEY(0, 5, KEY_BACK), | ||
182 | KEY(6, 2, KEY_VOLUMEUP), | ||
183 | KEY(1, 3, KEY_SPACE), | ||
184 | KEY(7, 6, KEY_LEFT), | ||
185 | KEY(5, 5, KEY_SEARCH), | ||
186 | }; | ||
187 | |||
188 | static struct matrix_keymap_data uib_keymap_data = { | ||
189 | .keymap = uib_keymap, | ||
190 | .keymap_size = ARRAY_SIZE(uib_keymap), | ||
191 | }; | ||
192 | |||
193 | static struct tc3589x_keypad_platform_data tc35893_data = { | ||
194 | .krow = TC_KPD_ROWS, | ||
195 | .kcol = TC_KPD_COLUMNS, | ||
196 | .debounce_period = TC_KPD_DEBOUNCE_PERIOD, | ||
197 | .settle_time = TC_KPD_SETTLE_TIME, | ||
198 | .irqtype = IRQF_TRIGGER_FALLING, | ||
199 | .enable_wakeup = true, | ||
200 | .keymap_data = &uib_keymap_data, | ||
201 | .no_autorepeat = true, | ||
202 | }; | ||
203 | |||
204 | static struct tc3589x_platform_data tc3589x_keypad_data = { | ||
205 | .block = TC3589x_BLOCK_KEYPAD, | ||
206 | .keypad = &tc35893_data, | ||
207 | .irq_base = MOP500_EGPIO_IRQ_BASE, | ||
208 | }; | ||
209 | |||
210 | static struct i2c_board_info mop500_i2c0_devices_uib[] = { | ||
211 | { | ||
212 | I2C_BOARD_INFO("tc3589x", 0x44), | ||
213 | .platform_data = &tc3589x_keypad_data, | ||
214 | .irq = NOMADIK_GPIO_TO_IRQ(218), | ||
215 | .flags = I2C_CLIENT_WAKE, | ||
216 | }, | ||
217 | }; | ||
218 | |||
219 | void mop500_keypad_init(void) | ||
220 | { | ||
221 | db8500_add_ske_keypad(&ske_keypad_board); | ||
222 | |||
223 | i2c_register_board_info(0, mop500_i2c0_devices_stuib, | ||
224 | ARRAY_SIZE(mop500_i2c0_devices_stuib)); | ||
225 | |||
226 | i2c_register_board_info(0, mop500_i2c0_devices_uib, | ||
227 | ARRAY_SIZE(mop500_i2c0_devices_uib)); | ||
228 | |||
229 | } | ||
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index bac995665b58..4b996676594e 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c | |||
@@ -16,10 +16,24 @@ | |||
16 | #include <mach/devices.h> | 16 | #include <mach/devices.h> |
17 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
18 | 18 | ||
19 | #include "devices-db8500.h" | ||
19 | #include "pins-db8500.h" | 20 | #include "pins-db8500.h" |
20 | #include "board-mop500.h" | 21 | #include "board-mop500.h" |
21 | 22 | ||
22 | static pin_cfg_t mop500_sdi_pins[] = { | 23 | static pin_cfg_t mop500_sdi_pins[] = { |
24 | /* SDI0 (MicroSD slot) */ | ||
25 | GPIO18_MC0_CMDDIR, | ||
26 | GPIO19_MC0_DAT0DIR, | ||
27 | GPIO20_MC0_DAT2DIR, | ||
28 | GPIO21_MC0_DAT31DIR, | ||
29 | GPIO22_MC0_FBCLK, | ||
30 | GPIO23_MC0_CLK, | ||
31 | GPIO24_MC0_CMD, | ||
32 | GPIO25_MC0_DAT0, | ||
33 | GPIO26_MC0_DAT1, | ||
34 | GPIO27_MC0_DAT2, | ||
35 | GPIO28_MC0_DAT3, | ||
36 | |||
23 | /* SDI4 (on-board eMMC) */ | 37 | /* SDI4 (on-board eMMC) */ |
24 | GPIO197_MC4_DAT3, | 38 | GPIO197_MC4_DAT3, |
25 | GPIO198_MC4_DAT2, | 39 | GPIO198_MC4_DAT2, |
@@ -50,6 +64,55 @@ static pin_cfg_t mop500_sdi2_pins[] = { | |||
50 | }; | 64 | }; |
51 | 65 | ||
52 | /* | 66 | /* |
67 | * SDI 0 (MicroSD slot) | ||
68 | */ | ||
69 | |||
70 | /* MMCIPOWER bits */ | ||
71 | #define MCI_DATA2DIREN (1 << 2) | ||
72 | #define MCI_CMDDIREN (1 << 3) | ||
73 | #define MCI_DATA0DIREN (1 << 4) | ||
74 | #define MCI_DATA31DIREN (1 << 5) | ||
75 | #define MCI_FBCLKEN (1 << 7) | ||
76 | |||
77 | static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd, | ||
78 | unsigned char power_mode) | ||
79 | { | ||
80 | if (power_mode == MMC_POWER_UP) | ||
81 | gpio_set_value_cansleep(GPIO_SDMMC_EN, 1); | ||
82 | else if (power_mode == MMC_POWER_OFF) | ||
83 | gpio_set_value_cansleep(GPIO_SDMMC_EN, 0); | ||
84 | |||
85 | return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN | | ||
86 | MCI_DATA2DIREN | MCI_DATA31DIREN; | ||
87 | } | ||
88 | |||
89 | static struct mmci_platform_data mop500_sdi0_data = { | ||
90 | .vdd_handler = mop500_sdi0_vdd_handler, | ||
91 | .ocr_mask = MMC_VDD_29_30, | ||
92 | .f_max = 100000000, | ||
93 | .capabilities = MMC_CAP_4_BIT_DATA, | ||
94 | .gpio_cd = GPIO_SDMMC_CD, | ||
95 | .gpio_wp = -1, | ||
96 | }; | ||
97 | |||
98 | void mop500_sdi_tc35892_init(void) | ||
99 | { | ||
100 | int ret; | ||
101 | |||
102 | ret = gpio_request(GPIO_SDMMC_EN, "SDMMC_EN"); | ||
103 | if (!ret) | ||
104 | ret = gpio_request(GPIO_SDMMC_1V8_3V_SEL, | ||
105 | "GPIO_SDMMC_1V8_3V_SEL"); | ||
106 | if (ret) | ||
107 | return; | ||
108 | |||
109 | gpio_direction_output(GPIO_SDMMC_1V8_3V_SEL, 1); | ||
110 | gpio_direction_output(GPIO_SDMMC_EN, 0); | ||
111 | |||
112 | db8500_add_sdi0(&mop500_sdi0_data); | ||
113 | } | ||
114 | |||
115 | /* | ||
53 | * SDI 2 (POP eMMC, not on DB8500ed) | 116 | * SDI 2 (POP eMMC, not on DB8500ed) |
54 | */ | 117 | */ |
55 | 118 | ||
@@ -74,18 +137,24 @@ static struct mmci_platform_data mop500_sdi4_data = { | |||
74 | .gpio_wp = -1, | 137 | .gpio_wp = -1, |
75 | }; | 138 | }; |
76 | 139 | ||
77 | void mop500_sdi_init(void) | 140 | void __init mop500_sdi_init(void) |
78 | { | 141 | { |
79 | nmk_config_pins(mop500_sdi_pins, ARRAY_SIZE(mop500_sdi_pins)); | 142 | nmk_config_pins(mop500_sdi_pins, ARRAY_SIZE(mop500_sdi_pins)); |
80 | 143 | ||
81 | u8500_sdi2_device.dev.platform_data = &mop500_sdi2_data; | 144 | /* |
82 | u8500_sdi4_device.dev.platform_data = &mop500_sdi4_data; | 145 | * sdi0 will finally be added when the TC35892 initializes and calls |
146 | * mop500_sdi_tc35892_init() above. | ||
147 | */ | ||
83 | 148 | ||
149 | /* PoP:ed eMMC */ | ||
84 | if (!cpu_is_u8500ed()) { | 150 | if (!cpu_is_u8500ed()) { |
85 | nmk_config_pins(mop500_sdi2_pins, ARRAY_SIZE(mop500_sdi2_pins)); | 151 | nmk_config_pins(mop500_sdi2_pins, ARRAY_SIZE(mop500_sdi2_pins)); |
86 | amba_device_register(&u8500_sdi2_device, &iomem_resource); | 152 | /* POP eMMC on v1.0 has problems with high speed */ |
153 | if (!cpu_is_u8500v10()) | ||
154 | mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED; | ||
155 | db8500_add_sdi2(&mop500_sdi2_data); | ||
87 | } | 156 | } |
88 | 157 | ||
89 | /* On-board eMMC */ | 158 | /* On-board eMMC */ |
90 | amba_device_register(&u8500_sdi4_device, &iomem_resource); | 159 | db8500_add_sdi4(&mop500_sdi4_data); |
91 | } | 160 | } |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index cac83a694880..a1c9ea1a66df 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -13,25 +13,26 @@ | |||
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/i2c.h> | ||
16 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
17 | #include <linux/amba/bus.h> | 18 | #include <linux/amba/bus.h> |
18 | #include <linux/amba/pl022.h> | 19 | #include <linux/amba/pl022.h> |
19 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
20 | #include <linux/mfd/ab8500.h> | 21 | #include <linux/mfd/ab8500.h> |
21 | #include <linux/input/matrix_keypad.h> | 22 | #include <linux/mfd/tc3589x.h> |
22 | 23 | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
25 | 26 | ||
26 | #include <plat/pincfg.h> | 27 | #include <plat/pincfg.h> |
27 | #include <plat/i2c.h> | 28 | #include <plat/i2c.h> |
28 | #include <plat/ske.h> | ||
29 | 29 | ||
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/setup.h> | 31 | #include <mach/setup.h> |
32 | #include <mach/devices.h> | 32 | #include <mach/devices.h> |
33 | #include <mach/irqs.h> | 33 | #include <mach/irqs.h> |
34 | 34 | ||
35 | #include "devices-db8500.h" | ||
35 | #include "pins-db8500.h" | 36 | #include "pins-db8500.h" |
36 | #include "board-mop500.h" | 37 | #include "board-mop500.h" |
37 | 38 | ||
@@ -69,22 +70,12 @@ static pin_cfg_t mop500_pins[] = { | |||
69 | GPIO166_KP_O2, | 70 | GPIO166_KP_O2, |
70 | GPIO167_KP_O1, | 71 | GPIO167_KP_O1, |
71 | GPIO168_KP_O0, | 72 | GPIO168_KP_O0, |
72 | }; | ||
73 | 73 | ||
74 | static void ab4500_spi_cs_control(u32 command) | 74 | /* GPIO_EXP_INT */ |
75 | { | 75 | GPIO217_GPIO, |
76 | /* set the FRM signal, which is CS - TODO */ | ||
77 | } | ||
78 | 76 | ||
79 | struct pl022_config_chip ab4500_chip_info = { | 77 | /* STMPE1601 IRQ */ |
80 | .com_mode = INTERRUPT_TRANSFER, | 78 | GPIO218_GPIO | PIN_INPUT_PULLUP, |
81 | .iface = SSP_INTERFACE_MOTOROLA_SPI, | ||
82 | /* we can act as master only */ | ||
83 | .hierarchy = SSP_MASTER, | ||
84 | .slave_tx_disable = 0, | ||
85 | .rx_lev_trig = SSP_RX_1_OR_MORE_ELEM, | ||
86 | .tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC, | ||
87 | .cs_control = ab4500_spi_cs_control, | ||
88 | }; | 79 | }; |
89 | 80 | ||
90 | static struct ab8500_platform_data ab8500_platdata = { | 81 | static struct ab8500_platform_data ab8500_platdata = { |
@@ -93,9 +84,9 @@ static struct ab8500_platform_data ab8500_platdata = { | |||
93 | 84 | ||
94 | static struct resource ab8500_resources[] = { | 85 | static struct resource ab8500_resources[] = { |
95 | [0] = { | 86 | [0] = { |
96 | .start = IRQ_AB8500, | 87 | .start = IRQ_DB8500_AB8500, |
97 | .end = IRQ_AB8500, | 88 | .end = IRQ_DB8500_AB8500, |
98 | .flags = IORESOURCE_IRQ | 89 | .flags = IORESOURCE_IRQ |
99 | } | 90 | } |
100 | }; | 91 | }; |
101 | 92 | ||
@@ -109,19 +100,6 @@ struct platform_device ab8500_device = { | |||
109 | .resource = ab8500_resources, | 100 | .resource = ab8500_resources, |
110 | }; | 101 | }; |
111 | 102 | ||
112 | static struct spi_board_info ab8500_spi_devices[] = { | ||
113 | { | ||
114 | .modalias = "ab8500-spi", | ||
115 | .controller_data = &ab4500_chip_info, | ||
116 | .platform_data = &ab8500_platdata, | ||
117 | .max_speed_hz = 12000000, | ||
118 | .bus_num = 0, | ||
119 | .chip_select = 0, | ||
120 | .mode = SPI_MODE_3, | ||
121 | .irq = IRQ_DB8500_AB8500, | ||
122 | }, | ||
123 | }; | ||
124 | |||
125 | static struct pl022_ssp_controller ssp0_platform_data = { | 103 | static struct pl022_ssp_controller ssp0_platform_data = { |
126 | .bus_id = 0, | 104 | .bus_id = 0, |
127 | /* pl022 not yet supports dma */ | 105 | /* pl022 not yet supports dma */ |
@@ -132,6 +110,34 @@ static struct pl022_ssp_controller ssp0_platform_data = { | |||
132 | .num_chipselect = 5, | 110 | .num_chipselect = 5, |
133 | }; | 111 | }; |
134 | 112 | ||
113 | /* | ||
114 | * TC35892 | ||
115 | */ | ||
116 | |||
117 | static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base) | ||
118 | { | ||
119 | mop500_sdi_tc35892_init(); | ||
120 | } | ||
121 | |||
122 | static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = { | ||
123 | .gpio_base = MOP500_EGPIO(0), | ||
124 | .setup = mop500_tc35892_init, | ||
125 | }; | ||
126 | |||
127 | static struct tc3589x_platform_data mop500_tc35892_data = { | ||
128 | .block = TC3589x_BLOCK_GPIO, | ||
129 | .gpio = &mop500_tc35892_gpio_data, | ||
130 | .irq_base = MOP500_EGPIO_IRQ_BASE, | ||
131 | }; | ||
132 | |||
133 | static struct i2c_board_info mop500_i2c0_devices[] = { | ||
134 | { | ||
135 | I2C_BOARD_INFO("tc3589x", 0x42), | ||
136 | .irq = NOMADIK_GPIO_TO_IRQ(217), | ||
137 | .platform_data = &mop500_tc35892_data, | ||
138 | }, | ||
139 | }; | ||
140 | |||
135 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ | 141 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ |
136 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ | 142 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ |
137 | /* \ | 143 | /* \ |
@@ -161,159 +167,49 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | |||
161 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 167 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
162 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 168 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
163 | 169 | ||
164 | static struct amba_device *amba_devs[] __initdata = { | 170 | static void __init mop500_i2c_init(void) |
165 | &ux500_uart0_device, | 171 | { |
166 | &ux500_uart1_device, | 172 | db8500_add_i2c0(&u8500_i2c0_data); |
167 | &ux500_uart2_device, | 173 | db8500_add_i2c1(&u8500_i2c1_data); |
168 | &u8500_ssp0_device, | 174 | db8500_add_i2c2(&u8500_i2c2_data); |
169 | }; | 175 | db8500_add_i2c3(&u8500_i2c3_data); |
170 | 176 | } | |
171 | static const unsigned int ux500_keymap[] = { | ||
172 | KEY(2, 5, KEY_END), | ||
173 | KEY(4, 1, KEY_POWER), | ||
174 | KEY(3, 5, KEY_VOLUMEDOWN), | ||
175 | KEY(1, 3, KEY_3), | ||
176 | KEY(5, 2, KEY_RIGHT), | ||
177 | KEY(5, 0, KEY_9), | ||
178 | |||
179 | KEY(0, 5, KEY_MENU), | ||
180 | KEY(7, 6, KEY_ENTER), | ||
181 | KEY(4, 5, KEY_0), | ||
182 | KEY(6, 7, KEY_2), | ||
183 | KEY(3, 4, KEY_UP), | ||
184 | KEY(3, 3, KEY_DOWN), | ||
185 | |||
186 | KEY(6, 4, KEY_SEND), | ||
187 | KEY(6, 2, KEY_BACK), | ||
188 | KEY(4, 2, KEY_VOLUMEUP), | ||
189 | KEY(5, 5, KEY_1), | ||
190 | KEY(4, 3, KEY_LEFT), | ||
191 | KEY(3, 2, KEY_7), | ||
192 | }; | ||
193 | |||
194 | static const struct matrix_keymap_data ux500_keymap_data = { | ||
195 | .keymap = ux500_keymap, | ||
196 | .keymap_size = ARRAY_SIZE(ux500_keymap), | ||
197 | }; | ||
198 | 177 | ||
199 | /* | 178 | /* add any platform devices here - TODO */ |
200 | * Nomadik SKE keypad | 179 | static struct platform_device *platform_devs[] __initdata = { |
201 | */ | ||
202 | #define ROW_PIN_I0 164 | ||
203 | #define ROW_PIN_I1 163 | ||
204 | #define ROW_PIN_I2 162 | ||
205 | #define ROW_PIN_I3 161 | ||
206 | #define ROW_PIN_I4 156 | ||
207 | #define ROW_PIN_I5 155 | ||
208 | #define ROW_PIN_I6 154 | ||
209 | #define ROW_PIN_I7 153 | ||
210 | #define COL_PIN_O0 168 | ||
211 | #define COL_PIN_O1 167 | ||
212 | #define COL_PIN_O2 166 | ||
213 | #define COL_PIN_O3 165 | ||
214 | #define COL_PIN_O4 160 | ||
215 | #define COL_PIN_O5 159 | ||
216 | #define COL_PIN_O6 158 | ||
217 | #define COL_PIN_O7 157 | ||
218 | |||
219 | #define SKE_KPD_MAX_ROWS 8 | ||
220 | #define SKE_KPD_MAX_COLS 8 | ||
221 | |||
222 | static int ske_kp_rows[] = { | ||
223 | ROW_PIN_I0, ROW_PIN_I1, ROW_PIN_I2, ROW_PIN_I3, | ||
224 | ROW_PIN_I4, ROW_PIN_I5, ROW_PIN_I6, ROW_PIN_I7, | ||
225 | }; | 180 | }; |
226 | 181 | ||
227 | /* | 182 | static void __init mop500_spi_init(void) |
228 | * ske_set_gpio_row: request and set gpio rows | ||
229 | */ | ||
230 | static int ske_set_gpio_row(int gpio) | ||
231 | { | 183 | { |
232 | int ret; | 184 | db8500_add_ssp0(&ssp0_platform_data); |
233 | |||
234 | ret = gpio_request(gpio, "ske-kp"); | ||
235 | if (ret < 0) { | ||
236 | pr_err("ske_set_gpio_row: gpio request failed\n"); | ||
237 | return ret; | ||
238 | } | ||
239 | |||
240 | ret = gpio_direction_output(gpio, 1); | ||
241 | if (ret < 0) { | ||
242 | pr_err("ske_set_gpio_row: gpio direction failed\n"); | ||
243 | gpio_free(gpio); | ||
244 | } | ||
245 | |||
246 | return ret; | ||
247 | } | 185 | } |
248 | 186 | ||
249 | /* | 187 | static void __init mop500_uart_init(void) |
250 | * ske_kp_init - enable the gpio configuration | ||
251 | */ | ||
252 | static int ske_kp_init(void) | ||
253 | { | 188 | { |
254 | int ret, i; | 189 | db8500_add_uart0(); |
255 | 190 | db8500_add_uart1(); | |
256 | for (i = 0; i < SKE_KPD_MAX_ROWS; i++) { | 191 | db8500_add_uart2(); |
257 | ret = ske_set_gpio_row(ske_kp_rows[i]); | ||
258 | if (ret < 0) { | ||
259 | pr_err("ske_kp_init: failed init\n"); | ||
260 | return ret; | ||
261 | } | ||
262 | } | ||
263 | |||
264 | return 0; | ||
265 | } | 192 | } |
266 | 193 | ||
267 | static struct ske_keypad_platform_data ske_keypad_board = { | ||
268 | .init = ske_kp_init, | ||
269 | .keymap_data = &ux500_keymap_data, | ||
270 | .no_autorepeat = true, | ||
271 | .krow = SKE_KPD_MAX_ROWS, /* 8x8 matrix */ | ||
272 | .kcol = SKE_KPD_MAX_COLS, | ||
273 | .debounce_ms = 40, /* in millsecs */ | ||
274 | }; | ||
275 | |||
276 | |||
277 | |||
278 | /* add any platform devices here - TODO */ | ||
279 | static struct platform_device *platform_devs[] __initdata = { | ||
280 | &u8500_i2c0_device, | ||
281 | &ux500_i2c1_device, | ||
282 | &ux500_i2c2_device, | ||
283 | &ux500_i2c3_device, | ||
284 | &ux500_ske_keypad_device, | ||
285 | }; | ||
286 | |||
287 | static void __init u8500_init_machine(void) | 194 | static void __init u8500_init_machine(void) |
288 | { | 195 | { |
289 | int i; | ||
290 | |||
291 | u8500_init_devices(); | 196 | u8500_init_devices(); |
292 | 197 | ||
293 | nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins)); | 198 | nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins)); |
294 | 199 | ||
295 | u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data; | ||
296 | ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data; | ||
297 | ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data; | ||
298 | ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data; | ||
299 | ux500_ske_keypad_device.dev.platform_data = &ske_keypad_board; | ||
300 | |||
301 | u8500_ssp0_device.dev.platform_data = &ssp0_platform_data; | ||
302 | |||
303 | /* Register the active AMBA devices on this board */ | ||
304 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
305 | amba_device_register(amba_devs[i], &iomem_resource); | ||
306 | |||
307 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | 200 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); |
308 | 201 | ||
202 | mop500_i2c_init(); | ||
309 | mop500_sdi_init(); | 203 | mop500_sdi_init(); |
204 | mop500_spi_init(); | ||
205 | mop500_uart_init(); | ||
206 | |||
207 | mop500_keypad_init(); | ||
208 | |||
209 | platform_device_register(&ab8500_device); | ||
310 | 210 | ||
311 | /* If HW is early drop (ED) or V1.0 then use SPI to access AB8500 */ | 211 | i2c_register_board_info(0, mop500_i2c0_devices, |
312 | if (cpu_is_u8500ed() || cpu_is_u8500v10()) | 212 | ARRAY_SIZE(mop500_i2c0_devices)); |
313 | spi_register_board_info(ab8500_spi_devices, | ||
314 | ARRAY_SIZE(ab8500_spi_devices)); | ||
315 | else /* If HW is v.1.1 or later use I2C to access AB8500 */ | ||
316 | platform_device_register(&ab8500_device); | ||
317 | } | 213 | } |
318 | 214 | ||
319 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | 215 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") |
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index 2d240322fa6f..3104ae2a02c2 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h | |||
@@ -7,6 +7,15 @@ | |||
7 | #ifndef __BOARD_MOP500_H | 7 | #ifndef __BOARD_MOP500_H |
8 | #define __BOARD_MOP500_H | 8 | #define __BOARD_MOP500_H |
9 | 9 | ||
10 | #define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x)) | ||
11 | |||
12 | /* GPIOs on the TC35892 expander */ | ||
13 | #define GPIO_SDMMC_CD MOP500_EGPIO(3) | ||
14 | #define GPIO_SDMMC_EN MOP500_EGPIO(17) | ||
15 | #define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18) | ||
16 | |||
10 | extern void mop500_sdi_init(void); | 17 | extern void mop500_sdi_init(void); |
18 | extern void mop500_sdi_tc35892_init(void); | ||
19 | extern void mop500_keypad_init(void); | ||
11 | 20 | ||
12 | #endif | 21 | #endif |
diff --git a/arch/arm/mach-ux500/board-u5500-sdi.c b/arch/arm/mach-ux500/board-u5500-sdi.c new file mode 100644 index 000000000000..54712acc0394 --- /dev/null +++ b/arch/arm/mach-ux500/board-u5500-sdi.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Hanumath Prasad <ulf.hansson@stericsson.com> | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/amba/mmci.h> | ||
9 | #include <linux/mmc/host.h> | ||
10 | #include <linux/gpio.h> | ||
11 | |||
12 | #include <plat/pincfg.h> | ||
13 | #include <mach/db5500-regs.h> | ||
14 | #include <plat/ste_dma40.h> | ||
15 | |||
16 | #include "pins-db5500.h" | ||
17 | #include "devices-db5500.h" | ||
18 | #include "ste-dma40-db5500.h" | ||
19 | |||
20 | static pin_cfg_t u5500_sdi_pins[] = { | ||
21 | /* SDI0 (POP eMMC) */ | ||
22 | GPIO5_MC0_DAT0 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
23 | GPIO6_MC0_DAT1 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
24 | GPIO7_MC0_DAT2 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
25 | GPIO8_MC0_DAT3 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
26 | GPIO9_MC0_DAT4 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
27 | GPIO10_MC0_DAT5 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
28 | GPIO11_MC0_DAT6 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
29 | GPIO12_MC0_DAT7 | PIN_DIR_INPUT | PIN_PULL_UP, | ||
30 | GPIO13_MC0_CMD | PIN_DIR_INPUT | PIN_PULL_UP, | ||
31 | GPIO14_MC0_CLK | PIN_DIR_OUTPUT | PIN_VAL_LOW, | ||
32 | }; | ||
33 | |||
34 | static struct mmci_platform_data u5500_sdi0_data = { | ||
35 | .ocr_mask = MMC_VDD_165_195, | ||
36 | .f_max = 50000000, | ||
37 | .capabilities = MMC_CAP_4_BIT_DATA | | ||
38 | MMC_CAP_8_BIT_DATA | | ||
39 | MMC_CAP_MMC_HIGHSPEED, | ||
40 | .gpio_cd = -1, | ||
41 | .gpio_wp = -1, | ||
42 | }; | ||
43 | |||
44 | void __init u5500_sdi_init(void) | ||
45 | { | ||
46 | nmk_config_pins(u5500_sdi_pins, ARRAY_SIZE(u5500_sdi_pins)); | ||
47 | |||
48 | db5500_add_sdi0(&u5500_sdi0_data); | ||
49 | } | ||
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c index 1ca094a45e71..39d370c1f3b4 100644 --- a/arch/arm/mach-ux500/board-u5500.c +++ b/arch/arm/mach-ux500/board-u5500.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/platform_device.h> | 9 | #include <linux/platform_device.h> |
10 | #include <linux/amba/bus.h> | 10 | #include <linux/amba/bus.h> |
11 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
12 | #include <linux/irq.h> | ||
12 | 13 | ||
13 | #include <asm/mach/arch.h> | 14 | #include <asm/mach/arch.h> |
14 | #include <asm/mach-types.h> | 15 | #include <asm/mach-types.h> |
@@ -17,20 +18,24 @@ | |||
17 | #include <mach/devices.h> | 18 | #include <mach/devices.h> |
18 | #include <mach/setup.h> | 19 | #include <mach/setup.h> |
19 | 20 | ||
20 | static struct amba_device *amba_board_devs[] __initdata = { | 21 | #include "devices-db5500.h" |
21 | &ux500_uart0_device, | 22 | |
22 | &ux500_uart1_device, | 23 | static void __init u5500_uart_init(void) |
23 | &ux500_uart2_device, | 24 | { |
24 | }; | 25 | db5500_add_uart0(); |
26 | db5500_add_uart1(); | ||
27 | db5500_add_uart2(); | ||
28 | } | ||
25 | 29 | ||
26 | static void __init u5500_init_machine(void) | 30 | static void __init u5500_init_machine(void) |
27 | { | 31 | { |
28 | u5500_init_devices(); | 32 | u5500_init_devices(); |
29 | 33 | ||
30 | amba_add_devices(amba_board_devs, ARRAY_SIZE(amba_board_devs)); | 34 | u5500_sdi_init(); |
35 | u5500_uart_init(); | ||
31 | } | 36 | } |
32 | 37 | ||
33 | MACHINE_START(U8500, "ST-Ericsson U5500 Platform") | 38 | MACHINE_START(U5500, "ST-Ericsson U5500 Platform") |
34 | .boot_params = 0x00000100, | 39 | .boot_params = 0x00000100, |
35 | .map_io = u5500_map_io, | 40 | .map_io = u5500_map_io, |
36 | .init_irq = ux500_init_irq, | 41 | .init_irq = ux500_init_irq, |
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index 1675047daf20..ccff2dae167f 100644 --- a/arch/arm/mach-ux500/clock.c +++ b/arch/arm/mach-ux500/clock.c | |||
@@ -13,13 +13,18 @@ | |||
13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | 16 | #include <linux/clkdev.h> | |
17 | #include <asm/clkdev.h> | ||
18 | 17 | ||
19 | #include <plat/mtu.h> | 18 | #include <plat/mtu.h> |
20 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
21 | #include "clock.h" | 20 | #include "clock.h" |
22 | 21 | ||
22 | #ifdef CONFIG_DEBUG_FS | ||
23 | #include <linux/debugfs.h> | ||
24 | #include <linux/uaccess.h> /* for copy_from_user */ | ||
25 | static LIST_HEAD(clk_list); | ||
26 | #endif | ||
27 | |||
23 | #define PRCC_PCKEN 0x00 | 28 | #define PRCC_PCKEN 0x00 |
24 | #define PRCC_PCKDIS 0x04 | 29 | #define PRCC_PCKDIS 0x04 |
25 | #define PRCC_KCKEN 0x08 | 30 | #define PRCC_KCKEN 0x08 |
@@ -133,7 +138,7 @@ static unsigned long clk_mtu_get_rate(struct clk *clk) | |||
133 | { | 138 | { |
134 | void __iomem *addr = __io_address(UX500_PRCMU_BASE) | 139 | void __iomem *addr = __io_address(UX500_PRCMU_BASE) |
135 | + PRCM_TCR; | 140 | + PRCM_TCR; |
136 | u32 tcr = readl(addr); | 141 | u32 tcr; |
137 | int mtu = (int) clk->data; | 142 | int mtu = (int) clk->data; |
138 | /* | 143 | /* |
139 | * One of these is selected eventually | 144 | * One of these is selected eventually |
@@ -144,6 +149,14 @@ static unsigned long clk_mtu_get_rate(struct clk *clk) | |||
144 | unsigned long mturate; | 149 | unsigned long mturate; |
145 | unsigned long retclk; | 150 | unsigned long retclk; |
146 | 151 | ||
152 | /* | ||
153 | * On a startup, always conifgure the TCR to the doze mode; | ||
154 | * bootloaders do it for us. Do this in the kernel too. | ||
155 | */ | ||
156 | writel(PRCM_TCR_DOZE_MODE, addr); | ||
157 | |||
158 | tcr = readl(addr); | ||
159 | |||
147 | /* Get the rate from the parent as a default */ | 160 | /* Get the rate from the parent as a default */ |
148 | if (clk->parent_periph) | 161 | if (clk->parent_periph) |
149 | mturate = clk_get_rate(clk->parent_periph); | 162 | mturate = clk_get_rate(clk->parent_periph); |
@@ -153,45 +166,6 @@ static unsigned long clk_mtu_get_rate(struct clk *clk) | |||
153 | /* We need to be connected SOMEWHERE */ | 166 | /* We need to be connected SOMEWHERE */ |
154 | BUG(); | 167 | BUG(); |
155 | 168 | ||
156 | /* | ||
157 | * Are we in doze mode? | ||
158 | * In this mode the parent peripheral or the fixed 32768 Hz | ||
159 | * clock is fed into the block. | ||
160 | */ | ||
161 | if (!(tcr & PRCM_TCR_DOZE_MODE)) { | ||
162 | /* | ||
163 | * Here we're using the clock input from the APE ULP | ||
164 | * clock domain. But first: are the timers stopped? | ||
165 | */ | ||
166 | if (tcr & PRCM_TCR_STOPPED) { | ||
167 | clk32k = 0; | ||
168 | mturate = 0; | ||
169 | } else { | ||
170 | /* Else default mode: 0 and 2.4 MHz */ | ||
171 | clk32k = 0; | ||
172 | if (cpu_is_u5500()) | ||
173 | /* DB5500 divides by 8 */ | ||
174 | mturate /= 8; | ||
175 | else if (cpu_is_u8500ed()) { | ||
176 | /* | ||
177 | * This clocking setting must not be used | ||
178 | * in the ED chip, it is simply not | ||
179 | * connected anywhere! | ||
180 | */ | ||
181 | mturate = 0; | ||
182 | BUG(); | ||
183 | } else | ||
184 | /* | ||
185 | * In this mode the ulp38m4 clock is divided | ||
186 | * by a factor 16, on the DB8500 typically | ||
187 | * 38400000 / 16 ~ 2.4 MHz. | ||
188 | * TODO: Replace the constant with a reference | ||
189 | * to the ULP source once this is modeled. | ||
190 | */ | ||
191 | mturate = 38400000 / 16; | ||
192 | } | ||
193 | } | ||
194 | |||
195 | /* Return the clock selected for this MTU */ | 169 | /* Return the clock selected for this MTU */ |
196 | if (tcr & (1 << mtu)) | 170 | if (tcr & (1 << mtu)) |
197 | retclk = clk32k; | 171 | retclk = clk32k; |
@@ -317,6 +291,7 @@ static struct clkops clk_prcc_ops = { | |||
317 | }; | 291 | }; |
318 | 292 | ||
319 | static struct clk clk_32khz = { | 293 | static struct clk clk_32khz = { |
294 | .name = "clk_32khz", | ||
320 | .rate = 32000, | 295 | .rate = 32000, |
321 | }; | 296 | }; |
322 | 297 | ||
@@ -366,94 +341,96 @@ static DEFINE_PRCMU_CLK(uiccclk, 0x4, 1, UICCCLK); /* v1 */ | |||
366 | */ | 341 | */ |
367 | 342 | ||
368 | /* Peripheral Cluster #1 */ | 343 | /* Peripheral Cluster #1 */ |
369 | static DEFINE_PRCC_CLK(1, i2c4, 10, 9, &clk_i2cclk); | 344 | static DEFINE_PRCC_CLK(1, i2c4, 10, 9, &clk_i2cclk); |
370 | static DEFINE_PRCC_CLK(1, gpio0, 9, -1, NULL); | 345 | static DEFINE_PRCC_CLK(1, gpio0, 9, -1, NULL); |
371 | static DEFINE_PRCC_CLK(1, slimbus0, 8, 8, &clk_slimclk); | 346 | static DEFINE_PRCC_CLK(1, slimbus0, 8, 8, &clk_slimclk); |
372 | static DEFINE_PRCC_CLK(1, spi3_ed, 7, 7, NULL); | 347 | static DEFINE_PRCC_CLK(1, spi3_ed, 7, 7, NULL); |
373 | static DEFINE_PRCC_CLK(1, spi3_v1, 7, -1, NULL); | 348 | static DEFINE_PRCC_CLK(1, spi3_v1, 7, -1, NULL); |
374 | static DEFINE_PRCC_CLK(1, i2c2, 6, 6, &clk_i2cclk); | 349 | static DEFINE_PRCC_CLK(1, i2c2, 6, 6, &clk_i2cclk); |
375 | static DEFINE_PRCC_CLK(1, sdi0, 5, 5, &clk_sdmmcclk); | 350 | static DEFINE_PRCC_CLK(1, sdi0, 5, 5, &clk_sdmmcclk); |
376 | static DEFINE_PRCC_CLK(1, msp1_ed, 4, 4, &clk_msp02clk); | 351 | static DEFINE_PRCC_CLK(1, msp1_ed, 4, 4, &clk_msp02clk); |
377 | static DEFINE_PRCC_CLK(1, msp1_v1, 4, 4, &clk_msp1clk); | 352 | static DEFINE_PRCC_CLK(1, msp1_v1, 4, 4, &clk_msp1clk); |
378 | static DEFINE_PRCC_CLK(1, msp0, 3, 3, &clk_msp02clk); | 353 | static DEFINE_PRCC_CLK(1, msp0, 3, 3, &clk_msp02clk); |
379 | static DEFINE_PRCC_CLK(1, i2c1, 2, 2, &clk_i2cclk); | 354 | static DEFINE_PRCC_CLK(1, i2c1, 2, 2, &clk_i2cclk); |
380 | static DEFINE_PRCC_CLK(1, uart1, 1, 1, &clk_uartclk); | 355 | static DEFINE_PRCC_CLK(1, uart1, 1, 1, &clk_uartclk); |
381 | static DEFINE_PRCC_CLK(1, uart0, 0, 0, &clk_uartclk); | 356 | static DEFINE_PRCC_CLK(1, uart0, 0, 0, &clk_uartclk); |
382 | 357 | ||
383 | /* Peripheral Cluster #2 */ | 358 | /* Peripheral Cluster #2 */ |
384 | 359 | ||
385 | static DEFINE_PRCC_CLK(2, gpio1_ed, 12, -1, NULL); | 360 | static DEFINE_PRCC_CLK(2, gpio1_ed, 12, -1, NULL); |
386 | static DEFINE_PRCC_CLK(2, ssitx_ed, 11, -1, NULL); | 361 | static DEFINE_PRCC_CLK(2, ssitx_ed, 11, -1, NULL); |
387 | static DEFINE_PRCC_CLK(2, ssirx_ed, 10, -1, NULL); | 362 | static DEFINE_PRCC_CLK(2, ssirx_ed, 10, -1, NULL); |
388 | static DEFINE_PRCC_CLK(2, spi0_ed, 9, -1, NULL); | 363 | static DEFINE_PRCC_CLK(2, spi0_ed, 9, -1, NULL); |
389 | static DEFINE_PRCC_CLK(2, sdi3_ed, 8, 6, &clk_sdmmcclk); | 364 | static DEFINE_PRCC_CLK(2, sdi3_ed, 8, 6, &clk_sdmmcclk); |
390 | static DEFINE_PRCC_CLK(2, sdi1_ed, 7, 5, &clk_sdmmcclk); | 365 | static DEFINE_PRCC_CLK(2, sdi1_ed, 7, 5, &clk_sdmmcclk); |
391 | static DEFINE_PRCC_CLK(2, msp2_ed, 6, 4, &clk_msp02clk); | 366 | static DEFINE_PRCC_CLK(2, msp2_ed, 6, 4, &clk_msp02clk); |
392 | static DEFINE_PRCC_CLK(2, sdi4_ed, 4, 2, &clk_sdmmcclk); | 367 | static DEFINE_PRCC_CLK(2, sdi4_ed, 4, 2, &clk_sdmmcclk); |
393 | static DEFINE_PRCC_CLK(2, pwl_ed, 3, 1, NULL); | 368 | static DEFINE_PRCC_CLK(2, pwl_ed, 3, 1, NULL); |
394 | static DEFINE_PRCC_CLK(2, spi1_ed, 2, -1, NULL); | 369 | static DEFINE_PRCC_CLK(2, spi1_ed, 2, -1, NULL); |
395 | static DEFINE_PRCC_CLK(2, spi2_ed, 1, -1, NULL); | 370 | static DEFINE_PRCC_CLK(2, spi2_ed, 1, -1, NULL); |
396 | static DEFINE_PRCC_CLK(2, i2c3_ed, 0, 0, &clk_i2cclk); | 371 | static DEFINE_PRCC_CLK(2, i2c3_ed, 0, 0, &clk_i2cclk); |
397 | 372 | ||
398 | static DEFINE_PRCC_CLK(2, gpio1_v1, 11, -1, NULL); | 373 | static DEFINE_PRCC_CLK(2, gpio1_v1, 11, -1, NULL); |
399 | static DEFINE_PRCC_CLK(2, ssitx_v1, 10, 7, NULL); | 374 | static DEFINE_PRCC_CLK(2, ssitx_v1, 10, 7, NULL); |
400 | static DEFINE_PRCC_CLK(2, ssirx_v1, 9, 6, NULL); | 375 | static DEFINE_PRCC_CLK(2, ssirx_v1, 9, 6, NULL); |
401 | static DEFINE_PRCC_CLK(2, spi0_v1, 8, -1, NULL); | 376 | static DEFINE_PRCC_CLK(2, spi0_v1, 8, -1, NULL); |
402 | static DEFINE_PRCC_CLK(2, sdi3_v1, 7, 5, &clk_sdmmcclk); | 377 | static DEFINE_PRCC_CLK(2, sdi3_v1, 7, 5, &clk_sdmmcclk); |
403 | static DEFINE_PRCC_CLK(2, sdi1_v1, 6, 4, &clk_sdmmcclk); | 378 | static DEFINE_PRCC_CLK(2, sdi1_v1, 6, 4, &clk_sdmmcclk); |
404 | static DEFINE_PRCC_CLK(2, msp2_v1, 5, 3, &clk_msp02clk); | 379 | static DEFINE_PRCC_CLK(2, msp2_v1, 5, 3, &clk_msp02clk); |
405 | static DEFINE_PRCC_CLK(2, sdi4_v1, 4, 2, &clk_sdmmcclk); | 380 | static DEFINE_PRCC_CLK(2, sdi4_v1, 4, 2, &clk_sdmmcclk); |
406 | static DEFINE_PRCC_CLK(2, pwl_v1, 3, 1, NULL); | 381 | static DEFINE_PRCC_CLK(2, pwl_v1, 3, 1, NULL); |
407 | static DEFINE_PRCC_CLK(2, spi1_v1, 2, -1, NULL); | 382 | static DEFINE_PRCC_CLK(2, spi1_v1, 2, -1, NULL); |
408 | static DEFINE_PRCC_CLK(2, spi2_v1, 1, -1, NULL); | 383 | static DEFINE_PRCC_CLK(2, spi2_v1, 1, -1, NULL); |
409 | static DEFINE_PRCC_CLK(2, i2c3_v1, 0, 0, &clk_i2cclk); | 384 | static DEFINE_PRCC_CLK(2, i2c3_v1, 0, 0, &clk_i2cclk); |
410 | 385 | ||
411 | /* Peripheral Cluster #3 */ | 386 | /* Peripheral Cluster #3 */ |
412 | static DEFINE_PRCC_CLK(3, gpio2, 8, -1, NULL); | 387 | static DEFINE_PRCC_CLK(3, gpio2, 8, -1, NULL); |
413 | static DEFINE_PRCC_CLK(3, sdi5, 7, 7, &clk_sdmmcclk); | 388 | static DEFINE_PRCC_CLK(3, sdi5, 7, 7, &clk_sdmmcclk); |
414 | static DEFINE_PRCC_CLK(3, uart2, 6, 6, &clk_uartclk); | 389 | static DEFINE_PRCC_CLK(3, uart2, 6, 6, &clk_uartclk); |
415 | static DEFINE_PRCC_CLK(3, ske, 5, 5, &clk_32khz); | 390 | static DEFINE_PRCC_CLK(3, ske, 5, 5, &clk_32khz); |
416 | static DEFINE_PRCC_CLK(3, sdi2, 4, 4, &clk_sdmmcclk); | 391 | static DEFINE_PRCC_CLK(3, sdi2, 4, 4, &clk_sdmmcclk); |
417 | static DEFINE_PRCC_CLK(3, i2c0, 3, 3, &clk_i2cclk); | 392 | static DEFINE_PRCC_CLK(3, i2c0, 3, 3, &clk_i2cclk); |
418 | static DEFINE_PRCC_CLK(3, ssp1_ed, 2, 2, &clk_i2cclk); | 393 | static DEFINE_PRCC_CLK(3, ssp1_ed, 2, 2, &clk_i2cclk); |
419 | static DEFINE_PRCC_CLK(3, ssp0_ed, 1, 1, &clk_i2cclk); | 394 | static DEFINE_PRCC_CLK(3, ssp0_ed, 1, 1, &clk_i2cclk); |
420 | static DEFINE_PRCC_CLK(3, ssp1_v1, 2, 2, &clk_sspclk); | 395 | static DEFINE_PRCC_CLK(3, ssp1_v1, 2, 2, &clk_sspclk); |
421 | static DEFINE_PRCC_CLK(3, ssp0_v1, 1, 1, &clk_sspclk); | 396 | static DEFINE_PRCC_CLK(3, ssp0_v1, 1, 1, &clk_sspclk); |
422 | static DEFINE_PRCC_CLK(3, fsmc, 0, -1, NULL); | 397 | static DEFINE_PRCC_CLK(3, fsmc, 0, -1, NULL); |
423 | 398 | ||
424 | /* Peripheral Cluster #4 is in the always on domain */ | 399 | /* Peripheral Cluster #4 is in the always on domain */ |
425 | 400 | ||
426 | /* Peripheral Cluster #5 */ | 401 | /* Peripheral Cluster #5 */ |
427 | static DEFINE_PRCC_CLK(5, gpio3, 1, -1, NULL); | 402 | static DEFINE_PRCC_CLK(5, gpio3, 1, -1, NULL); |
428 | static DEFINE_PRCC_CLK(5, usb_ed, 0, 0, &clk_i2cclk); | 403 | static DEFINE_PRCC_CLK(5, usb_ed, 0, 0, &clk_i2cclk); |
429 | static DEFINE_PRCC_CLK(5, usb_v1, 0, 0, NULL); | 404 | static DEFINE_PRCC_CLK(5, usb_v1, 0, 0, NULL); |
430 | 405 | ||
431 | /* Peripheral Cluster #6 */ | 406 | /* Peripheral Cluster #6 */ |
432 | 407 | ||
433 | /* MTU ID in data */ | 408 | /* MTU ID in data */ |
434 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu1_v1, 8, -1, NULL, clk_mtu_get_rate, 1); | 409 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu1_v1, 8, -1, NULL, clk_mtu_get_rate, 1); |
435 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu0_v1, 7, -1, NULL, clk_mtu_get_rate, 0); | 410 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu0_v1, 7, -1, NULL, clk_mtu_get_rate, 0); |
436 | static DEFINE_PRCC_CLK(6, cfgreg_v1, 6, 6, NULL); | 411 | static DEFINE_PRCC_CLK(6, cfgreg_v1, 6, 6, NULL); |
437 | static DEFINE_PRCC_CLK(6, dmc_ed, 6, 6, NULL); | 412 | static DEFINE_PRCC_CLK(6, dmc_ed, 6, 6, NULL); |
438 | static DEFINE_PRCC_CLK(6, hash1, 5, -1, NULL); | 413 | static DEFINE_PRCC_CLK(6, hash1, 5, -1, NULL); |
439 | static DEFINE_PRCC_CLK(6, unipro_v1, 4, 1, &clk_uniproclk); | 414 | static DEFINE_PRCC_CLK(6, unipro_v1, 4, 1, &clk_uniproclk); |
440 | static DEFINE_PRCC_CLK(6, cryp1_ed, 4, -1, NULL); | 415 | static DEFINE_PRCC_CLK(6, cryp1_ed, 4, -1, NULL); |
441 | static DEFINE_PRCC_CLK(6, pka, 3, -1, NULL); | 416 | static DEFINE_PRCC_CLK(6, pka, 3, -1, NULL); |
442 | static DEFINE_PRCC_CLK(6, hash0, 2, -1, NULL); | 417 | static DEFINE_PRCC_CLK(6, hash0, 2, -1, NULL); |
443 | static DEFINE_PRCC_CLK(6, cryp0, 1, -1, NULL); | 418 | static DEFINE_PRCC_CLK(6, cryp0, 1, -1, NULL); |
444 | static DEFINE_PRCC_CLK(6, rng_ed, 0, 0, &clk_i2cclk); | 419 | static DEFINE_PRCC_CLK(6, rng_ed, 0, 0, &clk_i2cclk); |
445 | static DEFINE_PRCC_CLK(6, rng_v1, 0, 0, &clk_rngclk); | 420 | static DEFINE_PRCC_CLK(6, rng_v1, 0, 0, &clk_rngclk); |
446 | 421 | ||
447 | /* Peripheral Cluster #7 */ | 422 | /* Peripheral Cluster #7 */ |
448 | 423 | ||
449 | static DEFINE_PRCC_CLK(7, tzpc0_ed, 4, -1, NULL); | 424 | static DEFINE_PRCC_CLK(7, tzpc0_ed, 4, -1, NULL); |
450 | /* MTU ID in data */ | 425 | /* MTU ID in data */ |
451 | static DEFINE_PRCC_CLK_CUSTOM(7, mtu1_ed, 3, -1, NULL, clk_mtu_get_rate, 1); | 426 | static DEFINE_PRCC_CLK_CUSTOM(7, mtu1_ed, 3, -1, NULL, clk_mtu_get_rate, 1); |
452 | static DEFINE_PRCC_CLK_CUSTOM(7, mtu0_ed, 2, -1, NULL, clk_mtu_get_rate, 0); | 427 | static DEFINE_PRCC_CLK_CUSTOM(7, mtu0_ed, 2, -1, NULL, clk_mtu_get_rate, 0); |
453 | static DEFINE_PRCC_CLK(7, wdg_ed, 1, -1, NULL); | 428 | static DEFINE_PRCC_CLK(7, wdg_ed, 1, -1, NULL); |
454 | static DEFINE_PRCC_CLK(7, cfgreg_ed, 0, -1, NULL); | 429 | static DEFINE_PRCC_CLK(7, cfgreg_ed, 0, -1, NULL); |
455 | 430 | ||
456 | static struct clk clk_dummy_apb_pclk; | 431 | static struct clk clk_dummy_apb_pclk = { |
432 | .name = "apb_pclk", | ||
433 | }; | ||
457 | 434 | ||
458 | static struct clk_lookup u8500_common_clks[] = { | 435 | static struct clk_lookup u8500_common_clks[] = { |
459 | CLK(dummy_apb_pclk, NULL, "apb_pclk"), | 436 | CLK(dummy_apb_pclk, NULL, "apb_pclk"), |
@@ -554,7 +531,7 @@ static struct clk_lookup u8500_ed_clks[] = { | |||
554 | 531 | ||
555 | static struct clk_lookup u8500_v1_clks[] = { | 532 | static struct clk_lookup u8500_v1_clks[] = { |
556 | /* Peripheral Cluster #1 */ | 533 | /* Peripheral Cluster #1 */ |
557 | CLK(i2c4, "nmk-i2c.4", NULL), | 534 | CLK(i2c4, "nmk-i2c.4", NULL), |
558 | CLK(spi3_v1, "spi3", NULL), | 535 | CLK(spi3_v1, "spi3", NULL), |
559 | CLK(msp1_v1, "msp1", NULL), | 536 | CLK(msp1_v1, "msp1", NULL), |
560 | 537 | ||
@@ -599,6 +576,183 @@ static struct clk_lookup u8500_v1_clks[] = { | |||
599 | CLK(uiccclk, "uicc", NULL), | 576 | CLK(uiccclk, "uicc", NULL), |
600 | }; | 577 | }; |
601 | 578 | ||
579 | #ifdef CONFIG_DEBUG_FS | ||
580 | /* | ||
581 | * debugfs support to trace clock tree hierarchy and attributes with | ||
582 | * powerdebug | ||
583 | */ | ||
584 | static struct dentry *clk_debugfs_root; | ||
585 | |||
586 | void __init clk_debugfs_add_table(struct clk_lookup *cl, size_t num) | ||
587 | { | ||
588 | while (num--) { | ||
589 | /* Check that the clock has not been already registered */ | ||
590 | if (!(cl->clk->list.prev != cl->clk->list.next)) | ||
591 | list_add_tail(&cl->clk->list, &clk_list); | ||
592 | |||
593 | cl++; | ||
594 | } | ||
595 | } | ||
596 | |||
597 | static ssize_t usecount_dbg_read(struct file *file, char __user *buf, | ||
598 | size_t size, loff_t *off) | ||
599 | { | ||
600 | struct clk *clk = file->f_dentry->d_inode->i_private; | ||
601 | char cusecount[128]; | ||
602 | unsigned int len; | ||
603 | |||
604 | len = sprintf(cusecount, "%u\n", clk->enabled); | ||
605 | return simple_read_from_buffer(buf, size, off, cusecount, len); | ||
606 | } | ||
607 | |||
608 | static ssize_t rate_dbg_read(struct file *file, char __user *buf, | ||
609 | size_t size, loff_t *off) | ||
610 | { | ||
611 | struct clk *clk = file->f_dentry->d_inode->i_private; | ||
612 | char crate[128]; | ||
613 | unsigned int rate; | ||
614 | unsigned int len; | ||
615 | |||
616 | rate = clk_get_rate(clk); | ||
617 | len = sprintf(crate, "%u\n", rate); | ||
618 | return simple_read_from_buffer(buf, size, off, crate, len); | ||
619 | } | ||
620 | |||
621 | static const struct file_operations usecount_fops = { | ||
622 | .read = usecount_dbg_read, | ||
623 | }; | ||
624 | |||
625 | static const struct file_operations set_rate_fops = { | ||
626 | .read = rate_dbg_read, | ||
627 | }; | ||
628 | |||
629 | static struct dentry *clk_debugfs_register_dir(struct clk *c, | ||
630 | struct dentry *p_dentry) | ||
631 | { | ||
632 | struct dentry *d, *clk_d, *child, *child_tmp; | ||
633 | char s[255]; | ||
634 | char *p = s; | ||
635 | |||
636 | if (c->name == NULL) | ||
637 | p += sprintf(p, "BUG"); | ||
638 | else | ||
639 | p += sprintf(p, "%s", c->name); | ||
640 | |||
641 | clk_d = debugfs_create_dir(s, p_dentry); | ||
642 | if (!clk_d) | ||
643 | return NULL; | ||
644 | |||
645 | d = debugfs_create_file("usecount", S_IRUGO, | ||
646 | clk_d, c, &usecount_fops); | ||
647 | if (!d) | ||
648 | goto err_out; | ||
649 | d = debugfs_create_file("rate", S_IRUGO, | ||
650 | clk_d, c, &set_rate_fops); | ||
651 | if (!d) | ||
652 | goto err_out; | ||
653 | /* | ||
654 | * TODO : not currently available in ux500 | ||
655 | * d = debugfs_create_x32("flags", S_IRUGO, clk_d, (u32 *)&c->flags); | ||
656 | * if (!d) | ||
657 | * goto err_out; | ||
658 | */ | ||
659 | |||
660 | return clk_d; | ||
661 | |||
662 | err_out: | ||
663 | d = clk_d; | ||
664 | list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) | ||
665 | debugfs_remove(child); | ||
666 | debugfs_remove(clk_d); | ||
667 | return NULL; | ||
668 | } | ||
669 | |||
670 | static void clk_debugfs_remove_dir(struct dentry *cdentry) | ||
671 | { | ||
672 | struct dentry *d, *child, *child_tmp; | ||
673 | |||
674 | d = cdentry; | ||
675 | list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) | ||
676 | debugfs_remove(child); | ||
677 | debugfs_remove(cdentry); | ||
678 | return ; | ||
679 | } | ||
680 | |||
681 | static int clk_debugfs_register_one(struct clk *c) | ||
682 | { | ||
683 | struct clk *pa = c->parent_periph; | ||
684 | struct clk *bpa = c->parent_cluster; | ||
685 | |||
686 | if (!(bpa && !pa)) { | ||
687 | c->dent = clk_debugfs_register_dir(c, | ||
688 | pa ? pa->dent : clk_debugfs_root); | ||
689 | if (!c->dent) | ||
690 | return -ENOMEM; | ||
691 | } | ||
692 | |||
693 | if (bpa) { | ||
694 | c->dent_bus = clk_debugfs_register_dir(c, | ||
695 | bpa->dent_bus ? bpa->dent_bus : bpa->dent); | ||
696 | if ((!c->dent_bus) && (c->dent)) { | ||
697 | clk_debugfs_remove_dir(c->dent); | ||
698 | c->dent = NULL; | ||
699 | return -ENOMEM; | ||
700 | } | ||
701 | } | ||
702 | return 0; | ||
703 | } | ||
704 | |||
705 | static int clk_debugfs_register(struct clk *c) | ||
706 | { | ||
707 | int err; | ||
708 | struct clk *pa = c->parent_periph; | ||
709 | struct clk *bpa = c->parent_cluster; | ||
710 | |||
711 | if (pa && (!pa->dent && !pa->dent_bus)) { | ||
712 | err = clk_debugfs_register(pa); | ||
713 | if (err) | ||
714 | return err; | ||
715 | } | ||
716 | |||
717 | if (bpa && (!bpa->dent && !bpa->dent_bus)) { | ||
718 | err = clk_debugfs_register(bpa); | ||
719 | if (err) | ||
720 | return err; | ||
721 | } | ||
722 | |||
723 | if ((!c->dent) && (!c->dent_bus)) { | ||
724 | err = clk_debugfs_register_one(c); | ||
725 | if (err) | ||
726 | return err; | ||
727 | } | ||
728 | return 0; | ||
729 | } | ||
730 | |||
731 | static int __init clk_debugfs_init(void) | ||
732 | { | ||
733 | struct clk *c; | ||
734 | struct dentry *d; | ||
735 | int err; | ||
736 | |||
737 | d = debugfs_create_dir("clock", NULL); | ||
738 | if (!d) | ||
739 | return -ENOMEM; | ||
740 | clk_debugfs_root = d; | ||
741 | |||
742 | list_for_each_entry(c, &clk_list, list) { | ||
743 | err = clk_debugfs_register(c); | ||
744 | if (err) | ||
745 | goto err_out; | ||
746 | } | ||
747 | return 0; | ||
748 | err_out: | ||
749 | debugfs_remove_recursive(clk_debugfs_root); | ||
750 | return err; | ||
751 | } | ||
752 | |||
753 | late_initcall(clk_debugfs_init); | ||
754 | #endif /* defined(CONFIG_DEBUG_FS) */ | ||
755 | |||
602 | int __init clk_init(void) | 756 | int __init clk_init(void) |
603 | { | 757 | { |
604 | if (cpu_is_u8500ed()) { | 758 | if (cpu_is_u8500ed()) { |
@@ -609,7 +763,8 @@ int __init clk_init(void) | |||
609 | /* Clock tree for U5500 not implemented yet */ | 763 | /* Clock tree for U5500 not implemented yet */ |
610 | clk_prcc_ops.enable = clk_prcc_ops.disable = NULL; | 764 | clk_prcc_ops.enable = clk_prcc_ops.disable = NULL; |
611 | clk_prcmu_ops.enable = clk_prcmu_ops.disable = NULL; | 765 | clk_prcmu_ops.enable = clk_prcmu_ops.disable = NULL; |
612 | clk_per6clk.rate = 26000000; | 766 | clk_uartclk.rate = 36360000; |
767 | clk_sdmmcclk.rate = 99900000; | ||
613 | } | 768 | } |
614 | 769 | ||
615 | clkdev_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks)); | 770 | clkdev_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks)); |
@@ -618,5 +773,12 @@ int __init clk_init(void) | |||
618 | else | 773 | else |
619 | clkdev_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks)); | 774 | clkdev_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks)); |
620 | 775 | ||
776 | #ifdef CONFIG_DEBUG_FS | ||
777 | clk_debugfs_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks)); | ||
778 | if (cpu_is_u8500ed()) | ||
779 | clk_debugfs_add_table(u8500_ed_clks, ARRAY_SIZE(u8500_ed_clks)); | ||
780 | else | ||
781 | clk_debugfs_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks)); | ||
782 | #endif | ||
621 | return 0; | 783 | return 0; |
622 | } | 784 | } |
diff --git a/arch/arm/mach-ux500/clock.h b/arch/arm/mach-ux500/clock.h index a05802501527..074490705229 100644 --- a/arch/arm/mach-ux500/clock.h +++ b/arch/arm/mach-ux500/clock.h | |||
@@ -90,6 +90,10 @@ struct clk { | |||
90 | 90 | ||
91 | struct clk *parent_cluster; | 91 | struct clk *parent_cluster; |
92 | struct clk *parent_periph; | 92 | struct clk *parent_periph; |
93 | #if defined(CONFIG_DEBUG_FS) | ||
94 | struct dentry *dent; /* For visible tree hierarchy */ | ||
95 | struct dentry *dent_bus; /* For visible tree hierarchy */ | ||
96 | #endif | ||
93 | }; | 97 | }; |
94 | 98 | ||
95 | #define DEFINE_PRCMU_CLK(_name, _cg_off, _cg_bit, _reg) \ | 99 | #define DEFINE_PRCMU_CLK(_name, _cg_off, _cg_bit, _reg) \ |
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c index 2f87075e9d6f..acc841e48de4 100644 --- a/arch/arm/mach-ux500/cpu-db5500.c +++ b/arch/arm/mach-ux500/cpu-db5500.c | |||
@@ -8,14 +8,19 @@ | |||
8 | #include <linux/platform_device.h> | 8 | #include <linux/platform_device.h> |
9 | #include <linux/amba/bus.h> | 9 | #include <linux/amba/bus.h> |
10 | #include <linux/io.h> | 10 | #include <linux/io.h> |
11 | #include <linux/irq.h> | ||
11 | 12 | ||
12 | #include <asm/mach/map.h> | 13 | #include <asm/mach/map.h> |
13 | 14 | ||
15 | #include <plat/gpio.h> | ||
16 | |||
14 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
15 | #include <mach/devices.h> | 18 | #include <mach/devices.h> |
16 | #include <mach/setup.h> | 19 | #include <mach/setup.h> |
17 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
18 | 21 | ||
22 | #include "devices-db5500.h" | ||
23 | |||
19 | static struct map_desc u5500_io_desc[] __initdata = { | 24 | static struct map_desc u5500_io_desc[] __initdata = { |
20 | __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K), | 25 | __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K), |
21 | __IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K), | 26 | __IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K), |
@@ -110,19 +115,32 @@ static struct platform_device mbox2_device = { | |||
110 | }; | 115 | }; |
111 | 116 | ||
112 | static struct platform_device *u5500_platform_devs[] __initdata = { | 117 | static struct platform_device *u5500_platform_devs[] __initdata = { |
113 | &u5500_gpio_devs[0], | ||
114 | &u5500_gpio_devs[1], | ||
115 | &u5500_gpio_devs[2], | ||
116 | &u5500_gpio_devs[3], | ||
117 | &u5500_gpio_devs[4], | ||
118 | &u5500_gpio_devs[5], | ||
119 | &u5500_gpio_devs[6], | ||
120 | &u5500_gpio_devs[7], | ||
121 | &mbox0_device, | 118 | &mbox0_device, |
122 | &mbox1_device, | 119 | &mbox1_device, |
123 | &mbox2_device, | 120 | &mbox2_device, |
124 | }; | 121 | }; |
125 | 122 | ||
123 | static resource_size_t __initdata db5500_gpio_base[] = { | ||
124 | U5500_GPIOBANK0_BASE, | ||
125 | U5500_GPIOBANK1_BASE, | ||
126 | U5500_GPIOBANK2_BASE, | ||
127 | U5500_GPIOBANK3_BASE, | ||
128 | U5500_GPIOBANK4_BASE, | ||
129 | U5500_GPIOBANK5_BASE, | ||
130 | U5500_GPIOBANK6_BASE, | ||
131 | U5500_GPIOBANK7_BASE, | ||
132 | }; | ||
133 | |||
134 | static void __init db5500_add_gpios(void) | ||
135 | { | ||
136 | struct nmk_gpio_platform_data pdata = { | ||
137 | /* No custom data yet */ | ||
138 | }; | ||
139 | |||
140 | dbx500_add_gpios(ARRAY_AND_SIZE(db5500_gpio_base), | ||
141 | IRQ_DB5500_GPIO0, &pdata); | ||
142 | } | ||
143 | |||
126 | void __init u5500_map_io(void) | 144 | void __init u5500_map_io(void) |
127 | { | 145 | { |
128 | ux500_map_io(); | 146 | ux500_map_io(); |
@@ -132,7 +150,9 @@ void __init u5500_map_io(void) | |||
132 | 150 | ||
133 | void __init u5500_init_devices(void) | 151 | void __init u5500_init_devices(void) |
134 | { | 152 | { |
135 | ux500_init_devices(); | 153 | db5500_add_gpios(); |
154 | db5500_dma_init(); | ||
155 | db5500_add_rtc(); | ||
136 | 156 | ||
137 | platform_add_devices(u5500_platform_devs, | 157 | platform_add_devices(u5500_platform_devs, |
138 | ARRAY_SIZE(u5500_platform_devs)); | 158 | ARRAY_SIZE(u5500_platform_devs)); |
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 4acab7544b3c..c0f34a404c53 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -22,23 +22,15 @@ | |||
22 | #include <mach/setup.h> | 22 | #include <mach/setup.h> |
23 | #include <mach/devices.h> | 23 | #include <mach/devices.h> |
24 | 24 | ||
25 | #include "devices-db8500.h" | ||
26 | |||
25 | static struct platform_device *platform_devs[] __initdata = { | 27 | static struct platform_device *platform_devs[] __initdata = { |
26 | &u8500_gpio_devs[0], | ||
27 | &u8500_gpio_devs[1], | ||
28 | &u8500_gpio_devs[2], | ||
29 | &u8500_gpio_devs[3], | ||
30 | &u8500_gpio_devs[4], | ||
31 | &u8500_gpio_devs[5], | ||
32 | &u8500_gpio_devs[6], | ||
33 | &u8500_gpio_devs[7], | ||
34 | &u8500_gpio_devs[8], | ||
35 | &u8500_dma40_device, | 28 | &u8500_dma40_device, |
36 | }; | 29 | }; |
37 | 30 | ||
38 | /* minimum static i/o mapping required to boot U8500 platforms */ | 31 | /* minimum static i/o mapping required to boot U8500 platforms */ |
39 | static struct map_desc u8500_io_desc[] __initdata = { | 32 | static struct map_desc u8500_io_desc[] __initdata = { |
40 | __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), | 33 | __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), |
41 | __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE, SZ_4K), | ||
42 | __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), | 34 | __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), |
43 | __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), | 35 | __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), |
44 | __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K), | 36 | __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K), |
@@ -46,13 +38,18 @@ static struct map_desc u8500_io_desc[] __initdata = { | |||
46 | __MEM_DEV_DESC(U8500_BOOT_ROM_BASE, SZ_1M), | 38 | __MEM_DEV_DESC(U8500_BOOT_ROM_BASE, SZ_1M), |
47 | }; | 39 | }; |
48 | 40 | ||
49 | static struct map_desc u8500ed_io_desc[] __initdata = { | 41 | static struct map_desc u8500_ed_io_desc[] __initdata = { |
50 | __IO_DEV_DESC(U8500_MTU0_BASE_ED, SZ_4K), | 42 | __IO_DEV_DESC(U8500_MTU0_BASE_ED, SZ_4K), |
51 | __IO_DEV_DESC(U8500_CLKRST7_BASE_ED, SZ_8K), | 43 | __IO_DEV_DESC(U8500_CLKRST7_BASE_ED, SZ_8K), |
52 | }; | 44 | }; |
53 | 45 | ||
54 | static struct map_desc u8500v1_io_desc[] __initdata = { | 46 | static struct map_desc u8500_v1_io_desc[] __initdata = { |
55 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), | 47 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), |
48 | __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE_V1, SZ_4K), | ||
49 | }; | ||
50 | |||
51 | static struct map_desc u8500_v2_io_desc[] __initdata = { | ||
52 | __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE, SZ_4K), | ||
56 | }; | 53 | }; |
57 | 54 | ||
58 | /* | 55 | /* |
@@ -125,14 +122,38 @@ void __init u8500_map_io(void) | |||
125 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); | 122 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); |
126 | 123 | ||
127 | if (cpu_is_u8500ed()) | 124 | if (cpu_is_u8500ed()) |
128 | iotable_init(u8500ed_io_desc, ARRAY_SIZE(u8500ed_io_desc)); | 125 | iotable_init(u8500_ed_io_desc, ARRAY_SIZE(u8500_ed_io_desc)); |
129 | else | 126 | else if (cpu_is_u8500v1()) |
130 | iotable_init(u8500v1_io_desc, ARRAY_SIZE(u8500v1_io_desc)); | 127 | iotable_init(u8500_v1_io_desc, ARRAY_SIZE(u8500_v1_io_desc)); |
128 | else if (cpu_is_u8500v2()) | ||
129 | iotable_init(u8500_v2_io_desc, ARRAY_SIZE(u8500_v2_io_desc)); | ||
131 | 130 | ||
132 | /* Read out the ASIC ID as early as we can */ | 131 | /* Read out the ASIC ID as early as we can */ |
133 | get_db8500_asic_id(); | 132 | get_db8500_asic_id(); |
134 | } | 133 | } |
135 | 134 | ||
135 | static resource_size_t __initdata db8500_gpio_base[] = { | ||
136 | U8500_GPIOBANK0_BASE, | ||
137 | U8500_GPIOBANK1_BASE, | ||
138 | U8500_GPIOBANK2_BASE, | ||
139 | U8500_GPIOBANK3_BASE, | ||
140 | U8500_GPIOBANK4_BASE, | ||
141 | U8500_GPIOBANK5_BASE, | ||
142 | U8500_GPIOBANK6_BASE, | ||
143 | U8500_GPIOBANK7_BASE, | ||
144 | U8500_GPIOBANK8_BASE, | ||
145 | }; | ||
146 | |||
147 | static void __init db8500_add_gpios(void) | ||
148 | { | ||
149 | struct nmk_gpio_platform_data pdata = { | ||
150 | /* No custom data yet */ | ||
151 | }; | ||
152 | |||
153 | dbx500_add_gpios(ARRAY_AND_SIZE(db8500_gpio_base), | ||
154 | IRQ_DB8500_GPIO0, &pdata); | ||
155 | } | ||
156 | |||
136 | /* | 157 | /* |
137 | * This function is called from the board init | 158 | * This function is called from the board init |
138 | */ | 159 | */ |
@@ -152,12 +173,13 @@ void __init u8500_init_devices(void) | |||
152 | else | 173 | else |
153 | pr_warning("ASIC: UNKNOWN SILICON VERSION!\n"); | 174 | pr_warning("ASIC: UNKNOWN SILICON VERSION!\n"); |
154 | 175 | ||
155 | ux500_init_devices(); | ||
156 | |||
157 | if (cpu_is_u8500ed()) | 176 | if (cpu_is_u8500ed()) |
158 | dma40_u8500ed_fixup(); | 177 | dma40_u8500ed_fixup(); |
159 | 178 | ||
160 | /* Register the platform devices */ | 179 | db8500_add_rtc(); |
180 | db8500_add_gpios(); | ||
181 | |||
182 | platform_device_register_simple("cpufreq-u8500", -1, NULL, 0); | ||
161 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | 183 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); |
162 | 184 | ||
163 | return ; | 185 | return ; |
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index 608a1372b172..5730409c0f7d 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c | |||
@@ -6,7 +6,6 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/platform_device.h> | 8 | #include <linux/platform_device.h> |
9 | #include <linux/amba/bus.h> | ||
10 | #include <linux/io.h> | 9 | #include <linux/io.h> |
11 | #include <linux/clk.h> | 10 | #include <linux/clk.h> |
12 | 11 | ||
@@ -20,6 +19,7 @@ | |||
20 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
21 | #include <mach/setup.h> | 20 | #include <mach/setup.h> |
22 | #include <mach/devices.h> | 21 | #include <mach/devices.h> |
22 | #include <mach/prcmu.h> | ||
23 | 23 | ||
24 | #include "clock.h" | 24 | #include "clock.h" |
25 | 25 | ||
@@ -45,29 +45,22 @@ static struct map_desc ux500_io_desc[] __initdata = { | |||
45 | __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K), | 45 | __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K), |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static struct amba_device *ux500_amba_devs[] __initdata = { | ||
49 | &ux500_pl031_device, | ||
50 | }; | ||
51 | |||
52 | void __init ux500_map_io(void) | 48 | void __init ux500_map_io(void) |
53 | { | 49 | { |
54 | iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc)); | 50 | iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc)); |
55 | } | 51 | } |
56 | 52 | ||
57 | void __init ux500_init_devices(void) | ||
58 | { | ||
59 | amba_add_devices(ux500_amba_devs, ARRAY_SIZE(ux500_amba_devs)); | ||
60 | } | ||
61 | |||
62 | void __init ux500_init_irq(void) | 53 | void __init ux500_init_irq(void) |
63 | { | 54 | { |
64 | gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29); | 55 | gic_init(0, 29, __io_address(UX500_GIC_DIST_BASE), |
65 | gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE)); | 56 | __io_address(UX500_GIC_CPU_BASE)); |
66 | 57 | ||
67 | /* | 58 | /* |
68 | * Init clocks here so that they are available for system timer | 59 | * Init clocks here so that they are available for system timer |
69 | * initialization. | 60 | * initialization. |
70 | */ | 61 | */ |
62 | if (cpu_is_u8500()) | ||
63 | prcmu_early_init(); | ||
71 | clk_init(); | 64 | clk_init(); |
72 | } | 65 | } |
73 | 66 | ||
diff --git a/arch/arm/mach-ux500/cpufreq.c b/arch/arm/mach-ux500/cpufreq.c new file mode 100644 index 000000000000..5c5b747f134d --- /dev/null +++ b/arch/arm/mach-ux500/cpufreq.c | |||
@@ -0,0 +1,211 @@ | |||
1 | /* | ||
2 | * CPU frequency scaling for u8500 | ||
3 | * Inspired by linux/arch/arm/mach-davinci/cpufreq.c | ||
4 | * | ||
5 | * Copyright (C) STMicroelectronics 2009 | ||
6 | * Copyright (C) ST-Ericsson SA 2010 | ||
7 | * | ||
8 | * License Terms: GNU General Public License v2 | ||
9 | * | ||
10 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> | ||
11 | * Author: Martin Persson <martin.persson@stericsson.com> | ||
12 | * Author: Jonas Aaberg <jonas.aberg@stericsson.com> | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/cpufreq.h> | ||
19 | #include <linux/delay.h> | ||
20 | |||
21 | #include <mach/hardware.h> | ||
22 | #include <mach/prcmu.h> | ||
23 | #include <mach/prcmu-defs.h> | ||
24 | |||
25 | #define DRIVER_NAME "cpufreq-u8500" | ||
26 | #define CPUFREQ_NAME "u8500" | ||
27 | |||
28 | static struct device *dev; | ||
29 | |||
30 | static struct cpufreq_frequency_table freq_table[] = { | ||
31 | [0] = { | ||
32 | .index = 0, | ||
33 | .frequency = 200000, | ||
34 | }, | ||
35 | [1] = { | ||
36 | .index = 1, | ||
37 | .frequency = 300000, | ||
38 | }, | ||
39 | [2] = { | ||
40 | .index = 2, | ||
41 | .frequency = 600000, | ||
42 | }, | ||
43 | [3] = { | ||
44 | /* Used for CPU_OPP_MAX, if available */ | ||
45 | .index = 3, | ||
46 | .frequency = CPUFREQ_TABLE_END, | ||
47 | }, | ||
48 | [4] = { | ||
49 | .index = 4, | ||
50 | .frequency = CPUFREQ_TABLE_END, | ||
51 | }, | ||
52 | }; | ||
53 | |||
54 | static enum prcmu_cpu_opp index2opp[] = { | ||
55 | CPU_OPP_EXT_CLK, | ||
56 | CPU_OPP_50, | ||
57 | CPU_OPP_100, | ||
58 | CPU_OPP_MAX | ||
59 | }; | ||
60 | |||
61 | static int u8500_cpufreq_verify_speed(struct cpufreq_policy *policy) | ||
62 | { | ||
63 | return cpufreq_frequency_table_verify(policy, freq_table); | ||
64 | } | ||
65 | |||
66 | static int u8500_cpufreq_target(struct cpufreq_policy *policy, | ||
67 | unsigned int target_freq, | ||
68 | unsigned int relation) | ||
69 | { | ||
70 | struct cpufreq_freqs freqs; | ||
71 | unsigned int index; | ||
72 | int ret = 0; | ||
73 | |||
74 | /* | ||
75 | * Ensure desired rate is within allowed range. Some govenors | ||
76 | * (ondemand) will just pass target_freq=0 to get the minimum. | ||
77 | */ | ||
78 | if (target_freq < policy->cpuinfo.min_freq) | ||
79 | target_freq = policy->cpuinfo.min_freq; | ||
80 | if (target_freq > policy->cpuinfo.max_freq) | ||
81 | target_freq = policy->cpuinfo.max_freq; | ||
82 | |||
83 | ret = cpufreq_frequency_table_target(policy, freq_table, | ||
84 | target_freq, relation, &index); | ||
85 | if (ret < 0) { | ||
86 | dev_err(dev, "Could not look up next frequency\n"); | ||
87 | return ret; | ||
88 | } | ||
89 | |||
90 | freqs.old = policy->cur; | ||
91 | freqs.new = freq_table[index].frequency; | ||
92 | freqs.cpu = policy->cpu; | ||
93 | |||
94 | if (freqs.old == freqs.new) { | ||
95 | dev_dbg(dev, "Current and target frequencies are equal\n"); | ||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | dev_dbg(dev, "transition: %u --> %u\n", freqs.old, freqs.new); | ||
100 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | ||
101 | |||
102 | ret = prcmu_set_cpu_opp(index2opp[index]); | ||
103 | if (ret < 0) { | ||
104 | dev_err(dev, "Failed to set OPP level\n"); | ||
105 | return ret; | ||
106 | } | ||
107 | |||
108 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | ||
109 | |||
110 | return ret; | ||
111 | } | ||
112 | |||
113 | static unsigned int u8500_cpufreq_getspeed(unsigned int cpu) | ||
114 | { | ||
115 | int i; | ||
116 | |||
117 | for (i = 0; prcmu_get_cpu_opp() != index2opp[i]; i++) | ||
118 | ; | ||
119 | return freq_table[i].frequency; | ||
120 | } | ||
121 | |||
122 | static int __cpuinit u8500_cpu_init(struct cpufreq_policy *policy) | ||
123 | { | ||
124 | int res; | ||
125 | |||
126 | BUILD_BUG_ON(ARRAY_SIZE(index2opp) + 1 != ARRAY_SIZE(freq_table)); | ||
127 | |||
128 | if (cpu_is_u8500v2()) { | ||
129 | freq_table[1].frequency = 400000; | ||
130 | freq_table[2].frequency = 800000; | ||
131 | if (prcmu_has_arm_maxopp()) | ||
132 | freq_table[3].frequency = 1000000; | ||
133 | } | ||
134 | |||
135 | /* get policy fields based on the table */ | ||
136 | res = cpufreq_frequency_table_cpuinfo(policy, freq_table); | ||
137 | if (!res) | ||
138 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); | ||
139 | else { | ||
140 | dev_err(dev, "u8500-cpufreq : Failed to read policy table\n"); | ||
141 | return res; | ||
142 | } | ||
143 | |||
144 | policy->min = policy->cpuinfo.min_freq; | ||
145 | policy->max = policy->cpuinfo.max_freq; | ||
146 | policy->cur = u8500_cpufreq_getspeed(policy->cpu); | ||
147 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | ||
148 | |||
149 | /* | ||
150 | * FIXME : Need to take time measurement across the target() | ||
151 | * function with no/some/all drivers in the notification | ||
152 | * list. | ||
153 | */ | ||
154 | policy->cpuinfo.transition_latency = 200 * 1000; /* in ns */ | ||
155 | |||
156 | /* policy sharing between dual CPUs */ | ||
157 | cpumask_copy(policy->cpus, &cpu_present_map); | ||
158 | |||
159 | policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; | ||
160 | |||
161 | return res; | ||
162 | } | ||
163 | |||
164 | static struct freq_attr *u8500_cpufreq_attr[] = { | ||
165 | &cpufreq_freq_attr_scaling_available_freqs, | ||
166 | NULL, | ||
167 | }; | ||
168 | static int u8500_cpu_exit(struct cpufreq_policy *policy) | ||
169 | { | ||
170 | cpufreq_frequency_table_put_attr(policy->cpu); | ||
171 | return 0; | ||
172 | } | ||
173 | |||
174 | static struct cpufreq_driver u8500_driver = { | ||
175 | .owner = THIS_MODULE, | ||
176 | .flags = CPUFREQ_STICKY, | ||
177 | .verify = u8500_cpufreq_verify_speed, | ||
178 | .target = u8500_cpufreq_target, | ||
179 | .get = u8500_cpufreq_getspeed, | ||
180 | .init = u8500_cpu_init, | ||
181 | .exit = u8500_cpu_exit, | ||
182 | .name = CPUFREQ_NAME, | ||
183 | .attr = u8500_cpufreq_attr, | ||
184 | }; | ||
185 | |||
186 | static int __init u8500_cpufreq_probe(struct platform_device *pdev) | ||
187 | { | ||
188 | dev = &pdev->dev; | ||
189 | return cpufreq_register_driver(&u8500_driver); | ||
190 | } | ||
191 | |||
192 | static int __exit u8500_cpufreq_remove(struct platform_device *pdev) | ||
193 | { | ||
194 | return cpufreq_unregister_driver(&u8500_driver); | ||
195 | } | ||
196 | |||
197 | static struct platform_driver u8500_cpufreq_driver = { | ||
198 | .driver = { | ||
199 | .name = DRIVER_NAME, | ||
200 | .owner = THIS_MODULE, | ||
201 | }, | ||
202 | .remove = __exit_p(u8500_cpufreq_remove), | ||
203 | }; | ||
204 | |||
205 | static int __init u8500_cpufreq_init(void) | ||
206 | { | ||
207 | return platform_driver_probe(&u8500_cpufreq_driver, | ||
208 | &u8500_cpufreq_probe); | ||
209 | } | ||
210 | |||
211 | device_initcall(u8500_cpufreq_init); | ||
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c new file mode 100644 index 000000000000..fe69f5fac1bb --- /dev/null +++ b/arch/arm/mach-ux500/devices-common.c | |||
@@ -0,0 +1,145 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL), version 2. | ||
6 | */ | ||
7 | |||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/dma-mapping.h> | ||
10 | #include <linux/err.h> | ||
11 | #include <linux/irq.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/amba/bus.h> | ||
15 | |||
16 | #include <plat/gpio.h> | ||
17 | |||
18 | #include <mach/hardware.h> | ||
19 | |||
20 | #include "devices-common.h" | ||
21 | |||
22 | struct amba_device * | ||
23 | dbx500_add_amba_device(const char *name, resource_size_t base, | ||
24 | int irq, void *pdata, unsigned int periphid) | ||
25 | { | ||
26 | struct amba_device *dev; | ||
27 | int ret; | ||
28 | |||
29 | dev = kzalloc(sizeof *dev, GFP_KERNEL); | ||
30 | if (!dev) | ||
31 | return ERR_PTR(-ENOMEM); | ||
32 | |||
33 | dev->dev.init_name = name; | ||
34 | |||
35 | dev->res.start = base; | ||
36 | dev->res.end = base + SZ_4K - 1; | ||
37 | dev->res.flags = IORESOURCE_MEM; | ||
38 | |||
39 | dev->dma_mask = DMA_BIT_MASK(32); | ||
40 | dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
41 | |||
42 | dev->irq[0] = irq; | ||
43 | dev->irq[1] = NO_IRQ; | ||
44 | |||
45 | dev->periphid = periphid; | ||
46 | |||
47 | dev->dev.platform_data = pdata; | ||
48 | |||
49 | ret = amba_device_register(dev, &iomem_resource); | ||
50 | if (ret) { | ||
51 | kfree(dev); | ||
52 | return ERR_PTR(ret); | ||
53 | } | ||
54 | |||
55 | return dev; | ||
56 | } | ||
57 | |||
58 | static struct platform_device * | ||
59 | dbx500_add_platform_device(const char *name, int id, void *pdata, | ||
60 | struct resource *res, int resnum) | ||
61 | { | ||
62 | struct platform_device *dev; | ||
63 | int ret; | ||
64 | |||
65 | dev = platform_device_alloc(name, id); | ||
66 | if (!dev) | ||
67 | return ERR_PTR(-ENOMEM); | ||
68 | |||
69 | dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
70 | dev->dev.dma_mask = &dev->dev.coherent_dma_mask; | ||
71 | |||
72 | ret = platform_device_add_resources(dev, res, resnum); | ||
73 | if (ret) | ||
74 | goto out_free; | ||
75 | |||
76 | dev->dev.platform_data = pdata; | ||
77 | |||
78 | ret = platform_device_add(dev); | ||
79 | if (ret) | ||
80 | goto out_free; | ||
81 | |||
82 | return dev; | ||
83 | |||
84 | out_free: | ||
85 | platform_device_put(dev); | ||
86 | return ERR_PTR(ret); | ||
87 | } | ||
88 | |||
89 | struct platform_device * | ||
90 | dbx500_add_platform_device_4k1irq(const char *name, int id, | ||
91 | resource_size_t base, | ||
92 | int irq, void *pdata) | ||
93 | { | ||
94 | struct resource resources[] = { | ||
95 | [0] = { | ||
96 | .start = base, | ||
97 | .end = base + SZ_4K - 1, | ||
98 | .flags = IORESOURCE_MEM, | ||
99 | }, | ||
100 | [1] = { | ||
101 | .start = irq, | ||
102 | .end = irq, | ||
103 | .flags = IORESOURCE_IRQ, | ||
104 | } | ||
105 | }; | ||
106 | |||
107 | return dbx500_add_platform_device(name, id, pdata, resources, | ||
108 | ARRAY_SIZE(resources)); | ||
109 | } | ||
110 | |||
111 | static struct platform_device * | ||
112 | dbx500_add_gpio(int id, resource_size_t addr, int irq, | ||
113 | struct nmk_gpio_platform_data *pdata) | ||
114 | { | ||
115 | struct resource resources[] = { | ||
116 | { | ||
117 | .start = addr, | ||
118 | .end = addr + 127, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, | ||
121 | { | ||
122 | .start = irq, | ||
123 | .end = irq, | ||
124 | .flags = IORESOURCE_IRQ, | ||
125 | } | ||
126 | }; | ||
127 | |||
128 | return platform_device_register_resndata(NULL, "gpio", id, | ||
129 | resources, ARRAY_SIZE(resources), | ||
130 | pdata, sizeof(*pdata)); | ||
131 | } | ||
132 | |||
133 | void dbx500_add_gpios(resource_size_t *base, int num, int irq, | ||
134 | struct nmk_gpio_platform_data *pdata) | ||
135 | { | ||
136 | int first = 0; | ||
137 | int i; | ||
138 | |||
139 | for (i = 0; i < num; i++, first += 32, irq++) { | ||
140 | pdata->first_gpio = first; | ||
141 | pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first); | ||
142 | |||
143 | dbx500_add_gpio(i, base[i], irq, pdata); | ||
144 | } | ||
145 | } | ||
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h new file mode 100644 index 000000000000..cbadc117d2db --- /dev/null +++ b/arch/arm/mach-ux500/devices-common.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL), version 2. | ||
6 | */ | ||
7 | |||
8 | #ifndef __DEVICES_COMMON_H | ||
9 | #define __DEVICES_COMMON_H | ||
10 | |||
11 | extern struct amba_device * | ||
12 | dbx500_add_amba_device(const char *name, resource_size_t base, | ||
13 | int irq, void *pdata, unsigned int periphid); | ||
14 | |||
15 | extern struct platform_device * | ||
16 | dbx500_add_platform_device_4k1irq(const char *name, int id, | ||
17 | resource_size_t base, | ||
18 | int irq, void *pdata); | ||
19 | |||
20 | struct spi_master_cntlr; | ||
21 | |||
22 | static inline struct amba_device * | ||
23 | dbx500_add_msp_spi(const char *name, resource_size_t base, int irq, | ||
24 | struct spi_master_cntlr *pdata) | ||
25 | { | ||
26 | return dbx500_add_amba_device(name, base, irq, pdata, 0); | ||
27 | } | ||
28 | |||
29 | static inline struct amba_device * | ||
30 | dbx500_add_spi(const char *name, resource_size_t base, int irq, | ||
31 | struct spi_master_cntlr *pdata) | ||
32 | { | ||
33 | return dbx500_add_amba_device(name, base, irq, pdata, 0); | ||
34 | } | ||
35 | |||
36 | struct mmci_platform_data; | ||
37 | |||
38 | static inline struct amba_device * | ||
39 | dbx500_add_sdi(const char *name, resource_size_t base, int irq, | ||
40 | struct mmci_platform_data *pdata) | ||
41 | { | ||
42 | return dbx500_add_amba_device(name, base, irq, pdata, 0); | ||
43 | } | ||
44 | |||
45 | static inline struct amba_device * | ||
46 | dbx500_add_uart(const char *name, resource_size_t base, int irq) | ||
47 | { | ||
48 | return dbx500_add_amba_device(name, base, irq, NULL, 0); | ||
49 | } | ||
50 | |||
51 | struct nmk_i2c_controller; | ||
52 | |||
53 | static inline struct platform_device * | ||
54 | dbx500_add_i2c(int id, resource_size_t base, int irq, | ||
55 | struct nmk_i2c_controller *pdata) | ||
56 | { | ||
57 | return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq, | ||
58 | pdata); | ||
59 | } | ||
60 | |||
61 | struct msp_i2s_platform_data; | ||
62 | |||
63 | static inline struct platform_device * | ||
64 | dbx500_add_msp_i2s(int id, resource_size_t base, int irq, | ||
65 | struct msp_i2s_platform_data *pdata) | ||
66 | { | ||
67 | return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq, | ||
68 | pdata); | ||
69 | } | ||
70 | |||
71 | static inline struct amba_device * | ||
72 | dbx500_add_rtc(resource_size_t base, int irq) | ||
73 | { | ||
74 | return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0); | ||
75 | } | ||
76 | |||
77 | struct nmk_gpio_platform_data; | ||
78 | |||
79 | void dbx500_add_gpios(resource_size_t *base, int num, int irq, | ||
80 | struct nmk_gpio_platform_data *pdata); | ||
81 | |||
82 | #endif | ||
diff --git a/arch/arm/mach-ux500/devices-db5500.c b/arch/arm/mach-ux500/devices-db5500.c deleted file mode 100644 index 33e5b56bebb6..000000000000 --- a/arch/arm/mach-ux500/devices-db5500.c +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/platform_device.h> | ||
9 | #include <linux/interrupt.h> | ||
10 | #include <linux/gpio.h> | ||
11 | |||
12 | #include <mach/hardware.h> | ||
13 | #include <mach/devices.h> | ||
14 | |||
15 | static struct nmk_gpio_platform_data u5500_gpio_data[] = { | ||
16 | GPIO_DATA("GPIO-0-31", 0), | ||
17 | GPIO_DATA("GPIO-32-63", 32), /* 36..63 not routed to pin */ | ||
18 | GPIO_DATA("GPIO-64-95", 64), /* 83..95 not routed to pin */ | ||
19 | GPIO_DATA("GPIO-96-127", 96), /* 102..127 not routed to pin */ | ||
20 | GPIO_DATA("GPIO-128-159", 128), /* 149..159 not routed to pin */ | ||
21 | GPIO_DATA("GPIO-160-191", 160), | ||
22 | GPIO_DATA("GPIO-192-223", 192), | ||
23 | GPIO_DATA("GPIO-224-255", 224), /* 228..255 not routed to pin */ | ||
24 | }; | ||
25 | |||
26 | static struct resource u5500_gpio_resources[] = { | ||
27 | GPIO_RESOURCE(0), | ||
28 | GPIO_RESOURCE(1), | ||
29 | GPIO_RESOURCE(2), | ||
30 | GPIO_RESOURCE(3), | ||
31 | GPIO_RESOURCE(4), | ||
32 | GPIO_RESOURCE(5), | ||
33 | GPIO_RESOURCE(6), | ||
34 | GPIO_RESOURCE(7), | ||
35 | }; | ||
36 | |||
37 | struct platform_device u5500_gpio_devs[] = { | ||
38 | GPIO_DEVICE(0), | ||
39 | GPIO_DEVICE(1), | ||
40 | GPIO_DEVICE(2), | ||
41 | GPIO_DEVICE(3), | ||
42 | GPIO_DEVICE(4), | ||
43 | GPIO_DEVICE(5), | ||
44 | GPIO_DEVICE(6), | ||
45 | GPIO_DEVICE(7), | ||
46 | }; | ||
diff --git a/arch/arm/mach-ux500/devices-db5500.h b/arch/arm/mach-ux500/devices-db5500.h new file mode 100644 index 000000000000..c8d7901c1f2d --- /dev/null +++ b/arch/arm/mach-ux500/devices-db5500.h | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL), version 2. | ||
6 | */ | ||
7 | |||
8 | #ifndef __DEVICES_DB5500_H | ||
9 | #define __DEVICES_DB5500_H | ||
10 | |||
11 | #include "devices-common.h" | ||
12 | |||
13 | #define db5500_add_i2c1(pdata) \ | ||
14 | dbx500_add_i2c(1, U5500_I2C1_BASE, IRQ_DB5500_I2C1, pdata) | ||
15 | #define db5500_add_i2c2(pdata) \ | ||
16 | dbx500_add_i2c(2, U5500_I2C2_BASE, IRQ_DB5500_I2C2, pdata) | ||
17 | #define db5500_add_i2c3(pdata) \ | ||
18 | dbx500_add_i2c(3, U5500_I2C3_BASE, IRQ_DB5500_I2C3, pdata) | ||
19 | |||
20 | #define db5500_add_msp0_i2s(pdata) \ | ||
21 | dbx500_add_msp_i2s(0, U5500_MSP0_BASE, IRQ_DB5500_MSP0, pdata) | ||
22 | #define db5500_add_msp1_i2s(pdata) \ | ||
23 | dbx500_add_msp_i2s(1, U5500_MSP1_BASE, IRQ_DB5500_MSP1, pdata) | ||
24 | #define db5500_add_msp2_i2s(pdata) \ | ||
25 | dbx500_add_msp_i2s(2, U5500_MSP2_BASE, IRQ_DB5500_MSP2, pdata) | ||
26 | |||
27 | #define db5500_add_msp0_spi(pdata) \ | ||
28 | dbx500_add_msp_spi("msp0", U5500_MSP0_BASE, IRQ_DB5500_MSP0, pdata) | ||
29 | #define db5500_add_msp1_spi(pdata) \ | ||
30 | dbx500_add_msp_spi("msp1", U5500_MSP1_BASE, IRQ_DB5500_MSP1, pdata) | ||
31 | #define db5500_add_msp2_spi(pdata) \ | ||
32 | dbx500_add_msp_spi("msp2", U5500_MSP2_BASE, IRQ_DB5500_MSP2, pdata) | ||
33 | |||
34 | #define db5500_add_rtc() \ | ||
35 | dbx500_add_rtc(U5500_RTC_BASE, IRQ_DB5500_RTC); | ||
36 | |||
37 | #define db5500_add_sdi0(pdata) \ | ||
38 | dbx500_add_sdi("sdi0", U5500_SDI0_BASE, IRQ_DB5500_SDMMC0, pdata) | ||
39 | #define db5500_add_sdi1(pdata) \ | ||
40 | dbx500_add_sdi("sdi1", U5500_SDI1_BASE, IRQ_DB5500_SDMMC1, pdata) | ||
41 | #define db5500_add_sdi2(pdata) \ | ||
42 | dbx500_add_sdi("sdi2", U5500_SDI2_BASE, IRQ_DB5500_SDMMC2, pdata) | ||
43 | #define db5500_add_sdi3(pdata) \ | ||
44 | dbx500_add_sdi("sdi3", U5500_SDI3_BASE, IRQ_DB5500_SDMMC3, pdata) | ||
45 | #define db5500_add_sdi4(pdata) \ | ||
46 | dbx500_add_sdi("sdi4", U5500_SDI4_BASE, IRQ_DB5500_SDMMC4, pdata) | ||
47 | |||
48 | #define db5500_add_spi0(pdata) \ | ||
49 | dbx500_add_spi("spi0", U5500_SPI0_BASE, IRQ_DB5500_SPI0, pdata) | ||
50 | #define db5500_add_spi1(pdata) \ | ||
51 | dbx500_add_spi("spi1", U5500_SPI1_BASE, IRQ_DB5500_SPI1, pdata) | ||
52 | #define db5500_add_spi2(pdata) \ | ||
53 | dbx500_add_spi("spi2", U5500_SPI2_BASE, IRQ_DB5500_SPI2, pdata) | ||
54 | #define db5500_add_spi3(pdata) \ | ||
55 | dbx500_add_spi("spi3", U5500_SPI3_BASE, IRQ_DB5500_SPI3, pdata) | ||
56 | |||
57 | #define db5500_add_uart0() \ | ||
58 | dbx500_add_uart("uart0", U5500_UART0_BASE, IRQ_DB5500_UART0) | ||
59 | #define db5500_add_uart1() \ | ||
60 | dbx500_add_uart("uart1", U5500_UART1_BASE, IRQ_DB5500_UART1) | ||
61 | #define db5500_add_uart2() \ | ||
62 | dbx500_add_uart("uart2", U5500_UART2_BASE, IRQ_DB5500_UART2) | ||
63 | #define db5500_add_uart3() \ | ||
64 | dbx500_add_uart("uart3", U5500_UART3_BASE, IRQ_DB5500_UART3) | ||
65 | |||
66 | #endif | ||
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index 4a94be3304b9..23c695d54977 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c | |||
@@ -19,173 +19,6 @@ | |||
19 | 19 | ||
20 | #include "ste-dma40-db8500.h" | 20 | #include "ste-dma40-db8500.h" |
21 | 21 | ||
22 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { | ||
23 | GPIO_DATA("GPIO-0-31", 0), | ||
24 | GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ | ||
25 | GPIO_DATA("GPIO-64-95", 64), | ||
26 | GPIO_DATA("GPIO-96-127", 96), /* 98..127 not routed to pin */ | ||
27 | GPIO_DATA("GPIO-128-159", 128), | ||
28 | GPIO_DATA("GPIO-160-191", 160), /* 172..191 not routed to pin */ | ||
29 | GPIO_DATA("GPIO-192-223", 192), | ||
30 | GPIO_DATA("GPIO-224-255", 224), /* 231..255 not routed to pin */ | ||
31 | GPIO_DATA("GPIO-256-288", 256), /* 268..288 not routed to pin */ | ||
32 | }; | ||
33 | |||
34 | static struct resource u8500_gpio_resources[] = { | ||
35 | GPIO_RESOURCE(0), | ||
36 | GPIO_RESOURCE(1), | ||
37 | GPIO_RESOURCE(2), | ||
38 | GPIO_RESOURCE(3), | ||
39 | GPIO_RESOURCE(4), | ||
40 | GPIO_RESOURCE(5), | ||
41 | GPIO_RESOURCE(6), | ||
42 | GPIO_RESOURCE(7), | ||
43 | GPIO_RESOURCE(8), | ||
44 | }; | ||
45 | |||
46 | struct platform_device u8500_gpio_devs[] = { | ||
47 | GPIO_DEVICE(0), | ||
48 | GPIO_DEVICE(1), | ||
49 | GPIO_DEVICE(2), | ||
50 | GPIO_DEVICE(3), | ||
51 | GPIO_DEVICE(4), | ||
52 | GPIO_DEVICE(5), | ||
53 | GPIO_DEVICE(6), | ||
54 | GPIO_DEVICE(7), | ||
55 | GPIO_DEVICE(8), | ||
56 | }; | ||
57 | |||
58 | struct amba_device u8500_ssp0_device = { | ||
59 | .dev = { | ||
60 | .coherent_dma_mask = ~0, | ||
61 | .init_name = "ssp0", | ||
62 | }, | ||
63 | .res = { | ||
64 | .start = U8500_SSP0_BASE, | ||
65 | .end = U8500_SSP0_BASE + SZ_4K - 1, | ||
66 | .flags = IORESOURCE_MEM, | ||
67 | }, | ||
68 | .irq = {IRQ_DB8500_SSP0, NO_IRQ }, | ||
69 | /* ST-Ericsson modified id */ | ||
70 | .periphid = SSP_PER_ID, | ||
71 | }; | ||
72 | |||
73 | static struct resource u8500_i2c0_resources[] = { | ||
74 | [0] = { | ||
75 | .start = U8500_I2C0_BASE, | ||
76 | .end = U8500_I2C0_BASE + SZ_4K - 1, | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, | ||
79 | [1] = { | ||
80 | .start = IRQ_DB8500_I2C0, | ||
81 | .end = IRQ_DB8500_I2C0, | ||
82 | .flags = IORESOURCE_IRQ, | ||
83 | } | ||
84 | }; | ||
85 | |||
86 | struct platform_device u8500_i2c0_device = { | ||
87 | .name = "nmk-i2c", | ||
88 | .id = 0, | ||
89 | .resource = u8500_i2c0_resources, | ||
90 | .num_resources = ARRAY_SIZE(u8500_i2c0_resources), | ||
91 | }; | ||
92 | |||
93 | static struct resource u8500_i2c4_resources[] = { | ||
94 | [0] = { | ||
95 | .start = U8500_I2C4_BASE, | ||
96 | .end = U8500_I2C4_BASE + SZ_4K - 1, | ||
97 | .flags = IORESOURCE_MEM, | ||
98 | }, | ||
99 | [1] = { | ||
100 | .start = IRQ_DB8500_I2C4, | ||
101 | .end = IRQ_DB8500_I2C4, | ||
102 | .flags = IORESOURCE_IRQ, | ||
103 | } | ||
104 | }; | ||
105 | |||
106 | struct platform_device u8500_i2c4_device = { | ||
107 | .name = "nmk-i2c", | ||
108 | .id = 4, | ||
109 | .resource = u8500_i2c4_resources, | ||
110 | .num_resources = ARRAY_SIZE(u8500_i2c4_resources), | ||
111 | }; | ||
112 | |||
113 | /* | ||
114 | * SD/MMC | ||
115 | */ | ||
116 | |||
117 | struct amba_device u8500_sdi0_device = { | ||
118 | .dev = { | ||
119 | .init_name = "sdi0", | ||
120 | }, | ||
121 | .res = { | ||
122 | .start = U8500_SDI0_BASE, | ||
123 | .end = U8500_SDI0_BASE + SZ_4K - 1, | ||
124 | .flags = IORESOURCE_MEM, | ||
125 | }, | ||
126 | .irq = {IRQ_DB8500_SDMMC0, NO_IRQ}, | ||
127 | }; | ||
128 | |||
129 | struct amba_device u8500_sdi1_device = { | ||
130 | .dev = { | ||
131 | .init_name = "sdi1", | ||
132 | }, | ||
133 | .res = { | ||
134 | .start = U8500_SDI1_BASE, | ||
135 | .end = U8500_SDI1_BASE + SZ_4K - 1, | ||
136 | .flags = IORESOURCE_MEM, | ||
137 | }, | ||
138 | .irq = {IRQ_DB8500_SDMMC1, NO_IRQ}, | ||
139 | }; | ||
140 | |||
141 | struct amba_device u8500_sdi2_device = { | ||
142 | .dev = { | ||
143 | .init_name = "sdi2", | ||
144 | }, | ||
145 | .res = { | ||
146 | .start = U8500_SDI2_BASE, | ||
147 | .end = U8500_SDI2_BASE + SZ_4K - 1, | ||
148 | .flags = IORESOURCE_MEM, | ||
149 | }, | ||
150 | .irq = {IRQ_DB8500_SDMMC2, NO_IRQ}, | ||
151 | }; | ||
152 | |||
153 | struct amba_device u8500_sdi3_device = { | ||
154 | .dev = { | ||
155 | .init_name = "sdi3", | ||
156 | }, | ||
157 | .res = { | ||
158 | .start = U8500_SDI3_BASE, | ||
159 | .end = U8500_SDI3_BASE + SZ_4K - 1, | ||
160 | .flags = IORESOURCE_MEM, | ||
161 | }, | ||
162 | .irq = {IRQ_DB8500_SDMMC3, NO_IRQ}, | ||
163 | }; | ||
164 | |||
165 | struct amba_device u8500_sdi4_device = { | ||
166 | .dev = { | ||
167 | .init_name = "sdi4", | ||
168 | }, | ||
169 | .res = { | ||
170 | .start = U8500_SDI4_BASE, | ||
171 | .end = U8500_SDI4_BASE + SZ_4K - 1, | ||
172 | .flags = IORESOURCE_MEM, | ||
173 | }, | ||
174 | .irq = {IRQ_DB8500_SDMMC4, NO_IRQ}, | ||
175 | }; | ||
176 | |||
177 | struct amba_device u8500_sdi5_device = { | ||
178 | .dev = { | ||
179 | .init_name = "sdi5", | ||
180 | }, | ||
181 | .res = { | ||
182 | .start = U8500_SDI5_BASE, | ||
183 | .end = U8500_SDI5_BASE + SZ_4K - 1, | ||
184 | .flags = IORESOURCE_MEM, | ||
185 | }, | ||
186 | .irq = {IRQ_DB8500_SDMMC5, NO_IRQ}, | ||
187 | }; | ||
188 | |||
189 | static struct resource dma40_resources[] = { | 22 | static struct resource dma40_resources[] = { |
190 | [0] = { | 23 | [0] = { |
191 | .start = U8500_DMA_BASE, | 24 | .start = U8500_DMA_BASE, |
@@ -295,7 +128,7 @@ struct resource keypad_resources[] = { | |||
295 | }, | 128 | }, |
296 | }; | 129 | }; |
297 | 130 | ||
298 | struct platform_device ux500_ske_keypad_device = { | 131 | struct platform_device u8500_ske_keypad_device = { |
299 | .name = "nmk-ske-keypad", | 132 | .name = "nmk-ske-keypad", |
300 | .id = -1, | 133 | .id = -1, |
301 | .num_resources = ARRAY_SIZE(keypad_resources), | 134 | .num_resources = ARRAY_SIZE(keypad_resources), |
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h new file mode 100644 index 000000000000..3a770c756979 --- /dev/null +++ b/arch/arm/mach-ux500/devices-db8500.h | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL), version 2. | ||
6 | */ | ||
7 | |||
8 | #ifndef __DEVICES_DB8500_H | ||
9 | #define __DEVICES_DB8500_H | ||
10 | |||
11 | #include "devices-common.h" | ||
12 | |||
13 | struct ske_keypad_platform_data; | ||
14 | struct pl022_ssp_controller; | ||
15 | |||
16 | static inline struct platform_device * | ||
17 | db8500_add_ske_keypad(struct ske_keypad_platform_data *pdata) | ||
18 | { | ||
19 | return dbx500_add_platform_device_4k1irq("nmk-ske-keypad", -1, | ||
20 | U8500_SKE_BASE, | ||
21 | IRQ_DB8500_KB, pdata); | ||
22 | } | ||
23 | |||
24 | static inline struct amba_device * | ||
25 | db8500_add_ssp(const char *name, resource_size_t base, int irq, | ||
26 | struct pl022_ssp_controller *pdata) | ||
27 | { | ||
28 | return dbx500_add_amba_device(name, base, irq, pdata, SSP_PER_ID); | ||
29 | } | ||
30 | |||
31 | |||
32 | #define db8500_add_i2c0(pdata) \ | ||
33 | dbx500_add_i2c(0, U8500_I2C0_BASE, IRQ_DB8500_I2C0, pdata) | ||
34 | #define db8500_add_i2c1(pdata) \ | ||
35 | dbx500_add_i2c(1, U8500_I2C1_BASE, IRQ_DB8500_I2C1, pdata) | ||
36 | #define db8500_add_i2c2(pdata) \ | ||
37 | dbx500_add_i2c(2, U8500_I2C2_BASE, IRQ_DB8500_I2C2, pdata) | ||
38 | #define db8500_add_i2c3(pdata) \ | ||
39 | dbx500_add_i2c(3, U8500_I2C3_BASE, IRQ_DB8500_I2C3, pdata) | ||
40 | #define db8500_add_i2c4(pdata) \ | ||
41 | dbx500_add_i2c(4, U8500_I2C4_BASE, IRQ_DB8500_I2C4, pdata) | ||
42 | |||
43 | #define db8500_add_msp0_i2s(pdata) \ | ||
44 | dbx500_add_msp_i2s(0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, pdata) | ||
45 | #define db8500_add_msp1_i2s(pdata) \ | ||
46 | dbx500_add_msp_i2s(1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, pdata) | ||
47 | #define db8500_add_msp2_i2s(pdata) \ | ||
48 | dbx500_add_msp_i2s(2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, pdata) | ||
49 | #define db8500_add_msp3_i2s(pdata) \ | ||
50 | dbx500_add_msp_i2s(3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, pdata) | ||
51 | |||
52 | #define db8500_add_msp0_spi(pdata) \ | ||
53 | dbx500_add_msp_spi("msp0", U8500_MSP0_BASE, IRQ_DB8500_MSP0, pdata) | ||
54 | #define db8500_add_msp1_spi(pdata) \ | ||
55 | dbx500_add_msp_spi("msp1", U8500_MSP1_BASE, IRQ_DB8500_MSP1, pdata) | ||
56 | #define db8500_add_msp2_spi(pdata) \ | ||
57 | dbx500_add_msp_spi("msp2", U8500_MSP2_BASE, IRQ_DB8500_MSP2, pdata) | ||
58 | #define db8500_add_msp3_spi(pdata) \ | ||
59 | dbx500_add_msp_spi("msp3", U8500_MSP3_BASE, IRQ_DB8500_MSP1, pdata) | ||
60 | |||
61 | #define db8500_add_rtc() \ | ||
62 | dbx500_add_rtc(U8500_RTC_BASE, IRQ_DB8500_RTC); | ||
63 | |||
64 | #define db8500_add_sdi0(pdata) \ | ||
65 | dbx500_add_sdi("sdi0", U8500_SDI0_BASE, IRQ_DB8500_SDMMC0, pdata) | ||
66 | #define db8500_add_sdi1(pdata) \ | ||
67 | dbx500_add_sdi("sdi1", U8500_SDI1_BASE, IRQ_DB8500_SDMMC1, pdata) | ||
68 | #define db8500_add_sdi2(pdata) \ | ||
69 | dbx500_add_sdi("sdi2", U8500_SDI2_BASE, IRQ_DB8500_SDMMC2, pdata) | ||
70 | #define db8500_add_sdi3(pdata) \ | ||
71 | dbx500_add_sdi("sdi3", U8500_SDI3_BASE, IRQ_DB8500_SDMMC3, pdata) | ||
72 | #define db8500_add_sdi4(pdata) \ | ||
73 | dbx500_add_sdi("sdi4", U8500_SDI4_BASE, IRQ_DB8500_SDMMC4, pdata) | ||
74 | #define db8500_add_sdi5(pdata) \ | ||
75 | dbx500_add_sdi("sdi5", U8500_SDI5_BASE, IRQ_DB8500_SDMMC5, pdata) | ||
76 | |||
77 | #define db8500_add_ssp0(pdata) \ | ||
78 | db8500_add_ssp("ssp0", U8500_SSP0_BASE, IRQ_DB8500_SSP0, pdata) | ||
79 | #define db8500_add_ssp1(pdata) \ | ||
80 | db8500_add_ssp("ssp1", U8500_SSP1_BASE, IRQ_DB8500_SSP1, pdata) | ||
81 | |||
82 | #define db8500_add_spi0(pdata) \ | ||
83 | dbx500_add_spi("spi0", U8500_SPI0_BASE, IRQ_DB8500_SPI0, pdata) | ||
84 | #define db8500_add_spi1(pdata) \ | ||
85 | dbx500_add_spi("spi1", U8500_SPI1_BASE, IRQ_DB8500_SPI1, pdata) | ||
86 | #define db8500_add_spi2(pdata) \ | ||
87 | dbx500_add_spi("spi2", U8500_SPI2_BASE, IRQ_DB8500_SPI2, pdata) | ||
88 | #define db8500_add_spi3(pdata) \ | ||
89 | dbx500_add_spi("spi3", U8500_SPI3_BASE, IRQ_DB8500_SPI3, pdata) | ||
90 | |||
91 | #define db8500_add_uart0() \ | ||
92 | dbx500_add_uart("uart0", U8500_UART0_BASE, IRQ_DB8500_UART0) | ||
93 | #define db8500_add_uart1() \ | ||
94 | dbx500_add_uart("uart1", U8500_UART1_BASE, IRQ_DB8500_UART1) | ||
95 | #define db8500_add_uart2() \ | ||
96 | dbx500_add_uart("uart2", U8500_UART2_BASE, IRQ_DB8500_UART2) | ||
97 | |||
98 | #endif | ||
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c index 8a268893cb7f..ea0a2f92ca70 100644 --- a/arch/arm/mach-ux500/devices.c +++ b/arch/arm/mach-ux500/devices.c | |||
@@ -14,69 +14,6 @@ | |||
14 | #include <mach/hardware.h> | 14 | #include <mach/hardware.h> |
15 | #include <mach/setup.h> | 15 | #include <mach/setup.h> |
16 | 16 | ||
17 | #define __MEM_4K_RESOURCE(x) \ | ||
18 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
19 | |||
20 | struct amba_device ux500_pl031_device = { | ||
21 | .dev = { | ||
22 | .init_name = "pl031", | ||
23 | }, | ||
24 | .res = { | ||
25 | .start = UX500_RTC_BASE, | ||
26 | .end = UX500_RTC_BASE + SZ_4K - 1, | ||
27 | .flags = IORESOURCE_MEM, | ||
28 | }, | ||
29 | .irq = {IRQ_RTC_RTT, NO_IRQ}, | ||
30 | }; | ||
31 | |||
32 | struct amba_device ux500_uart0_device = { | ||
33 | .dev = { .init_name = "uart0" }, | ||
34 | __MEM_4K_RESOURCE(UX500_UART0_BASE), | ||
35 | .irq = {IRQ_UART0, NO_IRQ}, | ||
36 | }; | ||
37 | |||
38 | struct amba_device ux500_uart1_device = { | ||
39 | .dev = { .init_name = "uart1" }, | ||
40 | __MEM_4K_RESOURCE(UX500_UART1_BASE), | ||
41 | .irq = {IRQ_UART1, NO_IRQ}, | ||
42 | }; | ||
43 | |||
44 | struct amba_device ux500_uart2_device = { | ||
45 | .dev = { .init_name = "uart2" }, | ||
46 | __MEM_4K_RESOURCE(UX500_UART2_BASE), | ||
47 | .irq = {IRQ_UART2, NO_IRQ}, | ||
48 | }; | ||
49 | |||
50 | #define UX500_I2C_RESOURCES(id, size) \ | ||
51 | static struct resource ux500_i2c##id##_resources[] = { \ | ||
52 | [0] = { \ | ||
53 | .start = UX500_I2C##id##_BASE, \ | ||
54 | .end = UX500_I2C##id##_BASE + size - 1, \ | ||
55 | .flags = IORESOURCE_MEM, \ | ||
56 | }, \ | ||
57 | [1] = { \ | ||
58 | .start = IRQ_I2C##id, \ | ||
59 | .end = IRQ_I2C##id, \ | ||
60 | .flags = IORESOURCE_IRQ \ | ||
61 | } \ | ||
62 | } | ||
63 | |||
64 | UX500_I2C_RESOURCES(1, SZ_4K); | ||
65 | UX500_I2C_RESOURCES(2, SZ_4K); | ||
66 | UX500_I2C_RESOURCES(3, SZ_4K); | ||
67 | |||
68 | #define UX500_I2C_PDEVICE(cid) \ | ||
69 | struct platform_device ux500_i2c##cid##_device = { \ | ||
70 | .name = "nmk-i2c", \ | ||
71 | .id = cid, \ | ||
72 | .num_resources = 2, \ | ||
73 | .resource = ux500_i2c##cid##_resources, \ | ||
74 | } | ||
75 | |||
76 | UX500_I2C_PDEVICE(1); | ||
77 | UX500_I2C_PDEVICE(2); | ||
78 | UX500_I2C_PDEVICE(3); | ||
79 | |||
80 | void __init amba_add_devices(struct amba_device *devs[], int num) | 17 | void __init amba_add_devices(struct amba_device *devs[], int num) |
81 | { | 18 | { |
82 | int i; | 19 | int i; |
diff --git a/arch/arm/mach-ux500/dma-db5500.c b/arch/arm/mach-ux500/dma-db5500.c new file mode 100644 index 000000000000..32a061f8a95b --- /dev/null +++ b/arch/arm/mach-ux500/dma-db5500.c | |||
@@ -0,0 +1,120 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Per Forlin <per.forlin@stericsson.com> for ST-Ericsson | ||
5 | * Author: Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson | ||
6 | * Author: Rabin Vincent <rabinv.vincent@stericsson.com> for ST-Ericsson | ||
7 | * | ||
8 | * License terms: GNU General Public License (GPL), version 2 | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/ste_dma40.h> | ||
15 | #include <mach/setup.h> | ||
16 | #include <mach/hardware.h> | ||
17 | |||
18 | #include "ste-dma40-db5500.h" | ||
19 | |||
20 | static struct resource dma40_resources[] = { | ||
21 | [0] = { | ||
22 | .start = U5500_DMA_BASE, | ||
23 | .end = U5500_DMA_BASE + SZ_4K - 1, | ||
24 | .flags = IORESOURCE_MEM, | ||
25 | .name = "base", | ||
26 | }, | ||
27 | [1] = { | ||
28 | .start = U5500_DMA_LCPA_BASE, | ||
29 | .end = U5500_DMA_LCPA_BASE + 2 * SZ_1K - 1, | ||
30 | .flags = IORESOURCE_MEM, | ||
31 | .name = "lcpa", | ||
32 | }, | ||
33 | [2] = { | ||
34 | .start = IRQ_DB5500_DMA, | ||
35 | .end = IRQ_DB5500_DMA, | ||
36 | .flags = IORESOURCE_IRQ | ||
37 | } | ||
38 | }; | ||
39 | |||
40 | /* Default configuration for physical memcpy */ | ||
41 | static struct stedma40_chan_cfg dma40_memcpy_conf_phy = { | ||
42 | .mode = STEDMA40_MODE_PHYSICAL, | ||
43 | .dir = STEDMA40_MEM_TO_MEM, | ||
44 | |||
45 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | ||
46 | .src_info.psize = STEDMA40_PSIZE_PHY_1, | ||
47 | .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, | ||
48 | |||
49 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | ||
50 | .dst_info.psize = STEDMA40_PSIZE_PHY_1, | ||
51 | .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, | ||
52 | }; | ||
53 | |||
54 | /* Default configuration for logical memcpy */ | ||
55 | static struct stedma40_chan_cfg dma40_memcpy_conf_log = { | ||
56 | .dir = STEDMA40_MEM_TO_MEM, | ||
57 | |||
58 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | ||
59 | .src_info.psize = STEDMA40_PSIZE_LOG_1, | ||
60 | .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, | ||
61 | |||
62 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | ||
63 | .dst_info.psize = STEDMA40_PSIZE_LOG_1, | ||
64 | .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * Mapping between soruce event lines and physical device address This was | ||
69 | * created assuming that the event line is tied to a device and therefore the | ||
70 | * address is constant, however this is not true for at least USB, and the | ||
71 | * values are just placeholders for USB. This table is preserved and used for | ||
72 | * now. | ||
73 | */ | ||
74 | static const dma_addr_t dma40_rx_map[DB5500_DMA_NR_DEV] = { | ||
75 | [DB5500_DMA_DEV24_SDMMC0_RX] = -1, | ||
76 | }; | ||
77 | |||
78 | /* Mapping between destination event lines and physical device address */ | ||
79 | static const dma_addr_t dma40_tx_map[DB5500_DMA_NR_DEV] = { | ||
80 | [DB5500_DMA_DEV24_SDMMC0_TX] = -1, | ||
81 | }; | ||
82 | |||
83 | static int dma40_memcpy_event[] = { | ||
84 | DB5500_DMA_MEMCPY_TX_1, | ||
85 | DB5500_DMA_MEMCPY_TX_2, | ||
86 | DB5500_DMA_MEMCPY_TX_3, | ||
87 | DB5500_DMA_MEMCPY_TX_4, | ||
88 | DB5500_DMA_MEMCPY_TX_5, | ||
89 | }; | ||
90 | |||
91 | static struct stedma40_platform_data dma40_plat_data = { | ||
92 | .dev_len = ARRAY_SIZE(dma40_rx_map), | ||
93 | .dev_rx = dma40_rx_map, | ||
94 | .dev_tx = dma40_tx_map, | ||
95 | .memcpy = dma40_memcpy_event, | ||
96 | .memcpy_len = ARRAY_SIZE(dma40_memcpy_event), | ||
97 | .memcpy_conf_phy = &dma40_memcpy_conf_phy, | ||
98 | .memcpy_conf_log = &dma40_memcpy_conf_log, | ||
99 | .disabled_channels = {-1}, | ||
100 | }; | ||
101 | |||
102 | static struct platform_device dma40_device = { | ||
103 | .dev = { | ||
104 | .platform_data = &dma40_plat_data, | ||
105 | }, | ||
106 | .name = "dma40", | ||
107 | .id = 0, | ||
108 | .num_resources = ARRAY_SIZE(dma40_resources), | ||
109 | .resource = dma40_resources | ||
110 | }; | ||
111 | |||
112 | void __init db5500_dma_init(void) | ||
113 | { | ||
114 | int ret; | ||
115 | |||
116 | ret = platform_device_register(&dma40_device); | ||
117 | if (ret) | ||
118 | dev_err(&dma40_device.dev, "unable to register device: %d\n", ret); | ||
119 | |||
120 | } | ||
diff --git a/arch/arm/mach-ux500/headsmp.S b/arch/arm/mach-ux500/headsmp.S index a6be2cdf2b2f..64fa451edcfd 100644 --- a/arch/arm/mach-ux500/headsmp.S +++ b/arch/arm/mach-ux500/headsmp.S | |||
@@ -23,7 +23,6 @@ ENTRY(u8500_secondary_startup) | |||
23 | ldmia r4, {r5, r6} | 23 | ldmia r4, {r5, r6} |
24 | sub r4, r4, r5 | 24 | sub r4, r4, r5 |
25 | add r6, r6, r4 | 25 | add r6, r6, r4 |
26 | dsb | ||
27 | pen: ldr r7, [r6] | 26 | pen: ldr r7, [r6] |
28 | cmp r7, r0 | 27 | cmp r7, r0 |
29 | bne pen | 28 | bne pen |
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c index b782a03024be..dd8037ebccf8 100644 --- a/arch/arm/mach-ux500/hotplug.c +++ b/arch/arm/mach-ux500/hotplug.c | |||
@@ -11,14 +11,11 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
14 | #include <linux/completion.h> | ||
15 | 14 | ||
16 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
17 | 16 | ||
18 | extern volatile int pen_release; | 17 | extern volatile int pen_release; |
19 | 18 | ||
20 | static DECLARE_COMPLETION(cpu_killed); | ||
21 | |||
22 | static inline void platform_do_lowpower(unsigned int cpu) | 19 | static inline void platform_do_lowpower(unsigned int cpu) |
23 | { | 20 | { |
24 | flush_cache_all(); | 21 | flush_cache_all(); |
@@ -38,7 +35,7 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
38 | 35 | ||
39 | int platform_cpu_kill(unsigned int cpu) | 36 | int platform_cpu_kill(unsigned int cpu) |
40 | { | 37 | { |
41 | return wait_for_completion_timeout(&cpu_killed, 5000); | 38 | return 1; |
42 | } | 39 | } |
43 | 40 | ||
44 | /* | 41 | /* |
@@ -48,19 +45,6 @@ int platform_cpu_kill(unsigned int cpu) | |||
48 | */ | 45 | */ |
49 | void platform_cpu_die(unsigned int cpu) | 46 | void platform_cpu_die(unsigned int cpu) |
50 | { | 47 | { |
51 | #ifdef DEBUG | ||
52 | unsigned int this_cpu = hard_smp_processor_id(); | ||
53 | |||
54 | if (cpu != this_cpu) { | ||
55 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
56 | this_cpu, cpu); | ||
57 | BUG(); | ||
58 | } | ||
59 | #endif | ||
60 | |||
61 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
62 | complete(&cpu_killed); | ||
63 | |||
64 | /* directly enter low power state, skipping secure registers */ | 48 | /* directly enter low power state, skipping secure registers */ |
65 | platform_do_lowpower(cpu); | 49 | platform_do_lowpower(cpu); |
66 | } | 50 | } |
diff --git a/arch/arm/mach-ux500/include/mach/db5500-regs.h b/arch/arm/mach-ux500/include/mach/db5500-regs.h index 3eafc0e24ba5..bd88c1e74060 100644 --- a/arch/arm/mach-ux500/include/mach/db5500-regs.h +++ b/arch/arm/mach-ux500/include/mach/db5500-regs.h | |||
@@ -114,4 +114,8 @@ | |||
114 | #define U5500_MBOX2_LOCAL_START (U5500_MBOX_BASE + 0x20) | 114 | #define U5500_MBOX2_LOCAL_START (U5500_MBOX_BASE + 0x20) |
115 | #define U5500_MBOX2_LOCAL_END (U5500_MBOX_BASE + 0x3F) | 115 | #define U5500_MBOX2_LOCAL_END (U5500_MBOX_BASE + 0x3F) |
116 | 116 | ||
117 | #define U5500_ESRAM_BASE 0x40000000 | ||
118 | #define U5500_ESRAM_DMA_LCPA_OFFSET 0x10000 | ||
119 | #define U5500_DMA_LCPA_BASE (U5500_ESRAM_BASE + U5500_ESRAM_DMA_LCPA_OFFSET) | ||
120 | |||
117 | #endif | 121 | #endif |
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h index f07d0986409d..0fefb34c11e4 100644 --- a/arch/arm/mach-ux500/include/mach/db8500-regs.h +++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h | |||
@@ -92,7 +92,8 @@ | |||
92 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) | 92 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) |
93 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) | 93 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) |
94 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) | 94 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) |
95 | #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x0f000) | 95 | #define U8500_PRCMU_TCDM_BASE_V1 (U8500_PER4_BASE + 0x0f000) |
96 | #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) | ||
96 | 97 | ||
97 | /* per3 base addresses */ | 98 | /* per3 base addresses */ |
98 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) | 99 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) |
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h index b91a4d1211a2..020b6369a30a 100644 --- a/arch/arm/mach-ux500/include/mach/devices.h +++ b/arch/arm/mach-ux500/include/mach/devices.h | |||
@@ -14,27 +14,10 @@ extern struct platform_device u5500_gpio_devs[]; | |||
14 | extern struct platform_device u8500_gpio_devs[]; | 14 | extern struct platform_device u8500_gpio_devs[]; |
15 | 15 | ||
16 | extern struct amba_device ux500_pl031_device; | 16 | extern struct amba_device ux500_pl031_device; |
17 | extern struct amba_device u8500_ssp0_device; | ||
18 | extern struct amba_device ux500_uart0_device; | ||
19 | extern struct amba_device ux500_uart1_device; | ||
20 | extern struct amba_device ux500_uart2_device; | ||
21 | 17 | ||
22 | extern struct platform_device ux500_i2c1_device; | ||
23 | extern struct platform_device ux500_i2c2_device; | ||
24 | extern struct platform_device ux500_i2c3_device; | ||
25 | |||
26 | extern struct platform_device u8500_i2c0_device; | ||
27 | extern struct platform_device u8500_i2c4_device; | ||
28 | extern struct platform_device u8500_dma40_device; | 18 | extern struct platform_device u8500_dma40_device; |
29 | extern struct platform_device ux500_ske_keypad_device; | 19 | extern struct platform_device ux500_ske_keypad_device; |
30 | 20 | ||
31 | extern struct amba_device u8500_sdi0_device; | ||
32 | extern struct amba_device u8500_sdi1_device; | ||
33 | extern struct amba_device u8500_sdi2_device; | ||
34 | extern struct amba_device u8500_sdi3_device; | ||
35 | extern struct amba_device u8500_sdi4_device; | ||
36 | extern struct amba_device u8500_sdi5_device; | ||
37 | |||
38 | void dma40_u8500ed_fixup(void); | 21 | void dma40_u8500ed_fixup(void); |
39 | 22 | ||
40 | #endif | 23 | #endif |
diff --git a/arch/arm/mach-ux500/include/mach/entry-macro.S b/arch/arm/mach-ux500/include/mach/entry-macro.S index 60ea88db8283..a37f585a3ecb 100644 --- a/arch/arm/mach-ux500/include/mach/entry-macro.S +++ b/arch/arm/mach-ux500/include/mach/entry-macro.S | |||
@@ -11,7 +11,8 @@ | |||
11 | * warranty of any kind, whether express or implied. | 11 | * warranty of any kind, whether express or implied. |
12 | */ | 12 | */ |
13 | #include <mach/hardware.h> | 13 | #include <mach/hardware.h> |
14 | #include <asm/hardware/gic.h> | 14 | #define HAVE_GET_IRQNR_PREAMBLE |
15 | #include <asm/hardware/entry-macro-gic.S> | ||
15 | 16 | ||
16 | .macro disable_fiq | 17 | .macro disable_fiq |
17 | .endm | 18 | .endm |
@@ -22,68 +23,3 @@ | |||
22 | 23 | ||
23 | .macro arch_ret_to_user, tmp1, tmp2 | 24 | .macro arch_ret_to_user, tmp1, tmp2 |
24 | .endm | 25 | .endm |
25 | |||
26 | /* | ||
27 | * The interrupt numbering scheme is defined in the | ||
28 | * interrupt controller spec. To wit: | ||
29 | * | ||
30 | * Interrupts 0-15 are IPI | ||
31 | * 16-28 are reserved | ||
32 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
33 | * 32-1020 are global | ||
34 | * 1021-1022 are reserved | ||
35 | * 1023 is "spurious" (no interrupt) | ||
36 | * | ||
37 | * For now, we ignore all local interrupts so only return an | ||
38 | * interrupt if it's between 30 and 1020. The test_for_ipi | ||
39 | * routine below will pick up on IPIs. | ||
40 | * | ||
41 | * A simple read from the controller will tell us the number | ||
42 | * of the highest priority enabled interrupt. We then just | ||
43 | * need to check whether it is in the valid range for an | ||
44 | * IRQ (30-1020 inclusive). | ||
45 | */ | ||
46 | |||
47 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
48 | |||
49 | /* bits 12-10 = src CPU, 9-0 = int # */ | ||
50 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
51 | |||
52 | ldr \tmp, =1021 | ||
53 | |||
54 | bic \irqnr, \irqstat, #0x1c00 | ||
55 | |||
56 | cmp \irqnr, #29 | ||
57 | cmpcc \irqnr, \irqnr | ||
58 | cmpne \irqnr, \tmp | ||
59 | cmpcs \irqnr, \irqnr | ||
60 | |||
61 | .endm | ||
62 | |||
63 | /* We assume that irqstat (the raw value of the IRQ | ||
64 | * acknowledge register) is preserved from the macro above. | ||
65 | * If there is an IPI, we immediately signal end of | ||
66 | * interrupt on the controller, since this requires the | ||
67 | * original irqstat value which we won't easily be able | ||
68 | * to recreate later. | ||
69 | */ | ||
70 | |||
71 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
72 | bic \irqnr, \irqstat, #0x1c00 | ||
73 | cmp \irqnr, #16 | ||
74 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
75 | cmpcs \irqnr, \irqnr | ||
76 | .endm | ||
77 | |||
78 | /* As above, this assumes that irqstat and base | ||
79 | * are preserved.. | ||
80 | */ | ||
81 | |||
82 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
83 | bic \irqnr, \irqstat, #0x1c00 | ||
84 | mov \tmp, #0 | ||
85 | cmp \irqnr, #29 | ||
86 | moveq \tmp, #1 | ||
87 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
88 | cmp \tmp, #0 | ||
89 | .endm | ||
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h index d548a622e7d2..3c4cd31ad9f7 100644 --- a/arch/arm/mach-ux500/include/mach/gpio.h +++ b/arch/arm/mach-ux500/include/mach/gpio.h | |||
@@ -9,42 +9,4 @@ | |||
9 | 9 | ||
10 | #include <plat/gpio.h> | 10 | #include <plat/gpio.h> |
11 | 11 | ||
12 | #define __GPIO_RESOURCE(soc, block) \ | ||
13 | { \ | ||
14 | .start = soc##_GPIOBANK##block##_BASE, \ | ||
15 | .end = soc##_GPIOBANK##block##_BASE + 127, \ | ||
16 | .flags = IORESOURCE_MEM, \ | ||
17 | }, \ | ||
18 | { \ | ||
19 | .start = IRQ_GPIO##block, \ | ||
20 | .end = IRQ_GPIO##block, \ | ||
21 | .flags = IORESOURCE_IRQ, \ | ||
22 | } | ||
23 | |||
24 | #define __GPIO_DEVICE(soc, block) \ | ||
25 | { \ | ||
26 | .name = "gpio", \ | ||
27 | .id = block, \ | ||
28 | .num_resources = 2, \ | ||
29 | .resource = &soc##_gpio_resources[block * 2], \ | ||
30 | .dev = { \ | ||
31 | .platform_data = &soc##_gpio_data[block], \ | ||
32 | }, \ | ||
33 | } | ||
34 | |||
35 | #define GPIO_DATA(_name, first) \ | ||
36 | { \ | ||
37 | .name = _name, \ | ||
38 | .first_gpio = first, \ | ||
39 | .first_irq = NOMADIK_GPIO_TO_IRQ(first), \ | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_UX500_SOC_DB8500 | ||
43 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U8500, block) | ||
44 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u8500, block) | ||
45 | #elif defined(CONFIG_UX500_SOC_DB5500) | ||
46 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U5500, block) | ||
47 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u5500, block) | ||
48 | #endif | ||
49 | |||
50 | #endif /* __ASM_ARCH_GPIO_H */ | 12 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h index 32e883a8f2a2..6295cc581355 100644 --- a/arch/arm/mach-ux500/include/mach/hardware.h +++ b/arch/arm/mach-ux500/include/mach/hardware.h | |||
@@ -142,6 +142,8 @@ static inline bool cpu_is_u5500(void) | |||
142 | #endif | 142 | #endif |
143 | } | 143 | } |
144 | 144 | ||
145 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) | ||
146 | |||
145 | #endif | 147 | #endif |
146 | 148 | ||
147 | #endif /* __MACH_HARDWARE_H */ | 149 | #endif /* __MACH_HARDWARE_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h index cca4f705601e..7cdeb2af0ebb 100644 --- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h +++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h | |||
@@ -8,12 +8,36 @@ | |||
8 | #ifndef __MACH_IRQS_BOARD_MOP500_H | 8 | #ifndef __MACH_IRQS_BOARD_MOP500_H |
9 | #define __MACH_IRQS_BOARD_MOP500_H | 9 | #define __MACH_IRQS_BOARD_MOP500_H |
10 | 10 | ||
11 | #define AB8500_NR_IRQS 104 | 11 | /* Number of AB8500 irqs is taken from header file */ |
12 | #include <linux/mfd/ab8500.h> | ||
12 | 13 | ||
13 | #define MOP500_AB8500_IRQ_BASE IRQ_BOARD_START | 14 | #define MOP500_AB8500_IRQ_BASE IRQ_BOARD_START |
14 | #define MOP500_AB8500_IRQ_END (MOP500_AB8500_IRQ_BASE \ | 15 | #define MOP500_AB8500_IRQ_END (MOP500_AB8500_IRQ_BASE \ |
15 | + AB8500_NR_IRQS) | 16 | + AB8500_NR_IRQS) |
16 | #define MOP500_IRQ_END MOP500_AB8500_IRQ_END | 17 | |
18 | /* TC35892 */ | ||
19 | #define TC35892_NR_INTERNAL_IRQS 8 | ||
20 | #define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x)) | ||
21 | #define TC35892_NR_GPIOS 24 | ||
22 | #define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS) | ||
23 | |||
24 | #define MOP500_EGPIO_NR_IRQS TC35892_NR_IRQS | ||
25 | |||
26 | #define MOP500_EGPIO_IRQ_BASE MOP500_AB8500_IRQ_END | ||
27 | #define MOP500_EGPIO_IRQ_END (MOP500_EGPIO_IRQ_BASE \ | ||
28 | + MOP500_EGPIO_NR_IRQS) | ||
29 | /* STMPE1601 irqs */ | ||
30 | #define STMPE_NR_INTERNAL_IRQS 9 | ||
31 | #define STMPE_INT_GPIO(x) (STMPE_NR_INTERNAL_IRQS + (x)) | ||
32 | #define STMPE_NR_GPIOS 24 | ||
33 | #define STMPE_NR_IRQS STMPE_INT_GPIO(STMPE_NR_GPIOS) | ||
34 | |||
35 | #define MOP500_STMPE1601_IRQBASE MOP500_EGPIO_IRQ_END | ||
36 | #define MOP500_STMPE1601_IRQ(x) (MOP500_STMPE1601_IRQBASE + (x)) | ||
37 | |||
38 | #define MOP500_NR_IRQS MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS) | ||
39 | |||
40 | #define MOP500_IRQ_END MOP500_NR_IRQS | ||
17 | 41 | ||
18 | #if MOP500_IRQ_END > IRQ_BOARD_END | 42 | #if MOP500_IRQ_END > IRQ_BOARD_END |
19 | #undef IRQ_BOARD_END | 43 | #undef IRQ_BOARD_END |
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h index 693aa57de88d..880ae45bc235 100644 --- a/arch/arm/mach-ux500/include/mach/irqs.h +++ b/arch/arm/mach-ux500/include/mach/irqs.h | |||
@@ -21,50 +21,6 @@ | |||
21 | 21 | ||
22 | /* Interrupt numbers generic for shared peripheral */ | 22 | /* Interrupt numbers generic for shared peripheral */ |
23 | #define IRQ_MTU0 (IRQ_SHPI_START + 4) | 23 | #define IRQ_MTU0 (IRQ_SHPI_START + 4) |
24 | #define IRQ_SPI2 (IRQ_SHPI_START + 6) | ||
25 | #define IRQ_SPI0 (IRQ_SHPI_START + 8) | ||
26 | #define IRQ_UART0 (IRQ_SHPI_START + 11) | ||
27 | #define IRQ_I2C3 (IRQ_SHPI_START + 12) | ||
28 | #define IRQ_SSP0 (IRQ_SHPI_START + 14) | ||
29 | #define IRQ_MTU1 (IRQ_SHPI_START + 17) | ||
30 | #define IRQ_RTC_RTT (IRQ_SHPI_START + 18) | ||
31 | #define IRQ_UART1 (IRQ_SHPI_START + 19) | ||
32 | #define IRQ_I2C0 (IRQ_SHPI_START + 21) | ||
33 | #define IRQ_I2C1 (IRQ_SHPI_START + 22) | ||
34 | #define IRQ_USBOTG (IRQ_SHPI_START + 23) | ||
35 | #define IRQ_DMA (IRQ_SHPI_START + 25) | ||
36 | #define IRQ_UART2 (IRQ_SHPI_START + 26) | ||
37 | #define IRQ_HSIR_EXCEP (IRQ_SHPI_START + 29) | ||
38 | #define IRQ_MSP0 (IRQ_SHPI_START + 31) | ||
39 | #define IRQ_HSIR_CH0_OVRRUN (IRQ_SHPI_START + 32) | ||
40 | #define IRQ_HSIR_CH1_OVRRUN (IRQ_SHPI_START + 33) | ||
41 | #define IRQ_HSIR_CH2_OVRRUN (IRQ_SHPI_START + 34) | ||
42 | #define IRQ_HSIR_CH3_OVRRUN (IRQ_SHPI_START + 35) | ||
43 | #define IRQ_AB8500 (IRQ_SHPI_START + 40) | ||
44 | #define IRQ_PRCMU (IRQ_SHPI_START + 47) | ||
45 | #define IRQ_DISP (IRQ_SHPI_START + 48) | ||
46 | #define IRQ_SiPI3 (IRQ_SHPI_START + 49) | ||
47 | #define IRQ_I2C4 (IRQ_SHPI_START + 51) | ||
48 | #define IRQ_SSP1 (IRQ_SHPI_START + 52) | ||
49 | #define IRQ_I2C2 (IRQ_SHPI_START + 55) | ||
50 | #define IRQ_SDMMC0 (IRQ_SHPI_START + 60) | ||
51 | #define IRQ_MSP1 (IRQ_SHPI_START + 62) | ||
52 | #define IRQ_SPI1 (IRQ_SHPI_START + 96) | ||
53 | #define IRQ_MSP2 (IRQ_SHPI_START + 98) | ||
54 | #define IRQ_SDMMC4 (IRQ_SHPI_START + 99) | ||
55 | #define IRQ_HSIRD0 (IRQ_SHPI_START + 104) | ||
56 | #define IRQ_HSIRD1 (IRQ_SHPI_START + 105) | ||
57 | #define IRQ_HSITD0 (IRQ_SHPI_START + 106) | ||
58 | #define IRQ_HSITD1 (IRQ_SHPI_START + 107) | ||
59 | #define IRQ_GPIO0 (IRQ_SHPI_START + 119) | ||
60 | #define IRQ_GPIO1 (IRQ_SHPI_START + 120) | ||
61 | #define IRQ_GPIO2 (IRQ_SHPI_START + 121) | ||
62 | #define IRQ_GPIO3 (IRQ_SHPI_START + 122) | ||
63 | #define IRQ_GPIO4 (IRQ_SHPI_START + 123) | ||
64 | #define IRQ_GPIO5 (IRQ_SHPI_START + 124) | ||
65 | #define IRQ_GPIO6 (IRQ_SHPI_START + 125) | ||
66 | #define IRQ_GPIO7 (IRQ_SHPI_START + 126) | ||
67 | #define IRQ_GPIO8 (IRQ_SHPI_START + 127) | ||
68 | 24 | ||
69 | /* There are 128 shared peripheral interrupts assigned to | 25 | /* There are 128 shared peripheral interrupts assigned to |
70 | * INTID[160:32]. The first 32 interrupts are reserved. | 26 | * INTID[160:32]. The first 32 interrupts are reserved. |
diff --git a/arch/arm/mach-ux500/include/mach/mbox.h b/arch/arm/mach-ux500/include/mach/mbox-db5500.h index 7f9da4d2fbda..7f9da4d2fbda 100644 --- a/arch/arm/mach-ux500/include/mach/mbox.h +++ b/arch/arm/mach-ux500/include/mach/mbox-db5500.h | |||
diff --git a/arch/arm/mach-ux500/include/mach/prcmu-defs.h b/arch/arm/mach-ux500/include/mach/prcmu-defs.h new file mode 100644 index 000000000000..848ba64b561f --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/prcmu-defs.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (C) STMicroelectronics 2009 | ||
3 | * Copyright (C) ST-Ericsson SA 2010 | ||
4 | * | ||
5 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> | ||
6 | * Author: Martin Persson <martin.persson@stericsson.com> | ||
7 | * | ||
8 | * License Terms: GNU General Public License v2 | ||
9 | * | ||
10 | * PRCM Unit definitions | ||
11 | */ | ||
12 | |||
13 | #ifndef __MACH_PRCMU_DEFS_H | ||
14 | #define __MACH_PRCMU_DEFS_H | ||
15 | |||
16 | enum prcmu_cpu_opp { | ||
17 | CPU_OPP_INIT = 0x00, | ||
18 | CPU_OPP_NO_CHANGE = 0x01, | ||
19 | CPU_OPP_100 = 0x02, | ||
20 | CPU_OPP_50 = 0x03, | ||
21 | CPU_OPP_MAX = 0x04, | ||
22 | CPU_OPP_EXT_CLK = 0x07 | ||
23 | }; | ||
24 | enum prcmu_ape_opp { | ||
25 | APE_OPP_NO_CHANGE = 0x00, | ||
26 | APE_OPP_100 = 0x02, | ||
27 | APE_OPP_50 = 0x03, | ||
28 | }; | ||
29 | |||
30 | #endif /* __MACH_PRCMU_DEFS_H */ | ||
diff --git a/arch/arm/mach-ux500/include/mach/prcmu-regs.h b/arch/arm/mach-ux500/include/mach/prcmu-regs.h index 8885f39a6421..455467e88791 100644 --- a/arch/arm/mach-ux500/include/mach/prcmu-regs.h +++ b/arch/arm/mach-ux500/include/mach/prcmu-regs.h | |||
@@ -1,10 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2009 ST-Ericsson SA | 2 | * Copyright (C) STMicroelectronics 2009 |
3 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify | 5 | * Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com> |
5 | * it under the terms of the GNU General Public License version 2 | 6 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> |
6 | * as published by the Free Software Foundation. | 7 | * |
8 | * License Terms: GNU General Public License v2 | ||
9 | * | ||
10 | * PRCM Unit registers | ||
7 | */ | 11 | */ |
12 | |||
8 | #ifndef __MACH_PRCMU_REGS_H | 13 | #ifndef __MACH_PRCMU_REGS_H |
9 | #define __MACH_PRCMU_REGS_H | 14 | #define __MACH_PRCMU_REGS_H |
10 | 15 | ||
@@ -88,4 +93,4 @@ | |||
88 | /* Miscellaneous unit registers */ | 93 | /* Miscellaneous unit registers */ |
89 | #define PRCM_DSI_SW_RESET (_PRCMU_BASE + 0x324) | 94 | #define PRCM_DSI_SW_RESET (_PRCMU_BASE + 0x324) |
90 | 95 | ||
91 | #endif /* __MACH_PRCMU__REGS_H */ | 96 | #endif /* __MACH_PRCMU_REGS_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/prcmu.h b/arch/arm/mach-ux500/include/mach/prcmu.h index 549843ff6dbe..c49e456162ef 100644 --- a/arch/arm/mach-ux500/include/mach/prcmu.h +++ b/arch/arm/mach-ux500/include/mach/prcmu.h | |||
@@ -2,14 +2,27 @@ | |||
2 | * Copyright (C) STMicroelectronics 2009 | 2 | * Copyright (C) STMicroelectronics 2009 |
3 | * Copyright (C) ST-Ericsson SA 2010 | 3 | * Copyright (C) ST-Ericsson SA 2010 |
4 | * | 4 | * |
5 | * Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com> | ||
6 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> | ||
7 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> | ||
8 | * | ||
5 | * License Terms: GNU General Public License v2 | 9 | * License Terms: GNU General Public License v2 |
6 | * | 10 | * |
7 | * PRCMU f/w APIs | 11 | * PRCM Unit f/w API |
8 | */ | 12 | */ |
9 | #ifndef __MACH_PRCMU_H | 13 | #ifndef __MACH_PRCMU_H |
10 | #define __MACH_PRCMU_H | 14 | #define __MACH_PRCMU_H |
15 | #include <mach/prcmu-defs.h> | ||
11 | 16 | ||
17 | void __init prcmu_early_init(void); | ||
12 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | 18 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); |
13 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | 19 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); |
20 | int prcmu_set_ape_opp(enum prcmu_ape_opp opp); | ||
21 | int prcmu_set_cpu_opp(enum prcmu_cpu_opp opp); | ||
22 | int prcmu_set_ape_cpu_opps(enum prcmu_ape_opp ape_opp, | ||
23 | enum prcmu_cpu_opp cpu_opp); | ||
24 | int prcmu_get_ape_opp(void); | ||
25 | int prcmu_get_cpu_opp(void); | ||
26 | bool prcmu_has_arm_maxopp(void); | ||
14 | 27 | ||
15 | #endif /* __MACH_PRCMU_H */ | 28 | #endif /* __MACH_PRCMU_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h index 54bbe648bf58..469877e0de90 100644 --- a/arch/arm/mach-ux500/include/mach/setup.h +++ b/arch/arm/mach-ux500/include/mach/setup.h | |||
@@ -18,14 +18,19 @@ extern void __init ux500_map_io(void); | |||
18 | extern void __init u5500_map_io(void); | 18 | extern void __init u5500_map_io(void); |
19 | extern void __init u8500_map_io(void); | 19 | extern void __init u8500_map_io(void); |
20 | 20 | ||
21 | extern void __init ux500_init_devices(void); | ||
22 | extern void __init u5500_init_devices(void); | 21 | extern void __init u5500_init_devices(void); |
23 | extern void __init u8500_init_devices(void); | 22 | extern void __init u8500_init_devices(void); |
24 | 23 | ||
25 | extern void __init ux500_init_irq(void); | 24 | extern void __init ux500_init_irq(void); |
25 | |||
26 | extern void __init u5500_sdi_init(void); | ||
27 | |||
28 | extern void __init db5500_dma_init(void); | ||
29 | |||
26 | /* We re-use nomadik_timer for this platform */ | 30 | /* We re-use nomadik_timer for this platform */ |
27 | extern void nmdk_timer_init(void); | 31 | extern void nmdk_timer_init(void); |
28 | 32 | ||
33 | struct amba_device; | ||
29 | extern void __init amba_add_devices(struct amba_device *devs[], int num); | 34 | extern void __init amba_add_devices(struct amba_device *devs[], int num); |
30 | 35 | ||
31 | struct sys_timer; | 36 | struct sys_timer; |
diff --git a/arch/arm/mach-ux500/include/mach/smp.h b/arch/arm/mach-ux500/include/mach/smp.h index 197e8417375e..ca2b15b1b3b1 100644 --- a/arch/arm/mach-ux500/include/mach/smp.h +++ b/arch/arm/mach-ux500/include/mach/smp.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #define ASMARM_ARCH_SMP_H | 10 | #define ASMARM_ARCH_SMP_H |
11 | 11 | ||
12 | #include <asm/hardware/gic.h> | 12 | #include <asm/hardware/gic.h> |
13 | #include <asm/smp_mpidr.h> | ||
14 | 13 | ||
15 | /* This is required to wakeup the secondary core */ | 14 | /* This is required to wakeup the secondary core */ |
16 | extern void u8500_secondary_startup(void); | 15 | extern void u8500_secondary_startup(void); |
@@ -18,8 +17,8 @@ extern void u8500_secondary_startup(void); | |||
18 | /* | 17 | /* |
19 | * We use IRQ1 as the IPI | 18 | * We use IRQ1 as the IPI |
20 | */ | 19 | */ |
21 | static inline void smp_cross_call(const struct cpumask *mask) | 20 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
22 | { | 21 | { |
23 | gic_raise_softirq(mask, 1); | 22 | gic_raise_softirq(mask, ipi); |
24 | } | 23 | } |
25 | #endif | 24 | #endif |
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h index 0271ca0a83df..9a6614c6808e 100644 --- a/arch/arm/mach-ux500/include/mach/uncompress.h +++ b/arch/arm/mach-ux500/include/mach/uncompress.h | |||
@@ -19,38 +19,43 @@ | |||
19 | #define __ASM_ARCH_UNCOMPRESS_H | 19 | #define __ASM_ARCH_UNCOMPRESS_H |
20 | 20 | ||
21 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
22 | #include <asm/mach-types.h> | ||
22 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/amba/serial.h> | ||
23 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
24 | 26 | ||
25 | #define U8500_UART_DR 0x80007000 | 27 | static u32 ux500_uart_base; |
26 | #define U8500_UART_LCRH 0x8000702c | ||
27 | #define U8500_UART_CR 0x80007030 | ||
28 | #define U8500_UART_FR 0x80007018 | ||
29 | 28 | ||
30 | static void putc(const char c) | 29 | static void putc(const char c) |
31 | { | 30 | { |
32 | /* Do nothing if the UART is not enabled. */ | 31 | /* Do nothing if the UART is not enabled. */ |
33 | if (!(__raw_readb(U8500_UART_CR) & 0x1)) | 32 | if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1)) |
34 | return; | 33 | return; |
35 | 34 | ||
36 | if (c == '\n') | 35 | if (c == '\n') |
37 | putc('\r'); | 36 | putc('\r'); |
38 | 37 | ||
39 | while (__raw_readb(U8500_UART_FR) & (1 << 5)) | 38 | while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 5)) |
40 | barrier(); | 39 | barrier(); |
41 | __raw_writeb(c, U8500_UART_DR); | 40 | __raw_writeb(c, ux500_uart_base + UART01x_DR); |
42 | } | 41 | } |
43 | 42 | ||
44 | static void flush(void) | 43 | static void flush(void) |
45 | { | 44 | { |
46 | if (!(__raw_readb(U8500_UART_CR) & 0x1)) | 45 | if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1)) |
47 | return; | 46 | return; |
48 | while (__raw_readb(U8500_UART_FR) & (1 << 3)) | 47 | while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 3)) |
49 | barrier(); | 48 | barrier(); |
50 | } | 49 | } |
51 | 50 | ||
52 | static inline void arch_decomp_setup(void) | 51 | static inline void arch_decomp_setup(void) |
53 | { | 52 | { |
53 | if (machine_is_u8500()) | ||
54 | ux500_uart_base = U8500_UART2_BASE; | ||
55 | else if (machine_is_u5500()) | ||
56 | ux500_uart_base = U5500_UART0_BASE; | ||
57 | else /* not much can be done to help here */ | ||
58 | ux500_uart_base = U8500_UART2_BASE; | ||
54 | } | 59 | } |
55 | 60 | ||
56 | #define arch_decomp_wdog() /* nothing to do here */ | 61 | #define arch_decomp_wdog() /* nothing to do here */ |
diff --git a/arch/arm/mach-ux500/mbox.c b/arch/arm/mach-ux500/mbox-db5500.c index 63435389c544..cbf15718fc3c 100644 --- a/arch/arm/mach-ux500/mbox.c +++ b/arch/arm/mach-ux500/mbox-db5500.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <linux/debugfs.h> | 38 | #include <linux/debugfs.h> |
39 | #include <linux/seq_file.h> | 39 | #include <linux/seq_file.h> |
40 | #include <linux/completion.h> | 40 | #include <linux/completion.h> |
41 | #include <mach/mbox.h> | 41 | #include <mach/mbox-db5500.h> |
42 | 42 | ||
43 | #define MBOX_NAME "mbox" | 43 | #define MBOX_NAME "mbox" |
44 | 44 | ||
diff --git a/arch/arm/mach-ux500/modem_irq.c b/arch/arm/mach-ux500/modem-irq-db5500.c index 3187f8871169..3187f8871169 100644 --- a/arch/arm/mach-ux500/modem_irq.c +++ b/arch/arm/mach-ux500/modem-irq-db5500.c | |||
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index 9e4c678de785..d77e76cb7edd 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | 19 | ||
20 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
21 | #include <asm/localtimer.h> | ||
22 | #include <asm/smp_scu.h> | 21 | #include <asm/smp_scu.h> |
23 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
24 | 23 | ||
@@ -26,31 +25,37 @@ | |||
26 | * control for which core is the next to come out of the secondary | 25 | * control for which core is the next to come out of the secondary |
27 | * boot "holding pen" | 26 | * boot "holding pen" |
28 | */ | 27 | */ |
29 | volatile int __cpuinitdata pen_release = -1; | 28 | volatile int pen_release = -1; |
30 | 29 | ||
31 | static unsigned int __init get_core_count(void) | 30 | /* |
31 | * Write pen_release in a way that is guaranteed to be visible to all | ||
32 | * observers, irrespective of whether they're taking part in coherency | ||
33 | * or not. This is necessary for the hotplug code to work reliably. | ||
34 | */ | ||
35 | static void write_pen_release(int val) | ||
32 | { | 36 | { |
33 | return scu_get_core_count(__io_address(UX500_SCU_BASE)); | 37 | pen_release = val; |
38 | smp_wmb(); | ||
39 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
40 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
34 | } | 41 | } |
35 | 42 | ||
36 | static DEFINE_SPINLOCK(boot_lock); | 43 | static DEFINE_SPINLOCK(boot_lock); |
37 | 44 | ||
38 | void __cpuinit platform_secondary_init(unsigned int cpu) | 45 | void __cpuinit platform_secondary_init(unsigned int cpu) |
39 | { | 46 | { |
40 | trace_hardirqs_off(); | ||
41 | |||
42 | /* | 47 | /* |
43 | * if any interrupts are already enabled for the primary | 48 | * if any interrupts are already enabled for the primary |
44 | * core (e.g. timer irq), then they will not have been enabled | 49 | * core (e.g. timer irq), then they will not have been enabled |
45 | * for us: do so | 50 | * for us: do so |
46 | */ | 51 | */ |
47 | gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE)); | 52 | gic_secondary_init(0); |
48 | 53 | ||
49 | /* | 54 | /* |
50 | * let the primary processor know we're out of the | 55 | * let the primary processor know we're out of the |
51 | * pen, then head off into the C entry point | 56 | * pen, then head off into the C entry point |
52 | */ | 57 | */ |
53 | pen_release = -1; | 58 | write_pen_release(-1); |
54 | 59 | ||
55 | /* | 60 | /* |
56 | * Synchronise with the boot thread. | 61 | * Synchronise with the boot thread. |
@@ -74,11 +79,9 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
74 | * the holding pen - release it, then wait for it to flag | 79 | * the holding pen - release it, then wait for it to flag |
75 | * that it has been released by resetting pen_release. | 80 | * that it has been released by resetting pen_release. |
76 | */ | 81 | */ |
77 | pen_release = cpu; | 82 | write_pen_release(cpu); |
78 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
79 | outer_clean_range(__pa(&pen_release), __pa(&pen_release) + 1); | ||
80 | 83 | ||
81 | smp_cross_call(cpumask_of(cpu)); | 84 | smp_cross_call(cpumask_of(cpu), 1); |
82 | 85 | ||
83 | timeout = jiffies + (1 * HZ); | 86 | timeout = jiffies + (1 * HZ); |
84 | while (time_before(jiffies, timeout)) { | 87 | while (time_before(jiffies, timeout)) { |
@@ -97,9 +100,6 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
97 | 100 | ||
98 | static void __init wakeup_secondary(void) | 101 | static void __init wakeup_secondary(void) |
99 | { | 102 | { |
100 | /* nobody is to be released from the pen yet */ | ||
101 | pen_release = -1; | ||
102 | |||
103 | /* | 103 | /* |
104 | * write the address of secondary startup into the backup ram register | 104 | * write the address of secondary startup into the backup ram register |
105 | * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the | 105 | * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the |
@@ -126,40 +126,26 @@ static void __init wakeup_secondary(void) | |||
126 | */ | 126 | */ |
127 | void __init smp_init_cpus(void) | 127 | void __init smp_init_cpus(void) |
128 | { | 128 | { |
129 | unsigned int i, ncores = get_core_count(); | 129 | unsigned int i, ncores; |
130 | 130 | ||
131 | for (i = 0; i < ncores; i++) | 131 | ncores = scu_get_core_count(__io_address(UX500_SCU_BASE)); |
132 | set_cpu_possible(i, true); | ||
133 | } | ||
134 | |||
135 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
136 | { | ||
137 | unsigned int ncores = get_core_count(); | ||
138 | unsigned int cpu = smp_processor_id(); | ||
139 | int i; | ||
140 | 132 | ||
141 | /* sanity check */ | 133 | /* sanity check */ |
142 | if (ncores == 0) { | 134 | if (ncores > NR_CPUS) { |
143 | printk(KERN_ERR | ||
144 | "U8500: strange CM count of 0? Default to 1\n"); | ||
145 | ncores = 1; | ||
146 | } | ||
147 | |||
148 | if (ncores > num_possible_cpus()) { | ||
149 | printk(KERN_WARNING | 135 | printk(KERN_WARNING |
150 | "U8500: no. of cores (%d) greater than configured " | 136 | "U8500: no. of cores (%d) greater than configured " |
151 | "maximum of %d - clipping\n", | 137 | "maximum of %d - clipping\n", |
152 | ncores, num_possible_cpus()); | 138 | ncores, NR_CPUS); |
153 | ncores = num_possible_cpus(); | 139 | ncores = NR_CPUS; |
154 | } | 140 | } |
155 | 141 | ||
156 | smp_store_cpu_info(cpu); | 142 | for (i = 0; i < ncores; i++) |
143 | set_cpu_possible(i, true); | ||
144 | } | ||
157 | 145 | ||
158 | /* | 146 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
159 | * are we trying to boot more cores than exist? | 147 | { |
160 | */ | 148 | int i; |
161 | if (max_cpus > ncores) | ||
162 | max_cpus = ncores; | ||
163 | 149 | ||
164 | /* | 150 | /* |
165 | * Initialise the present map, which describes the set of CPUs | 151 | * Initialise the present map, which describes the set of CPUs |
@@ -168,13 +154,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
168 | for (i = 0; i < max_cpus; i++) | 154 | for (i = 0; i < max_cpus; i++) |
169 | set_cpu_present(i, true); | 155 | set_cpu_present(i, true); |
170 | 156 | ||
171 | if (max_cpus > 1) { | 157 | scu_enable(__io_address(UX500_SCU_BASE)); |
172 | /* | 158 | wakeup_secondary(); |
173 | * Enable the local timer or broadcast device for the | ||
174 | * boot CPU, but only if we have more than one CPU. | ||
175 | */ | ||
176 | percpu_timer_setup(); | ||
177 | scu_enable(__io_address(UX500_SCU_BASE)); | ||
178 | wakeup_secondary(); | ||
179 | } | ||
180 | } | 159 | } |
diff --git a/arch/arm/mach-ux500/prcmu.c b/arch/arm/mach-ux500/prcmu.c index 293274d1342a..c522d26ef348 100644 --- a/arch/arm/mach-ux500/prcmu.c +++ b/arch/arm/mach-ux500/prcmu.c | |||
@@ -1,10 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) ST Ericsson SA 2010 | 2 | * Copyright (C) STMicroelectronics 2009 |
3 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | 4 | * |
4 | * License Terms: GNU General Public License v2 | 5 | * License Terms: GNU General Public License v2 |
6 | * Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com> | ||
7 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> | ||
5 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 8 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> |
6 | * | 9 | * |
7 | * U8500 PRCMU driver. | 10 | * U8500 PRCM Unit interface driver |
11 | * | ||
8 | */ | 12 | */ |
9 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
10 | #include <linux/module.h> | 14 | #include <linux/module.h> |
@@ -19,11 +23,26 @@ | |||
19 | 23 | ||
20 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
21 | #include <mach/prcmu-regs.h> | 25 | #include <mach/prcmu-regs.h> |
26 | #include <mach/prcmu-defs.h> | ||
27 | |||
28 | /* Global var to runtime determine TCDM base for v2 or v1 */ | ||
29 | static __iomem void *tcdm_base; | ||
30 | |||
31 | #define _MBOX_HEADER (tcdm_base + 0xFE8) | ||
32 | #define MBOX_HEADER_REQ_MB0 (_MBOX_HEADER + 0x0) | ||
33 | |||
34 | #define REQ_MB1 (tcdm_base + 0xFD0) | ||
35 | #define REQ_MB5 (tcdm_base + 0xE44) | ||
22 | 36 | ||
23 | #define PRCMU_TCDM_BASE __io_address(U8500_PRCMU_TCDM_BASE) | 37 | #define REQ_MB1_ARMOPP (REQ_MB1 + 0x0) |
38 | #define REQ_MB1_APEOPP (REQ_MB1 + 0x1) | ||
39 | #define REQ_MB1_BOOSTOPP (REQ_MB1 + 0x2) | ||
24 | 40 | ||
25 | #define REQ_MB5 (PRCMU_TCDM_BASE + 0xE44) | 41 | #define ACK_MB1 (tcdm_base + 0xE04) |
26 | #define ACK_MB5 (PRCMU_TCDM_BASE + 0xDF4) | 42 | #define ACK_MB5 (tcdm_base + 0xDF4) |
43 | |||
44 | #define ACK_MB1_CURR_ARMOPP (ACK_MB1 + 0x0) | ||
45 | #define ACK_MB1_CURR_APEOPP (ACK_MB1 + 0x1) | ||
27 | 46 | ||
28 | #define REQ_MB5_I2C_SLAVE_OP (REQ_MB5) | 47 | #define REQ_MB5_I2C_SLAVE_OP (REQ_MB5) |
29 | #define REQ_MB5_I2C_HW_BITS (REQ_MB5 + 1) | 48 | #define REQ_MB5_I2C_HW_BITS (REQ_MB5 + 1) |
@@ -33,10 +52,33 @@ | |||
33 | #define ACK_MB5_I2C_STATUS (ACK_MB5 + 1) | 52 | #define ACK_MB5_I2C_STATUS (ACK_MB5 + 1) |
34 | #define ACK_MB5_I2C_VAL (ACK_MB5 + 3) | 53 | #define ACK_MB5_I2C_VAL (ACK_MB5 + 3) |
35 | 54 | ||
36 | #define I2C_WRITE(slave) ((slave) << 1) | 55 | #define PRCM_AVS_VARM_MAX_OPP (tcdm_base + 0x2E4) |
37 | #define I2C_READ(slave) (((slave) << 1) | BIT(0)) | 56 | #define PRCM_AVS_ISMODEENABLE 7 |
57 | #define PRCM_AVS_ISMODEENABLE_MASK (1 << PRCM_AVS_ISMODEENABLE) | ||
58 | |||
59 | #define I2C_WRITE(slave) \ | ||
60 | (((slave) << 1) | (cpu_is_u8500v2() ? BIT(6) : 0)) | ||
61 | #define I2C_READ(slave) \ | ||
62 | (((slave) << 1) | (cpu_is_u8500v2() ? BIT(6) : 0) | BIT(0)) | ||
38 | #define I2C_STOP_EN BIT(3) | 63 | #define I2C_STOP_EN BIT(3) |
39 | 64 | ||
65 | enum mb1_h { | ||
66 | MB1H_ARM_OPP = 1, | ||
67 | MB1H_APE_OPP, | ||
68 | MB1H_ARM_APE_OPP, | ||
69 | }; | ||
70 | |||
71 | static struct { | ||
72 | struct mutex lock; | ||
73 | struct completion work; | ||
74 | struct { | ||
75 | u8 arm_opp; | ||
76 | u8 ape_opp; | ||
77 | u8 arm_status; | ||
78 | u8 ape_status; | ||
79 | } ack; | ||
80 | } mb1_transfer; | ||
81 | |||
40 | enum ack_mb5_status { | 82 | enum ack_mb5_status { |
41 | I2C_WR_OK = 0x01, | 83 | I2C_WR_OK = 0x01, |
42 | I2C_RD_OK = 0x02, | 84 | I2C_RD_OK = 0x02, |
@@ -145,6 +187,104 @@ unlock_and_return: | |||
145 | } | 187 | } |
146 | EXPORT_SYMBOL(prcmu_abb_write); | 188 | EXPORT_SYMBOL(prcmu_abb_write); |
147 | 189 | ||
190 | static int set_ape_cpu_opps(u8 header, enum prcmu_ape_opp ape_opp, | ||
191 | enum prcmu_cpu_opp cpu_opp) | ||
192 | { | ||
193 | bool do_ape; | ||
194 | bool do_arm; | ||
195 | int err = 0; | ||
196 | |||
197 | do_ape = ((header == MB1H_APE_OPP) || (header == MB1H_ARM_APE_OPP)); | ||
198 | do_arm = ((header == MB1H_ARM_OPP) || (header == MB1H_ARM_APE_OPP)); | ||
199 | |||
200 | mutex_lock(&mb1_transfer.lock); | ||
201 | |||
202 | while (readl(PRCM_MBOX_CPU_VAL) & MBOX_BIT(1)) | ||
203 | cpu_relax(); | ||
204 | |||
205 | writeb(0, MBOX_HEADER_REQ_MB0); | ||
206 | writeb(cpu_opp, REQ_MB1_ARMOPP); | ||
207 | writeb(ape_opp, REQ_MB1_APEOPP); | ||
208 | writeb(0, REQ_MB1_BOOSTOPP); | ||
209 | writel(MBOX_BIT(1), PRCM_MBOX_CPU_SET); | ||
210 | wait_for_completion(&mb1_transfer.work); | ||
211 | if ((do_ape) && (mb1_transfer.ack.ape_status != 0)) | ||
212 | err = -EIO; | ||
213 | if ((do_arm) && (mb1_transfer.ack.arm_status != 0)) | ||
214 | err = -EIO; | ||
215 | |||
216 | mutex_unlock(&mb1_transfer.lock); | ||
217 | |||
218 | return err; | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * prcmu_set_ape_opp() - Set the OPP of the APE. | ||
223 | * @opp: The OPP to set. | ||
224 | * | ||
225 | * This function sets the OPP of the APE. | ||
226 | */ | ||
227 | int prcmu_set_ape_opp(enum prcmu_ape_opp opp) | ||
228 | { | ||
229 | return set_ape_cpu_opps(MB1H_APE_OPP, opp, APE_OPP_NO_CHANGE); | ||
230 | } | ||
231 | EXPORT_SYMBOL(prcmu_set_ape_opp); | ||
232 | |||
233 | /** | ||
234 | * prcmu_set_cpu_opp() - Set the OPP of the CPU. | ||
235 | * @opp: The OPP to set. | ||
236 | * | ||
237 | * This function sets the OPP of the CPU. | ||
238 | */ | ||
239 | int prcmu_set_cpu_opp(enum prcmu_cpu_opp opp) | ||
240 | { | ||
241 | return set_ape_cpu_opps(MB1H_ARM_OPP, CPU_OPP_NO_CHANGE, opp); | ||
242 | } | ||
243 | EXPORT_SYMBOL(prcmu_set_cpu_opp); | ||
244 | |||
245 | /** | ||
246 | * prcmu_set_ape_cpu_opps() - Set the OPPs of the APE and the CPU. | ||
247 | * @ape_opp: The APE OPP to set. | ||
248 | * @cpu_opp: The CPU OPP to set. | ||
249 | * | ||
250 | * This function sets the OPPs of the APE and the CPU. | ||
251 | */ | ||
252 | int prcmu_set_ape_cpu_opps(enum prcmu_ape_opp ape_opp, | ||
253 | enum prcmu_cpu_opp cpu_opp) | ||
254 | { | ||
255 | return set_ape_cpu_opps(MB1H_ARM_APE_OPP, ape_opp, cpu_opp); | ||
256 | } | ||
257 | EXPORT_SYMBOL(prcmu_set_ape_cpu_opps); | ||
258 | |||
259 | /** | ||
260 | * prcmu_get_ape_opp() - Get the OPP of the APE. | ||
261 | * | ||
262 | * This function gets the OPP of the APE. | ||
263 | */ | ||
264 | enum prcmu_ape_opp prcmu_get_ape_opp(void) | ||
265 | { | ||
266 | return readb(ACK_MB1_CURR_APEOPP); | ||
267 | } | ||
268 | EXPORT_SYMBOL(prcmu_get_ape_opp); | ||
269 | |||
270 | /** | ||
271 | * prcmu_get_cpu_opp() - Get the OPP of the CPU. | ||
272 | * | ||
273 | * This function gets the OPP of the CPU. The OPP is specified in %%. | ||
274 | * PRCMU_OPP_EXT is a special OPP value, not specified in %%. | ||
275 | */ | ||
276 | int prcmu_get_cpu_opp(void) | ||
277 | { | ||
278 | return readb(ACK_MB1_CURR_ARMOPP); | ||
279 | } | ||
280 | EXPORT_SYMBOL(prcmu_get_cpu_opp); | ||
281 | |||
282 | bool prcmu_has_arm_maxopp(void) | ||
283 | { | ||
284 | return (readb(PRCM_AVS_VARM_MAX_OPP) & PRCM_AVS_ISMODEENABLE_MASK) | ||
285 | == PRCM_AVS_ISMODEENABLE_MASK; | ||
286 | } | ||
287 | |||
148 | static void read_mailbox_0(void) | 288 | static void read_mailbox_0(void) |
149 | { | 289 | { |
150 | writel(MBOX_BIT(0), PRCM_ARM_IT1_CLEAR); | 290 | writel(MBOX_BIT(0), PRCM_ARM_IT1_CLEAR); |
@@ -152,6 +292,9 @@ static void read_mailbox_0(void) | |||
152 | 292 | ||
153 | static void read_mailbox_1(void) | 293 | static void read_mailbox_1(void) |
154 | { | 294 | { |
295 | mb1_transfer.ack.arm_opp = readb(ACK_MB1_CURR_ARMOPP); | ||
296 | mb1_transfer.ack.ape_opp = readb(ACK_MB1_CURR_APEOPP); | ||
297 | complete(&mb1_transfer.work); | ||
155 | writel(MBOX_BIT(1), PRCM_ARM_IT1_CLEAR); | 298 | writel(MBOX_BIT(1), PRCM_ARM_IT1_CLEAR); |
156 | } | 299 | } |
157 | 300 | ||
@@ -217,15 +360,35 @@ static irqreturn_t prcmu_irq_handler(int irq, void *data) | |||
217 | return IRQ_HANDLED; | 360 | return IRQ_HANDLED; |
218 | } | 361 | } |
219 | 362 | ||
363 | void __init prcmu_early_init(void) | ||
364 | { | ||
365 | if (cpu_is_u8500v11() || cpu_is_u8500ed()) { | ||
366 | tcdm_base = __io_address(U8500_PRCMU_TCDM_BASE_V1); | ||
367 | } else if (cpu_is_u8500v2()) { | ||
368 | tcdm_base = __io_address(U8500_PRCMU_TCDM_BASE); | ||
369 | } else { | ||
370 | pr_err("prcmu: Unsupported chip version\n"); | ||
371 | BUG(); | ||
372 | } | ||
373 | } | ||
374 | |||
220 | static int __init prcmu_init(void) | 375 | static int __init prcmu_init(void) |
221 | { | 376 | { |
377 | if (cpu_is_u8500ed()) { | ||
378 | pr_err("prcmu: Unsupported chip version\n"); | ||
379 | return 0; | ||
380 | } | ||
381 | |||
382 | mutex_init(&mb1_transfer.lock); | ||
383 | init_completion(&mb1_transfer.work); | ||
222 | mutex_init(&mb5_transfer.lock); | 384 | mutex_init(&mb5_transfer.lock); |
223 | init_completion(&mb5_transfer.work); | 385 | init_completion(&mb5_transfer.work); |
224 | 386 | ||
225 | /* Clean up the mailbox interrupts after pre-kernel code. */ | 387 | /* Clean up the mailbox interrupts after pre-kernel code. */ |
226 | writel((MBOX_BIT(NUM_MBOX) - 1), PRCM_ARM_IT1_CLEAR); | 388 | writel((MBOX_BIT(NUM_MBOX) - 1), PRCM_ARM_IT1_CLEAR); |
227 | 389 | ||
228 | return request_irq(IRQ_PRCMU, prcmu_irq_handler, 0, "prcmu", NULL); | 390 | return request_irq(IRQ_DB8500_PRCMU1, prcmu_irq_handler, 0, |
391 | "prcmu", NULL); | ||
229 | } | 392 | } |
230 | 393 | ||
231 | arch_initcall(prcmu_init); | 394 | arch_initcall(prcmu_init); |
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig index c781f30c8368..3f7b5e9d83c5 100644 --- a/arch/arm/mach-versatile/Kconfig +++ b/arch/arm/mach-versatile/Kconfig | |||
@@ -4,6 +4,7 @@ menu "Versatile platform type" | |||
4 | config ARCH_VERSATILE_PB | 4 | config ARCH_VERSATILE_PB |
5 | bool "Support Versatile/PB platform" | 5 | bool "Support Versatile/PB platform" |
6 | select CPU_ARM926T | 6 | select CPU_ARM926T |
7 | select MIGHT_HAVE_PCI | ||
7 | default y | 8 | default y |
8 | help | 9 | help |
9 | Include support for the ARM(R) Versatile/PB platform. | 10 | Include support for the ARM(R) Versatile/PB platform. |
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index e38acb0f89c8..13a83e45a33b 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -31,8 +31,8 @@ | |||
31 | #include <linux/amba/pl022.h> | 31 | #include <linux/amba/pl022.h> |
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/gfp.h> | 33 | #include <linux/gfp.h> |
34 | #include <linux/clkdev.h> | ||
34 | 35 | ||
35 | #include <asm/clkdev.h> | ||
36 | #include <asm/system.h> | 36 | #include <asm/system.h> |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/leds.h> | 38 | #include <asm/leds.h> |
@@ -46,10 +46,11 @@ | |||
46 | #include <asm/mach/irq.h> | 46 | #include <asm/mach/irq.h> |
47 | #include <asm/mach/time.h> | 47 | #include <asm/mach/time.h> |
48 | #include <asm/mach/map.h> | 48 | #include <asm/mach/map.h> |
49 | #include <mach/clkdev.h> | ||
50 | #include <mach/hardware.h> | 49 | #include <mach/hardware.h> |
51 | #include <mach/platform.h> | 50 | #include <mach/platform.h> |
52 | #include <plat/timer-sp.h> | 51 | #include <asm/hardware/timer-sp.h> |
52 | |||
53 | #include <plat/sched_clock.h> | ||
53 | 54 | ||
54 | #include "core.h" | 55 | #include "core.h" |
55 | 56 | ||
@@ -886,6 +887,12 @@ void __init versatile_init(void) | |||
886 | } | 887 | } |
887 | 888 | ||
888 | /* | 889 | /* |
890 | * The sched_clock counter | ||
891 | */ | ||
892 | #define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + \ | ||
893 | VERSATILE_SYS_24MHz_OFFSET) | ||
894 | |||
895 | /* | ||
889 | * Where is the timer (VA)? | 896 | * Where is the timer (VA)? |
890 | */ | 897 | */ |
891 | #define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE) | 898 | #define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE) |
@@ -900,6 +907,8 @@ static void __init versatile_timer_init(void) | |||
900 | { | 907 | { |
901 | u32 val; | 908 | u32 val; |
902 | 909 | ||
910 | versatile_sched_clock_init(REFCOUNTER, 24000000); | ||
911 | |||
903 | /* | 912 | /* |
904 | * set clock frequency: | 913 | * set clock frequency: |
905 | * VERSATILE_REFCLK is 32KHz | 914 | * VERSATILE_REFCLK is 32KHz |
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile index 1b71b77ade22..2c0ac7de2814 100644 --- a/arch/arm/mach-vexpress/Makefile +++ b/arch/arm/mach-vexpress/Makefile | |||
@@ -5,4 +5,5 @@ | |||
5 | obj-y := v2m.o | 5 | obj-y := v2m.o |
6 | obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o | 6 | obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o |
7 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 7 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
8 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | ||
8 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o | 9 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o |
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h index 57dd95ce41f9..362780d868de 100644 --- a/arch/arm/mach-vexpress/core.h +++ b/arch/arm/mach-vexpress/core.h | |||
@@ -22,5 +22,3 @@ struct map_desc; | |||
22 | 22 | ||
23 | void v2m_map_io(struct map_desc *tile, size_t num); | 23 | void v2m_map_io(struct map_desc *tile, size_t num); |
24 | extern struct sys_timer v2m_timer; | 24 | extern struct sys_timer v2m_timer; |
25 | |||
26 | extern void __iomem *gic_cpu_base_addr; | ||
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index fd25ccd7272f..e628402b754c 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
@@ -8,8 +8,8 @@ | |||
8 | #include <linux/platform_device.h> | 8 | #include <linux/platform_device.h> |
9 | #include <linux/amba/bus.h> | 9 | #include <linux/amba/bus.h> |
10 | #include <linux/amba/clcd.h> | 10 | #include <linux/amba/clcd.h> |
11 | #include <linux/clkdev.h> | ||
11 | 12 | ||
12 | #include <asm/clkdev.h> | ||
13 | #include <asm/pgtable.h> | 13 | #include <asm/pgtable.h> |
14 | #include <asm/hardware/arm_timer.h> | 14 | #include <asm/hardware/arm_timer.h> |
15 | #include <asm/hardware/cache-l2x0.h> | 15 | #include <asm/hardware/cache-l2x0.h> |
@@ -18,10 +18,9 @@ | |||
18 | #include <asm/pmu.h> | 18 | #include <asm/pmu.h> |
19 | #include <asm/smp_twd.h> | 19 | #include <asm/smp_twd.h> |
20 | 20 | ||
21 | #include <mach/clkdev.h> | ||
22 | #include <mach/ct-ca9x4.h> | 21 | #include <mach/ct-ca9x4.h> |
23 | 22 | ||
24 | #include <plat/timer-sp.h> | 23 | #include <asm/hardware/timer-sp.h> |
25 | 24 | ||
26 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
@@ -60,13 +59,10 @@ static void __init ct_ca9x4_map_io(void) | |||
60 | v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); | 59 | v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); |
61 | } | 60 | } |
62 | 61 | ||
63 | void __iomem *gic_cpu_base_addr; | ||
64 | |||
65 | static void __init ct_ca9x4_init_irq(void) | 62 | static void __init ct_ca9x4_init_irq(void) |
66 | { | 63 | { |
67 | gic_cpu_base_addr = MMIO_P2V(A9_MPCORE_GIC_CPU); | 64 | gic_init(0, 29, MMIO_P2V(A9_MPCORE_GIC_DIST), |
68 | gic_dist_init(0, MMIO_P2V(A9_MPCORE_GIC_DIST), 29); | 65 | MMIO_P2V(A9_MPCORE_GIC_CPU)); |
69 | gic_cpu_init(0, gic_cpu_base_addr); | ||
70 | } | 66 | } |
71 | 67 | ||
72 | #if 0 | 68 | #if 0 |
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c new file mode 100644 index 000000000000..ea4cbfb90a66 --- /dev/null +++ b/arch/arm/mach-vexpress/hotplug.c | |||
@@ -0,0 +1,128 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-realview/hotplug.c | ||
3 | * | ||
4 | * Copyright (C) 2002 ARM Ltd. | ||
5 | * All Rights Reserved | ||
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 | #include <linux/kernel.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/smp.h> | ||
14 | |||
15 | #include <asm/cacheflush.h> | ||
16 | |||
17 | extern volatile int pen_release; | ||
18 | |||
19 | static inline void cpu_enter_lowpower(void) | ||
20 | { | ||
21 | unsigned int v; | ||
22 | |||
23 | flush_cache_all(); | ||
24 | asm volatile( | ||
25 | "mcr p15, 0, %1, c7, c5, 0\n" | ||
26 | " mcr p15, 0, %1, c7, c10, 4\n" | ||
27 | /* | ||
28 | * Turn off coherency | ||
29 | */ | ||
30 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
31 | " bic %0, %0, %3\n" | ||
32 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
33 | " mrc p15, 0, %0, c1, c0, 0\n" | ||
34 | " bic %0, %0, %2\n" | ||
35 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
36 | : "=&r" (v) | ||
37 | : "r" (0), "Ir" (CR_C), "Ir" (0x40) | ||
38 | : "cc"); | ||
39 | } | ||
40 | |||
41 | static inline void cpu_leave_lowpower(void) | ||
42 | { | ||
43 | unsigned int v; | ||
44 | |||
45 | asm volatile( | ||
46 | "mrc p15, 0, %0, c1, c0, 0\n" | ||
47 | " orr %0, %0, %1\n" | ||
48 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
49 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
50 | " orr %0, %0, %2\n" | ||
51 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
52 | : "=&r" (v) | ||
53 | : "Ir" (CR_C), "Ir" (0x40) | ||
54 | : "cc"); | ||
55 | } | ||
56 | |||
57 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) | ||
58 | { | ||
59 | /* | ||
60 | * there is no power-control hardware on this platform, so all | ||
61 | * we can do is put the core into WFI; this is safe as the calling | ||
62 | * code will have already disabled interrupts | ||
63 | */ | ||
64 | for (;;) { | ||
65 | /* | ||
66 | * here's the WFI | ||
67 | */ | ||
68 | asm(".word 0xe320f003\n" | ||
69 | : | ||
70 | : | ||
71 | : "memory", "cc"); | ||
72 | |||
73 | if (pen_release == cpu) { | ||
74 | /* | ||
75 | * OK, proper wakeup, we're done | ||
76 | */ | ||
77 | break; | ||
78 | } | ||
79 | |||
80 | /* | ||
81 | * Getting here, means that we have come out of WFI without | ||
82 | * having been woken up - this shouldn't happen | ||
83 | * | ||
84 | * Just note it happening - when we're woken, we can report | ||
85 | * its occurrence. | ||
86 | */ | ||
87 | (*spurious)++; | ||
88 | } | ||
89 | } | ||
90 | |||
91 | int platform_cpu_kill(unsigned int cpu) | ||
92 | { | ||
93 | return 1; | ||
94 | } | ||
95 | |||
96 | /* | ||
97 | * platform-specific code to shutdown a CPU | ||
98 | * | ||
99 | * Called with IRQs disabled | ||
100 | */ | ||
101 | void platform_cpu_die(unsigned int cpu) | ||
102 | { | ||
103 | int spurious = 0; | ||
104 | |||
105 | /* | ||
106 | * we're ready for shutdown now, so do it | ||
107 | */ | ||
108 | cpu_enter_lowpower(); | ||
109 | platform_do_lowpower(cpu, &spurious); | ||
110 | |||
111 | /* | ||
112 | * bring this CPU back into the world of cache | ||
113 | * coherency, and then restore interrupts | ||
114 | */ | ||
115 | cpu_leave_lowpower(); | ||
116 | |||
117 | if (spurious) | ||
118 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
119 | } | ||
120 | |||
121 | int platform_cpu_disable(unsigned int cpu) | ||
122 | { | ||
123 | /* | ||
124 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
125 | * e.g. clock tick interrupts) | ||
126 | */ | ||
127 | return cpu == 0 ? -EPERM : 0; | ||
128 | } | ||
diff --git a/arch/arm/mach-vexpress/include/mach/entry-macro.S b/arch/arm/mach-vexpress/include/mach/entry-macro.S index 20e9fb514f0a..73c11297509e 100644 --- a/arch/arm/mach-vexpress/include/mach/entry-macro.S +++ b/arch/arm/mach-vexpress/include/mach/entry-macro.S | |||
@@ -1,67 +1,7 @@ | |||
1 | #include <asm/hardware/gic.h> | 1 | #include <asm/hardware/entry-macro-gic.S> |
2 | 2 | ||
3 | .macro disable_fiq | 3 | .macro disable_fiq |
4 | .endm | 4 | .endm |
5 | 5 | ||
6 | .macro get_irqnr_preamble, base, tmp | ||
7 | ldr \base, =gic_cpu_base_addr | ||
8 | ldr \base, [\base] | ||
9 | .endm | ||
10 | |||
11 | .macro arch_ret_to_user, tmp1, tmp2 | 6 | .macro arch_ret_to_user, tmp1, tmp2 |
12 | .endm | 7 | .endm |
13 | |||
14 | /* | ||
15 | * The interrupt numbering scheme is defined in the | ||
16 | * interrupt controller spec. To wit: | ||
17 | * | ||
18 | * Interrupts 0-15 are IPI | ||
19 | * 16-28 are reserved | ||
20 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
21 | * 32-1020 are global | ||
22 | * 1021-1022 are reserved | ||
23 | * 1023 is "spurious" (no interrupt) | ||
24 | * | ||
25 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
26 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
27 | * | ||
28 | * A simple read from the controller will tell us the number of the highest | ||
29 | * priority enabled interrupt. We then just need to check whether it is in the | ||
30 | * valid range for an IRQ (30-1020 inclusive). | ||
31 | */ | ||
32 | |||
33 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
34 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ | ||
35 | ldr \tmp, =1021 | ||
36 | bic \irqnr, \irqstat, #0x1c00 | ||
37 | cmp \irqnr, #29 | ||
38 | cmpcc \irqnr, \irqnr | ||
39 | cmpne \irqnr, \tmp | ||
40 | cmpcs \irqnr, \irqnr | ||
41 | .endm | ||
42 | |||
43 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
44 | * register) is preserved from the macro above. | ||
45 | * If there is an IPI, we immediately signal end of interrupt on the | ||
46 | * controller, since this requires the original irqstat value which | ||
47 | * we won't easily be able to recreate later. | ||
48 | */ | ||
49 | |||
50 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
51 | bic \irqnr, \irqstat, #0x1c00 | ||
52 | cmp \irqnr, #16 | ||
53 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
54 | cmpcs \irqnr, \irqnr | ||
55 | .endm | ||
56 | |||
57 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
58 | |||
59 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
60 | bic \irqnr, \irqstat, #0x1c00 | ||
61 | mov \tmp, #0 | ||
62 | cmp \irqnr, #29 | ||
63 | moveq \tmp, #1 | ||
64 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
65 | cmp \tmp, #0 | ||
66 | .endm | ||
67 | |||
diff --git a/arch/arm/mach-vexpress/include/mach/smp.h b/arch/arm/mach-vexpress/include/mach/smp.h index 5a6da4fd247e..4c05e4a9713a 100644 --- a/arch/arm/mach-vexpress/include/mach/smp.h +++ b/arch/arm/mach-vexpress/include/mach/smp.h | |||
@@ -2,13 +2,12 @@ | |||
2 | #define __MACH_SMP_H | 2 | #define __MACH_SMP_H |
3 | 3 | ||
4 | #include <asm/hardware/gic.h> | 4 | #include <asm/hardware/gic.h> |
5 | #include <asm/smp_mpidr.h> | ||
6 | 5 | ||
7 | /* | 6 | /* |
8 | * We use IRQ1 as the IPI | 7 | * We use IRQ1 as the IPI |
9 | */ | 8 | */ |
10 | static inline void smp_cross_call(const struct cpumask *mask) | 9 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
11 | { | 10 | { |
12 | gic_raise_softirq(mask, 1); | 11 | gic_raise_softirq(mask, ipi); |
13 | } | 12 | } |
14 | #endif | 13 | #endif |
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index 670970699ba9..b1687b6abe63 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | 18 | ||
19 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
20 | #include <asm/localtimer.h> | ||
21 | #include <asm/smp_scu.h> | 20 | #include <asm/smp_scu.h> |
22 | #include <asm/unified.h> | 21 | #include <asm/unified.h> |
23 | 22 | ||
@@ -35,6 +34,19 @@ extern void vexpress_secondary_startup(void); | |||
35 | */ | 34 | */ |
36 | volatile int __cpuinitdata pen_release = -1; | 35 | volatile int __cpuinitdata pen_release = -1; |
37 | 36 | ||
37 | /* | ||
38 | * Write pen_release in a way that is guaranteed to be visible to all | ||
39 | * observers, irrespective of whether they're taking part in coherency | ||
40 | * or not. This is necessary for the hotplug code to work reliably. | ||
41 | */ | ||
42 | static void write_pen_release(int val) | ||
43 | { | ||
44 | pen_release = val; | ||
45 | smp_wmb(); | ||
46 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
47 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
48 | } | ||
49 | |||
38 | static void __iomem *scu_base_addr(void) | 50 | static void __iomem *scu_base_addr(void) |
39 | { | 51 | { |
40 | return MMIO_P2V(A9_MPCORE_SCU); | 52 | return MMIO_P2V(A9_MPCORE_SCU); |
@@ -44,21 +56,18 @@ static DEFINE_SPINLOCK(boot_lock); | |||
44 | 56 | ||
45 | void __cpuinit platform_secondary_init(unsigned int cpu) | 57 | void __cpuinit platform_secondary_init(unsigned int cpu) |
46 | { | 58 | { |
47 | trace_hardirqs_off(); | ||
48 | |||
49 | /* | 59 | /* |
50 | * if any interrupts are already enabled for the primary | 60 | * if any interrupts are already enabled for the primary |
51 | * core (e.g. timer irq), then they will not have been enabled | 61 | * core (e.g. timer irq), then they will not have been enabled |
52 | * for us: do so | 62 | * for us: do so |
53 | */ | 63 | */ |
54 | gic_cpu_init(0, gic_cpu_base_addr); | 64 | gic_secondary_init(0); |
55 | 65 | ||
56 | /* | 66 | /* |
57 | * let the primary processor know we're out of the | 67 | * let the primary processor know we're out of the |
58 | * pen, then head off into the C entry point | 68 | * pen, then head off into the C entry point |
59 | */ | 69 | */ |
60 | pen_release = -1; | 70 | write_pen_release(-1); |
61 | smp_wmb(); | ||
62 | 71 | ||
63 | /* | 72 | /* |
64 | * Synchronise with the boot thread. | 73 | * Synchronise with the boot thread. |
@@ -83,16 +92,14 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
83 | * since we haven't sent them a soft interrupt, they shouldn't | 92 | * since we haven't sent them a soft interrupt, they shouldn't |
84 | * be there. | 93 | * be there. |
85 | */ | 94 | */ |
86 | pen_release = cpu; | 95 | write_pen_release(cpu); |
87 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
88 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
89 | 96 | ||
90 | /* | 97 | /* |
91 | * Send the secondary CPU a soft interrupt, thereby causing | 98 | * Send the secondary CPU a soft interrupt, thereby causing |
92 | * the boot monitor to read the system wide flags register, | 99 | * the boot monitor to read the system wide flags register, |
93 | * and branch to the address found there. | 100 | * and branch to the address found there. |
94 | */ | 101 | */ |
95 | smp_cross_call(cpumask_of(cpu)); | 102 | smp_cross_call(cpumask_of(cpu), 1); |
96 | 103 | ||
97 | timeout = jiffies + (1 * HZ); | 104 | timeout = jiffies + (1 * HZ); |
98 | while (time_before(jiffies, timeout)) { | 105 | while (time_before(jiffies, timeout)) { |
@@ -124,13 +131,6 @@ void __init smp_init_cpus(void) | |||
124 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; | 131 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; |
125 | 132 | ||
126 | /* sanity check */ | 133 | /* sanity check */ |
127 | if (ncores == 0) { | ||
128 | printk(KERN_ERR | ||
129 | "vexpress: strange CM count of 0? Default to 1\n"); | ||
130 | |||
131 | ncores = 1; | ||
132 | } | ||
133 | |||
134 | if (ncores > NR_CPUS) { | 134 | if (ncores > NR_CPUS) { |
135 | printk(KERN_WARNING | 135 | printk(KERN_WARNING |
136 | "vexpress: no. of cores (%d) greater than configured " | 136 | "vexpress: no. of cores (%d) greater than configured " |
@@ -143,20 +143,10 @@ void __init smp_init_cpus(void) | |||
143 | set_cpu_possible(i, true); | 143 | set_cpu_possible(i, true); |
144 | } | 144 | } |
145 | 145 | ||
146 | void __init smp_prepare_cpus(unsigned int max_cpus) | 146 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
147 | { | 147 | { |
148 | unsigned int ncores = num_possible_cpus(); | ||
149 | unsigned int cpu = smp_processor_id(); | ||
150 | int i; | 148 | int i; |
151 | 149 | ||
152 | smp_store_cpu_info(cpu); | ||
153 | |||
154 | /* | ||
155 | * are we trying to boot more cores than exist? | ||
156 | */ | ||
157 | if (max_cpus > ncores) | ||
158 | max_cpus = ncores; | ||
159 | |||
160 | /* | 150 | /* |
161 | * Initialise the present map, which describes the set of CPUs | 151 | * Initialise the present map, which describes the set of CPUs |
162 | * actually populated at the present time. | 152 | * actually populated at the present time. |
@@ -164,27 +154,15 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
164 | for (i = 0; i < max_cpus; i++) | 154 | for (i = 0; i < max_cpus; i++) |
165 | set_cpu_present(i, true); | 155 | set_cpu_present(i, true); |
166 | 156 | ||
157 | scu_enable(scu_base_addr()); | ||
158 | |||
167 | /* | 159 | /* |
168 | * Initialise the SCU if there are more than one CPU and let | 160 | * Write the address of secondary startup into the |
169 | * them know where to start. | 161 | * system-wide flags register. The boot monitor waits |
162 | * until it receives a soft interrupt, and then the | ||
163 | * secondary CPU branches to this address. | ||
170 | */ | 164 | */ |
171 | if (max_cpus > 1) { | 165 | writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR)); |
172 | /* | 166 | writel(BSYM(virt_to_phys(vexpress_secondary_startup)), |
173 | * Enable the local timer or broadcast device for the | 167 | MMIO_P2V(V2M_SYS_FLAGSSET)); |
174 | * boot CPU, but only if we have more than one CPU. | ||
175 | */ | ||
176 | percpu_timer_setup(); | ||
177 | |||
178 | scu_enable(scu_base_addr()); | ||
179 | |||
180 | /* | ||
181 | * Write the address of secondary startup into the | ||
182 | * system-wide flags register. The boot monitor waits | ||
183 | * until it receives a soft interrupt, and then the | ||
184 | * secondary CPU branches to this address. | ||
185 | */ | ||
186 | writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR)); | ||
187 | writel(BSYM(virt_to_phys(vexpress_secondary_startup)), | ||
188 | MMIO_P2V(V2M_SYS_FLAGSSET)); | ||
189 | } | ||
190 | } | 168 | } |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 7eaa232180a5..a9ed3428a2fa 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -11,18 +11,18 @@ | |||
11 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
12 | #include <linux/sysdev.h> | 12 | #include <linux/sysdev.h> |
13 | #include <linux/usb/isp1760.h> | 13 | #include <linux/usb/isp1760.h> |
14 | #include <linux/clkdev.h> | ||
14 | 15 | ||
15 | #include <asm/clkdev.h> | ||
16 | #include <asm/sizes.h> | 16 | #include <asm/sizes.h> |
17 | #include <asm/mach/flash.h> | 17 | #include <asm/mach/flash.h> |
18 | #include <asm/mach/map.h> | 18 | #include <asm/mach/map.h> |
19 | #include <asm/mach/time.h> | 19 | #include <asm/mach/time.h> |
20 | #include <asm/hardware/arm_timer.h> | 20 | #include <asm/hardware/arm_timer.h> |
21 | #include <asm/hardware/timer-sp.h> | ||
21 | 22 | ||
22 | #include <mach/clkdev.h> | ||
23 | #include <mach/motherboard.h> | 23 | #include <mach/motherboard.h> |
24 | 24 | ||
25 | #include <plat/timer-sp.h> | 25 | #include <plat/sched_clock.h> |
26 | 26 | ||
27 | #include "core.h" | 27 | #include "core.h" |
28 | 28 | ||
@@ -50,6 +50,8 @@ void __init v2m_map_io(struct map_desc *tile, size_t num) | |||
50 | 50 | ||
51 | static void __init v2m_timer_init(void) | 51 | static void __init v2m_timer_init(void) |
52 | { | 52 | { |
53 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); | ||
54 | |||
53 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); | 55 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); |
54 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); | 56 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); |
55 | 57 | ||
diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h index c56ddab3d912..b88a1b16b2e9 100644 --- a/arch/arm/mach-w90x900/clock.h +++ b/arch/arm/mach-w90x900/clock.h | |||
@@ -10,7 +10,7 @@ | |||
10 | * the Free Software Foundation; either version 2 of the License. | 10 | * the Free Software Foundation; either version 2 of the License. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <asm/clkdev.h> | 13 | #include <linux/clkdev.h> |
14 | 14 | ||
15 | void nuc900_clk_enable(struct clk *clk, int enable); | 15 | void nuc900_clk_enable(struct clk *clk, int enable); |
16 | void nuc900_subclk_enable(struct clk *clk, int enable); | 16 | void nuc900_subclk_enable(struct clk *clk, int enable); |
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c index b80f769bc135..4b089cb930dc 100644 --- a/arch/arm/mach-w90x900/time.c +++ b/arch/arm/mach-w90x900/time.c | |||
@@ -153,7 +153,6 @@ static struct clocksource clocksource_nuc900 = { | |||
153 | .rating = 200, | 153 | .rating = 200, |
154 | .read = nuc900_get_cycles, | 154 | .read = nuc900_get_cycles, |
155 | .mask = CLOCKSOURCE_MASK(TDR_SHIFT), | 155 | .mask = CLOCKSOURCE_MASK(TDR_SHIFT), |
156 | .shift = 10, | ||
157 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 156 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
158 | }; | 157 | }; |
159 | 158 | ||
@@ -176,9 +175,7 @@ static void __init nuc900_clocksource_init(void) | |||
176 | val |= (COUNTEN | PERIOD | PRESCALE); | 175 | val |= (COUNTEN | PERIOD | PRESCALE); |
177 | __raw_writel(val, REG_TCSR1); | 176 | __raw_writel(val, REG_TCSR1); |
178 | 177 | ||
179 | clocksource_nuc900.mult = | 178 | clocksource_register_hz(&clocksource_nuc900, rate); |
180 | clocksource_khz2mult((rate / 1000), clocksource_nuc900.shift); | ||
181 | clocksource_register(&clocksource_nuc900); | ||
182 | } | 179 | } |
183 | 180 | ||
184 | static void __init nuc900_timer_init(void) | 181 | static void __init nuc900_timer_init(void) |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 4414a01e1e8a..49db8b3e4a49 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -382,6 +382,12 @@ config CPU_FEROCEON_OLD_ID | |||
382 | for which the CPU ID is equal to the ARM926 ID. | 382 | for which the CPU ID is equal to the ARM926 ID. |
383 | Relevant for Feroceon-1850 and early Feroceon-2850. | 383 | Relevant for Feroceon-1850 and early Feroceon-2850. |
384 | 384 | ||
385 | # Marvell PJ4 | ||
386 | config CPU_PJ4 | ||
387 | bool | ||
388 | select CPU_V7 | ||
389 | select ARM_THUMBEE | ||
390 | |||
385 | # ARMv6 | 391 | # ARMv6 |
386 | config CPU_V6 | 392 | config CPU_V6 |
387 | bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE | 393 | bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE |
@@ -599,6 +605,14 @@ config CPU_CP15_MPU | |||
599 | help | 605 | help |
600 | Processor has the CP15 register, which has MPU related registers. | 606 | Processor has the CP15 register, which has MPU related registers. |
601 | 607 | ||
608 | config CPU_USE_DOMAINS | ||
609 | bool | ||
610 | depends on MMU | ||
611 | default y if !CPU_32v6K | ||
612 | help | ||
613 | This option enables or disables the use of domain switching | ||
614 | via the set_fs() function. | ||
615 | |||
602 | # | 616 | # |
603 | # CPU supports 36-bit I/O | 617 | # CPU supports 36-bit I/O |
604 | # | 618 | # |
@@ -628,6 +642,33 @@ config ARM_THUMBEE | |||
628 | Say Y here if you have a CPU with the ThumbEE extension and code to | 642 | Say Y here if you have a CPU with the ThumbEE extension and code to |
629 | make use of it. Say N for code that can run on CPUs without ThumbEE. | 643 | make use of it. Say N for code that can run on CPUs without ThumbEE. |
630 | 644 | ||
645 | config SWP_EMULATE | ||
646 | bool "Emulate SWP/SWPB instructions" | ||
647 | depends on CPU_V7 | ||
648 | select HAVE_PROC_CPU if PROC_FS | ||
649 | default y if SMP | ||
650 | help | ||
651 | ARMv6 architecture deprecates use of the SWP/SWPB instructions. | ||
652 | ARMv7 multiprocessing extensions introduce the ability to disable | ||
653 | these instructions, triggering an undefined instruction exception | ||
654 | when executed. Say Y here to enable software emulation of these | ||
655 | instructions for userspace (not kernel) using LDREX/STREX. | ||
656 | Also creates /proc/cpu/swp_emulation for statistics. | ||
657 | |||
658 | In some older versions of glibc [<=2.8] SWP is used during futex | ||
659 | trylock() operations with the assumption that the code will not | ||
660 | be preempted. This invalid assumption may be more likely to fail | ||
661 | with SWP emulation enabled, leading to deadlock of the user | ||
662 | application. | ||
663 | |||
664 | NOTE: when accessing uncached shared regions, LDREX/STREX rely | ||
665 | on an external transaction monitoring block called a global | ||
666 | monitor to maintain update atomicity. If your system does not | ||
667 | implement a global monitor, this option can cause programs that | ||
668 | perform SWP operations to uncached memory to deadlock. | ||
669 | |||
670 | If unsure, say Y. | ||
671 | |||
631 | config CPU_BIG_ENDIAN | 672 | config CPU_BIG_ENDIAN |
632 | bool "Build big-endian kernel" | 673 | bool "Build big-endian kernel" |
633 | depends on ARCH_SUPPORTS_BIG_ENDIAN | 674 | depends on ARCH_SUPPORTS_BIG_ENDIAN |
@@ -789,7 +830,7 @@ config CACHE_PL310 | |||
789 | 830 | ||
790 | config CACHE_TAUROS2 | 831 | config CACHE_TAUROS2 |
791 | bool "Enable the Tauros2 L2 cache controller" | 832 | bool "Enable the Tauros2 L2 cache controller" |
792 | depends on (ARCH_DOVE || ARCH_MMP) | 833 | depends on (ARCH_DOVE || ARCH_MMP || CPU_PJ4) |
793 | default y | 834 | default y |
794 | select OUTER_CACHE | 835 | select OUTER_CACHE |
795 | help | 836 | help |
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index d63b6c413758..00d74a04af3a 100644 --- a/arch/arm/mm/Makefile +++ b/arch/arm/mm/Makefile | |||
@@ -5,8 +5,8 @@ | |||
5 | obj-y := dma-mapping.o extable.o fault.o init.o \ | 5 | obj-y := dma-mapping.o extable.o fault.o init.o \ |
6 | iomap.o | 6 | iomap.o |
7 | 7 | ||
8 | obj-$(CONFIG_MMU) += fault-armv.o flush.o ioremap.o mmap.o \ | 8 | obj-$(CONFIG_MMU) += fault-armv.o flush.o idmap.o ioremap.o \ |
9 | pgd.o mmu.o vmregion.o | 9 | mmap.o pgd.o mmu.o vmregion.o |
10 | 10 | ||
11 | ifneq ($(CONFIG_MMU),y) | 11 | ifneq ($(CONFIG_MMU),y) |
12 | obj-y += nommu.o | 12 | obj-y += nommu.o |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 809f1bf9fa29..6b48e0a3d7aa 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -312,7 +312,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, | |||
312 | addr = page_address(page); | 312 | addr = page_address(page); |
313 | 313 | ||
314 | if (addr) | 314 | if (addr) |
315 | *handle = page_to_dma(dev, page); | 315 | *handle = pfn_to_dma(dev, page_to_pfn(page)); |
316 | 316 | ||
317 | return addr; | 317 | return addr; |
318 | } | 318 | } |
@@ -407,7 +407,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr | |||
407 | if (!arch_is_coherent()) | 407 | if (!arch_is_coherent()) |
408 | __dma_free_remap(cpu_addr, size); | 408 | __dma_free_remap(cpu_addr, size); |
409 | 409 | ||
410 | __dma_free_buffer(dma_to_page(dev, handle), size); | 410 | __dma_free_buffer(pfn_to_page(dma_to_pfn(dev, handle)), size); |
411 | } | 411 | } |
412 | EXPORT_SYMBOL(dma_free_coherent); | 412 | EXPORT_SYMBOL(dma_free_coherent); |
413 | 413 | ||
@@ -555,17 +555,20 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
555 | struct scatterlist *s; | 555 | struct scatterlist *s; |
556 | int i, j; | 556 | int i, j; |
557 | 557 | ||
558 | BUG_ON(!valid_dma_direction(dir)); | ||
559 | |||
558 | for_each_sg(sg, s, nents, i) { | 560 | for_each_sg(sg, s, nents, i) { |
559 | s->dma_address = dma_map_page(dev, sg_page(s), s->offset, | 561 | s->dma_address = __dma_map_page(dev, sg_page(s), s->offset, |
560 | s->length, dir); | 562 | s->length, dir); |
561 | if (dma_mapping_error(dev, s->dma_address)) | 563 | if (dma_mapping_error(dev, s->dma_address)) |
562 | goto bad_mapping; | 564 | goto bad_mapping; |
563 | } | 565 | } |
566 | debug_dma_map_sg(dev, sg, nents, nents, dir); | ||
564 | return nents; | 567 | return nents; |
565 | 568 | ||
566 | bad_mapping: | 569 | bad_mapping: |
567 | for_each_sg(sg, s, i, j) | 570 | for_each_sg(sg, s, i, j) |
568 | dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir); | 571 | __dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir); |
569 | return 0; | 572 | return 0; |
570 | } | 573 | } |
571 | EXPORT_SYMBOL(dma_map_sg); | 574 | EXPORT_SYMBOL(dma_map_sg); |
@@ -586,8 +589,10 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
586 | struct scatterlist *s; | 589 | struct scatterlist *s; |
587 | int i; | 590 | int i; |
588 | 591 | ||
592 | debug_dma_unmap_sg(dev, sg, nents, dir); | ||
593 | |||
589 | for_each_sg(sg, s, nents, i) | 594 | for_each_sg(sg, s, nents, i) |
590 | dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir); | 595 | __dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir); |
591 | } | 596 | } |
592 | EXPORT_SYMBOL(dma_unmap_sg); | 597 | EXPORT_SYMBOL(dma_unmap_sg); |
593 | 598 | ||
@@ -612,6 +617,8 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | |||
612 | __dma_page_dev_to_cpu(sg_page(s), s->offset, | 617 | __dma_page_dev_to_cpu(sg_page(s), s->offset, |
613 | s->length, dir); | 618 | s->length, dir); |
614 | } | 619 | } |
620 | |||
621 | debug_dma_sync_sg_for_cpu(dev, sg, nents, dir); | ||
615 | } | 622 | } |
616 | EXPORT_SYMBOL(dma_sync_sg_for_cpu); | 623 | EXPORT_SYMBOL(dma_sync_sg_for_cpu); |
617 | 624 | ||
@@ -636,5 +643,16 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
636 | __dma_page_cpu_to_dev(sg_page(s), s->offset, | 643 | __dma_page_cpu_to_dev(sg_page(s), s->offset, |
637 | s->length, dir); | 644 | s->length, dir); |
638 | } | 645 | } |
646 | |||
647 | debug_dma_sync_sg_for_device(dev, sg, nents, dir); | ||
639 | } | 648 | } |
640 | EXPORT_SYMBOL(dma_sync_sg_for_device); | 649 | EXPORT_SYMBOL(dma_sync_sg_for_device); |
650 | |||
651 | #define PREALLOC_DMA_DEBUG_ENTRIES 4096 | ||
652 | |||
653 | static int __init dma_debug_do_init(void) | ||
654 | { | ||
655 | dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); | ||
656 | return 0; | ||
657 | } | ||
658 | fs_initcall(dma_debug_do_init); | ||
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c index 83e59f870426..01210dba0221 100644 --- a/arch/arm/mm/fault-armv.c +++ b/arch/arm/mm/fault-armv.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "mm.h" | 27 | #include "mm.h" |
28 | 28 | ||
29 | static unsigned long shared_pte_mask = L_PTE_MT_BUFFERABLE; | 29 | static pteval_t shared_pte_mask = L_PTE_MT_BUFFERABLE; |
30 | 30 | ||
31 | #if __LINUX_ARM_ARCH__ < 6 | 31 | #if __LINUX_ARM_ARCH__ < 6 |
32 | /* | 32 | /* |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 1e21e125fe3a..f10f9bac2206 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -108,7 +108,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr) | |||
108 | 108 | ||
109 | pte = pte_offset_map(pmd, addr); | 109 | pte = pte_offset_map(pmd, addr); |
110 | printk(", *pte=%08lx", pte_val(*pte)); | 110 | printk(", *pte=%08lx", pte_val(*pte)); |
111 | printk(", *ppte=%08lx", pte_val(pte[-PTRS_PER_PTE])); | 111 | printk(", *ppte=%08lx", pte_val(pte[PTE_HWTABLE_PTRS])); |
112 | pte_unmap(pte); | 112 | pte_unmap(pte); |
113 | } while(0); | 113 | } while(0); |
114 | 114 | ||
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c new file mode 100644 index 000000000000..57299446f787 --- /dev/null +++ b/arch/arm/mm/idmap.c | |||
@@ -0,0 +1,67 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | |||
3 | #include <asm/cputype.h> | ||
4 | #include <asm/pgalloc.h> | ||
5 | #include <asm/pgtable.h> | ||
6 | |||
7 | static void idmap_add_pmd(pgd_t *pgd, unsigned long addr, unsigned long end, | ||
8 | unsigned long prot) | ||
9 | { | ||
10 | pmd_t *pmd = pmd_offset(pgd, addr); | ||
11 | |||
12 | addr = (addr & PMD_MASK) | prot; | ||
13 | pmd[0] = __pmd(addr); | ||
14 | addr += SECTION_SIZE; | ||
15 | pmd[1] = __pmd(addr); | ||
16 | flush_pmd_entry(pmd); | ||
17 | } | ||
18 | |||
19 | void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end) | ||
20 | { | ||
21 | unsigned long prot, next; | ||
22 | |||
23 | prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE; | ||
24 | if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) | ||
25 | prot |= PMD_BIT4; | ||
26 | |||
27 | pgd += pgd_index(addr); | ||
28 | do { | ||
29 | next = pgd_addr_end(addr, end); | ||
30 | idmap_add_pmd(pgd, addr, next, prot); | ||
31 | } while (pgd++, addr = next, addr != end); | ||
32 | } | ||
33 | |||
34 | #ifdef CONFIG_SMP | ||
35 | static void idmap_del_pmd(pgd_t *pgd, unsigned long addr, unsigned long end) | ||
36 | { | ||
37 | pmd_t *pmd = pmd_offset(pgd, addr); | ||
38 | pmd_clear(pmd); | ||
39 | } | ||
40 | |||
41 | void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end) | ||
42 | { | ||
43 | unsigned long next; | ||
44 | |||
45 | pgd += pgd_index(addr); | ||
46 | do { | ||
47 | next = pgd_addr_end(addr, end); | ||
48 | idmap_del_pmd(pgd, addr, next); | ||
49 | } while (pgd++, addr = next, addr != end); | ||
50 | } | ||
51 | #endif | ||
52 | |||
53 | /* | ||
54 | * In order to soft-boot, we need to insert a 1:1 mapping in place of | ||
55 | * the user-mode pages. This will then ensure that we have predictable | ||
56 | * results when turning the mmu off | ||
57 | */ | ||
58 | void setup_mm_for_reboot(char mode) | ||
59 | { | ||
60 | /* | ||
61 | * We need to access to user-mode page tables here. For kernel threads | ||
62 | * we don't have any user-mode mappings so we use the context that we | ||
63 | * "borrowed". | ||
64 | */ | ||
65 | identity_mapping_add(current->active_mm->pgd, 0, TASK_SIZE); | ||
66 | local_flush_tlb_all(); | ||
67 | } | ||
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 55c17a6fb22f..ab506272b2d3 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -204,12 +204,8 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn, | |||
204 | /* | 204 | /* |
205 | * Don't allow RAM to be mapped - this causes problems with ARMv6+ | 205 | * Don't allow RAM to be mapped - this causes problems with ARMv6+ |
206 | */ | 206 | */ |
207 | if (pfn_valid(pfn)) { | 207 | if (WARN_ON(pfn_valid(pfn))) |
208 | printk(KERN_WARNING "BUG: Your driver calls ioremap() on system memory. This leads\n" | 208 | return NULL; |
209 | "to architecturally unpredictable behaviour on ARMv6+, and ioremap()\n" | ||
210 | "will fail in the next kernel release. Please fix your driver.\n"); | ||
211 | WARN_ON(1); | ||
212 | } | ||
213 | 209 | ||
214 | type = get_mem_type(mtype); | 210 | type = get_mem_type(mtype); |
215 | if (!type) | 211 | if (!type) |
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index 6630620380a4..36960df5fb76 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h | |||
@@ -16,7 +16,7 @@ static inline pmd_t *pmd_off_k(unsigned long virt) | |||
16 | } | 16 | } |
17 | 17 | ||
18 | struct mem_type { | 18 | struct mem_type { |
19 | unsigned int prot_pte; | 19 | pteval_t prot_pte; |
20 | unsigned int prot_l1; | 20 | unsigned int prot_l1; |
21 | unsigned int prot_sect; | 21 | unsigned int prot_sect; |
22 | unsigned int domain; | 22 | unsigned int domain; |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 72ad3e1f56cf..3c67e92f7d59 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/smp_plat.h> | 24 | #include <asm/smp_plat.h> |
25 | #include <asm/tlb.h> | 25 | #include <asm/tlb.h> |
26 | #include <asm/highmem.h> | 26 | #include <asm/highmem.h> |
27 | #include <asm/traps.h> | ||
27 | 28 | ||
28 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
29 | #include <asm/mach/map.h> | 30 | #include <asm/mach/map.h> |
@@ -62,7 +63,7 @@ struct cachepolicy { | |||
62 | const char policy[16]; | 63 | const char policy[16]; |
63 | unsigned int cr_mask; | 64 | unsigned int cr_mask; |
64 | unsigned int pmd; | 65 | unsigned int pmd; |
65 | unsigned int pte; | 66 | pteval_t pte; |
66 | }; | 67 | }; |
67 | 68 | ||
68 | static struct cachepolicy cache_policies[] __initdata = { | 69 | static struct cachepolicy cache_policies[] __initdata = { |
@@ -190,7 +191,7 @@ void adjust_cr(unsigned long mask, unsigned long set) | |||
190 | } | 191 | } |
191 | #endif | 192 | #endif |
192 | 193 | ||
193 | #define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_WRITE | 194 | #define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN |
194 | #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE | 195 | #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE |
195 | 196 | ||
196 | static struct mem_type mem_types[] = { | 197 | static struct mem_type mem_types[] = { |
@@ -235,19 +236,18 @@ static struct mem_type mem_types[] = { | |||
235 | }, | 236 | }, |
236 | [MT_LOW_VECTORS] = { | 237 | [MT_LOW_VECTORS] = { |
237 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | 238 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | |
238 | L_PTE_EXEC, | 239 | L_PTE_RDONLY, |
239 | .prot_l1 = PMD_TYPE_TABLE, | 240 | .prot_l1 = PMD_TYPE_TABLE, |
240 | .domain = DOMAIN_USER, | 241 | .domain = DOMAIN_USER, |
241 | }, | 242 | }, |
242 | [MT_HIGH_VECTORS] = { | 243 | [MT_HIGH_VECTORS] = { |
243 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | 244 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | |
244 | L_PTE_USER | L_PTE_EXEC, | 245 | L_PTE_USER | L_PTE_RDONLY, |
245 | .prot_l1 = PMD_TYPE_TABLE, | 246 | .prot_l1 = PMD_TYPE_TABLE, |
246 | .domain = DOMAIN_USER, | 247 | .domain = DOMAIN_USER, |
247 | }, | 248 | }, |
248 | [MT_MEMORY] = { | 249 | [MT_MEMORY] = { |
249 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | 250 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, |
250 | L_PTE_WRITE | L_PTE_EXEC, | ||
251 | .prot_l1 = PMD_TYPE_TABLE, | 251 | .prot_l1 = PMD_TYPE_TABLE, |
252 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | 252 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, |
253 | .domain = DOMAIN_KERNEL, | 253 | .domain = DOMAIN_KERNEL, |
@@ -258,21 +258,20 @@ static struct mem_type mem_types[] = { | |||
258 | }, | 258 | }, |
259 | [MT_MEMORY_NONCACHED] = { | 259 | [MT_MEMORY_NONCACHED] = { |
260 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | 260 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | |
261 | L_PTE_WRITE | L_PTE_EXEC | L_PTE_MT_BUFFERABLE, | 261 | L_PTE_MT_BUFFERABLE, |
262 | .prot_l1 = PMD_TYPE_TABLE, | 262 | .prot_l1 = PMD_TYPE_TABLE, |
263 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, | 263 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, |
264 | .domain = DOMAIN_KERNEL, | 264 | .domain = DOMAIN_KERNEL, |
265 | }, | 265 | }, |
266 | [MT_MEMORY_DTCM] = { | 266 | [MT_MEMORY_DTCM] = { |
267 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | 267 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | |
268 | L_PTE_WRITE, | 268 | L_PTE_XN, |
269 | .prot_l1 = PMD_TYPE_TABLE, | 269 | .prot_l1 = PMD_TYPE_TABLE, |
270 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, | 270 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, |
271 | .domain = DOMAIN_KERNEL, | 271 | .domain = DOMAIN_KERNEL, |
272 | }, | 272 | }, |
273 | [MT_MEMORY_ITCM] = { | 273 | [MT_MEMORY_ITCM] = { |
274 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | | 274 | .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, |
275 | L_PTE_WRITE | L_PTE_EXEC, | ||
276 | .prot_l1 = PMD_TYPE_TABLE, | 275 | .prot_l1 = PMD_TYPE_TABLE, |
277 | .domain = DOMAIN_KERNEL, | 276 | .domain = DOMAIN_KERNEL, |
278 | }, | 277 | }, |
@@ -479,7 +478,7 @@ static void __init build_mem_type_table(void) | |||
479 | 478 | ||
480 | pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot); | 479 | pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot); |
481 | pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | | 480 | pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | |
482 | L_PTE_DIRTY | L_PTE_WRITE | kern_pgprot); | 481 | L_PTE_DIRTY | kern_pgprot); |
483 | 482 | ||
484 | mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; | 483 | mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; |
485 | mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; | 484 | mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; |
@@ -535,7 +534,7 @@ static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned l | |||
535 | { | 534 | { |
536 | if (pmd_none(*pmd)) { | 535 | if (pmd_none(*pmd)) { |
537 | pte_t *pte = early_alloc(2 * PTRS_PER_PTE * sizeof(pte_t)); | 536 | pte_t *pte = early_alloc(2 * PTRS_PER_PTE * sizeof(pte_t)); |
538 | __pmd_populate(pmd, __pa(pte) | prot); | 537 | __pmd_populate(pmd, __pa(pte), prot); |
539 | } | 538 | } |
540 | BUG_ON(pmd_bad(*pmd)); | 539 | BUG_ON(pmd_bad(*pmd)); |
541 | return pte_offset_kernel(pmd, addr); | 540 | return pte_offset_kernel(pmd, addr); |
@@ -553,7 +552,7 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr, | |||
553 | } | 552 | } |
554 | 553 | ||
555 | static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, | 554 | static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, |
556 | unsigned long end, unsigned long phys, | 555 | unsigned long end, phys_addr_t phys, |
557 | const struct mem_type *type) | 556 | const struct mem_type *type) |
558 | { | 557 | { |
559 | pmd_t *pmd = pmd_offset(pgd, addr); | 558 | pmd_t *pmd = pmd_offset(pgd, addr); |
@@ -588,7 +587,8 @@ static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, | |||
588 | static void __init create_36bit_mapping(struct map_desc *md, | 587 | static void __init create_36bit_mapping(struct map_desc *md, |
589 | const struct mem_type *type) | 588 | const struct mem_type *type) |
590 | { | 589 | { |
591 | unsigned long phys, addr, length, end; | 590 | unsigned long addr, length, end; |
591 | phys_addr_t phys; | ||
592 | pgd_t *pgd; | 592 | pgd_t *pgd; |
593 | 593 | ||
594 | addr = md->virtual; | 594 | addr = md->virtual; |
@@ -914,12 +914,11 @@ static void __init devicemaps_init(struct machine_desc *mdesc) | |||
914 | { | 914 | { |
915 | struct map_desc map; | 915 | struct map_desc map; |
916 | unsigned long addr; | 916 | unsigned long addr; |
917 | void *vectors; | ||
918 | 917 | ||
919 | /* | 918 | /* |
920 | * Allocate the vector page early. | 919 | * Allocate the vector page early. |
921 | */ | 920 | */ |
922 | vectors = early_alloc(PAGE_SIZE); | 921 | vectors_page = early_alloc(PAGE_SIZE); |
923 | 922 | ||
924 | for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) | 923 | for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE) |
925 | pmd_clear(pmd_off_k(addr)); | 924 | pmd_clear(pmd_off_k(addr)); |
@@ -959,7 +958,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc) | |||
959 | * location (0xffff0000). If we aren't using high-vectors, also | 958 | * location (0xffff0000). If we aren't using high-vectors, also |
960 | * create a mapping at the low-vectors virtual address. | 959 | * create a mapping at the low-vectors virtual address. |
961 | */ | 960 | */ |
962 | map.pfn = __phys_to_pfn(virt_to_phys(vectors)); | 961 | map.pfn = __phys_to_pfn(virt_to_phys(vectors_page)); |
963 | map.virtual = 0xffff0000; | 962 | map.virtual = 0xffff0000; |
964 | map.length = PAGE_SIZE; | 963 | map.length = PAGE_SIZE; |
965 | map.type = MT_HIGH_VECTORS; | 964 | map.type = MT_HIGH_VECTORS; |
@@ -1044,38 +1043,3 @@ void __init paging_init(struct machine_desc *mdesc) | |||
1044 | empty_zero_page = virt_to_page(zero_page); | 1043 | empty_zero_page = virt_to_page(zero_page); |
1045 | __flush_dcache_page(NULL, empty_zero_page); | 1044 | __flush_dcache_page(NULL, empty_zero_page); |
1046 | } | 1045 | } |
1047 | |||
1048 | /* | ||
1049 | * In order to soft-boot, we need to insert a 1:1 mapping in place of | ||
1050 | * the user-mode pages. This will then ensure that we have predictable | ||
1051 | * results when turning the mmu off | ||
1052 | */ | ||
1053 | void setup_mm_for_reboot(char mode) | ||
1054 | { | ||
1055 | unsigned long base_pmdval; | ||
1056 | pgd_t *pgd; | ||
1057 | int i; | ||
1058 | |||
1059 | /* | ||
1060 | * We need to access to user-mode page tables here. For kernel threads | ||
1061 | * we don't have any user-mode mappings so we use the context that we | ||
1062 | * "borrowed". | ||
1063 | */ | ||
1064 | pgd = current->active_mm->pgd; | ||
1065 | |||
1066 | base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT; | ||
1067 | if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale()) | ||
1068 | base_pmdval |= PMD_BIT4; | ||
1069 | |||
1070 | for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) { | ||
1071 | unsigned long pmdval = (i << PGDIR_SHIFT) | base_pmdval; | ||
1072 | pmd_t *pmd; | ||
1073 | |||
1074 | pmd = pmd_off(pgd, i << PGDIR_SHIFT); | ||
1075 | pmd[0] = __pmd(pmdval); | ||
1076 | pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1))); | ||
1077 | flush_pmd_entry(pmd); | ||
1078 | } | ||
1079 | |||
1080 | local_flush_tlb_all(); | ||
1081 | } | ||
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c index 69bbfc6645a6..93292a18cf77 100644 --- a/arch/arm/mm/pgd.c +++ b/arch/arm/mm/pgd.c | |||
@@ -17,12 +17,10 @@ | |||
17 | 17 | ||
18 | #include "mm.h" | 18 | #include "mm.h" |
19 | 19 | ||
20 | #define FIRST_KERNEL_PGD_NR (FIRST_USER_PGD_NR + USER_PTRS_PER_PGD) | ||
21 | |||
22 | /* | 20 | /* |
23 | * need to get a 16k page for level 1 | 21 | * need to get a 16k page for level 1 |
24 | */ | 22 | */ |
25 | pgd_t *get_pgd_slow(struct mm_struct *mm) | 23 | pgd_t *pgd_alloc(struct mm_struct *mm) |
26 | { | 24 | { |
27 | pgd_t *new_pgd, *init_pgd; | 25 | pgd_t *new_pgd, *init_pgd; |
28 | pmd_t *new_pmd, *init_pmd; | 26 | pmd_t *new_pmd, *init_pmd; |
@@ -32,14 +30,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
32 | if (!new_pgd) | 30 | if (!new_pgd) |
33 | goto no_pgd; | 31 | goto no_pgd; |
34 | 32 | ||
35 | memset(new_pgd, 0, FIRST_KERNEL_PGD_NR * sizeof(pgd_t)); | 33 | memset(new_pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); |
36 | 34 | ||
37 | /* | 35 | /* |
38 | * Copy over the kernel and IO PGD entries | 36 | * Copy over the kernel and IO PGD entries |
39 | */ | 37 | */ |
40 | init_pgd = pgd_offset_k(0); | 38 | init_pgd = pgd_offset_k(0); |
41 | memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR, | 39 | memcpy(new_pgd + USER_PTRS_PER_PGD, init_pgd + USER_PTRS_PER_PGD, |
42 | (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t)); | 40 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); |
43 | 41 | ||
44 | clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t)); | 42 | clean_dcache_area(new_pgd, PTRS_PER_PGD * sizeof(pgd_t)); |
45 | 43 | ||
@@ -73,28 +71,29 @@ no_pgd: | |||
73 | return NULL; | 71 | return NULL; |
74 | } | 72 | } |
75 | 73 | ||
76 | void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd) | 74 | void pgd_free(struct mm_struct *mm, pgd_t *pgd_base) |
77 | { | 75 | { |
76 | pgd_t *pgd; | ||
78 | pmd_t *pmd; | 77 | pmd_t *pmd; |
79 | pgtable_t pte; | 78 | pgtable_t pte; |
80 | 79 | ||
81 | if (!pgd) | 80 | if (!pgd_base) |
82 | return; | 81 | return; |
83 | 82 | ||
84 | /* pgd is always present and good */ | 83 | pgd = pgd_base + pgd_index(0); |
85 | pmd = pmd_off(pgd, 0); | 84 | if (pgd_none_or_clear_bad(pgd)) |
86 | if (pmd_none(*pmd)) | 85 | goto no_pgd; |
87 | goto free; | 86 | |
88 | if (pmd_bad(*pmd)) { | 87 | pmd = pmd_offset(pgd, 0); |
89 | pmd_ERROR(*pmd); | 88 | if (pmd_none_or_clear_bad(pmd)) |
90 | pmd_clear(pmd); | 89 | goto no_pmd; |
91 | goto free; | ||
92 | } | ||
93 | 90 | ||
94 | pte = pmd_pgtable(*pmd); | 91 | pte = pmd_pgtable(*pmd); |
95 | pmd_clear(pmd); | 92 | pmd_clear(pmd); |
96 | pte_free(mm, pte); | 93 | pte_free(mm, pte); |
94 | no_pmd: | ||
95 | pgd_clear(pgd); | ||
97 | pmd_free(mm, pmd); | 96 | pmd_free(mm, pmd); |
98 | free: | 97 | no_pgd: |
99 | free_pages((unsigned long) pgd, 2); | 98 | free_pages((unsigned long) pgd_base, 2); |
100 | } | 99 | } |
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index b795afd0a2c6..e32fa499194c 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S | |||
@@ -91,7 +91,7 @@ | |||
91 | #if L_PTE_SHARED != PTE_EXT_SHARED | 91 | #if L_PTE_SHARED != PTE_EXT_SHARED |
92 | #error PTE shared bit mismatch | 92 | #error PTE shared bit mismatch |
93 | #endif | 93 | #endif |
94 | #if (L_PTE_EXEC+L_PTE_USER+L_PTE_WRITE+L_PTE_DIRTY+L_PTE_YOUNG+\ | 94 | #if (L_PTE_XN+L_PTE_USER+L_PTE_RDONLY+L_PTE_DIRTY+L_PTE_YOUNG+\ |
95 | L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED | 95 | L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED |
96 | #error Invalid Linux PTE bit settings | 96 | #error Invalid Linux PTE bit settings |
97 | #endif | 97 | #endif |
@@ -109,6 +109,10 @@ | |||
109 | * 110x 0 1 0 r/w r/o | 109 | * 110x 0 1 0 r/w r/o |
110 | * 11x0 0 1 0 r/w r/o | 110 | * 11x0 0 1 0 r/w r/o |
111 | * 1111 0 1 1 r/w r/w | 111 | * 1111 0 1 1 r/w r/w |
112 | * | ||
113 | * If !CONFIG_CPU_USE_DOMAINS, the following permissions are changed: | ||
114 | * 110x 1 1 1 r/o r/o | ||
115 | * 11x0 1 1 1 r/o r/o | ||
112 | */ | 116 | */ |
113 | .macro armv6_mt_table pfx | 117 | .macro armv6_mt_table pfx |
114 | \pfx\()_mt_table: | 118 | \pfx\()_mt_table: |
@@ -131,7 +135,7 @@ | |||
131 | .endm | 135 | .endm |
132 | 136 | ||
133 | .macro armv6_set_pte_ext pfx | 137 | .macro armv6_set_pte_ext pfx |
134 | str r1, [r0], #-2048 @ linux version | 138 | str r1, [r0], #2048 @ linux version |
135 | 139 | ||
136 | bic r3, r1, #0x000003fc | 140 | bic r3, r1, #0x000003fc |
137 | bic r3, r3, #PTE_TYPE_MASK | 141 | bic r3, r3, #PTE_TYPE_MASK |
@@ -142,17 +146,20 @@ | |||
142 | and r2, r1, #L_PTE_MT_MASK | 146 | and r2, r1, #L_PTE_MT_MASK |
143 | ldr r2, [ip, r2] | 147 | ldr r2, [ip, r2] |
144 | 148 | ||
145 | tst r1, #L_PTE_WRITE | 149 | eor r1, r1, #L_PTE_DIRTY |
146 | tstne r1, #L_PTE_DIRTY | 150 | tst r1, #L_PTE_DIRTY|L_PTE_RDONLY |
147 | orreq r3, r3, #PTE_EXT_APX | 151 | orrne r3, r3, #PTE_EXT_APX |
148 | 152 | ||
149 | tst r1, #L_PTE_USER | 153 | tst r1, #L_PTE_USER |
150 | orrne r3, r3, #PTE_EXT_AP1 | 154 | orrne r3, r3, #PTE_EXT_AP1 |
155 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
156 | @ allow kernel read/write access to read-only user pages | ||
151 | tstne r3, #PTE_EXT_APX | 157 | tstne r3, #PTE_EXT_APX |
152 | bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0 | 158 | bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0 |
159 | #endif | ||
153 | 160 | ||
154 | tst r1, #L_PTE_EXEC | 161 | tst r1, #L_PTE_XN |
155 | orreq r3, r3, #PTE_EXT_XN | 162 | orrne r3, r3, #PTE_EXT_XN |
156 | 163 | ||
157 | orr r3, r3, r2 | 164 | orr r3, r3, r2 |
158 | 165 | ||
@@ -180,9 +187,9 @@ | |||
180 | * 1111 0xff r/w r/w | 187 | * 1111 0xff r/w r/w |
181 | */ | 188 | */ |
182 | .macro armv3_set_pte_ext wc_disable=1 | 189 | .macro armv3_set_pte_ext wc_disable=1 |
183 | str r1, [r0], #-2048 @ linux version | 190 | str r1, [r0], #2048 @ linux version |
184 | 191 | ||
185 | eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 192 | eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
186 | 193 | ||
187 | bic r2, r1, #PTE_SMALL_AP_MASK @ keep C, B bits | 194 | bic r2, r1, #PTE_SMALL_AP_MASK @ keep C, B bits |
188 | bic r2, r2, #PTE_TYPE_MASK | 195 | bic r2, r2, #PTE_TYPE_MASK |
@@ -191,7 +198,7 @@ | |||
191 | tst r3, #L_PTE_USER @ user? | 198 | tst r3, #L_PTE_USER @ user? |
192 | orrne r2, r2, #PTE_SMALL_AP_URO_SRW | 199 | orrne r2, r2, #PTE_SMALL_AP_URO_SRW |
193 | 200 | ||
194 | tst r3, #L_PTE_WRITE | L_PTE_DIRTY @ write and dirty? | 201 | tst r3, #L_PTE_RDONLY | L_PTE_DIRTY @ write and dirty? |
195 | orreq r2, r2, #PTE_SMALL_AP_UNO_SRW | 202 | orreq r2, r2, #PTE_SMALL_AP_UNO_SRW |
196 | 203 | ||
197 | tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ present and young? | 204 | tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ present and young? |
@@ -203,7 +210,7 @@ | |||
203 | bicne r2, r2, #PTE_BUFFERABLE | 210 | bicne r2, r2, #PTE_BUFFERABLE |
204 | #endif | 211 | #endif |
205 | .endif | 212 | .endif |
206 | str r2, [r0] @ hardware version | 213 | str r2, [r0] @ hardware version |
207 | .endm | 214 | .endm |
208 | 215 | ||
209 | 216 | ||
@@ -223,9 +230,9 @@ | |||
223 | * 1111 11 r/w r/w | 230 | * 1111 11 r/w r/w |
224 | */ | 231 | */ |
225 | .macro xscale_set_pte_ext_prologue | 232 | .macro xscale_set_pte_ext_prologue |
226 | str r1, [r0], #-2048 @ linux version | 233 | str r1, [r0] @ linux version |
227 | 234 | ||
228 | eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 235 | eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
229 | 236 | ||
230 | bic r2, r1, #PTE_SMALL_AP_MASK @ keep C, B bits | 237 | bic r2, r1, #PTE_SMALL_AP_MASK @ keep C, B bits |
231 | orr r2, r2, #PTE_TYPE_EXT @ extended page | 238 | orr r2, r2, #PTE_TYPE_EXT @ extended page |
@@ -233,7 +240,7 @@ | |||
233 | tst r3, #L_PTE_USER @ user? | 240 | tst r3, #L_PTE_USER @ user? |
234 | orrne r2, r2, #PTE_EXT_AP_URO_SRW @ yes -> user r/o, system r/w | 241 | orrne r2, r2, #PTE_EXT_AP_URO_SRW @ yes -> user r/o, system r/w |
235 | 242 | ||
236 | tst r3, #L_PTE_WRITE | L_PTE_DIRTY @ write and dirty? | 243 | tst r3, #L_PTE_RDONLY | L_PTE_DIRTY @ write and dirty? |
237 | orreq r2, r2, #PTE_EXT_AP_UNO_SRW @ yes -> user n/a, system r/w | 244 | orreq r2, r2, #PTE_EXT_AP_UNO_SRW @ yes -> user n/a, system r/w |
238 | @ combined with user -> user r/w | 245 | @ combined with user -> user r/w |
239 | .endm | 246 | .endm |
@@ -242,7 +249,7 @@ | |||
242 | tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ present and young? | 249 | tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ present and young? |
243 | movne r2, #0 @ no -> fault | 250 | movne r2, #0 @ no -> fault |
244 | 251 | ||
245 | str r2, [r0] @ hardware version | 252 | str r2, [r0, #2048]! @ hardware version |
246 | mov ip, #0 | 253 | mov ip, #0 |
247 | mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line | 254 | mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line |
248 | mcr p15, 0, ip, c7, c10, 4 @ data write barrier | 255 | mcr p15, 0, ip, c7, c10, 4 @ data write barrier |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 9b9ff5d949fd..b49fab21517c 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -124,15 +124,13 @@ ENDPROC(cpu_v7_switch_mm) | |||
124 | * Set a level 2 translation table entry. | 124 | * Set a level 2 translation table entry. |
125 | * | 125 | * |
126 | * - ptep - pointer to level 2 translation table entry | 126 | * - ptep - pointer to level 2 translation table entry |
127 | * (hardware version is stored at -1024 bytes) | 127 | * (hardware version is stored at +2048 bytes) |
128 | * - pte - PTE value to store | 128 | * - pte - PTE value to store |
129 | * - ext - value for extended PTE bits | 129 | * - ext - value for extended PTE bits |
130 | */ | 130 | */ |
131 | ENTRY(cpu_v7_set_pte_ext) | 131 | ENTRY(cpu_v7_set_pte_ext) |
132 | #ifdef CONFIG_MMU | 132 | #ifdef CONFIG_MMU |
133 | ARM( str r1, [r0], #-2048 ) @ linux version | 133 | str r1, [r0] @ linux version |
134 | THUMB( str r1, [r0] ) @ linux version | ||
135 | THUMB( sub r0, r0, #2048 ) | ||
136 | 134 | ||
137 | bic r3, r1, #0x000003f0 | 135 | bic r3, r1, #0x000003f0 |
138 | bic r3, r3, #PTE_TYPE_MASK | 136 | bic r3, r3, #PTE_TYPE_MASK |
@@ -142,23 +140,26 @@ ENTRY(cpu_v7_set_pte_ext) | |||
142 | tst r1, #1 << 4 | 140 | tst r1, #1 << 4 |
143 | orrne r3, r3, #PTE_EXT_TEX(1) | 141 | orrne r3, r3, #PTE_EXT_TEX(1) |
144 | 142 | ||
145 | tst r1, #L_PTE_WRITE | 143 | eor r1, r1, #L_PTE_DIRTY |
146 | tstne r1, #L_PTE_DIRTY | 144 | tst r1, #L_PTE_RDONLY | L_PTE_DIRTY |
147 | orreq r3, r3, #PTE_EXT_APX | 145 | orrne r3, r3, #PTE_EXT_APX |
148 | 146 | ||
149 | tst r1, #L_PTE_USER | 147 | tst r1, #L_PTE_USER |
150 | orrne r3, r3, #PTE_EXT_AP1 | 148 | orrne r3, r3, #PTE_EXT_AP1 |
149 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
150 | @ allow kernel read/write access to read-only user pages | ||
151 | tstne r3, #PTE_EXT_APX | 151 | tstne r3, #PTE_EXT_APX |
152 | bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0 | 152 | bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0 |
153 | #endif | ||
153 | 154 | ||
154 | tst r1, #L_PTE_EXEC | 155 | tst r1, #L_PTE_XN |
155 | orreq r3, r3, #PTE_EXT_XN | 156 | orrne r3, r3, #PTE_EXT_XN |
156 | 157 | ||
157 | tst r1, #L_PTE_YOUNG | 158 | tst r1, #L_PTE_YOUNG |
158 | tstne r1, #L_PTE_PRESENT | 159 | tstne r1, #L_PTE_PRESENT |
159 | moveq r3, #0 | 160 | moveq r3, #0 |
160 | 161 | ||
161 | str r3, [r0] | 162 | str r3, [r0, #2048]! |
162 | mcr p15, 0, r0, c7, c10, 1 @ flush_pte | 163 | mcr p15, 0, r0, c7, c10, 1 @ flush_pte |
163 | #endif | 164 | #endif |
164 | mov pc, lr | 165 | mov pc, lr |
@@ -273,8 +274,6 @@ __v7_setup: | |||
273 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) | 274 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) |
274 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) | 275 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) |
275 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 | 276 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 |
276 | mov r10, #0x1f @ domains 0, 1 = manager | ||
277 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register | ||
278 | /* | 277 | /* |
279 | * Memory region attributes with SCTLR.TRE=1 | 278 | * Memory region attributes with SCTLR.TRE=1 |
280 | * | 279 | * |
@@ -313,6 +312,10 @@ __v7_setup: | |||
313 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 312 | #ifdef CONFIG_CPU_ENDIAN_BE8 |
314 | orr r6, r6, #1 << 25 @ big-endian page tables | 313 | orr r6, r6, #1 << 25 @ big-endian page tables |
315 | #endif | 314 | #endif |
315 | #ifdef CONFIG_SWP_EMULATE | ||
316 | orr r5, r5, #(1 << 10) @ set SW bit in "clear" | ||
317 | bic r6, r6, #(1 << 10) @ clear it in "mmuset" | ||
318 | #endif | ||
316 | mrc p15, 0, r0, c1, c0, 0 @ read control register | 319 | mrc p15, 0, r0, c1, c0, 0 @ read control register |
317 | bic r0, r0, r5 @ clear bits them | 320 | bic r0, r0, r5 @ clear bits them |
318 | orr r0, r0, r6 @ set them | 321 | orr r0, r0, r6 @ set them |
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S index 523408c0bb38..5a37c5e45c41 100644 --- a/arch/arm/mm/proc-xscale.S +++ b/arch/arm/mm/proc-xscale.S | |||
@@ -500,8 +500,8 @@ ENTRY(cpu_xscale_set_pte_ext) | |||
500 | @ | 500 | @ |
501 | @ Erratum 40: must set memory to write-through for user read-only pages | 501 | @ Erratum 40: must set memory to write-through for user read-only pages |
502 | @ | 502 | @ |
503 | and ip, r1, #(L_PTE_MT_MASK | L_PTE_USER | L_PTE_WRITE) & ~(4 << 2) | 503 | and ip, r1, #(L_PTE_MT_MASK | L_PTE_USER | L_PTE_RDONLY) & ~(4 << 2) |
504 | teq ip, #L_PTE_MT_WRITEBACK | L_PTE_USER | 504 | teq ip, #L_PTE_MT_WRITEBACK | L_PTE_USER | L_PTE_RDONLY |
505 | 505 | ||
506 | moveq r1, #L_PTE_MT_WRITETHROUGH | 506 | moveq r1, #L_PTE_MT_WRITETHROUGH |
507 | and r1, r1, #L_PTE_MT_MASK | 507 | and r1, r1, #L_PTE_MT_MASK |
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c index 558cdfaf76b6..07f23bb42bed 100644 --- a/arch/arm/plat-iop/time.c +++ b/arch/arm/plat-iop/time.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/time.h> | 18 | #include <linux/time.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/sched.h> | ||
20 | #include <linux/timex.h> | 21 | #include <linux/timex.h> |
21 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
22 | #include <linux/io.h> | 23 | #include <linux/io.h> |
@@ -24,6 +25,7 @@ | |||
24 | #include <linux/clockchips.h> | 25 | #include <linux/clockchips.h> |
25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
26 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
28 | #include <asm/sched_clock.h> | ||
27 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
28 | #include <asm/mach/irq.h> | 30 | #include <asm/mach/irq.h> |
29 | #include <asm/mach/time.h> | 31 | #include <asm/mach/time.h> |
@@ -50,15 +52,21 @@ static struct clocksource iop_clocksource = { | |||
50 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 52 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
51 | }; | 53 | }; |
52 | 54 | ||
55 | static DEFINE_CLOCK_DATA(cd); | ||
56 | |||
53 | /* | 57 | /* |
54 | * IOP sched_clock() implementation via its clocksource. | 58 | * IOP sched_clock() implementation via its clocksource. |
55 | */ | 59 | */ |
56 | unsigned long long sched_clock(void) | 60 | unsigned long long notrace sched_clock(void) |
57 | { | 61 | { |
58 | cycle_t cyc = iop_clocksource_read(NULL); | 62 | u32 cyc = 0xffffffffu - read_tcr1(); |
59 | struct clocksource *cs = &iop_clocksource; | 63 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
64 | } | ||
60 | 65 | ||
61 | return clocksource_cyc2ns(cyc, cs->mult, cs->shift); | 66 | static void notrace iop_update_sched_clock(void) |
67 | { | ||
68 | u32 cyc = 0xffffffffu - read_tcr1(); | ||
69 | update_sched_clock(&cd, cyc, (u32)~0); | ||
62 | } | 70 | } |
63 | 71 | ||
64 | /* | 72 | /* |
@@ -88,6 +96,7 @@ static void iop_set_mode(enum clock_event_mode mode, | |||
88 | case CLOCK_EVT_MODE_PERIODIC: | 96 | case CLOCK_EVT_MODE_PERIODIC: |
89 | write_tmr0(tmr & ~IOP_TMR_EN); | 97 | write_tmr0(tmr & ~IOP_TMR_EN); |
90 | write_tcr0(ticks_per_jiffy - 1); | 98 | write_tcr0(ticks_per_jiffy - 1); |
99 | write_trr0(ticks_per_jiffy - 1); | ||
91 | tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN); | 100 | tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN); |
92 | break; | 101 | break; |
93 | case CLOCK_EVT_MODE_ONESHOT: | 102 | case CLOCK_EVT_MODE_ONESHOT: |
@@ -143,6 +152,8 @@ void __init iop_init_time(unsigned long tick_rate) | |||
143 | { | 152 | { |
144 | u32 timer_ctl; | 153 | u32 timer_ctl; |
145 | 154 | ||
155 | init_sched_clock(&cd, iop_update_sched_clock, 32, tick_rate); | ||
156 | |||
146 | ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ); | 157 | ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ); |
147 | iop_tick_rate = tick_rate; | 158 | iop_tick_rate = tick_rate; |
148 | 159 | ||
@@ -153,6 +164,7 @@ void __init iop_init_time(unsigned long tick_rate) | |||
153 | * Set up interrupting clockevent timer 0. | 164 | * Set up interrupting clockevent timer 0. |
154 | */ | 165 | */ |
155 | write_tmr0(timer_ctl & ~IOP_TMR_EN); | 166 | write_tmr0(timer_ctl & ~IOP_TMR_EN); |
167 | write_tisr(1); | ||
156 | setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); | 168 | setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); |
157 | clockevents_calc_mult_shift(&iop_clockevent, | 169 | clockevents_calc_mult_shift(&iop_clockevent, |
158 | tick_rate, IOP_MIN_RANGE); | 170 | tick_rate, IOP_MIN_RANGE); |
@@ -162,9 +174,6 @@ void __init iop_init_time(unsigned long tick_rate) | |||
162 | clockevent_delta2ns(0xf, &iop_clockevent); | 174 | clockevent_delta2ns(0xf, &iop_clockevent); |
163 | iop_clockevent.cpumask = cpumask_of(0); | 175 | iop_clockevent.cpumask = cpumask_of(0); |
164 | clockevents_register_device(&iop_clockevent); | 176 | clockevents_register_device(&iop_clockevent); |
165 | write_trr0(ticks_per_jiffy - 1); | ||
166 | write_tcr0(ticks_per_jiffy - 1); | ||
167 | write_tmr0(timer_ctl); | ||
168 | 177 | ||
169 | /* | 178 | /* |
170 | * Set up free-running clocksource timer 1. | 179 | * Set up free-running clocksource timer 1. |
@@ -172,7 +181,5 @@ void __init iop_init_time(unsigned long tick_rate) | |||
172 | write_trr1(0xffffffff); | 181 | write_trr1(0xffffffff); |
173 | write_tcr1(0xffffffff); | 182 | write_tcr1(0xffffffff); |
174 | write_tmr1(timer_ctl); | 183 | write_tmr1(timer_ctl); |
175 | clocksource_calc_mult_shift(&iop_clocksource, tick_rate, | 184 | clocksource_register_hz(&iop_clocksource, tick_rate); |
176 | IOP_MIN_RANGE); | ||
177 | clocksource_register(&iop_clocksource); | ||
178 | } | 185 | } |
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig index 64e3a64520e0..389f21795015 100644 --- a/arch/arm/plat-mxc/Kconfig +++ b/arch/arm/plat-mxc/Kconfig | |||
@@ -21,10 +21,6 @@ config ARCH_MX2 | |||
21 | 21 | ||
22 | config ARCH_MX25 | 22 | config ARCH_MX25 |
23 | bool "MX25-based" | 23 | bool "MX25-based" |
24 | select CPU_ARM926T | ||
25 | select ARCH_MXC_IOMUX_V3 | ||
26 | select HAVE_FB_IMX | ||
27 | select ARCH_MXC_AUDMUX_V2 | ||
28 | help | 24 | help |
29 | This enables support for systems based on the Freescale i.MX25 family | 25 | This enables support for systems based on the Freescale i.MX25 family |
30 | 26 | ||
@@ -51,7 +47,6 @@ endchoice | |||
51 | 47 | ||
52 | source "arch/arm/mach-imx/Kconfig" | 48 | source "arch/arm/mach-imx/Kconfig" |
53 | source "arch/arm/mach-mx3/Kconfig" | 49 | source "arch/arm/mach-mx3/Kconfig" |
54 | source "arch/arm/mach-mx25/Kconfig" | ||
55 | source "arch/arm/mach-mxc91231/Kconfig" | 50 | source "arch/arm/mach-mxc91231/Kconfig" |
56 | source "arch/arm/mach-mx5/Kconfig" | 51 | source "arch/arm/mach-mx5/Kconfig" |
57 | 52 | ||
@@ -68,12 +63,10 @@ config MXC_IRQ_PRIOR | |||
68 | Say N here, unless you have a specialized requirement. | 63 | Say N here, unless you have a specialized requirement. |
69 | 64 | ||
70 | config MXC_TZIC | 65 | config MXC_TZIC |
71 | bool "Enable TrustZone Interrupt Controller" | 66 | bool |
72 | depends on ARCH_MX51 | 67 | |
73 | help | 68 | config MXC_AVIC |
74 | This will be automatically selected for all processors | 69 | bool |
75 | containing this interrupt controller. | ||
76 | Say N here only if you are really sure. | ||
77 | 70 | ||
78 | config MXC_PWM | 71 | config MXC_PWM |
79 | tristate "Enable PWM driver" | 72 | tristate "Enable PWM driver" |
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile index 372670952789..5fd20e96876c 100644 --- a/arch/arm/plat-mxc/Makefile +++ b/arch/arm/plat-mxc/Makefile | |||
@@ -3,10 +3,11 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o system.o | 6 | obj-y := clock.o gpio.o time.o devices.o cpu.o system.o irq-common.o |
7 | 7 | ||
8 | # MX51 uses the TZIC interrupt controller, older platforms use AVIC (irq.o) | 8 | # MX51 uses the TZIC interrupt controller, older platforms use AVIC |
9 | obj-$(CONFIG_MXC_TZIC) += tzic.o | 9 | obj-$(CONFIG_MXC_TZIC) += tzic.o |
10 | obj-$(CONFIG_MXC_AVIC) += avic.o | ||
10 | 11 | ||
11 | obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o | 12 | obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o |
12 | obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o | 13 | obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o |
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c index 0be1ac7f421b..175e3647bb27 100644 --- a/arch/arm/plat-mxc/audmux-v2.c +++ b/arch/arm/plat-mxc/audmux-v2.c | |||
@@ -209,7 +209,7 @@ static int mxc_audmux_v2_init(void) | |||
209 | audmux_base = MX35_IO_ADDRESS(MX35_AUDMUX_BASE_ADDR); | 209 | audmux_base = MX35_IO_ADDRESS(MX35_AUDMUX_BASE_ADDR); |
210 | } | 210 | } |
211 | #endif | 211 | #endif |
212 | #if defined(CONFIG_ARCH_MX25) | 212 | #if defined(CONFIG_SOC_IMX25) |
213 | if (cpu_is_mx25()) { | 213 | if (cpu_is_mx25()) { |
214 | audmux_clk = clk_get(NULL, "audmux"); | 214 | audmux_clk = clk_get(NULL, "audmux"); |
215 | if (IS_ERR(audmux_clk)) { | 215 | if (IS_ERR(audmux_clk)) { |
@@ -220,7 +220,7 @@ static int mxc_audmux_v2_init(void) | |||
220 | } | 220 | } |
221 | audmux_base = MX25_IO_ADDRESS(MX25_AUDMUX_BASE_ADDR); | 221 | audmux_base = MX25_IO_ADDRESS(MX25_AUDMUX_BASE_ADDR); |
222 | } | 222 | } |
223 | #endif | 223 | #endif /* if defined(CONFIG_SOC_IMX25) */ |
224 | audmux_debugfs_init(); | 224 | audmux_debugfs_init(); |
225 | 225 | ||
226 | return 0; | 226 | return 0; |
diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/avic.c index 7331f2ace5fe..9a4e8a22dd0a 100644 --- a/arch/arm/plat-mxc/irq.c +++ b/arch/arm/plat-mxc/avic.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <asm/mach/irq.h> | 24 | #include <asm/mach/irq.h> |
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | 26 | ||
27 | #include "irq-common.h" | ||
28 | |||
27 | #define AVIC_INTCNTL 0x00 /* int control reg */ | 29 | #define AVIC_INTCNTL 0x00 /* int control reg */ |
28 | #define AVIC_NIMASK 0x04 /* int mask reg */ | 30 | #define AVIC_NIMASK 0x04 /* int mask reg */ |
29 | #define AVIC_INTENNUM 0x08 /* int enable number reg */ | 31 | #define AVIC_INTENNUM 0x08 /* int enable number reg */ |
@@ -46,9 +48,9 @@ | |||
46 | 48 | ||
47 | void __iomem *avic_base; | 49 | void __iomem *avic_base; |
48 | 50 | ||
49 | int imx_irq_set_priority(unsigned char irq, unsigned char prio) | ||
50 | { | ||
51 | #ifdef CONFIG_MXC_IRQ_PRIOR | 51 | #ifdef CONFIG_MXC_IRQ_PRIOR |
52 | static int avic_irq_set_priority(unsigned char irq, unsigned char prio) | ||
53 | { | ||
52 | unsigned int temp; | 54 | unsigned int temp; |
53 | unsigned int mask = 0x0F << irq % 8 * 4; | 55 | unsigned int mask = 0x0F << irq % 8 * 4; |
54 | 56 | ||
@@ -62,14 +64,11 @@ int imx_irq_set_priority(unsigned char irq, unsigned char prio) | |||
62 | __raw_writel(temp, avic_base + AVIC_NIPRIORITY(irq / 8)); | 64 | __raw_writel(temp, avic_base + AVIC_NIPRIORITY(irq / 8)); |
63 | 65 | ||
64 | return 0; | 66 | return 0; |
65 | #else | ||
66 | return -ENOSYS; | ||
67 | #endif | ||
68 | } | 67 | } |
69 | EXPORT_SYMBOL(imx_irq_set_priority); | 68 | #endif |
70 | 69 | ||
71 | #ifdef CONFIG_FIQ | 70 | #ifdef CONFIG_FIQ |
72 | int mxc_set_irq_fiq(unsigned int irq, unsigned int type) | 71 | static int avic_set_irq_fiq(unsigned int irq, unsigned int type) |
73 | { | 72 | { |
74 | unsigned int irqt; | 73 | unsigned int irqt; |
75 | 74 | ||
@@ -87,7 +86,6 @@ int mxc_set_irq_fiq(unsigned int irq, unsigned int type) | |||
87 | 86 | ||
88 | return 0; | 87 | return 0; |
89 | } | 88 | } |
90 | EXPORT_SYMBOL(mxc_set_irq_fiq); | ||
91 | #endif /* CONFIG_FIQ */ | 89 | #endif /* CONFIG_FIQ */ |
92 | 90 | ||
93 | /* Disable interrupt number "irq" in the AVIC */ | 91 | /* Disable interrupt number "irq" in the AVIC */ |
@@ -102,10 +100,18 @@ static void mxc_unmask_irq(unsigned int irq) | |||
102 | __raw_writel(irq, avic_base + AVIC_INTENNUM); | 100 | __raw_writel(irq, avic_base + AVIC_INTENNUM); |
103 | } | 101 | } |
104 | 102 | ||
105 | static struct irq_chip mxc_avic_chip = { | 103 | static struct mxc_irq_chip mxc_avic_chip = { |
106 | .ack = mxc_mask_irq, | 104 | .base = { |
107 | .mask = mxc_mask_irq, | 105 | .ack = mxc_mask_irq, |
108 | .unmask = mxc_unmask_irq, | 106 | .mask = mxc_mask_irq, |
107 | .unmask = mxc_unmask_irq, | ||
108 | }, | ||
109 | #ifdef CONFIG_MXC_IRQ_PRIOR | ||
110 | .set_priority = avic_irq_set_priority, | ||
111 | #endif | ||
112 | #ifdef CONFIG_FIQ | ||
113 | .set_irq_fiq = avic_set_irq_fiq, | ||
114 | #endif | ||
109 | }; | 115 | }; |
110 | 116 | ||
111 | /* | 117 | /* |
@@ -133,7 +139,7 @@ void __init mxc_init_irq(void __iomem *irqbase) | |||
133 | __raw_writel(0, avic_base + AVIC_INTTYPEH); | 139 | __raw_writel(0, avic_base + AVIC_INTTYPEH); |
134 | __raw_writel(0, avic_base + AVIC_INTTYPEL); | 140 | __raw_writel(0, avic_base + AVIC_INTTYPEL); |
135 | for (i = 0; i < MXC_INTERNAL_IRQS; i++) { | 141 | for (i = 0; i < MXC_INTERNAL_IRQS; i++) { |
136 | set_irq_chip(i, &mxc_avic_chip); | 142 | set_irq_chip(i, &mxc_avic_chip.base); |
137 | set_irq_handler(i, handle_level_irq); | 143 | set_irq_handler(i, handle_level_irq); |
138 | set_irq_flags(i, IRQF_VALID); | 144 | set_irq_flags(i, IRQF_VALID); |
139 | } | 145 | } |
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c index 039538e68793..ce81481becf1 100644 --- a/arch/arm/plat-mxc/cpufreq.c +++ b/arch/arm/plat-mxc/cpufreq.c | |||
@@ -144,7 +144,6 @@ static int __init mxc_cpufreq_init(struct cpufreq_policy *policy) | |||
144 | imx_freq_table[i].frequency = CPUFREQ_TABLE_END; | 144 | imx_freq_table[i].frequency = CPUFREQ_TABLE_END; |
145 | 145 | ||
146 | policy->cur = clk_get_rate(cpu_clk) / 1000; | 146 | policy->cur = clk_get_rate(cpu_clk) / 1000; |
147 | policy->governor = CPUFREQ_DEFAULT_GOVERNOR; | ||
148 | policy->min = policy->cpuinfo.min_freq = cpu_freq_khz_min; | 147 | policy->min = policy->cpuinfo.min_freq = cpu_freq_khz_min; |
149 | policy->max = policy->cpuinfo.max_freq = cpu_freq_khz_max; | 148 | policy->max = policy->cpuinfo.max_freq = cpu_freq_khz_max; |
150 | 149 | ||
diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/plat-mxc/devices.c index 735776d84956..e9bcefe79a43 100644 --- a/arch/arm/plat-mxc/devices.c +++ b/arch/arm/plat-mxc/devices.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/slab.h> | ||
20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
21 | #include <linux/err.h> | 22 | #include <linux/err.h> |
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
@@ -36,9 +37,10 @@ int __init mxc_register_device(struct platform_device *pdev, void *data) | |||
36 | return ret; | 37 | return ret; |
37 | } | 38 | } |
38 | 39 | ||
39 | struct platform_device *__init imx_add_platform_device(const char *name, int id, | 40 | struct platform_device *__init imx_add_platform_device_dmamask( |
41 | const char *name, int id, | ||
40 | const struct resource *res, unsigned int num_resources, | 42 | const struct resource *res, unsigned int num_resources, |
41 | const void *data, size_t size_data) | 43 | const void *data, size_t size_data, u64 dmamask) |
42 | { | 44 | { |
43 | int ret = -ENOMEM; | 45 | int ret = -ENOMEM; |
44 | struct platform_device *pdev; | 46 | struct platform_device *pdev; |
@@ -47,6 +49,23 @@ struct platform_device *__init imx_add_platform_device(const char *name, int id, | |||
47 | if (!pdev) | 49 | if (!pdev) |
48 | goto err; | 50 | goto err; |
49 | 51 | ||
52 | if (dmamask) { | ||
53 | /* | ||
54 | * This memory isn't freed when the device is put, | ||
55 | * I don't have a nice idea for that though. Conceptually | ||
56 | * dma_mask in struct device should not be a pointer. | ||
57 | * See http://thread.gmane.org/gmane.linux.kernel.pci/9081 | ||
58 | */ | ||
59 | pdev->dev.dma_mask = | ||
60 | kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); | ||
61 | if (!pdev->dev.dma_mask) | ||
62 | /* ret is still -ENOMEM; */ | ||
63 | goto err; | ||
64 | |||
65 | *pdev->dev.dma_mask = dmamask; | ||
66 | pdev->dev.coherent_dma_mask = dmamask; | ||
67 | } | ||
68 | |||
50 | if (res) { | 69 | if (res) { |
51 | ret = platform_device_add_resources(pdev, res, num_resources); | 70 | ret = platform_device_add_resources(pdev, res, num_resources); |
52 | if (ret) | 71 | if (ret) |
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 9aa6f3ea9012..2537166468ac 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -1,29 +1,73 @@ | |||
1 | config IMX_HAVE_PLATFORM_ESDHC | ||
2 | bool | ||
3 | |||
4 | config IMX_HAVE_PLATFORM_FEC | 1 | config IMX_HAVE_PLATFORM_FEC |
5 | bool | 2 | bool |
6 | default y if ARCH_MX25 || SOC_IMX27 || ARCH_MX35 || ARCH_MX51 | 3 | default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 |
7 | 4 | ||
8 | config IMX_HAVE_PLATFORM_FLEXCAN | 5 | config IMX_HAVE_PLATFORM_FLEXCAN |
9 | select HAVE_CAN_FLEXCAN if CAN | 6 | select HAVE_CAN_FLEXCAN if CAN |
10 | bool | 7 | bool |
11 | 8 | ||
9 | config IMX_HAVE_PLATFORM_FSL_USB2_UDC | ||
10 | bool | ||
11 | |||
12 | config IMX_HAVE_PLATFORM_GPIO_KEYS | 12 | config IMX_HAVE_PLATFORM_GPIO_KEYS |
13 | bool | 13 | bool |
14 | default y if ARCH_MX51 | 14 | default y if SOC_IMX51 |
15 | |||
16 | config IMX_HAVE_PLATFORM_IMX21_HCD | ||
17 | bool | ||
15 | 18 | ||
19 | config IMX_HAVE_PLATFORM_IMX2_WDT | ||
20 | bool | ||
21 | |||
22 | config IMX_HAVE_PLATFORM_IMXDI_RTC | ||
23 | bool | ||
24 | |||
25 | config IMX_HAVE_PLATFORM_IMX_FB | ||
26 | bool | ||
27 | select HAVE_FB_IMX | ||
28 | |||
16 | config IMX_HAVE_PLATFORM_IMX_I2C | 29 | config IMX_HAVE_PLATFORM_IMX_I2C |
17 | bool | 30 | bool |
18 | 31 | ||
32 | config IMX_HAVE_PLATFORM_IMX_KEYPAD | ||
33 | bool | ||
34 | |||
19 | config IMX_HAVE_PLATFORM_IMX_SSI | 35 | config IMX_HAVE_PLATFORM_IMX_SSI |
20 | bool | 36 | bool |
21 | 37 | ||
22 | config IMX_HAVE_PLATFORM_IMX_UART | 38 | config IMX_HAVE_PLATFORM_IMX_UART |
23 | bool | 39 | bool |
24 | 40 | ||
41 | config IMX_HAVE_PLATFORM_IMX_UDC | ||
42 | bool | ||
43 | |||
44 | config IMX_HAVE_PLATFORM_MX1_CAMERA | ||
45 | bool | ||
46 | |||
47 | config IMX_HAVE_PLATFORM_MX2_CAMERA | ||
48 | bool | ||
49 | |||
50 | config IMX_HAVE_PLATFORM_MXC_EHCI | ||
51 | bool | ||
52 | |||
53 | config IMX_HAVE_PLATFORM_MXC_MMC | ||
54 | bool | ||
55 | |||
25 | config IMX_HAVE_PLATFORM_MXC_NAND | 56 | config IMX_HAVE_PLATFORM_MXC_NAND |
26 | bool | 57 | bool |
27 | 58 | ||
59 | config IMX_HAVE_PLATFORM_MXC_PWM | ||
60 | bool | ||
61 | |||
62 | config IMX_HAVE_PLATFORM_MXC_RNGA | ||
63 | bool | ||
64 | select ARCH_HAS_RNGA | ||
65 | |||
66 | config IMX_HAVE_PLATFORM_MXC_W1 | ||
67 | bool | ||
68 | |||
69 | config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX | ||
70 | bool | ||
71 | |||
28 | config IMX_HAVE_PLATFORM_SPI_IMX | 72 | config IMX_HAVE_PLATFORM_SPI_IMX |
29 | bool | 73 | bool |
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 45aefeb283ba..75cd2ece9053 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -1,10 +1,24 @@ | |||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o | ||
2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o | 1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o |
3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o | 2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o |
3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o | ||
4 | obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o | 4 | obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o |
5 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o | ||
6 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o | ||
7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o | ||
5 | obj-y += platform-imx-dma.o | 8 | obj-y += platform-imx-dma.o |
9 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o | ||
6 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | 10 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o |
11 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o | ||
7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o | 12 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o |
8 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o | 13 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o |
14 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o | ||
15 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o | ||
16 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o | ||
17 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o | ||
18 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o | ||
9 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 19 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
20 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o | ||
21 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o | ||
22 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o | ||
23 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o | ||
10 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o | 24 | obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o |
diff --git a/arch/arm/plat-mxc/devices/platform-esdhc.c b/arch/arm/plat-mxc/devices/platform-esdhc.c deleted file mode 100644 index 2605bfa0dfb0..000000000000 --- a/arch/arm/plat-mxc/devices/platform-esdhc.c +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | #include <mach/esdhc.h> | ||
12 | |||
13 | #define imx_esdhc_imx_data_entry_single(soc, _id, hwid) \ | ||
14 | { \ | ||
15 | .id = _id, \ | ||
16 | .iobase = soc ## _ESDHC ## hwid ## _BASE_ADDR, \ | ||
17 | .irq = soc ## _INT_ESDHC ## hwid, \ | ||
18 | } | ||
19 | |||
20 | #define imx_esdhc_imx_data_entry(soc, id, hwid) \ | ||
21 | [id] = imx_esdhc_imx_data_entry_single(soc, id, hwid) | ||
22 | |||
23 | #ifdef CONFIG_ARCH_MX25 | ||
24 | const struct imx_esdhc_imx_data imx25_esdhc_data[] __initconst = { | ||
25 | #define imx25_esdhc_data_entry(_id, _hwid) \ | ||
26 | imx_esdhc_imx_data_entry(MX25, _id, _hwid) | ||
27 | imx25_esdhc_data_entry(0, 1), | ||
28 | imx25_esdhc_data_entry(1, 2), | ||
29 | }; | ||
30 | #endif /* ifdef CONFIG_ARCH_MX25 */ | ||
31 | |||
32 | #ifdef CONFIG_ARCH_MX35 | ||
33 | const struct imx_esdhc_imx_data imx35_esdhc_data[] __initconst = { | ||
34 | #define imx35_esdhc_data_entry(_id, _hwid) \ | ||
35 | imx_esdhc_imx_data_entry(MX35, _id, _hwid) | ||
36 | imx35_esdhc_data_entry(0, 1), | ||
37 | imx35_esdhc_data_entry(1, 2), | ||
38 | imx35_esdhc_data_entry(2, 3), | ||
39 | }; | ||
40 | #endif /* ifdef CONFIG_ARCH_MX35 */ | ||
41 | |||
42 | #ifdef CONFIG_ARCH_MX51 | ||
43 | const struct imx_esdhc_imx_data imx51_esdhc_data[] __initconst = { | ||
44 | #define imx51_esdhc_data_entry(_id, _hwid) \ | ||
45 | imx_esdhc_imx_data_entry(MX51, _id, _hwid) | ||
46 | imx51_esdhc_data_entry(0, 1), | ||
47 | imx51_esdhc_data_entry(1, 2), | ||
48 | imx51_esdhc_data_entry(2, 3), | ||
49 | imx51_esdhc_data_entry(3, 4), | ||
50 | }; | ||
51 | #endif /* ifdef CONFIG_ARCH_MX51 */ | ||
52 | |||
53 | struct platform_device *__init imx_add_esdhc( | ||
54 | const struct imx_esdhc_imx_data *data, | ||
55 | const struct esdhc_platform_data *pdata) | ||
56 | { | ||
57 | struct resource res[] = { | ||
58 | { | ||
59 | .start = data->iobase, | ||
60 | .end = data->iobase + SZ_16K - 1, | ||
61 | .flags = IORESOURCE_MEM, | ||
62 | }, { | ||
63 | .start = data->irq, | ||
64 | .end = data->irq, | ||
65 | .flags = IORESOURCE_IRQ, | ||
66 | }, | ||
67 | }; | ||
68 | |||
69 | return imx_add_platform_device("sdhci-esdhc-imx", data->id, res, | ||
70 | ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
71 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c index 11d087f4e219..269ec78aba77 100644 --- a/arch/arm/plat-mxc/devices/platform-fec.c +++ b/arch/arm/plat-mxc/devices/platform-fec.c | |||
@@ -16,22 +16,22 @@ | |||
16 | .irq = soc ## _INT_FEC, \ | 16 | .irq = soc ## _INT_FEC, \ |
17 | } | 17 | } |
18 | 18 | ||
19 | #ifdef CONFIG_ARCH_MX25 | 19 | #ifdef CONFIG_SOC_IMX25 |
20 | const struct imx_fec_data imx25_fec_data __initconst = | 20 | const struct imx_fec_data imx25_fec_data __initconst = |
21 | imx_fec_data_entry_single(MX25); | 21 | imx_fec_data_entry_single(MX25); |
22 | #endif /* ifdef CONFIG_ARCH_MX25 */ | 22 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
23 | 23 | ||
24 | #ifdef CONFIG_SOC_IMX27 | 24 | #ifdef CONFIG_SOC_IMX27 |
25 | const struct imx_fec_data imx27_fec_data __initconst = | 25 | const struct imx_fec_data imx27_fec_data __initconst = |
26 | imx_fec_data_entry_single(MX27); | 26 | imx_fec_data_entry_single(MX27); |
27 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 27 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
28 | 28 | ||
29 | #ifdef CONFIG_ARCH_MX35 | 29 | #ifdef CONFIG_SOC_IMX35 |
30 | const struct imx_fec_data imx35_fec_data __initconst = | 30 | const struct imx_fec_data imx35_fec_data __initconst = |
31 | imx_fec_data_entry_single(MX35); | 31 | imx_fec_data_entry_single(MX35); |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #ifdef CONFIG_ARCH_MX51 | 34 | #ifdef CONFIG_SOC_IMX51 |
35 | const struct imx_fec_data imx51_fec_data __initconst = | 35 | const struct imx_fec_data imx51_fec_data __initconst = |
36 | imx_fec_data_entry_single(MX51); | 36 | imx_fec_data_entry_single(MX51); |
37 | #endif | 37 | #endif |
diff --git a/arch/arm/plat-mxc/devices/platform-flexcan.c b/arch/arm/plat-mxc/devices/platform-flexcan.c index 5e97a01f14f3..4e8497af2eb1 100644 --- a/arch/arm/plat-mxc/devices/platform-flexcan.c +++ b/arch/arm/plat-mxc/devices/platform-flexcan.c | |||
@@ -5,26 +5,54 @@ | |||
5 | * the terms of the GNU General Public License version 2 as published by the | 5 | * the terms of the GNU General Public License version 2 as published by the |
6 | * Free Software Foundation. | 6 | * Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | #include <mach/hardware.h> | |
9 | #include <mach/devices-common.h> | 9 | #include <mach/devices-common.h> |
10 | 10 | ||
11 | struct platform_device *__init imx_add_flexcan(int id, | 11 | #define imx_flexcan_data_entry_single(soc, _id, _hwid, _size) \ |
12 | resource_size_t iobase, resource_size_t iosize, | 12 | { \ |
13 | resource_size_t irq, | 13 | .id = _id, \ |
14 | .iobase = soc ## _CAN ## _hwid ## _BASE_ADDR, \ | ||
15 | .iosize = _size, \ | ||
16 | .irq = soc ## _INT_CAN ## _hwid, \ | ||
17 | } | ||
18 | |||
19 | #define imx_flexcan_data_entry(soc, _id, _hwid, _size) \ | ||
20 | [_id] = imx_flexcan_data_entry_single(soc, _id, _hwid, _size) | ||
21 | |||
22 | #ifdef CONFIG_SOC_IMX25 | ||
23 | const struct imx_flexcan_data imx25_flexcan_data[] __initconst = { | ||
24 | #define imx25_flexcan_data_entry(_id, _hwid) \ | ||
25 | imx_flexcan_data_entry(MX25, _id, _hwid, SZ_16K) | ||
26 | imx25_flexcan_data_entry(0, 1), | ||
27 | imx25_flexcan_data_entry(1, 2), | ||
28 | }; | ||
29 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
30 | |||
31 | #ifdef CONFIG_SOC_IMX35 | ||
32 | const struct imx_flexcan_data imx35_flexcan_data[] __initconst = { | ||
33 | #define imx35_flexcan_data_entry(_id, _hwid) \ | ||
34 | imx_flexcan_data_entry(MX35, _id, _hwid, SZ_16K) | ||
35 | imx35_flexcan_data_entry(0, 1), | ||
36 | imx35_flexcan_data_entry(1, 2), | ||
37 | }; | ||
38 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
39 | |||
40 | struct platform_device *__init imx_add_flexcan( | ||
41 | const struct imx_flexcan_data *data, | ||
14 | const struct flexcan_platform_data *pdata) | 42 | const struct flexcan_platform_data *pdata) |
15 | { | 43 | { |
16 | struct resource res[] = { | 44 | struct resource res[] = { |
17 | { | 45 | { |
18 | .start = iobase, | 46 | .start = data->iobase, |
19 | .end = iobase + iosize - 1, | 47 | .end = data->iobase + data->iosize - 1, |
20 | .flags = IORESOURCE_MEM, | 48 | .flags = IORESOURCE_MEM, |
21 | }, { | 49 | }, { |
22 | .start = irq, | 50 | .start = data->irq, |
23 | .end = irq, | 51 | .end = data->irq, |
24 | .flags = IORESOURCE_IRQ, | 52 | .flags = IORESOURCE_IRQ, |
25 | }, | 53 | }, |
26 | }; | 54 | }; |
27 | 55 | ||
28 | return imx_add_platform_device("flexcan", id, res, ARRAY_SIZE(res), | 56 | return imx_add_platform_device("flexcan", data->id, |
29 | pdata, sizeof(*pdata)); | 57 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); |
30 | } | 58 | } |
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c new file mode 100644 index 000000000000..59c33f6e401c --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_fsl_usb2_udc_data_entry_single(soc) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _USB_OTG_BASE_ADDR, \ | ||
15 | .irq = soc ## _INT_USB_OTG, \ | ||
16 | } | ||
17 | |||
18 | #ifdef CONFIG_SOC_IMX25 | ||
19 | const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst = | ||
20 | imx_fsl_usb2_udc_data_entry_single(MX25); | ||
21 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX27 | ||
24 | const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst = | ||
25 | imx_fsl_usb2_udc_data_entry_single(MX27); | ||
26 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
27 | |||
28 | #ifdef CONFIG_SOC_IMX31 | ||
29 | const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst = | ||
30 | imx_fsl_usb2_udc_data_entry_single(MX31); | ||
31 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
32 | |||
33 | #ifdef CONFIG_SOC_IMX35 | ||
34 | const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst = | ||
35 | imx_fsl_usb2_udc_data_entry_single(MX35); | ||
36 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
37 | |||
38 | struct platform_device *__init imx_add_fsl_usb2_udc( | ||
39 | const struct imx_fsl_usb2_udc_data *data, | ||
40 | const struct fsl_usb2_platform_data *pdata) | ||
41 | { | ||
42 | struct resource res[] = { | ||
43 | { | ||
44 | .start = data->iobase, | ||
45 | .end = data->iobase + SZ_512 - 1, | ||
46 | .flags = IORESOURCE_MEM, | ||
47 | }, { | ||
48 | .start = data->irq, | ||
49 | .end = data->irq, | ||
50 | .flags = IORESOURCE_IRQ, | ||
51 | }, | ||
52 | }; | ||
53 | return imx_add_platform_device_dmamask("fsl-usb2-udc", -1, | ||
54 | res, ARRAY_SIZE(res), | ||
55 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
56 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c index 3a705c7877dd..33530d2d5ed1 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-dma.c +++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c | |||
@@ -31,25 +31,25 @@ struct imx_imx_sdma_data { | |||
31 | }, \ | 31 | }, \ |
32 | } | 32 | } |
33 | 33 | ||
34 | #ifdef CONFIG_ARCH_MX25 | 34 | #ifdef CONFIG_SOC_IMX25 |
35 | const struct imx_imx_sdma_data imx25_imx_sdma_data __initconst = | 35 | struct imx_imx_sdma_data imx25_imx_sdma_data __initconst = |
36 | imx_imx_sdma_data_entry_single(MX25, 1, "imx25", 0); | 36 | imx_imx_sdma_data_entry_single(MX25, 1, "imx25", 0); |
37 | #endif /* ifdef CONFIG_ARCH_MX25 */ | 37 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
38 | 38 | ||
39 | #ifdef CONFIG_ARCH_MX31 | 39 | #ifdef CONFIG_SOC_IMX31 |
40 | struct imx_imx_sdma_data imx31_imx_sdma_data __initdata = | 40 | struct imx_imx_sdma_data imx31_imx_sdma_data __initdata = |
41 | imx_imx_sdma_data_entry_single(MX31, 1, "imx31", 0); | 41 | imx_imx_sdma_data_entry_single(MX31, 1, "imx31", 0); |
42 | #endif /* ifdef CONFIG_ARCH_MX31 */ | 42 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
43 | 43 | ||
44 | #ifdef CONFIG_ARCH_MX35 | 44 | #ifdef CONFIG_SOC_IMX35 |
45 | struct imx_imx_sdma_data imx35_imx_sdma_data __initdata = | 45 | struct imx_imx_sdma_data imx35_imx_sdma_data __initdata = |
46 | imx_imx_sdma_data_entry_single(MX35, 2, "imx35", 0); | 46 | imx_imx_sdma_data_entry_single(MX35, 2, "imx35", 0); |
47 | #endif /* ifdef CONFIG_ARCH_MX35 */ | 47 | #endif /* ifdef CONFIG_SOC_IMX35 */ |
48 | 48 | ||
49 | #ifdef CONFIG_ARCH_MX51 | 49 | #ifdef CONFIG_SOC_IMX51 |
50 | const struct imx_imx_sdma_data imx51_imx_sdma_data __initconst = | 50 | struct imx_imx_sdma_data imx51_imx_sdma_data __initconst = |
51 | imx_imx_sdma_data_entry_single(MX51, 2, "imx51", 0); | 51 | imx_imx_sdma_data_entry_single(MX51, 2, "imx51", 0); |
52 | #endif /* ifdef CONFIG_ARCH_MX51 */ | 52 | #endif /* ifdef CONFIG_SOC_IMX51 */ |
53 | 53 | ||
54 | static struct platform_device __init __maybe_unused *imx_add_imx_sdma( | 54 | static struct platform_device __init __maybe_unused *imx_add_imx_sdma( |
55 | const struct imx_imx_sdma_data *data) | 55 | const struct imx_imx_sdma_data *data) |
@@ -76,6 +76,83 @@ static struct platform_device __init __maybe_unused *imx_add_imx_dma(void) | |||
76 | return imx_add_platform_device("imx-dma", -1, NULL, 0, NULL, 0); | 76 | return imx_add_platform_device("imx-dma", -1, NULL, 0, NULL, 0); |
77 | } | 77 | } |
78 | 78 | ||
79 | #ifdef CONFIG_ARCH_MX25 | ||
80 | static struct sdma_script_start_addrs addr_imx25_to1 = { | ||
81 | .ap_2_ap_addr = 729, | ||
82 | .uart_2_mcu_addr = 904, | ||
83 | .per_2_app_addr = 1255, | ||
84 | .mcu_2_app_addr = 834, | ||
85 | .uartsh_2_mcu_addr = 1120, | ||
86 | .per_2_shp_addr = 1329, | ||
87 | .mcu_2_shp_addr = 1048, | ||
88 | .ata_2_mcu_addr = 1560, | ||
89 | .mcu_2_ata_addr = 1479, | ||
90 | .app_2_per_addr = 1189, | ||
91 | .app_2_mcu_addr = 770, | ||
92 | .shp_2_per_addr = 1407, | ||
93 | .shp_2_mcu_addr = 979, | ||
94 | }; | ||
95 | #endif | ||
96 | |||
97 | #ifdef CONFIG_ARCH_MX31 | ||
98 | static struct sdma_script_start_addrs addr_imx31_to1 = { | ||
99 | .per_2_per_addr = 1677, | ||
100 | }; | ||
101 | |||
102 | static struct sdma_script_start_addrs addr_imx31_to2 = { | ||
103 | .ap_2_ap_addr = 423, | ||
104 | .ap_2_bp_addr = 829, | ||
105 | .bp_2_ap_addr = 1029, | ||
106 | }; | ||
107 | #endif | ||
108 | |||
109 | #ifdef CONFIG_ARCH_MX35 | ||
110 | static struct sdma_script_start_addrs addr_imx35_to1 = { | ||
111 | .ap_2_ap_addr = 642, | ||
112 | .uart_2_mcu_addr = 817, | ||
113 | .mcu_2_app_addr = 747, | ||
114 | .uartsh_2_mcu_addr = 1183, | ||
115 | .per_2_shp_addr = 1033, | ||
116 | .mcu_2_shp_addr = 961, | ||
117 | .ata_2_mcu_addr = 1333, | ||
118 | .mcu_2_ata_addr = 1252, | ||
119 | .app_2_mcu_addr = 683, | ||
120 | .shp_2_per_addr = 1111, | ||
121 | .shp_2_mcu_addr = 892, | ||
122 | }; | ||
123 | |||
124 | static struct sdma_script_start_addrs addr_imx35_to2 = { | ||
125 | .ap_2_ap_addr = 729, | ||
126 | .uart_2_mcu_addr = 904, | ||
127 | .per_2_app_addr = 1597, | ||
128 | .mcu_2_app_addr = 834, | ||
129 | .uartsh_2_mcu_addr = 1270, | ||
130 | .per_2_shp_addr = 1120, | ||
131 | .mcu_2_shp_addr = 1048, | ||
132 | .ata_2_mcu_addr = 1429, | ||
133 | .mcu_2_ata_addr = 1339, | ||
134 | .app_2_per_addr = 1531, | ||
135 | .app_2_mcu_addr = 770, | ||
136 | .shp_2_per_addr = 1198, | ||
137 | .shp_2_mcu_addr = 979, | ||
138 | }; | ||
139 | #endif | ||
140 | |||
141 | #ifdef CONFIG_SOC_IMX51 | ||
142 | static struct sdma_script_start_addrs addr_imx51_to1 = { | ||
143 | .ap_2_ap_addr = 642, | ||
144 | .uart_2_mcu_addr = 817, | ||
145 | .mcu_2_app_addr = 747, | ||
146 | .mcu_2_shp_addr = 961, | ||
147 | .ata_2_mcu_addr = 1473, | ||
148 | .mcu_2_ata_addr = 1392, | ||
149 | .app_2_per_addr = 1033, | ||
150 | .app_2_mcu_addr = 683, | ||
151 | .shp_2_per_addr = 1251, | ||
152 | .shp_2_mcu_addr = 892, | ||
153 | }; | ||
154 | #endif | ||
155 | |||
79 | static int __init imxXX_add_imx_dma(void) | 156 | static int __init imxXX_add_imx_dma(void) |
80 | { | 157 | { |
81 | struct platform_device *ret; | 158 | struct platform_device *ret; |
@@ -86,30 +163,42 @@ static int __init imxXX_add_imx_dma(void) | |||
86 | else | 163 | else |
87 | #endif | 164 | #endif |
88 | 165 | ||
89 | #if defined(CONFIG_ARCH_MX25) | 166 | #if defined(CONFIG_SOC_IMX25) |
90 | if (cpu_is_mx25()) | 167 | if (cpu_is_mx25()) { |
168 | imx25_imx_sdma_data.pdata.script_addrs = &addr_imx25_to1; | ||
91 | ret = imx_add_imx_sdma(&imx25_imx_sdma_data); | 169 | ret = imx_add_imx_sdma(&imx25_imx_sdma_data); |
92 | else | 170 | } else |
93 | #endif | 171 | #endif |
94 | 172 | ||
95 | #if defined(CONFIG_ARCH_MX31) | 173 | #if defined(CONFIG_SOC_IMX31) |
96 | if (cpu_is_mx31()) { | 174 | if (cpu_is_mx31()) { |
97 | imx31_imx_sdma_data.pdata.to_version = mx31_revision() >> 4; | 175 | int to_version = mx31_revision() >> 4; |
176 | imx31_imx_sdma_data.pdata.to_version = to_version; | ||
177 | if (to_version == 1) | ||
178 | imx31_imx_sdma_data.pdata.script_addrs = &addr_imx31_to1; | ||
179 | else | ||
180 | imx31_imx_sdma_data.pdata.script_addrs = &addr_imx31_to2; | ||
98 | ret = imx_add_imx_sdma(&imx31_imx_sdma_data); | 181 | ret = imx_add_imx_sdma(&imx31_imx_sdma_data); |
99 | } else | 182 | } else |
100 | #endif | 183 | #endif |
101 | 184 | ||
102 | #if defined(CONFIG_ARCH_MX35) | 185 | #if defined(CONFIG_SOC_IMX35) |
103 | if (cpu_is_mx35()) { | 186 | if (cpu_is_mx35()) { |
104 | imx35_imx_sdma_data.pdata.to_version = mx35_revision() >> 4; | 187 | int to_version = mx35_revision() >> 4; |
188 | imx35_imx_sdma_data.pdata.to_version = to_version; | ||
189 | if (to_version == 1) | ||
190 | imx35_imx_sdma_data.pdata.script_addrs = &addr_imx35_to1; | ||
191 | else | ||
192 | imx35_imx_sdma_data.pdata.script_addrs = &addr_imx35_to2; | ||
105 | ret = imx_add_imx_sdma(&imx35_imx_sdma_data); | 193 | ret = imx_add_imx_sdma(&imx35_imx_sdma_data); |
106 | } else | 194 | } else |
107 | #endif | 195 | #endif |
108 | 196 | ||
109 | #if defined(CONFIG_ARCH_MX51) | 197 | #if defined(CONFIG_ARCH_MX51) |
110 | if (cpu_is_mx51()) | 198 | if (cpu_is_mx51()) { |
199 | imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51_to1; | ||
111 | ret = imx_add_imx_sdma(&imx51_imx_sdma_data); | 200 | ret = imx_add_imx_sdma(&imx51_imx_sdma_data); |
112 | else | 201 | } else |
113 | #endif | 202 | #endif |
114 | ret = ERR_PTR(-ENODEV); | 203 | ret = ERR_PTR(-ENODEV); |
115 | 204 | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/plat-mxc/devices/platform-imx-fb.c new file mode 100644 index 000000000000..6100a7d824dd --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-fb.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_imx_fb_data_entry_single(soc, _size) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _LCDC_BASE_ADDR, \ | ||
15 | .iosize = _size, \ | ||
16 | .irq = soc ## _INT_LCDC, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX21 | ||
20 | const struct imx_imx_fb_data imx21_imx_fb_data __initconst = | ||
21 | imx_imx_fb_data_entry_single(MX21, SZ_4K); | ||
22 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX25 | ||
25 | const struct imx_imx_fb_data imx25_imx_fb_data __initconst = | ||
26 | imx_imx_fb_data_entry_single(MX25, SZ_16K); | ||
27 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
28 | |||
29 | #ifdef CONFIG_SOC_IMX27 | ||
30 | const struct imx_imx_fb_data imx27_imx_fb_data __initconst = | ||
31 | imx_imx_fb_data_entry_single(MX27, SZ_4K); | ||
32 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
33 | |||
34 | struct platform_device *__init imx_add_imx_fb( | ||
35 | const struct imx_imx_fb_data *data, | ||
36 | const struct imx_fb_platform_data *pdata) | ||
37 | { | ||
38 | struct resource res[] = { | ||
39 | { | ||
40 | .start = data->iobase, | ||
41 | .end = data->iobase + data->iosize - 1, | ||
42 | .flags = IORESOURCE_MEM, | ||
43 | }, { | ||
44 | .start = data->irq, | ||
45 | .end = data->irq, | ||
46 | .flags = IORESOURCE_IRQ, | ||
47 | }, | ||
48 | }; | ||
49 | return imx_add_platform_device_dmamask("imx-fb", 0, | ||
50 | res, ARRAY_SIZE(res), | ||
51 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
52 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c index 679588453aad..72ba880c75af 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c +++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c | |||
@@ -30,7 +30,7 @@ const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst = | |||
30 | imx_imx_i2c_data_entry_single(MX21, 0, , SZ_4K); | 30 | imx_imx_i2c_data_entry_single(MX21, 0, , SZ_4K); |
31 | #endif /* ifdef CONFIG_SOC_IMX21 */ | 31 | #endif /* ifdef CONFIG_SOC_IMX21 */ |
32 | 32 | ||
33 | #ifdef CONFIG_ARCH_MX25 | 33 | #ifdef CONFIG_SOC_IMX25 |
34 | const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = { | 34 | const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = { |
35 | #define imx25_imx_i2c_data_entry(_id, _hwid) \ | 35 | #define imx25_imx_i2c_data_entry(_id, _hwid) \ |
36 | imx_imx_i2c_data_entry(MX25, _id, _hwid, SZ_16K) | 36 | imx_imx_i2c_data_entry(MX25, _id, _hwid, SZ_16K) |
@@ -38,7 +38,7 @@ const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = { | |||
38 | imx25_imx_i2c_data_entry(1, 2), | 38 | imx25_imx_i2c_data_entry(1, 2), |
39 | imx25_imx_i2c_data_entry(2, 3), | 39 | imx25_imx_i2c_data_entry(2, 3), |
40 | }; | 40 | }; |
41 | #endif /* ifdef CONFIG_ARCH_MX25 */ | 41 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
42 | 42 | ||
43 | #ifdef CONFIG_SOC_IMX27 | 43 | #ifdef CONFIG_SOC_IMX27 |
44 | const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = { | 44 | const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = { |
@@ -49,7 +49,7 @@ const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = { | |||
49 | }; | 49 | }; |
50 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 50 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
51 | 51 | ||
52 | #ifdef CONFIG_ARCH_MX31 | 52 | #ifdef CONFIG_SOC_IMX31 |
53 | const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = { | 53 | const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = { |
54 | #define imx31_imx_i2c_data_entry(_id, _hwid) \ | 54 | #define imx31_imx_i2c_data_entry(_id, _hwid) \ |
55 | imx_imx_i2c_data_entry(MX31, _id, _hwid, SZ_4K) | 55 | imx_imx_i2c_data_entry(MX31, _id, _hwid, SZ_4K) |
@@ -57,9 +57,9 @@ const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = { | |||
57 | imx31_imx_i2c_data_entry(1, 2), | 57 | imx31_imx_i2c_data_entry(1, 2), |
58 | imx31_imx_i2c_data_entry(2, 3), | 58 | imx31_imx_i2c_data_entry(2, 3), |
59 | }; | 59 | }; |
60 | #endif /* ifdef CONFIG_ARCH_MX31 */ | 60 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
61 | 61 | ||
62 | #ifdef CONFIG_ARCH_MX35 | 62 | #ifdef CONFIG_SOC_IMX35 |
63 | const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = { | 63 | const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = { |
64 | #define imx35_imx_i2c_data_entry(_id, _hwid) \ | 64 | #define imx35_imx_i2c_data_entry(_id, _hwid) \ |
65 | imx_imx_i2c_data_entry(MX35, _id, _hwid, SZ_4K) | 65 | imx_imx_i2c_data_entry(MX35, _id, _hwid, SZ_4K) |
@@ -67,16 +67,16 @@ const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = { | |||
67 | imx35_imx_i2c_data_entry(1, 2), | 67 | imx35_imx_i2c_data_entry(1, 2), |
68 | imx35_imx_i2c_data_entry(2, 3), | 68 | imx35_imx_i2c_data_entry(2, 3), |
69 | }; | 69 | }; |
70 | #endif /* ifdef CONFIG_ARCH_MX35 */ | 70 | #endif /* ifdef CONFIG_SOC_IMX35 */ |
71 | 71 | ||
72 | #ifdef CONFIG_ARCH_MX51 | 72 | #ifdef CONFIG_SOC_IMX51 |
73 | const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = { | 73 | const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = { |
74 | #define imx51_imx_i2c_data_entry(_id, _hwid) \ | 74 | #define imx51_imx_i2c_data_entry(_id, _hwid) \ |
75 | imx_imx_i2c_data_entry(MX51, _id, _hwid, SZ_4K) | 75 | imx_imx_i2c_data_entry(MX51, _id, _hwid, SZ_4K) |
76 | imx51_imx_i2c_data_entry(0, 1), | 76 | imx51_imx_i2c_data_entry(0, 1), |
77 | imx51_imx_i2c_data_entry(1, 2), | 77 | imx51_imx_i2c_data_entry(1, 2), |
78 | }; | 78 | }; |
79 | #endif /* ifdef CONFIG_ARCH_MX51 */ | 79 | #endif /* ifdef CONFIG_SOC_IMX51 */ |
80 | 80 | ||
81 | struct platform_device *__init imx_add_imx_i2c( | 81 | struct platform_device *__init imx_add_imx_i2c( |
82 | const struct imx_imx_i2c_data *data, | 82 | const struct imx_imx_i2c_data *data, |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-keypad.c b/arch/arm/plat-mxc/devices/platform-imx-keypad.c new file mode 100644 index 000000000000..40238f0b8643 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-keypad.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_imx_keypad_data_entry_single(soc, _size) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _KPP_BASE_ADDR, \ | ||
15 | .iosize = _size, \ | ||
16 | .irq = soc ## _INT_KPP, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX21 | ||
20 | const struct imx_imx_keypad_data imx21_imx_keypad_data __initconst = | ||
21 | imx_imx_keypad_data_entry_single(MX21, SZ_16); | ||
22 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX25 | ||
25 | const struct imx_imx_keypad_data imx25_imx_keypad_data __initconst = | ||
26 | imx_imx_keypad_data_entry_single(MX25, SZ_16K); | ||
27 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
28 | |||
29 | #ifdef CONFIG_SOC_IMX27 | ||
30 | const struct imx_imx_keypad_data imx27_imx_keypad_data __initconst = | ||
31 | imx_imx_keypad_data_entry_single(MX27, SZ_16); | ||
32 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
33 | |||
34 | #ifdef CONFIG_SOC_IMX31 | ||
35 | const struct imx_imx_keypad_data imx31_imx_keypad_data __initconst = | ||
36 | imx_imx_keypad_data_entry_single(MX31, SZ_16); | ||
37 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
38 | |||
39 | #ifdef CONFIG_SOC_IMX35 | ||
40 | const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst = | ||
41 | imx_imx_keypad_data_entry_single(MX35, SZ_16); | ||
42 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
43 | |||
44 | struct platform_device *__init imx_add_imx_keypad( | ||
45 | const struct imx_imx_keypad_data *data, | ||
46 | const struct matrix_keymap_data *pdata) | ||
47 | { | ||
48 | struct resource res[] = { | ||
49 | { | ||
50 | .start = data->iobase, | ||
51 | .end = data->iobase + data->iosize - 1, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, { | ||
54 | .start = data->irq, | ||
55 | .end = data->irq, | ||
56 | .flags = IORESOURCE_IRQ, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | return imx_add_platform_device("imx-keypad", -1, | ||
61 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
62 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx-ssi.c b/arch/arm/plat-mxc/devices/platform-imx-ssi.c index 38a7a0b8f2f1..2569c8d8a2ef 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-ssi.c +++ b/arch/arm/plat-mxc/devices/platform-imx-ssi.c | |||
@@ -30,14 +30,14 @@ const struct imx_imx_ssi_data imx21_imx_ssi_data[] __initconst = { | |||
30 | }; | 30 | }; |
31 | #endif /* ifdef CONFIG_SOC_IMX21 */ | 31 | #endif /* ifdef CONFIG_SOC_IMX21 */ |
32 | 32 | ||
33 | #ifdef CONFIG_ARCH_MX25 | 33 | #ifdef CONFIG_SOC_IMX25 |
34 | const struct imx_imx_ssi_data imx25_imx_ssi_data[] __initconst = { | 34 | const struct imx_imx_ssi_data imx25_imx_ssi_data[] __initconst = { |
35 | #define imx25_imx_ssi_data_entry(_id, _hwid) \ | 35 | #define imx25_imx_ssi_data_entry(_id, _hwid) \ |
36 | imx_imx_ssi_data_entry(MX25, _id, _hwid, SZ_4K) | 36 | imx_imx_ssi_data_entry(MX25, _id, _hwid, SZ_4K) |
37 | imx25_imx_ssi_data_entry(0, 1), | 37 | imx25_imx_ssi_data_entry(0, 1), |
38 | imx25_imx_ssi_data_entry(1, 2), | 38 | imx25_imx_ssi_data_entry(1, 2), |
39 | }; | 39 | }; |
40 | #endif /* ifdef CONFIG_ARCH_MX25 */ | 40 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
41 | 41 | ||
42 | #ifdef CONFIG_SOC_IMX27 | 42 | #ifdef CONFIG_SOC_IMX27 |
43 | const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst = { | 43 | const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst = { |
@@ -48,32 +48,33 @@ const struct imx_imx_ssi_data imx27_imx_ssi_data[] __initconst = { | |||
48 | }; | 48 | }; |
49 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 49 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
50 | 50 | ||
51 | #ifdef CONFIG_ARCH_MX31 | 51 | #ifdef CONFIG_SOC_IMX31 |
52 | const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst = { | 52 | const struct imx_imx_ssi_data imx31_imx_ssi_data[] __initconst = { |
53 | #define imx31_imx_ssi_data_entry(_id, _hwid) \ | 53 | #define imx31_imx_ssi_data_entry(_id, _hwid) \ |
54 | imx_imx_ssi_data_entry(MX31, _id, _hwid, SZ_4K) | 54 | imx_imx_ssi_data_entry(MX31, _id, _hwid, SZ_4K) |
55 | imx31_imx_ssi_data_entry(0, 1), | 55 | imx31_imx_ssi_data_entry(0, 1), |
56 | imx31_imx_ssi_data_entry(1, 2), | 56 | imx31_imx_ssi_data_entry(1, 2), |
57 | }; | 57 | }; |
58 | #endif /* ifdef CONFIG_ARCH_MX31 */ | 58 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
59 | 59 | ||
60 | #ifdef CONFIG_ARCH_MX35 | 60 | #ifdef CONFIG_SOC_IMX35 |
61 | const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst = { | 61 | const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst = { |
62 | #define imx35_imx_ssi_data_entry(_id, _hwid) \ | 62 | #define imx35_imx_ssi_data_entry(_id, _hwid) \ |
63 | imx_imx_ssi_data_entry(MX35, _id, _hwid, SZ_4K) | 63 | imx_imx_ssi_data_entry(MX35, _id, _hwid, SZ_4K) |
64 | imx35_imx_ssi_data_entry(0, 1), | 64 | imx35_imx_ssi_data_entry(0, 1), |
65 | imx35_imx_ssi_data_entry(1, 2), | 65 | imx35_imx_ssi_data_entry(1, 2), |
66 | }; | 66 | }; |
67 | #endif /* ifdef CONFIG_ARCH_MX35 */ | 67 | #endif /* ifdef CONFIG_SOC_IMX35 */ |
68 | 68 | ||
69 | #ifdef CONFIG_ARCH_MX51 | 69 | #ifdef CONFIG_SOC_IMX51 |
70 | const struct imx_imx_ssi_data imx51_imx_ssi_data[] __initconst = { | 70 | const struct imx_imx_ssi_data imx51_imx_ssi_data[] __initconst = { |
71 | #define imx51_imx_ssi_data_entry(_id, _hwid) \ | 71 | #define imx51_imx_ssi_data_entry(_id, _hwid) \ |
72 | imx_imx_ssi_data_entry(MX51, _id, _hwid, SZ_4K) | 72 | imx_imx_ssi_data_entry(MX51, _id, _hwid, SZ_4K) |
73 | imx51_imx_ssi_data_entry(0, 1), | 73 | imx51_imx_ssi_data_entry(0, 1), |
74 | imx51_imx_ssi_data_entry(1, 2), | 74 | imx51_imx_ssi_data_entry(1, 2), |
75 | imx51_imx_ssi_data_entry(2, 3), | ||
75 | }; | 76 | }; |
76 | #endif /* ifdef CONFIG_ARCH_MX51 */ | 77 | #endif /* ifdef CONFIG_SOC_IMX51 */ |
77 | 78 | ||
78 | struct platform_device *__init imx_add_imx_ssi( | 79 | struct platform_device *__init imx_add_imx_ssi( |
79 | const struct imx_imx_ssi_data *data, | 80 | const struct imx_imx_ssi_data *data, |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c index 2039640adf27..3c854c2cc6dd 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-uart.c +++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c | |||
@@ -47,7 +47,7 @@ const struct imx_imx_uart_1irq_data imx21_imx_uart_data[] __initconst = { | |||
47 | }; | 47 | }; |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #ifdef CONFIG_ARCH_MX25 | 50 | #ifdef CONFIG_SOC_IMX25 |
51 | const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst = { | 51 | const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst = { |
52 | #define imx25_imx_uart_data_entry(_id, _hwid) \ | 52 | #define imx25_imx_uart_data_entry(_id, _hwid) \ |
53 | imx_imx_uart_1irq_data_entry(MX25, _id, _hwid, SZ_16K) | 53 | imx_imx_uart_1irq_data_entry(MX25, _id, _hwid, SZ_16K) |
@@ -57,7 +57,7 @@ const struct imx_imx_uart_1irq_data imx25_imx_uart_data[] __initconst = { | |||
57 | imx25_imx_uart_data_entry(3, 4), | 57 | imx25_imx_uart_data_entry(3, 4), |
58 | imx25_imx_uart_data_entry(4, 5), | 58 | imx25_imx_uart_data_entry(4, 5), |
59 | }; | 59 | }; |
60 | #endif /* ifdef CONFIG_ARCH_MX25 */ | 60 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
61 | 61 | ||
62 | #ifdef CONFIG_SOC_IMX27 | 62 | #ifdef CONFIG_SOC_IMX27 |
63 | const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst = { | 63 | const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst = { |
@@ -72,7 +72,7 @@ const struct imx_imx_uart_1irq_data imx27_imx_uart_data[] __initconst = { | |||
72 | }; | 72 | }; |
73 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 73 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
74 | 74 | ||
75 | #ifdef CONFIG_ARCH_MX31 | 75 | #ifdef CONFIG_SOC_IMX31 |
76 | const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = { | 76 | const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = { |
77 | #define imx31_imx_uart_data_entry(_id, _hwid) \ | 77 | #define imx31_imx_uart_data_entry(_id, _hwid) \ |
78 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_4K) | 78 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_4K) |
@@ -82,9 +82,9 @@ const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = { | |||
82 | imx31_imx_uart_data_entry(3, 4), | 82 | imx31_imx_uart_data_entry(3, 4), |
83 | imx31_imx_uart_data_entry(4, 5), | 83 | imx31_imx_uart_data_entry(4, 5), |
84 | }; | 84 | }; |
85 | #endif /* ifdef CONFIG_ARCH_MX31 */ | 85 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
86 | 86 | ||
87 | #ifdef CONFIG_ARCH_MX35 | 87 | #ifdef CONFIG_SOC_IMX35 |
88 | const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { | 88 | const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { |
89 | #define imx35_imx_uart_data_entry(_id, _hwid) \ | 89 | #define imx35_imx_uart_data_entry(_id, _hwid) \ |
90 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_16K) | 90 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_16K) |
@@ -92,9 +92,21 @@ const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { | |||
92 | imx35_imx_uart_data_entry(1, 2), | 92 | imx35_imx_uart_data_entry(1, 2), |
93 | imx35_imx_uart_data_entry(2, 3), | 93 | imx35_imx_uart_data_entry(2, 3), |
94 | }; | 94 | }; |
95 | #endif /* ifdef CONFIG_ARCH_MX35 */ | 95 | #endif /* ifdef CONFIG_SOC_IMX35 */ |
96 | 96 | ||
97 | #ifdef CONFIG_ARCH_MX51 | 97 | #ifdef CONFIG_SOC_IMX50 |
98 | const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst = { | ||
99 | #define imx50_imx_uart_data_entry(_id, _hwid) \ | ||
100 | imx_imx_uart_1irq_data_entry(MX50, _id, _hwid, SZ_4K) | ||
101 | imx50_imx_uart_data_entry(0, 1), | ||
102 | imx50_imx_uart_data_entry(1, 2), | ||
103 | imx50_imx_uart_data_entry(2, 3), | ||
104 | imx50_imx_uart_data_entry(3, 4), | ||
105 | imx50_imx_uart_data_entry(4, 5), | ||
106 | }; | ||
107 | #endif /* ifdef CONFIG_SOC_IMX50 */ | ||
108 | |||
109 | #ifdef CONFIG_SOC_IMX51 | ||
98 | const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = { | 110 | const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = { |
99 | #define imx51_imx_uart_data_entry(_id, _hwid) \ | 111 | #define imx51_imx_uart_data_entry(_id, _hwid) \ |
100 | imx_imx_uart_1irq_data_entry(MX51, _id, _hwid, SZ_4K) | 112 | imx_imx_uart_1irq_data_entry(MX51, _id, _hwid, SZ_4K) |
@@ -102,7 +114,17 @@ const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = { | |||
102 | imx51_imx_uart_data_entry(1, 2), | 114 | imx51_imx_uart_data_entry(1, 2), |
103 | imx51_imx_uart_data_entry(2, 3), | 115 | imx51_imx_uart_data_entry(2, 3), |
104 | }; | 116 | }; |
105 | #endif /* ifdef CONFIG_ARCH_MX51 */ | 117 | #endif /* ifdef CONFIG_SOC_IMX51 */ |
118 | |||
119 | #ifdef CONFIG_SOC_IMX53 | ||
120 | const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst = { | ||
121 | #define imx53_imx_uart_data_entry(_id, _hwid) \ | ||
122 | imx_imx_uart_1irq_data_entry(MX53, _id, _hwid, SZ_4K) | ||
123 | imx53_imx_uart_data_entry(0, 1), | ||
124 | imx53_imx_uart_data_entry(1, 2), | ||
125 | imx53_imx_uart_data_entry(2, 3), | ||
126 | }; | ||
127 | #endif /* ifdef CONFIG_SOC_IMX53 */ | ||
106 | 128 | ||
107 | struct platform_device *__init imx_add_imx_uart_3irq( | 129 | struct platform_device *__init imx_add_imx_uart_3irq( |
108 | const struct imx_imx_uart_3irq_data *data, | 130 | const struct imx_imx_uart_3irq_data *data, |
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c new file mode 100644 index 000000000000..e0aec61177f4 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <asm/sizes.h> | ||
10 | #include <mach/hardware.h> | ||
11 | #include <mach/devices-common.h> | ||
12 | |||
13 | #define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \ | ||
14 | { \ | ||
15 | .id = _id, \ | ||
16 | .iobase = soc ## _WDOG ## _hwid ## _BASE_ADDR, \ | ||
17 | .iosize = _size, \ | ||
18 | } | ||
19 | #define imx_imx2_wdt_data_entry(soc, _id, _hwid, _size) \ | ||
20 | [_id] = imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) | ||
21 | |||
22 | #ifdef CONFIG_SOC_IMX21 | ||
23 | const struct imx_imx2_wdt_data imx21_imx2_wdt_data __initconst = | ||
24 | imx_imx2_wdt_data_entry_single(MX21, 0, , SZ_4K); | ||
25 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
26 | |||
27 | #ifdef CONFIG_SOC_IMX25 | ||
28 | const struct imx_imx2_wdt_data imx25_imx2_wdt_data __initconst = | ||
29 | imx_imx2_wdt_data_entry_single(MX25, 0, , SZ_16K); | ||
30 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
31 | |||
32 | #ifdef CONFIG_SOC_IMX27 | ||
33 | const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst = | ||
34 | imx_imx2_wdt_data_entry_single(MX27, 0, , SZ_4K); | ||
35 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
36 | |||
37 | #ifdef CONFIG_SOC_IMX31 | ||
38 | const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst = | ||
39 | imx_imx2_wdt_data_entry_single(MX31, 0, , SZ_16K); | ||
40 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
41 | |||
42 | #ifdef CONFIG_SOC_IMX35 | ||
43 | const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst = | ||
44 | imx_imx2_wdt_data_entry_single(MX35, 0, , SZ_16K); | ||
45 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
46 | |||
47 | #ifdef CONFIG_SOC_IMX51 | ||
48 | const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst = { | ||
49 | #define imx51_imx2_wdt_data_entry(_id, _hwid) \ | ||
50 | imx_imx2_wdt_data_entry(MX51, _id, _hwid, SZ_16K) | ||
51 | imx51_imx2_wdt_data_entry(0, 1), | ||
52 | imx51_imx2_wdt_data_entry(1, 2), | ||
53 | }; | ||
54 | #endif /* ifdef CONFIG_SOC_IMX51 */ | ||
55 | |||
56 | struct platform_device *__init imx_add_imx2_wdt( | ||
57 | const struct imx_imx2_wdt_data *data) | ||
58 | { | ||
59 | struct resource res[] = { | ||
60 | { | ||
61 | .start = data->iobase, | ||
62 | .end = data->iobase + data->iosize - 1, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | }, | ||
65 | }; | ||
66 | return imx_add_platform_device("imx2-wdt", data->id, | ||
67 | res, ARRAY_SIZE(res), NULL, 0); | ||
68 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c b/arch/arm/plat-mxc/devices/platform-imx21-hcd.c new file mode 100644 index 000000000000..5770a42f33bf --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx21-hcd.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_imx21_hcd_data_entry_single(soc) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _USBOTG_BASE_ADDR, \ | ||
15 | .irq = soc ## _INT_USBHOST, \ | ||
16 | } | ||
17 | |||
18 | #ifdef CONFIG_SOC_IMX21 | ||
19 | const struct imx_imx21_hcd_data imx21_imx21_hcd_data __initconst = | ||
20 | imx_imx21_hcd_data_entry_single(MX21); | ||
21 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
22 | |||
23 | struct platform_device *__init imx_add_imx21_hcd( | ||
24 | const struct imx_imx21_hcd_data *data, | ||
25 | const struct mx21_usbh_platform_data *pdata) | ||
26 | { | ||
27 | struct resource res[] = { | ||
28 | { | ||
29 | .start = data->iobase, | ||
30 | .end = data->iobase + SZ_8K - 1, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }, { | ||
33 | .start = data->irq, | ||
34 | .end = data->irq, | ||
35 | .flags = IORESOURCE_IRQ, | ||
36 | }, | ||
37 | }; | ||
38 | return imx_add_platform_device_dmamask("imx21-hcd", 0, | ||
39 | res, ARRAY_SIZE(res), | ||
40 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
41 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imx_udc.c b/arch/arm/plat-mxc/devices/platform-imx_udc.c new file mode 100644 index 000000000000..6fd675dfce14 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx_udc.c | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_imx_udc_data_entry_single(soc, _size) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _USBD_BASE_ADDR, \ | ||
15 | .iosize = _size, \ | ||
16 | .irq0 = soc ## _INT_USBD0, \ | ||
17 | .irq1 = soc ## _INT_USBD1, \ | ||
18 | .irq2 = soc ## _INT_USBD2, \ | ||
19 | .irq3 = soc ## _INT_USBD3, \ | ||
20 | .irq4 = soc ## _INT_USBD4, \ | ||
21 | .irq5 = soc ## _INT_USBD5, \ | ||
22 | .irq6 = soc ## _INT_USBD6, \ | ||
23 | } | ||
24 | |||
25 | #define imx_imx_udc_data_entry(soc, _size) \ | ||
26 | [_id] = imx_imx_udc_data_entry_single(soc, _size) | ||
27 | |||
28 | #ifdef CONFIG_SOC_IMX1 | ||
29 | const struct imx_imx_udc_data imx1_imx_udc_data __initconst = | ||
30 | imx_imx_udc_data_entry_single(MX1, SZ_4K); | ||
31 | #endif /* ifdef CONFIG_SOC_IMX1 */ | ||
32 | |||
33 | struct platform_device *__init imx_add_imx_udc( | ||
34 | const struct imx_imx_udc_data *data, | ||
35 | const struct imxusb_platform_data *pdata) | ||
36 | { | ||
37 | struct resource res[] = { | ||
38 | { | ||
39 | .start = data->iobase, | ||
40 | .end = data->iobase + data->iosize - 1, | ||
41 | .flags = IORESOURCE_MEM, | ||
42 | }, { | ||
43 | .start = data->irq0, | ||
44 | .end = data->irq0, | ||
45 | .flags = IORESOURCE_IRQ, | ||
46 | }, { | ||
47 | .start = data->irq1, | ||
48 | .end = data->irq1, | ||
49 | .flags = IORESOURCE_IRQ, | ||
50 | }, { | ||
51 | .start = data->irq2, | ||
52 | .end = data->irq2, | ||
53 | .flags = IORESOURCE_IRQ, | ||
54 | }, { | ||
55 | .start = data->irq3, | ||
56 | .end = data->irq3, | ||
57 | .flags = IORESOURCE_IRQ, | ||
58 | }, { | ||
59 | .start = data->irq4, | ||
60 | .end = data->irq4, | ||
61 | .flags = IORESOURCE_IRQ, | ||
62 | }, { | ||
63 | .start = data->irq5, | ||
64 | .end = data->irq5, | ||
65 | .flags = IORESOURCE_IRQ, | ||
66 | }, { | ||
67 | .start = data->irq6, | ||
68 | .end = data->irq6, | ||
69 | .flags = IORESOURCE_IRQ, | ||
70 | }, | ||
71 | }; | ||
72 | |||
73 | return imx_add_platform_device("imx_udc", 0, | ||
74 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
75 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c new file mode 100644 index 000000000000..10653cc8d1fa --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <asm/sizes.h> | ||
10 | #include <mach/hardware.h> | ||
11 | #include <mach/devices-common.h> | ||
12 | |||
13 | #define imx_imxdi_rtc_data_entry_single(soc) \ | ||
14 | { \ | ||
15 | .iobase = soc ## _DRYICE_BASE_ADDR, \ | ||
16 | .irq = soc ## _INT_DRYICE, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX25 | ||
20 | const struct imx_imxdi_rtc_data imx25_imxdi_rtc_data __initconst = | ||
21 | imx_imxdi_rtc_data_entry_single(MX25); | ||
22 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
23 | |||
24 | struct platform_device *__init imx_add_imxdi_rtc( | ||
25 | const struct imx_imxdi_rtc_data *data) | ||
26 | { | ||
27 | struct resource res[] = { | ||
28 | { | ||
29 | .start = data->iobase, | ||
30 | .end = data->iobase + SZ_16K, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }, { | ||
33 | .start = data->irq, | ||
34 | .end = data->irq, | ||
35 | .flags = IORESOURCE_IRQ, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | return imx_add_platform_device("imxdi_rtc", 0, | ||
40 | res, ARRAY_SIZE(res), NULL, 0); | ||
41 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mx1-camera.c b/arch/arm/plat-mxc/devices/platform-mx1-camera.c new file mode 100644 index 000000000000..edcc581a30a9 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mx1-camera.c | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mx1_camera_data_entry_single(soc, _size) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _CSI ## _BASE_ADDR, \ | ||
15 | .iosize = _size, \ | ||
16 | .irq = soc ## _INT_CSI, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX1 | ||
20 | const struct imx_mx1_camera_data imx1_mx1_camera_data __initconst = | ||
21 | imx_mx1_camera_data_entry_single(MX1, 10); | ||
22 | #endif /* ifdef CONFIG_SOC_IMX1 */ | ||
23 | |||
24 | struct platform_device *__init imx_add_mx1_camera( | ||
25 | const struct imx_mx1_camera_data *data, | ||
26 | const struct mx1_camera_pdata *pdata) | ||
27 | { | ||
28 | struct resource res[] = { | ||
29 | { | ||
30 | .start = data->iobase, | ||
31 | .end = data->iobase + data->iosize - 1, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, { | ||
34 | .start = data->irq, | ||
35 | .end = data->irq, | ||
36 | .flags = IORESOURCE_IRQ, | ||
37 | }, | ||
38 | }; | ||
39 | return imx_add_platform_device_dmamask("mx1-camera", 0, | ||
40 | res, ARRAY_SIZE(res), | ||
41 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
42 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/plat-mxc/devices/platform-mx2-camera.c new file mode 100644 index 000000000000..b3f4828dc447 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mx2-camera.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mx2_camera_data_entry_single(soc) \ | ||
13 | { \ | ||
14 | .iobasecsi = soc ## _CSI_BASE_ADDR, \ | ||
15 | .iosizecsi = SZ_4K, \ | ||
16 | .irqcsi = soc ## _INT_CSI, \ | ||
17 | } | ||
18 | #define imx_mx2_camera_data_entry_single_emma(soc) \ | ||
19 | { \ | ||
20 | .iobasecsi = soc ## _CSI_BASE_ADDR, \ | ||
21 | .iosizecsi = SZ_32, \ | ||
22 | .irqcsi = soc ## _INT_CSI, \ | ||
23 | .iobaseemmaprp = soc ## _EMMAPRP_BASE_ADDR, \ | ||
24 | .iosizeemmaprp = SZ_32, \ | ||
25 | .irqemmaprp = soc ## _INT_EMMAPRP, \ | ||
26 | } | ||
27 | |||
28 | #ifdef CONFIG_SOC_IMX25 | ||
29 | const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst = | ||
30 | imx_mx2_camera_data_entry_single(MX25); | ||
31 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
32 | |||
33 | #ifdef CONFIG_SOC_IMX27 | ||
34 | const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst = | ||
35 | imx_mx2_camera_data_entry_single_emma(MX27); | ||
36 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
37 | |||
38 | struct platform_device *__init imx_add_mx2_camera( | ||
39 | const struct imx_mx2_camera_data *data, | ||
40 | const struct mx2_camera_platform_data *pdata) | ||
41 | { | ||
42 | struct resource res[] = { | ||
43 | { | ||
44 | .start = data->iobasecsi, | ||
45 | .end = data->iobasecsi + data->iosizecsi - 1, | ||
46 | .flags = IORESOURCE_MEM, | ||
47 | }, { | ||
48 | .start = data->irqcsi, | ||
49 | .end = data->irqcsi, | ||
50 | .flags = IORESOURCE_IRQ, | ||
51 | }, { | ||
52 | .start = data->iobaseemmaprp, | ||
53 | .end = data->iobaseemmaprp + data->iosizeemmaprp - 1, | ||
54 | .flags = IORESOURCE_MEM, | ||
55 | }, { | ||
56 | .start = data->irqemmaprp, | ||
57 | .end = data->irqemmaprp, | ||
58 | .flags = IORESOURCE_IRQ, | ||
59 | }, | ||
60 | }; | ||
61 | return imx_add_platform_device_dmamask("mx2-camera", 0, | ||
62 | res, data->iobaseemmaprp ? 4 : 2, | ||
63 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
64 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c new file mode 100644 index 000000000000..cc488f4b6204 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mxc_ehci_data_entry_single(soc, _id, hs) \ | ||
13 | { \ | ||
14 | .id = _id, \ | ||
15 | .iobase = soc ## _USB_ ## hs ## _BASE_ADDR, \ | ||
16 | .irq = soc ## _INT_USB_ ## hs, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX25 | ||
20 | const struct imx_mxc_ehci_data imx25_mxc_ehci_otg_data __initconst = | ||
21 | imx_mxc_ehci_data_entry_single(MX25, 0, OTG); | ||
22 | const struct imx_mxc_ehci_data imx25_mxc_ehci_hs_data __initconst = | ||
23 | imx_mxc_ehci_data_entry_single(MX25, 1, HS); | ||
24 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
25 | |||
26 | #ifdef CONFIG_SOC_IMX27 | ||
27 | const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst = | ||
28 | imx_mxc_ehci_data_entry_single(MX27, 0, OTG); | ||
29 | const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst = { | ||
30 | imx_mxc_ehci_data_entry_single(MX27, 1, HS1), | ||
31 | imx_mxc_ehci_data_entry_single(MX27, 2, HS2), | ||
32 | }; | ||
33 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
34 | |||
35 | #ifdef CONFIG_SOC_IMX31 | ||
36 | const struct imx_mxc_ehci_data imx31_mxc_ehci_otg_data __initconst = | ||
37 | imx_mxc_ehci_data_entry_single(MX31, 0, OTG); | ||
38 | const struct imx_mxc_ehci_data imx31_mxc_ehci_hs_data[] __initconst = { | ||
39 | imx_mxc_ehci_data_entry_single(MX31, 1, HS1), | ||
40 | imx_mxc_ehci_data_entry_single(MX31, 2, HS2), | ||
41 | }; | ||
42 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
43 | |||
44 | #ifdef CONFIG_SOC_IMX35 | ||
45 | const struct imx_mxc_ehci_data imx35_mxc_ehci_otg_data __initconst = | ||
46 | imx_mxc_ehci_data_entry_single(MX35, 0, OTG); | ||
47 | const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst = | ||
48 | imx_mxc_ehci_data_entry_single(MX35, 1, HS); | ||
49 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
50 | |||
51 | struct platform_device *__init imx_add_mxc_ehci( | ||
52 | const struct imx_mxc_ehci_data *data, | ||
53 | const struct mxc_usbh_platform_data *pdata) | ||
54 | { | ||
55 | struct resource res[] = { | ||
56 | { | ||
57 | .start = data->iobase, | ||
58 | .end = data->iobase + SZ_512 - 1, | ||
59 | .flags = IORESOURCE_MEM, | ||
60 | }, { | ||
61 | .start = data->irq, | ||
62 | .end = data->irq, | ||
63 | .flags = IORESOURCE_IRQ, | ||
64 | }, | ||
65 | }; | ||
66 | return imx_add_platform_device_dmamask("mxc-ehci", data->id, | ||
67 | res, ARRAY_SIZE(res), | ||
68 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
69 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c new file mode 100644 index 000000000000..90d762f6f93b --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) \ | ||
13 | { \ | ||
14 | .id = _id, \ | ||
15 | .iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \ | ||
16 | .iosize = _size, \ | ||
17 | .irq = soc ## _INT_SDHC ## _hwid, \ | ||
18 | .dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \ | ||
19 | } | ||
20 | #define imx_mxc_mmc_data_entry(soc, _id, _hwid, _size) \ | ||
21 | [_id] = imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX21 | ||
24 | const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = { | ||
25 | #define imx21_mxc_mmc_data_entry(_id, _hwid) \ | ||
26 | imx_mxc_mmc_data_entry(MX21, _id, _hwid, SZ_4K) | ||
27 | imx21_mxc_mmc_data_entry(0, 1), | ||
28 | imx21_mxc_mmc_data_entry(1, 2), | ||
29 | }; | ||
30 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
31 | |||
32 | #ifdef CONFIG_SOC_IMX27 | ||
33 | const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = { | ||
34 | #define imx27_mxc_mmc_data_entry(_id, _hwid) \ | ||
35 | imx_mxc_mmc_data_entry(MX27, _id, _hwid, SZ_4K) | ||
36 | imx27_mxc_mmc_data_entry(0, 1), | ||
37 | imx27_mxc_mmc_data_entry(1, 2), | ||
38 | }; | ||
39 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
40 | |||
41 | #ifdef CONFIG_SOC_IMX31 | ||
42 | const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = { | ||
43 | #define imx31_mxc_mmc_data_entry(_id, _hwid) \ | ||
44 | imx_mxc_mmc_data_entry(MX31, _id, _hwid, SZ_16K) | ||
45 | imx31_mxc_mmc_data_entry(0, 1), | ||
46 | imx31_mxc_mmc_data_entry(1, 2), | ||
47 | }; | ||
48 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
49 | |||
50 | struct platform_device *__init imx_add_mxc_mmc( | ||
51 | const struct imx_mxc_mmc_data *data, | ||
52 | const struct imxmmc_platform_data *pdata) | ||
53 | { | ||
54 | struct resource res[] = { | ||
55 | { | ||
56 | .start = data->iobase, | ||
57 | .end = data->iobase + SZ_4K - 1, | ||
58 | .flags = IORESOURCE_MEM, | ||
59 | }, { | ||
60 | .start = data->irq, | ||
61 | .end = data->irq, | ||
62 | .flags = IORESOURCE_IRQ, | ||
63 | }, { | ||
64 | .start = data->dmareq, | ||
65 | .end = data->dmareq, | ||
66 | .flags = IORESOURCE_DMA, | ||
67 | }, | ||
68 | }; | ||
69 | return imx_add_platform_device_dmamask("mxc-mmc", data->id, | ||
70 | res, ARRAY_SIZE(res), | ||
71 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
72 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/plat-mxc/devices/platform-mxc_nand.c index 3fdcc32e3d67..1568f39fba8b 100644 --- a/arch/arm/plat-mxc/devices/platform-mxc_nand.c +++ b/arch/arm/plat-mxc/devices/platform-mxc_nand.c | |||
@@ -31,27 +31,27 @@ const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst = | |||
31 | imx_mxc_nand_data_entry_single(MX21, SZ_4K); | 31 | imx_mxc_nand_data_entry_single(MX21, SZ_4K); |
32 | #endif /* ifdef CONFIG_SOC_IMX21 */ | 32 | #endif /* ifdef CONFIG_SOC_IMX21 */ |
33 | 33 | ||
34 | #ifdef CONFIG_ARCH_MX25 | 34 | #ifdef CONFIG_SOC_IMX25 |
35 | const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst = | 35 | const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst = |
36 | imx_mxc_nand_data_entry_single(MX25, SZ_8K); | 36 | imx_mxc_nand_data_entry_single(MX25, SZ_8K); |
37 | #endif /* ifdef CONFIG_ARCH_MX25 */ | 37 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
38 | 38 | ||
39 | #ifdef CONFIG_SOC_IMX27 | 39 | #ifdef CONFIG_SOC_IMX27 |
40 | const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst = | 40 | const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst = |
41 | imx_mxc_nand_data_entry_single(MX27, SZ_4K); | 41 | imx_mxc_nand_data_entry_single(MX27, SZ_4K); |
42 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 42 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
43 | 43 | ||
44 | #ifdef CONFIG_ARCH_MX31 | 44 | #ifdef CONFIG_SOC_IMX31 |
45 | const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst = | 45 | const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst = |
46 | imx_mxc_nand_data_entry_single(MX31, SZ_4K); | 46 | imx_mxc_nand_data_entry_single(MX31, SZ_4K); |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #ifdef CONFIG_ARCH_MX35 | 49 | #ifdef CONFIG_SOC_IMX35 |
50 | const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst = | 50 | const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst = |
51 | imx_mxc_nand_data_entry_single(MX35, SZ_8K); | 51 | imx_mxc_nand_data_entry_single(MX35, SZ_8K); |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #ifdef CONFIG_ARCH_MX51 | 54 | #ifdef CONFIG_SOC_IMX51 |
55 | const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst = | 55 | const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst = |
56 | imx_mxc_nandv3_data_entry_single(MX51, SZ_16K); | 56 | imx_mxc_nandv3_data_entry_single(MX51, SZ_16K); |
57 | #endif | 57 | #endif |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c new file mode 100644 index 000000000000..3d8ebdba38ee --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \ | ||
13 | { \ | ||
14 | .id = _id, \ | ||
15 | .iobase = soc ## _PWM ## _hwid ## _BASE_ADDR, \ | ||
16 | .iosize = _size, \ | ||
17 | .irq = soc ## _INT_PWM ## _hwid, \ | ||
18 | } | ||
19 | #define imx_mxc_pwm_data_entry(soc, _id, _hwid, _size) \ | ||
20 | [_id] = imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) | ||
21 | |||
22 | #ifdef CONFIG_SOC_IMX21 | ||
23 | const struct imx_mxc_pwm_data imx21_mxc_pwm_data __initconst = | ||
24 | imx_mxc_pwm_data_entry_single(MX21, 0, , SZ_4K); | ||
25 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
26 | |||
27 | #ifdef CONFIG_SOC_IMX25 | ||
28 | const struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst = { | ||
29 | #define imx25_mxc_pwm_data_entry(_id, _hwid) \ | ||
30 | imx_mxc_pwm_data_entry(MX25, _id, _hwid, SZ_16K) | ||
31 | imx25_mxc_pwm_data_entry(0, 1), | ||
32 | imx25_mxc_pwm_data_entry(1, 2), | ||
33 | imx25_mxc_pwm_data_entry(2, 3), | ||
34 | imx25_mxc_pwm_data_entry(3, 4), | ||
35 | }; | ||
36 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
37 | |||
38 | #ifdef CONFIG_SOC_IMX27 | ||
39 | const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst = | ||
40 | imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); | ||
41 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
42 | |||
43 | struct platform_device *__init imx_add_mxc_pwm( | ||
44 | const struct imx_mxc_pwm_data *data) | ||
45 | { | ||
46 | struct resource res[] = { | ||
47 | { | ||
48 | .start = data->iobase, | ||
49 | .end = data->iobase + data->iosize - 1, | ||
50 | .flags = IORESOURCE_MEM, | ||
51 | }, { | ||
52 | .start = data->irq, | ||
53 | .end = data->irq, | ||
54 | .flags = IORESOURCE_IRQ, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | return imx_add_platform_device("mxc_pwm", data->id, | ||
59 | res, ARRAY_SIZE(res), NULL, 0); | ||
60 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c new file mode 100644 index 000000000000..b4b7612b6e17 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc_rnga.c | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | struct imx_mxc_rnga_data { | ||
13 | resource_size_t iobase; | ||
14 | }; | ||
15 | |||
16 | #define imx_mxc_rnga_data_entry_single(soc) \ | ||
17 | { \ | ||
18 | .iobase = soc ## _RNGA_BASE_ADDR, \ | ||
19 | } | ||
20 | |||
21 | #ifdef CONFIG_SOC_IMX31 | ||
22 | static const struct imx_mxc_rnga_data imx31_mxc_rnga_data __initconst = | ||
23 | imx_mxc_rnga_data_entry_single(MX31); | ||
24 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
25 | |||
26 | static struct platform_device *__init imx_add_mxc_rnga( | ||
27 | const struct imx_mxc_rnga_data *data) | ||
28 | { | ||
29 | struct resource res[] = { | ||
30 | { | ||
31 | .start = data->iobase, | ||
32 | .end = data->iobase + SZ_16K - 1, | ||
33 | .flags = IORESOURCE_MEM, | ||
34 | }, | ||
35 | }; | ||
36 | return imx_add_platform_device("mxc_rnga", -1, | ||
37 | res, ARRAY_SIZE(res), NULL, 0); | ||
38 | } | ||
39 | |||
40 | static int __init imxXX_add_mxc_rnga(void) | ||
41 | { | ||
42 | struct platform_device *ret; | ||
43 | |||
44 | #if defined(CONFIG_SOC_IMX31) | ||
45 | if (cpu_is_mx31()) | ||
46 | ret = imx_add_mxc_rnga(&imx31_mxc_rnga_data); | ||
47 | else | ||
48 | #endif /* if defined(CONFIG_SOC_IMX31) */ | ||
49 | ret = ERR_PTR(-ENODEV); | ||
50 | |||
51 | if (IS_ERR(ret)) | ||
52 | return PTR_ERR(ret); | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | arch_initcall(imxXX_add_mxc_rnga); | ||
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_w1.c b/arch/arm/plat-mxc/devices/platform-mxc_w1.c new file mode 100644 index 000000000000..96fa5ea91fe8 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc_w1.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mxc_w1_data_entry_single(soc) \ | ||
13 | { \ | ||
14 | .iobase = soc ## _OWIRE_BASE_ADDR, \ | ||
15 | } | ||
16 | |||
17 | #ifdef CONFIG_SOC_IMX21 | ||
18 | const struct imx_mxc_w1_data imx21_mxc_w1_data __initconst = | ||
19 | imx_mxc_w1_data_entry_single(MX21); | ||
20 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
21 | |||
22 | #ifdef CONFIG_SOC_IMX27 | ||
23 | const struct imx_mxc_w1_data imx27_mxc_w1_data __initconst = | ||
24 | imx_mxc_w1_data_entry_single(MX27); | ||
25 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
26 | |||
27 | #ifdef CONFIG_SOC_IMX31 | ||
28 | const struct imx_mxc_w1_data imx31_mxc_w1_data __initconst = | ||
29 | imx_mxc_w1_data_entry_single(MX31); | ||
30 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
31 | |||
32 | #ifdef CONFIG_SOC_IMX35 | ||
33 | const struct imx_mxc_w1_data imx35_mxc_w1_data __initconst = | ||
34 | imx_mxc_w1_data_entry_single(MX35); | ||
35 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
36 | |||
37 | struct platform_device *__init imx_add_mxc_w1( | ||
38 | const struct imx_mxc_w1_data *data) | ||
39 | { | ||
40 | struct resource res[] = { | ||
41 | { | ||
42 | .start = data->iobase, | ||
43 | .end = data->iobase + SZ_4K - 1, | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | return imx_add_platform_device("mxc_w1", 0, | ||
49 | res, ARRAY_SIZE(res), NULL, 0); | ||
50 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c new file mode 100644 index 000000000000..b3525648a01d --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | #include <mach/esdhc.h> | ||
12 | |||
13 | #define imx_sdhci_esdhc_imx_data_entry_single(soc, _id, hwid) \ | ||
14 | { \ | ||
15 | .id = _id, \ | ||
16 | .iobase = soc ## _ESDHC ## hwid ## _BASE_ADDR, \ | ||
17 | .irq = soc ## _INT_ESDHC ## hwid, \ | ||
18 | } | ||
19 | |||
20 | #define imx_sdhci_esdhc_imx_data_entry(soc, id, hwid) \ | ||
21 | [id] = imx_sdhci_esdhc_imx_data_entry_single(soc, id, hwid) | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX25 | ||
24 | const struct imx_sdhci_esdhc_imx_data | ||
25 | imx25_sdhci_esdhc_imx_data[] __initconst = { | ||
26 | #define imx25_sdhci_esdhc_imx_data_entry(_id, _hwid) \ | ||
27 | imx_sdhci_esdhc_imx_data_entry(MX25, _id, _hwid) | ||
28 | imx25_sdhci_esdhc_imx_data_entry(0, 1), | ||
29 | imx25_sdhci_esdhc_imx_data_entry(1, 2), | ||
30 | }; | ||
31 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
32 | |||
33 | #ifdef CONFIG_SOC_IMX35 | ||
34 | const struct imx_sdhci_esdhc_imx_data | ||
35 | imx35_sdhci_esdhc_imx_data[] __initconst = { | ||
36 | #define imx35_sdhci_esdhc_imx_data_entry(_id, _hwid) \ | ||
37 | imx_sdhci_esdhc_imx_data_entry(MX35, _id, _hwid) | ||
38 | imx35_sdhci_esdhc_imx_data_entry(0, 1), | ||
39 | imx35_sdhci_esdhc_imx_data_entry(1, 2), | ||
40 | imx35_sdhci_esdhc_imx_data_entry(2, 3), | ||
41 | }; | ||
42 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
43 | |||
44 | #ifdef CONFIG_SOC_IMX51 | ||
45 | const struct imx_sdhci_esdhc_imx_data | ||
46 | imx51_sdhci_esdhc_imx_data[] __initconst = { | ||
47 | #define imx51_sdhci_esdhc_imx_data_entry(_id, _hwid) \ | ||
48 | imx_sdhci_esdhc_imx_data_entry(MX51, _id, _hwid) | ||
49 | imx51_sdhci_esdhc_imx_data_entry(0, 1), | ||
50 | imx51_sdhci_esdhc_imx_data_entry(1, 2), | ||
51 | imx51_sdhci_esdhc_imx_data_entry(2, 3), | ||
52 | imx51_sdhci_esdhc_imx_data_entry(3, 4), | ||
53 | }; | ||
54 | #endif /* ifdef CONFIG_SOC_IMX51 */ | ||
55 | |||
56 | struct platform_device *__init imx_add_sdhci_esdhc_imx( | ||
57 | const struct imx_sdhci_esdhc_imx_data *data, | ||
58 | const struct esdhc_platform_data *pdata) | ||
59 | { | ||
60 | struct resource res[] = { | ||
61 | { | ||
62 | .start = data->iobase, | ||
63 | .end = data->iobase + SZ_16K - 1, | ||
64 | .flags = IORESOURCE_MEM, | ||
65 | }, { | ||
66 | .start = data->irq, | ||
67 | .end = data->irq, | ||
68 | .flags = IORESOURCE_IRQ, | ||
69 | }, | ||
70 | }; | ||
71 | |||
72 | return imx_add_platform_device("sdhci-esdhc-imx", data->id, res, | ||
73 | ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
74 | } | ||
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c index 17f724c9452d..8ea49adcdfc1 100644 --- a/arch/arm/plat-mxc/devices/platform-spi_imx.c +++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c | |||
@@ -30,7 +30,7 @@ const struct imx_spi_imx_data imx21_cspi_data[] __initconst = { | |||
30 | }; | 30 | }; |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #ifdef CONFIG_ARCH_MX25 | 33 | #ifdef CONFIG_SOC_IMX25 |
34 | const struct imx_spi_imx_data imx25_cspi_data[] __initconst = { | 34 | const struct imx_spi_imx_data imx25_cspi_data[] __initconst = { |
35 | #define imx25_cspi_data_entry(_id, _hwid) \ | 35 | #define imx25_cspi_data_entry(_id, _hwid) \ |
36 | imx_spi_imx_data_entry(MX25, CSPI, "imx25-cspi", _id, _hwid, SZ_16K) | 36 | imx_spi_imx_data_entry(MX25, CSPI, "imx25-cspi", _id, _hwid, SZ_16K) |
@@ -38,7 +38,7 @@ const struct imx_spi_imx_data imx25_cspi_data[] __initconst = { | |||
38 | imx25_cspi_data_entry(1, 2), | 38 | imx25_cspi_data_entry(1, 2), |
39 | imx25_cspi_data_entry(2, 3), | 39 | imx25_cspi_data_entry(2, 3), |
40 | }; | 40 | }; |
41 | #endif /* ifdef CONFIG_ARCH_MX25 */ | 41 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
42 | 42 | ||
43 | #ifdef CONFIG_SOC_IMX27 | 43 | #ifdef CONFIG_SOC_IMX27 |
44 | const struct imx_spi_imx_data imx27_cspi_data[] __initconst = { | 44 | const struct imx_spi_imx_data imx27_cspi_data[] __initconst = { |
@@ -50,7 +50,7 @@ const struct imx_spi_imx_data imx27_cspi_data[] __initconst = { | |||
50 | }; | 50 | }; |
51 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 51 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
52 | 52 | ||
53 | #ifdef CONFIG_ARCH_MX31 | 53 | #ifdef CONFIG_SOC_IMX31 |
54 | const struct imx_spi_imx_data imx31_cspi_data[] __initconst = { | 54 | const struct imx_spi_imx_data imx31_cspi_data[] __initconst = { |
55 | #define imx31_cspi_data_entry(_id, _hwid) \ | 55 | #define imx31_cspi_data_entry(_id, _hwid) \ |
56 | imx_spi_imx_data_entry(MX31, CSPI, "imx31-cspi", _id, _hwid, SZ_4K) | 56 | imx_spi_imx_data_entry(MX31, CSPI, "imx31-cspi", _id, _hwid, SZ_4K) |
@@ -58,18 +58,18 @@ const struct imx_spi_imx_data imx31_cspi_data[] __initconst = { | |||
58 | imx31_cspi_data_entry(1, 2), | 58 | imx31_cspi_data_entry(1, 2), |
59 | imx31_cspi_data_entry(2, 3), | 59 | imx31_cspi_data_entry(2, 3), |
60 | }; | 60 | }; |
61 | #endif /* ifdef CONFIG_ARCH_MX31 */ | 61 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
62 | 62 | ||
63 | #ifdef CONFIG_ARCH_MX35 | 63 | #ifdef CONFIG_SOC_IMX35 |
64 | const struct imx_spi_imx_data imx35_cspi_data[] __initconst = { | 64 | const struct imx_spi_imx_data imx35_cspi_data[] __initconst = { |
65 | #define imx35_cspi_data_entry(_id, _hwid) \ | 65 | #define imx35_cspi_data_entry(_id, _hwid) \ |
66 | imx_spi_imx_data_entry(MX35, CSPI, "imx35-cspi", _id, _hwid, SZ_4K) | 66 | imx_spi_imx_data_entry(MX35, CSPI, "imx35-cspi", _id, _hwid, SZ_4K) |
67 | imx35_cspi_data_entry(0, 1), | 67 | imx35_cspi_data_entry(0, 1), |
68 | imx35_cspi_data_entry(1, 2), | 68 | imx35_cspi_data_entry(1, 2), |
69 | }; | 69 | }; |
70 | #endif /* ifdef CONFIG_ARCH_MX35 */ | 70 | #endif /* ifdef CONFIG_SOC_IMX35 */ |
71 | 71 | ||
72 | #ifdef CONFIG_ARCH_MX51 | 72 | #ifdef CONFIG_SOC_IMX51 |
73 | const struct imx_spi_imx_data imx51_cspi_data __initconst = | 73 | const struct imx_spi_imx_data imx51_cspi_data __initconst = |
74 | imx_spi_imx_data_entry_single(MX51, CSPI, "imx51-cspi", 0, , SZ_4K); | 74 | imx_spi_imx_data_entry_single(MX51, CSPI, "imx51-cspi", 0, , SZ_4K); |
75 | 75 | ||
@@ -79,7 +79,7 @@ const struct imx_spi_imx_data imx51_ecspi_data[] __initconst = { | |||
79 | imx51_ecspi_data_entry(0, 1), | 79 | imx51_ecspi_data_entry(0, 1), |
80 | imx51_ecspi_data_entry(1, 2), | 80 | imx51_ecspi_data_entry(1, 2), |
81 | }; | 81 | }; |
82 | #endif /* ifdef CONFIG_ARCH_MX51 */ | 82 | #endif /* ifdef CONFIG_SOC_IMX51 */ |
83 | 83 | ||
84 | struct platform_device *__init imx_add_spi_imx( | 84 | struct platform_device *__init imx_add_spi_imx( |
85 | const struct imx_spi_imx_data *data, | 85 | const struct imx_spi_imx_data *data, |
diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c index 9915607683de..8772ce346a58 100644 --- a/arch/arm/plat-mxc/ehci.c +++ b/arch/arm/plat-mxc/ehci.c | |||
@@ -49,6 +49,7 @@ | |||
49 | 49 | ||
50 | #define MXC_OTG_OFFSET 0 | 50 | #define MXC_OTG_OFFSET 0 |
51 | #define MXC_H1_OFFSET 0x200 | 51 | #define MXC_H1_OFFSET 0x200 |
52 | #define MXC_H2_OFFSET 0x400 | ||
52 | 53 | ||
53 | /* USB_CTRL */ | 54 | /* USB_CTRL */ |
54 | #define MXC_OTG_UCTRL_OWIE_BIT (1 << 27) /* OTG wakeup intr enable */ | 55 | #define MXC_OTG_UCTRL_OWIE_BIT (1 << 27) /* OTG wakeup intr enable */ |
@@ -61,6 +62,11 @@ | |||
61 | #define MXC_OTG_PHYCTRL_OC_DIS_BIT (1 << 8) /* OTG Disable Overcurrent Event */ | 62 | #define MXC_OTG_PHYCTRL_OC_DIS_BIT (1 << 8) /* OTG Disable Overcurrent Event */ |
62 | #define MXC_H1_OC_DIS_BIT (1 << 5) /* UH1 Disable Overcurrent Event */ | 63 | #define MXC_H1_OC_DIS_BIT (1 << 5) /* UH1 Disable Overcurrent Event */ |
63 | 64 | ||
65 | /* USBH2CTRL */ | ||
66 | #define MXC_H2_UCTRL_H2UIE_BIT (1 << 8) | ||
67 | #define MXC_H2_UCTRL_H2WIE_BIT (1 << 7) | ||
68 | #define MXC_H2_UCTRL_H2PM_BIT (1 << 4) | ||
69 | |||
64 | #define MXC_USBCMD_OFFSET 0x140 | 70 | #define MXC_USBCMD_OFFSET 0x140 |
65 | 71 | ||
66 | /* USBCMD */ | 72 | /* USBCMD */ |
@@ -69,9 +75,9 @@ | |||
69 | int mxc_initialize_usb_hw(int port, unsigned int flags) | 75 | int mxc_initialize_usb_hw(int port, unsigned int flags) |
70 | { | 76 | { |
71 | unsigned int v; | 77 | unsigned int v; |
72 | #if defined(CONFIG_ARCH_MX25) | 78 | #if defined(CONFIG_SOC_IMX25) |
73 | if (cpu_is_mx25()) { | 79 | if (cpu_is_mx25()) { |
74 | v = readl(MX25_IO_ADDRESS(MX25_OTG_BASE_ADDR + | 80 | v = readl(MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + |
75 | USBCTRL_OTGBASE_OFFSET)); | 81 | USBCTRL_OTGBASE_OFFSET)); |
76 | 82 | ||
77 | switch (port) { | 83 | switch (port) { |
@@ -108,14 +114,14 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
108 | return -EINVAL; | 114 | return -EINVAL; |
109 | } | 115 | } |
110 | 116 | ||
111 | writel(v, MX25_IO_ADDRESS(MX25_OTG_BASE_ADDR + | 117 | writel(v, MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + |
112 | USBCTRL_OTGBASE_OFFSET)); | 118 | USBCTRL_OTGBASE_OFFSET)); |
113 | return 0; | 119 | return 0; |
114 | } | 120 | } |
115 | #endif /* CONFIG_ARCH_MX25 */ | 121 | #endif /* if defined(CONFIG_SOC_IMX25) */ |
116 | #if defined(CONFIG_ARCH_MX3) | 122 | #if defined(CONFIG_ARCH_MX3) |
117 | if (cpu_is_mx31()) { | 123 | if (cpu_is_mx31()) { |
118 | v = readl(MX31_IO_ADDRESS(MX31_OTG_BASE_ADDR + | 124 | v = readl(MX31_IO_ADDRESS(MX31_USB_BASE_ADDR + |
119 | USBCTRL_OTGBASE_OFFSET)); | 125 | USBCTRL_OTGBASE_OFFSET)); |
120 | 126 | ||
121 | switch (port) { | 127 | switch (port) { |
@@ -153,13 +159,13 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
153 | return -EINVAL; | 159 | return -EINVAL; |
154 | } | 160 | } |
155 | 161 | ||
156 | writel(v, MX31_IO_ADDRESS(MX31_OTG_BASE_ADDR + | 162 | writel(v, MX31_IO_ADDRESS(MX31_USB_BASE_ADDR + |
157 | USBCTRL_OTGBASE_OFFSET)); | 163 | USBCTRL_OTGBASE_OFFSET)); |
158 | return 0; | 164 | return 0; |
159 | } | 165 | } |
160 | 166 | ||
161 | if (cpu_is_mx35()) { | 167 | if (cpu_is_mx35()) { |
162 | v = readl(MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR + | 168 | v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + |
163 | USBCTRL_OTGBASE_OFFSET)); | 169 | USBCTRL_OTGBASE_OFFSET)); |
164 | 170 | ||
165 | switch (port) { | 171 | switch (port) { |
@@ -196,7 +202,7 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
196 | return -EINVAL; | 202 | return -EINVAL; |
197 | } | 203 | } |
198 | 204 | ||
199 | writel(v, MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR + | 205 | writel(v, MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + |
200 | USBCTRL_OTGBASE_OFFSET)); | 206 | USBCTRL_OTGBASE_OFFSET)); |
201 | return 0; | 207 | return 0; |
202 | } | 208 | } |
@@ -206,7 +212,7 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
206 | /* On i.MX27 we can use the i.MX31 USBCTRL bits, they | 212 | /* On i.MX27 we can use the i.MX31 USBCTRL bits, they |
207 | * are identical | 213 | * are identical |
208 | */ | 214 | */ |
209 | v = readl(MX27_IO_ADDRESS(MX27_OTG_BASE_ADDR + | 215 | v = readl(MX27_IO_ADDRESS(MX27_USB_BASE_ADDR + |
210 | USBCTRL_OTGBASE_OFFSET)); | 216 | USBCTRL_OTGBASE_OFFSET)); |
211 | switch (port) { | 217 | switch (port) { |
212 | case 0: /* OTG port */ | 218 | case 0: /* OTG port */ |
@@ -241,12 +247,12 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
241 | default: | 247 | default: |
242 | return -EINVAL; | 248 | return -EINVAL; |
243 | } | 249 | } |
244 | writel(v, MX27_IO_ADDRESS(MX27_OTG_BASE_ADDR + | 250 | writel(v, MX27_IO_ADDRESS(MX27_USB_BASE_ADDR + |
245 | USBCTRL_OTGBASE_OFFSET)); | 251 | USBCTRL_OTGBASE_OFFSET)); |
246 | return 0; | 252 | return 0; |
247 | } | 253 | } |
248 | #endif /* CONFIG_MACH_MX27 */ | 254 | #endif /* CONFIG_MACH_MX27 */ |
249 | #ifdef CONFIG_ARCH_MX51 | 255 | #ifdef CONFIG_SOC_IMX51 |
250 | if (cpu_is_mx51()) { | 256 | if (cpu_is_mx51()) { |
251 | void __iomem *usb_base; | 257 | void __iomem *usb_base; |
252 | void __iomem *usbotg_base; | 258 | void __iomem *usbotg_base; |
@@ -254,6 +260,10 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
254 | int ret = 0; | 260 | int ret = 0; |
255 | 261 | ||
256 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 262 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
263 | if (!usb_base) { | ||
264 | printk(KERN_ERR "%s(): ioremap failed\n", __func__); | ||
265 | return -ENOMEM; | ||
266 | } | ||
257 | 267 | ||
258 | switch (port) { | 268 | switch (port) { |
259 | case 0: /* OTG port */ | 269 | case 0: /* OTG port */ |
@@ -262,6 +272,9 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
262 | case 1: /* Host 1 port */ | 272 | case 1: /* Host 1 port */ |
263 | usbotg_base = usb_base + MXC_H1_OFFSET; | 273 | usbotg_base = usb_base + MXC_H1_OFFSET; |
264 | break; | 274 | break; |
275 | case 2: /* Host 2 port */ | ||
276 | usbotg_base = usb_base + MXC_H2_OFFSET; | ||
277 | break; | ||
265 | default: | 278 | default: |
266 | printk(KERN_ERR"%s no such port %d\n", __func__, port); | 279 | printk(KERN_ERR"%s no such port %d\n", __func__, port); |
267 | ret = -ENOENT; | 280 | ret = -ENOENT; |
@@ -274,10 +287,13 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
274 | if (flags & MXC_EHCI_INTERNAL_PHY) { | 287 | if (flags & MXC_EHCI_INTERNAL_PHY) { |
275 | v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET); | 288 | v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET); |
276 | 289 | ||
277 | if (flags & MXC_EHCI_POWER_PINS_ENABLED) | 290 | if (flags & MXC_EHCI_POWER_PINS_ENABLED) { |
278 | v |= (MXC_OTG_PHYCTRL_OC_DIS_BIT | MXC_OTG_UCTRL_OPM_BIT); /* OC/USBPWR is not used */ | 291 | /* OC/USBPWR is not used */ |
279 | else | 292 | v |= MXC_OTG_PHYCTRL_OC_DIS_BIT; |
280 | v &= ~(MXC_OTG_PHYCTRL_OC_DIS_BIT | MXC_OTG_UCTRL_OPM_BIT); /* OC/USBPWR is used */ | 293 | } else { |
294 | /* OC/USBPWR is used */ | ||
295 | v &= ~MXC_OTG_PHYCTRL_OC_DIS_BIT; | ||
296 | } | ||
281 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET); | 297 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET); |
282 | 298 | ||
283 | v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET); | 299 | v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET); |
@@ -285,16 +301,23 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
285 | v |= MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup enable */ | 301 | v |= MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup enable */ |
286 | else | 302 | else |
287 | v &= ~MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup disable */ | 303 | v &= ~MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup disable */ |
304 | if (flags & MXC_EHCI_POWER_PINS_ENABLED) | ||
305 | v |= MXC_OTG_UCTRL_OPM_BIT; | ||
306 | else | ||
307 | v &= ~MXC_OTG_UCTRL_OPM_BIT; | ||
288 | __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET); | 308 | __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET); |
289 | } | 309 | } |
290 | break; | 310 | break; |
291 | case 1: /* Host 1 */ | 311 | case 1: /* Host 1 */ |
292 | /*Host ULPI */ | 312 | /*Host ULPI */ |
293 | v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET); | 313 | v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET); |
294 | if (flags & MXC_EHCI_WAKEUP_ENABLED) | 314 | if (flags & MXC_EHCI_WAKEUP_ENABLED) { |
295 | v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);/* HOST1 wakeup/ULPI intr disable */ | 315 | /* HOST1 wakeup/ULPI intr enable */ |
296 | else | 316 | v |= (MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT); |
297 | v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);/* HOST1 wakeup/ULPI intr disable */ | 317 | } else { |
318 | /* HOST1 wakeup/ULPI intr disable */ | ||
319 | v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT); | ||
320 | } | ||
298 | 321 | ||
299 | if (flags & MXC_EHCI_POWER_PINS_ENABLED) | 322 | if (flags & MXC_EHCI_POWER_PINS_ENABLED) |
300 | v &= ~MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/ | 323 | v &= ~MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/ |
@@ -315,6 +338,22 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) | |||
315 | v &= MXC_UCMD_ITC_NO_THRESHOLD_MASK; | 338 | v &= MXC_UCMD_ITC_NO_THRESHOLD_MASK; |
316 | __raw_writel(v, usbotg_base + MXC_USBCMD_OFFSET); | 339 | __raw_writel(v, usbotg_base + MXC_USBCMD_OFFSET); |
317 | break; | 340 | break; |
341 | case 2: /* Host 2 ULPI */ | ||
342 | v = __raw_readl(usbother_base + MXC_USBH2CTRL_OFFSET); | ||
343 | if (flags & MXC_EHCI_WAKEUP_ENABLED) { | ||
344 | /* HOST1 wakeup/ULPI intr enable */ | ||
345 | v |= (MXC_H2_UCTRL_H2WIE_BIT | MXC_H2_UCTRL_H2UIE_BIT); | ||
346 | } else { | ||
347 | /* HOST1 wakeup/ULPI intr disable */ | ||
348 | v &= ~(MXC_H2_UCTRL_H2WIE_BIT | MXC_H2_UCTRL_H2UIE_BIT); | ||
349 | } | ||
350 | |||
351 | if (flags & MXC_EHCI_POWER_PINS_ENABLED) | ||
352 | v &= ~MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used*/ | ||
353 | else | ||
354 | v |= MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used*/ | ||
355 | __raw_writel(v, usbother_base + MXC_USBH2CTRL_OFFSET); | ||
356 | break; | ||
318 | } | 357 | } |
319 | 358 | ||
320 | error: | 359 | error: |
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c index ee9582f4972e..d69d343ff61f 100644 --- a/arch/arm/plat-mxc/epit.c +++ b/arch/arm/plat-mxc/epit.c | |||
@@ -93,7 +93,6 @@ static struct clocksource clocksource_epit = { | |||
93 | .rating = 200, | 93 | .rating = 200, |
94 | .read = epit_read, | 94 | .read = epit_read, |
95 | .mask = CLOCKSOURCE_MASK(32), | 95 | .mask = CLOCKSOURCE_MASK(32), |
96 | .shift = 20, | ||
97 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 96 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
98 | }; | 97 | }; |
99 | 98 | ||
@@ -101,9 +100,7 @@ static int __init epit_clocksource_init(struct clk *timer_clk) | |||
101 | { | 100 | { |
102 | unsigned int c = clk_get_rate(timer_clk); | 101 | unsigned int c = clk_get_rate(timer_clk); |
103 | 102 | ||
104 | clocksource_epit.mult = clocksource_hz2mult(c, | 103 | clocksource_register_hz(&clocksource_epit, c); |
105 | clocksource_epit.shift); | ||
106 | clocksource_register(&clocksource_epit); | ||
107 | 104 | ||
108 | return 0; | 105 | return 0; |
109 | } | 106 | } |
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index 9c3e36232b5b..bc2c7bc6f10a 100644 --- a/arch/arm/plat-mxc/gpio.c +++ b/arch/arm/plat-mxc/gpio.c | |||
@@ -175,7 +175,7 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat) | |||
175 | static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc) | 175 | static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc) |
176 | { | 176 | { |
177 | u32 irq_stat; | 177 | u32 irq_stat; |
178 | struct mxc_gpio_port *port = (struct mxc_gpio_port *)get_irq_data(irq); | 178 | struct mxc_gpio_port *port = get_irq_data(irq); |
179 | 179 | ||
180 | irq_stat = __raw_readl(port->base + GPIO_ISR) & | 180 | irq_stat = __raw_readl(port->base + GPIO_ISR) & |
181 | __raw_readl(port->base + GPIO_IMR); | 181 | __raw_readl(port->base + GPIO_IMR); |
@@ -188,7 +188,7 @@ static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc) | |||
188 | { | 188 | { |
189 | int i; | 189 | int i; |
190 | u32 irq_msk, irq_stat; | 190 | u32 irq_msk, irq_stat; |
191 | struct mxc_gpio_port *port = (struct mxc_gpio_port *)get_irq_data(irq); | 191 | struct mxc_gpio_port *port = get_irq_data(irq); |
192 | 192 | ||
193 | /* walk through all interrupt status registers */ | 193 | /* walk through all interrupt status registers */ |
194 | for (i = 0; i < gpio_table_size; i++) { | 194 | for (i = 0; i < gpio_table_size; i++) { |
@@ -349,3 +349,113 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) | |||
349 | 349 | ||
350 | return 0; | 350 | return 0; |
351 | } | 351 | } |
352 | |||
353 | #define DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, _irq_high) \ | ||
354 | { \ | ||
355 | .chip.label = "gpio-" #_id, \ | ||
356 | .irq = _irq, \ | ||
357 | .irq_high = _irq_high, \ | ||
358 | .base = soc ## _IO_ADDRESS( \ | ||
359 | soc ## _GPIO ## _hwid ## _BASE_ADDR), \ | ||
360 | .virtual_irq_start = MXC_GPIO_IRQ_START + (_id) * 32, \ | ||
361 | } | ||
362 | |||
363 | #define DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, _irq) \ | ||
364 | DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, 0) | ||
365 | #define DEFINE_IMX_GPIO_PORT(soc, _id, _hwid) \ | ||
366 | DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, 0) | ||
367 | |||
368 | #define DEFINE_REGISTER_FUNCTION(prefix) \ | ||
369 | int __init prefix ## _register_gpios(void) \ | ||
370 | { \ | ||
371 | return mxc_gpio_init(prefix ## _gpio_ports, \ | ||
372 | ARRAY_SIZE(prefix ## _gpio_ports)); \ | ||
373 | } | ||
374 | |||
375 | #if defined(CONFIG_SOC_IMX1) | ||
376 | static struct mxc_gpio_port imx1_gpio_ports[] = { | ||
377 | DEFINE_IMX_GPIO_PORT_IRQ(MX1, 0, 1, MX1_GPIO_INT_PORTA), | ||
378 | DEFINE_IMX_GPIO_PORT_IRQ(MX1, 1, 2, MX1_GPIO_INT_PORTB), | ||
379 | DEFINE_IMX_GPIO_PORT_IRQ(MX1, 2, 3, MX1_GPIO_INT_PORTC), | ||
380 | DEFINE_IMX_GPIO_PORT_IRQ(MX1, 3, 4, MX1_GPIO_INT_PORTD), | ||
381 | }; | ||
382 | |||
383 | DEFINE_REGISTER_FUNCTION(imx1) | ||
384 | |||
385 | #endif /* if defined(CONFIG_SOC_IMX1) */ | ||
386 | |||
387 | #if defined(CONFIG_SOC_IMX21) | ||
388 | static struct mxc_gpio_port imx21_gpio_ports[] = { | ||
389 | DEFINE_IMX_GPIO_PORT_IRQ(MX21, 0, 1, MX21_INT_GPIO), | ||
390 | DEFINE_IMX_GPIO_PORT(MX21, 1, 2), | ||
391 | DEFINE_IMX_GPIO_PORT(MX21, 2, 3), | ||
392 | DEFINE_IMX_GPIO_PORT(MX21, 3, 4), | ||
393 | DEFINE_IMX_GPIO_PORT(MX21, 4, 5), | ||
394 | DEFINE_IMX_GPIO_PORT(MX21, 5, 6), | ||
395 | }; | ||
396 | |||
397 | DEFINE_REGISTER_FUNCTION(imx21) | ||
398 | |||
399 | #endif /* if defined(CONFIG_SOC_IMX21) */ | ||
400 | |||
401 | #if defined(CONFIG_SOC_IMX25) | ||
402 | static struct mxc_gpio_port imx25_gpio_ports[] = { | ||
403 | DEFINE_IMX_GPIO_PORT_IRQ(MX25, 0, 1, MX25_INT_GPIO1), | ||
404 | DEFINE_IMX_GPIO_PORT_IRQ(MX25, 1, 2, MX25_INT_GPIO2), | ||
405 | DEFINE_IMX_GPIO_PORT_IRQ(MX25, 2, 3, MX25_INT_GPIO3), | ||
406 | DEFINE_IMX_GPIO_PORT_IRQ(MX25, 3, 4, MX25_INT_GPIO4), | ||
407 | }; | ||
408 | |||
409 | DEFINE_REGISTER_FUNCTION(imx25) | ||
410 | |||
411 | #endif /* if defined(CONFIG_SOC_IMX25) */ | ||
412 | |||
413 | #if defined(CONFIG_SOC_IMX27) | ||
414 | static struct mxc_gpio_port imx27_gpio_ports[] = { | ||
415 | DEFINE_IMX_GPIO_PORT_IRQ(MX27, 0, 1, MX27_INT_GPIO), | ||
416 | DEFINE_IMX_GPIO_PORT(MX27, 1, 2), | ||
417 | DEFINE_IMX_GPIO_PORT(MX27, 2, 3), | ||
418 | DEFINE_IMX_GPIO_PORT(MX27, 3, 4), | ||
419 | DEFINE_IMX_GPIO_PORT(MX27, 4, 5), | ||
420 | DEFINE_IMX_GPIO_PORT(MX27, 5, 6), | ||
421 | }; | ||
422 | |||
423 | DEFINE_REGISTER_FUNCTION(imx27) | ||
424 | |||
425 | #endif /* if defined(CONFIG_SOC_IMX27) */ | ||
426 | |||
427 | #if defined(CONFIG_SOC_IMX31) | ||
428 | static struct mxc_gpio_port imx31_gpio_ports[] = { | ||
429 | DEFINE_IMX_GPIO_PORT_IRQ(MX31, 0, 1, MX31_INT_GPIO1), | ||
430 | DEFINE_IMX_GPIO_PORT_IRQ(MX31, 1, 2, MX31_INT_GPIO2), | ||
431 | DEFINE_IMX_GPIO_PORT_IRQ(MX31, 2, 3, MX31_INT_GPIO3), | ||
432 | }; | ||
433 | |||
434 | DEFINE_REGISTER_FUNCTION(imx31) | ||
435 | |||
436 | #endif /* if defined(CONFIG_SOC_IMX31) */ | ||
437 | |||
438 | #if defined(CONFIG_SOC_IMX35) | ||
439 | static struct mxc_gpio_port imx35_gpio_ports[] = { | ||
440 | DEFINE_IMX_GPIO_PORT_IRQ(MX35, 0, 1, MX35_INT_GPIO1), | ||
441 | DEFINE_IMX_GPIO_PORT_IRQ(MX35, 1, 2, MX35_INT_GPIO2), | ||
442 | DEFINE_IMX_GPIO_PORT_IRQ(MX35, 2, 3, MX35_INT_GPIO3), | ||
443 | }; | ||
444 | |||
445 | DEFINE_REGISTER_FUNCTION(imx35) | ||
446 | |||
447 | #endif /* if defined(CONFIG_SOC_IMX35) */ | ||
448 | |||
449 | #if defined(CONFIG_SOC_IMX50) | ||
450 | static struct mxc_gpio_port imx50_gpio_ports[] = { | ||
451 | DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 0, 1, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH), | ||
452 | DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 1, 2, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH), | ||
453 | DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 2, 3, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH), | ||
454 | DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 3, 4, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH), | ||
455 | DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 4, 5, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH), | ||
456 | DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 5, 6, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH), | ||
457 | }; | ||
458 | |||
459 | DEFINE_REGISTER_FUNCTION(imx50) | ||
460 | |||
461 | #endif /* if defined(CONFIG_SOC_IMX50) */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 7a1e1f89ff09..aea2cd3b6d15 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h | |||
@@ -20,7 +20,9 @@ extern void mx25_map_io(void); | |||
20 | extern void mx27_map_io(void); | 20 | extern void mx27_map_io(void); |
21 | extern void mx31_map_io(void); | 21 | extern void mx31_map_io(void); |
22 | extern void mx35_map_io(void); | 22 | extern void mx35_map_io(void); |
23 | extern void mx50_map_io(void); | ||
23 | extern void mx51_map_io(void); | 24 | extern void mx51_map_io(void); |
25 | extern void mx53_map_io(void); | ||
24 | extern void mxc91231_map_io(void); | 26 | extern void mxc91231_map_io(void); |
25 | extern void mxc_init_irq(void __iomem *); | 27 | extern void mxc_init_irq(void __iomem *); |
26 | extern void tzic_init_irq(void __iomem *); | 28 | extern void tzic_init_irq(void __iomem *); |
@@ -30,7 +32,9 @@ extern void mx25_init_irq(void); | |||
30 | extern void mx27_init_irq(void); | 32 | extern void mx27_init_irq(void); |
31 | extern void mx31_init_irq(void); | 33 | extern void mx31_init_irq(void); |
32 | extern void mx35_init_irq(void); | 34 | extern void mx35_init_irq(void); |
35 | extern void mx50_init_irq(void); | ||
33 | extern void mx51_init_irq(void); | 36 | extern void mx51_init_irq(void); |
37 | extern void mx53_init_irq(void); | ||
34 | extern void mxc91231_init_irq(void); | 38 | extern void mxc91231_init_irq(void); |
35 | extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq); | 39 | extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq); |
36 | extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); | 40 | extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); |
@@ -42,6 +46,8 @@ extern int mx31_clocks_init(unsigned long fref); | |||
42 | extern int mx35_clocks_init(void); | 46 | extern int mx35_clocks_init(void); |
43 | extern int mx51_clocks_init(unsigned long ckil, unsigned long osc, | 47 | extern int mx51_clocks_init(unsigned long ckil, unsigned long osc, |
44 | unsigned long ckih1, unsigned long ckih2); | 48 | unsigned long ckih1, unsigned long ckih2); |
49 | extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, | ||
50 | unsigned long ckih1, unsigned long ckih2); | ||
45 | extern int mxc91231_clocks_init(unsigned long fref); | 51 | extern int mxc91231_clocks_init(unsigned long fref); |
46 | extern int mxc_register_gpios(void); | 52 | extern int mxc_register_gpios(void); |
47 | extern int mxc_register_device(struct platform_device *pdev, void *data); | 53 | extern int mxc_register_device(struct platform_device *pdev, void *data); |
@@ -50,5 +56,6 @@ extern void mxc_arch_reset_init(void __iomem *); | |||
50 | extern void mxc91231_power_off(void); | 56 | extern void mxc91231_power_off(void); |
51 | extern void mxc91231_arch_reset(int, const char *); | 57 | extern void mxc91231_arch_reset(int, const char *); |
52 | extern void mxc91231_prepare_idle(void); | 58 | extern void mxc91231_prepare_idle(void); |
53 | 59 | extern void mx51_efikamx_reset(void); | |
60 | extern int mx53_revision(void); | ||
54 | #endif | 61 | #endif |
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S index d56213fb901b..3b3a37c25c56 100644 --- a/arch/arm/plat-mxc/include/mach/debug-macro.S +++ b/arch/arm/plat-mxc/include/mach/debug-macro.S | |||
@@ -10,58 +10,49 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | #define IMX_NEEDS_DEPRECATED_SYMBOLS | 13 | #include <mach/hardware.h> |
14 | 14 | ||
15 | #ifdef CONFIG_ARCH_MX1 | 15 | #ifdef CONFIG_ARCH_MX1 |
16 | #include <mach/mx1.h> | 16 | #define UART_PADDR MX1_UART1_BASE_ADDR |
17 | #define UART_PADDR UART1_BASE_ADDR | ||
18 | #define UART_VADDR IO_ADDRESS(UART1_BASE_ADDR) | ||
19 | #endif | 17 | #endif |
20 | 18 | ||
21 | #ifdef CONFIG_ARCH_MX25 | 19 | #ifdef CONFIG_ARCH_MX25 |
22 | #ifdef UART_PADDR | 20 | #ifdef UART_PADDR |
23 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | 21 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
24 | #endif | 22 | #endif |
25 | #include <mach/mx25.h> | ||
26 | #define UART_PADDR MX25_UART1_BASE_ADDR | 23 | #define UART_PADDR MX25_UART1_BASE_ADDR |
27 | #define UART_VADDR MX25_AIPS1_IO_ADDRESS(MX25_UART1_BASE_ADDR) | ||
28 | #endif | 24 | #endif |
29 | 25 | ||
30 | #ifdef CONFIG_ARCH_MX2 | 26 | #ifdef CONFIG_ARCH_MX2 |
31 | #ifdef UART_PADDR | 27 | #ifdef UART_PADDR |
32 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | 28 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
33 | #endif | 29 | #endif |
34 | #include <mach/mx2x.h> | 30 | #define UART_PADDR MX2x_UART1_BASE_ADDR |
35 | #define UART_PADDR UART1_BASE_ADDR | ||
36 | #define UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR) | ||
37 | #endif | 31 | #endif |
38 | 32 | ||
39 | #ifdef CONFIG_ARCH_MX3 | 33 | #ifdef CONFIG_ARCH_MX3 |
40 | #ifdef UART_PADDR | 34 | #ifdef UART_PADDR |
41 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | 35 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
42 | #endif | 36 | #endif |
43 | #include <mach/mx3x.h> | 37 | #define UART_PADDR MX3x_UART1_BASE_ADDR |
44 | #define UART_PADDR UART1_BASE_ADDR | ||
45 | #define UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) | ||
46 | #endif | 38 | #endif |
47 | 39 | ||
48 | #ifdef CONFIG_ARCH_MX5 | 40 | #ifdef CONFIG_ARCH_MX5 |
49 | #ifdef UART_PADDR | 41 | #ifdef UART_PADDR |
50 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | 42 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
51 | #endif | 43 | #endif |
52 | #include <mach/mx51.h> | ||
53 | #define UART_PADDR MX51_UART1_BASE_ADDR | 44 | #define UART_PADDR MX51_UART1_BASE_ADDR |
54 | #define UART_VADDR MX51_AIPS1_IO_ADDRESS(MX51_UART1_BASE_ADDR) | ||
55 | #endif | 45 | #endif |
56 | 46 | ||
57 | #ifdef CONFIG_ARCH_MXC91231 | 47 | #ifdef CONFIG_ARCH_MXC91231 |
58 | #ifdef UART_PADDR | 48 | #ifdef UART_PADDR |
59 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | 49 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" |
60 | #endif | 50 | #endif |
61 | #include <mach/mxc91231.h> | ||
62 | #define UART_PADDR MXC91231_UART2_BASE_ADDR | 51 | #define UART_PADDR MXC91231_UART2_BASE_ADDR |
63 | #define UART_VADDR MXC91231_IO_ADDRESS(MXC91231_UART2_BASE_ADDR) | ||
64 | #endif | 52 | #endif |
53 | |||
54 | #define UART_VADDR IMX_IO_ADDRESS(UART_PADDR) | ||
55 | |||
65 | .macro addruart, rp, rv | 56 | .macro addruart, rp, rv |
66 | ldr \rp, =UART_PADDR @ physical | 57 | ldr \rp, =UART_PADDR @ physical |
67 | ldr \rv, =UART_VADDR @ virtual | 58 | ldr \rv, =UART_VADDR @ virtual |
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 8c6896fd1e5f..8658c9caa650 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -10,9 +10,19 @@ | |||
10 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | 12 | ||
13 | struct platform_device *imx_add_platform_device(const char *name, int id, | 13 | struct platform_device *imx_add_platform_device_dmamask( |
14 | const char *name, int id, | ||
14 | const struct resource *res, unsigned int num_resources, | 15 | const struct resource *res, unsigned int num_resources, |
15 | const void *data, size_t size_data); | 16 | const void *data, size_t size_data, u64 dmamask); |
17 | |||
18 | static inline struct platform_device *imx_add_platform_device( | ||
19 | const char *name, int id, | ||
20 | const struct resource *res, unsigned int num_resources, | ||
21 | const void *data, size_t size_data) | ||
22 | { | ||
23 | return imx_add_platform_device_dmamask( | ||
24 | name, id, res, num_resources, data, size_data, 0); | ||
25 | } | ||
16 | 26 | ||
17 | #include <linux/fec.h> | 27 | #include <linux/fec.h> |
18 | struct imx_fec_data { | 28 | struct imx_fec_data { |
@@ -24,15 +34,63 @@ struct platform_device *__init imx_add_fec( | |||
24 | const struct fec_platform_data *pdata); | 34 | const struct fec_platform_data *pdata); |
25 | 35 | ||
26 | #include <linux/can/platform/flexcan.h> | 36 | #include <linux/can/platform/flexcan.h> |
27 | struct platform_device *__init imx_add_flexcan(int id, | 37 | struct imx_flexcan_data { |
28 | resource_size_t iobase, resource_size_t iosize, | 38 | int id; |
29 | resource_size_t irq, | 39 | resource_size_t iobase; |
40 | resource_size_t iosize; | ||
41 | resource_size_t irq; | ||
42 | }; | ||
43 | struct platform_device *__init imx_add_flexcan( | ||
44 | const struct imx_flexcan_data *data, | ||
30 | const struct flexcan_platform_data *pdata); | 45 | const struct flexcan_platform_data *pdata); |
31 | 46 | ||
47 | #include <linux/fsl_devices.h> | ||
48 | struct imx_fsl_usb2_udc_data { | ||
49 | resource_size_t iobase; | ||
50 | resource_size_t irq; | ||
51 | }; | ||
52 | struct platform_device *__init imx_add_fsl_usb2_udc( | ||
53 | const struct imx_fsl_usb2_udc_data *data, | ||
54 | const struct fsl_usb2_platform_data *pdata); | ||
55 | |||
32 | #include <linux/gpio_keys.h> | 56 | #include <linux/gpio_keys.h> |
33 | struct platform_device *__init imx_add_gpio_keys( | 57 | struct platform_device *__init imx_add_gpio_keys( |
34 | const struct gpio_keys_platform_data *pdata); | 58 | const struct gpio_keys_platform_data *pdata); |
35 | 59 | ||
60 | #include <mach/mx21-usbhost.h> | ||
61 | struct imx_imx21_hcd_data { | ||
62 | resource_size_t iobase; | ||
63 | resource_size_t irq; | ||
64 | }; | ||
65 | struct platform_device *__init imx_add_imx21_hcd( | ||
66 | const struct imx_imx21_hcd_data *data, | ||
67 | const struct mx21_usbh_platform_data *pdata); | ||
68 | |||
69 | struct imx_imx2_wdt_data { | ||
70 | int id; | ||
71 | resource_size_t iobase; | ||
72 | resource_size_t iosize; | ||
73 | }; | ||
74 | struct platform_device *__init imx_add_imx2_wdt( | ||
75 | const struct imx_imx2_wdt_data *data); | ||
76 | |||
77 | struct imx_imxdi_rtc_data { | ||
78 | resource_size_t iobase; | ||
79 | resource_size_t irq; | ||
80 | }; | ||
81 | struct platform_device *__init imx_add_imxdi_rtc( | ||
82 | const struct imx_imxdi_rtc_data *data); | ||
83 | |||
84 | #include <mach/imxfb.h> | ||
85 | struct imx_imx_fb_data { | ||
86 | resource_size_t iobase; | ||
87 | resource_size_t iosize; | ||
88 | resource_size_t irq; | ||
89 | }; | ||
90 | struct platform_device *__init imx_add_imx_fb( | ||
91 | const struct imx_imx_fb_data *data, | ||
92 | const struct imx_fb_platform_data *pdata); | ||
93 | |||
36 | #include <mach/i2c.h> | 94 | #include <mach/i2c.h> |
37 | struct imx_imx_i2c_data { | 95 | struct imx_imx_i2c_data { |
38 | int id; | 96 | int id; |
@@ -44,6 +102,16 @@ struct platform_device *__init imx_add_imx_i2c( | |||
44 | const struct imx_imx_i2c_data *data, | 102 | const struct imx_imx_i2c_data *data, |
45 | const struct imxi2c_platform_data *pdata); | 103 | const struct imxi2c_platform_data *pdata); |
46 | 104 | ||
105 | #include <linux/input/matrix_keypad.h> | ||
106 | struct imx_imx_keypad_data { | ||
107 | resource_size_t iobase; | ||
108 | resource_size_t iosize; | ||
109 | resource_size_t irq; | ||
110 | }; | ||
111 | struct platform_device *__init imx_add_imx_keypad( | ||
112 | const struct imx_imx_keypad_data *data, | ||
113 | const struct matrix_keymap_data *pdata); | ||
114 | |||
47 | #include <mach/ssi.h> | 115 | #include <mach/ssi.h> |
48 | struct imx_imx_ssi_data { | 116 | struct imx_imx_ssi_data { |
49 | int id; | 117 | int id; |
@@ -82,6 +150,67 @@ struct platform_device *__init imx_add_imx_uart_1irq( | |||
82 | const struct imx_imx_uart_1irq_data *data, | 150 | const struct imx_imx_uart_1irq_data *data, |
83 | const struct imxuart_platform_data *pdata); | 151 | const struct imxuart_platform_data *pdata); |
84 | 152 | ||
153 | #include <mach/usb.h> | ||
154 | struct imx_imx_udc_data { | ||
155 | resource_size_t iobase; | ||
156 | resource_size_t iosize; | ||
157 | resource_size_t irq0; | ||
158 | resource_size_t irq1; | ||
159 | resource_size_t irq2; | ||
160 | resource_size_t irq3; | ||
161 | resource_size_t irq4; | ||
162 | resource_size_t irq5; | ||
163 | resource_size_t irq6; | ||
164 | }; | ||
165 | struct platform_device *__init imx_add_imx_udc( | ||
166 | const struct imx_imx_udc_data *data, | ||
167 | const struct imxusb_platform_data *pdata); | ||
168 | |||
169 | #include <mach/mx1_camera.h> | ||
170 | struct imx_mx1_camera_data { | ||
171 | resource_size_t iobase; | ||
172 | resource_size_t iosize; | ||
173 | resource_size_t irq; | ||
174 | }; | ||
175 | struct platform_device *__init imx_add_mx1_camera( | ||
176 | const struct imx_mx1_camera_data *data, | ||
177 | const struct mx1_camera_pdata *pdata); | ||
178 | |||
179 | #include <mach/mx2_cam.h> | ||
180 | struct imx_mx2_camera_data { | ||
181 | resource_size_t iobasecsi; | ||
182 | resource_size_t iosizecsi; | ||
183 | resource_size_t irqcsi; | ||
184 | resource_size_t iobaseemmaprp; | ||
185 | resource_size_t iosizeemmaprp; | ||
186 | resource_size_t irqemmaprp; | ||
187 | }; | ||
188 | struct platform_device *__init imx_add_mx2_camera( | ||
189 | const struct imx_mx2_camera_data *data, | ||
190 | const struct mx2_camera_platform_data *pdata); | ||
191 | |||
192 | #include <mach/mxc_ehci.h> | ||
193 | struct imx_mxc_ehci_data { | ||
194 | int id; | ||
195 | resource_size_t iobase; | ||
196 | resource_size_t irq; | ||
197 | }; | ||
198 | struct platform_device *__init imx_add_mxc_ehci( | ||
199 | const struct imx_mxc_ehci_data *data, | ||
200 | const struct mxc_usbh_platform_data *pdata); | ||
201 | |||
202 | #include <mach/mmc.h> | ||
203 | struct imx_mxc_mmc_data { | ||
204 | int id; | ||
205 | resource_size_t iobase; | ||
206 | resource_size_t iosize; | ||
207 | resource_size_t irq; | ||
208 | resource_size_t dmareq; | ||
209 | }; | ||
210 | struct platform_device *__init imx_add_mxc_mmc( | ||
211 | const struct imx_mxc_mmc_data *data, | ||
212 | const struct imxmmc_platform_data *pdata); | ||
213 | |||
85 | #include <mach/mxc_nand.h> | 214 | #include <mach/mxc_nand.h> |
86 | struct imx_mxc_nand_data { | 215 | struct imx_mxc_nand_data { |
87 | /* | 216 | /* |
@@ -99,24 +228,39 @@ struct platform_device *__init imx_add_mxc_nand( | |||
99 | const struct imx_mxc_nand_data *data, | 228 | const struct imx_mxc_nand_data *data, |
100 | const struct mxc_nand_platform_data *pdata); | 229 | const struct mxc_nand_platform_data *pdata); |
101 | 230 | ||
102 | #include <mach/spi.h> | 231 | struct imx_mxc_pwm_data { |
103 | struct imx_spi_imx_data { | ||
104 | const char *devid; | ||
105 | int id; | 232 | int id; |
106 | resource_size_t iobase; | 233 | resource_size_t iobase; |
107 | resource_size_t iosize; | 234 | resource_size_t iosize; |
108 | int irq; | 235 | resource_size_t irq; |
109 | }; | 236 | }; |
110 | struct platform_device *__init imx_add_spi_imx( | 237 | struct platform_device *__init imx_add_mxc_pwm( |
111 | const struct imx_spi_imx_data *data, | 238 | const struct imx_mxc_pwm_data *data); |
112 | const struct spi_imx_master *pdata); | 239 | |
240 | struct imx_mxc_w1_data { | ||
241 | resource_size_t iobase; | ||
242 | }; | ||
243 | struct platform_device *__init imx_add_mxc_w1( | ||
244 | const struct imx_mxc_w1_data *data); | ||
113 | 245 | ||
114 | #include <mach/esdhc.h> | 246 | #include <mach/esdhc.h> |
115 | struct imx_esdhc_imx_data { | 247 | struct imx_sdhci_esdhc_imx_data { |
116 | int id; | 248 | int id; |
117 | resource_size_t iobase; | 249 | resource_size_t iobase; |
118 | resource_size_t irq; | 250 | resource_size_t irq; |
119 | }; | 251 | }; |
120 | struct platform_device *__init imx_add_esdhc( | 252 | struct platform_device *__init imx_add_sdhci_esdhc_imx( |
121 | const struct imx_esdhc_imx_data *data, | 253 | const struct imx_sdhci_esdhc_imx_data *data, |
122 | const struct esdhc_platform_data *pdata); | 254 | const struct esdhc_platform_data *pdata); |
255 | |||
256 | #include <mach/spi.h> | ||
257 | struct imx_spi_imx_data { | ||
258 | const char *devid; | ||
259 | int id; | ||
260 | resource_size_t iobase; | ||
261 | resource_size_t iosize; | ||
262 | int irq; | ||
263 | }; | ||
264 | struct platform_device *__init imx_add_spi_imx( | ||
265 | const struct imx_spi_imx_data *data, | ||
266 | const struct spi_imx_master *pdata); | ||
diff --git a/arch/arm/plat-mxc/include/mach/entry-macro.S b/arch/arm/plat-mxc/include/mach/entry-macro.S index aeb08697726b..bd9bb9799141 100644 --- a/arch/arm/plat-mxc/include/mach/entry-macro.S +++ b/arch/arm/plat-mxc/include/mach/entry-macro.S | |||
@@ -54,15 +54,15 @@ | |||
54 | #elif defined CONFIG_MXC_TZIC | 54 | #elif defined CONFIG_MXC_TZIC |
55 | @ Load offset & priority of the highest priority | 55 | @ Load offset & priority of the highest priority |
56 | @ interrupt pending. | 56 | @ interrupt pending. |
57 | @ 0x080 is INTSEC0 register | ||
57 | @ 0xD80 is HIPND0 register | 58 | @ 0xD80 is HIPND0 register |
58 | mov \irqnr, #0 | 59 | mov \irqnr, #0 |
59 | mov \irqstat, #0x0D80 | 60 | 1000: add \irqstat, \base, \irqnr, lsr #3 |
60 | 1000: | 61 | ldr \tmp, [\irqstat, #0xd80] |
61 | ldr \tmp, [\irqstat, \base] | 62 | ldr \irqstat, [\irqstat, #0x080] |
62 | cmp \tmp, #0 | 63 | ands \tmp, \tmp, \irqstat |
63 | bne 1001f | 64 | bne 1001f |
64 | addeq \irqnr, \irqnr, #32 | 65 | add \irqnr, \irqnr, #32 |
65 | addeq \irqstat, \irqstat, #4 | ||
66 | cmp \irqnr, #128 | 66 | cmp \irqnr, #128 |
67 | blo 1000b | 67 | blo 1000b |
68 | b 2001f | 68 | b 2001f |
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h index af33b74f569e..0044e2f1bea8 100644 --- a/arch/arm/plat-mxc/include/mach/gpio.h +++ b/arch/arm/plat-mxc/include/mach/gpio.h | |||
@@ -23,6 +23,11 @@ | |||
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <asm-generic/gpio.h> | 24 | #include <asm-generic/gpio.h> |
25 | 25 | ||
26 | |||
27 | /* There's a off-by-one betweem the gpio bank number and the gpiochip */ | ||
28 | /* range e.g. GPIO_1_5 is gpio 5 under linux */ | ||
29 | #define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr)) | ||
30 | |||
26 | /* use gpiolib dispatchers */ | 31 | /* use gpiolib dispatchers */ |
27 | #define gpio_get_value __gpio_get_value | 32 | #define gpio_get_value __gpio_get_value |
28 | #define gpio_set_value __gpio_set_value | 33 | #define gpio_set_value __gpio_set_value |
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h index ebadf4ac43fc..26bb1bab4aeb 100644 --- a/arch/arm/plat-mxc/include/mach/hardware.h +++ b/arch/arm/plat-mxc/include/mach/hardware.h | |||
@@ -22,13 +22,92 @@ | |||
22 | 22 | ||
23 | #include <asm/sizes.h> | 23 | #include <asm/sizes.h> |
24 | 24 | ||
25 | #define IMX_IO_ADDRESS(addr, module) \ | 25 | #ifdef __ASSEMBLER__ |
26 | ((void __force __iomem *) \ | 26 | #define IOMEM(addr) (addr) |
27 | (((unsigned long)((addr) - (module ## _BASE_ADDR)) < module ## _SIZE) ?\ | 27 | #else |
28 | (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0)) | 28 | #define IOMEM(addr) ((void __force __iomem *)(addr)) |
29 | #endif | ||
30 | |||
31 | #define IMX_IO_P2V_MODULE(addr, module) \ | ||
32 | (((addr) - module ## _BASE_ADDR) < module ## _SIZE ? \ | ||
33 | (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0) | ||
34 | |||
35 | /* | ||
36 | * This is rather complicated for humans and ugly to verify, but for a machine | ||
37 | * it's OK. Still more as it is usually only applied to constants. The upsides | ||
38 | * on using this approach are: | ||
39 | * | ||
40 | * - same mapping on all i.MX machines | ||
41 | * - works for assembler, too | ||
42 | * - no need to nurture #defines for virtual addresses | ||
43 | * | ||
44 | * The downside it, it's hard to verify (but I have a script for that). | ||
45 | * | ||
46 | * Obviously this needs to be injective for each SoC. In general it maps the | ||
47 | * whole address space to [0xf4000000, 0xf5ffffff]. So [0xf6000000,0xfeffffff] | ||
48 | * is free for per-machine use (e.g. KZM_ARM11_01 uses 64MiB there). | ||
49 | * | ||
50 | * It applies the following mappings for the different SoCs: | ||
51 | * | ||
52 | * mx1: | ||
53 | * IO 0x00200000+0x100000 -> 0xf4000000+0x100000 | ||
54 | * mx21: | ||
55 | * AIPI 0x10000000+0x100000 -> 0xf4400000+0x100000 | ||
56 | * SAHB1 0x80000000+0x100000 -> 0xf4000000+0x100000 | ||
57 | * X_MEMC 0xdf000000+0x004000 -> 0xf5f00000+0x004000 | ||
58 | * mx25: | ||
59 | * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000 | ||
60 | * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000 | ||
61 | * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000 | ||
62 | * mx27: | ||
63 | * AIPI 0x10000000+0x100000 -> 0xf4400000+0x100000 | ||
64 | * SAHB1 0x80000000+0x100000 -> 0xf4000000+0x100000 | ||
65 | * X_MEMC 0xd8000000+0x100000 -> 0xf5c00000+0x100000 | ||
66 | * mx31: | ||
67 | * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000 | ||
68 | * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000 | ||
69 | * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000 | ||
70 | * X_MEMC 0xb8000000+0x010000 -> 0xf4c00000+0x010000 | ||
71 | * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000 | ||
72 | * mx35: | ||
73 | * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000 | ||
74 | * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000 | ||
75 | * AVIC 0x68000000+0x100000 -> 0xf5800000+0x100000 | ||
76 | * X_MEMC 0xb8000000+0x010000 -> 0xf4c00000+0x010000 | ||
77 | * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000 | ||
78 | * mx50: | ||
79 | * TZIC 0x0fffc000+0x004000 -> 0xf4bfc000+0x004000 | ||
80 | * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000 | ||
81 | * AIPS1 0x53f00000+0x100000 -> 0xf5700000+0x100000 | ||
82 | * AIPS2 0x63f00000+0x100000 -> 0xf5300000+0x100000 | ||
83 | * mx51: | ||
84 | * IRAM 0x1ffe0000+0x020000 -> 0xf4fe0000+0x020000 | ||
85 | * DEBUG 0x60000000+0x100000 -> 0xf5000000+0x100000 | ||
86 | * SPBA0 0x70000000+0x100000 -> 0xf5400000+0x100000 | ||
87 | * AIPS1 0x73f00000+0x100000 -> 0xf5700000+0x100000 | ||
88 | * AIPS2 0x83f00000+0x100000 -> 0xf4300000+0x100000 | ||
89 | * mxc91231: | ||
90 | * L2CC 0x30000000+0x010000 -> 0xf4400000+0x010000 | ||
91 | * X_MEMC 0xb8000000+0x010000 -> 0xf4c00000+0x010000 | ||
92 | * ROMP 0x60000000+0x010000 -> 0xf5000000+0x010000 | ||
93 | * AVIC 0x68000000+0x010000 -> 0xf5800000+0x010000 | ||
94 | * AIPS1 0x43f00000+0x100000 -> 0xf5300000+0x100000 | ||
95 | * SPBA0 0x50000000+0x100000 -> 0xf5400000+0x100000 | ||
96 | * SPBA1 0x52000000+0x100000 -> 0xf5600000+0x100000 | ||
97 | * AIPS2 0x53f00000+0x100000 -> 0xf5700000+0x100000 | ||
98 | */ | ||
99 | #define IMX_IO_P2V(x) ( \ | ||
100 | 0xf4000000 + \ | ||
101 | (((x) & 0x50000000) >> 6) + \ | ||
102 | (((x) & 0x0b000000) >> 4) + \ | ||
103 | (((x) & 0x000fffff))) | ||
104 | |||
105 | #define IMX_IO_ADDRESS(x) IOMEM(IMX_IO_P2V(x)) | ||
29 | 106 | ||
30 | #ifdef CONFIG_ARCH_MX5 | 107 | #ifdef CONFIG_ARCH_MX5 |
108 | #include <mach/mx50.h> | ||
31 | #include <mach/mx51.h> | 109 | #include <mach/mx51.h> |
110 | #include <mach/mx53.h> | ||
32 | #endif | 111 | #endif |
33 | 112 | ||
34 | #ifdef CONFIG_ARCH_MX3 | 113 | #ifdef CONFIG_ARCH_MX3 |
@@ -61,4 +140,11 @@ | |||
61 | 140 | ||
62 | #include <mach/mxc.h> | 141 | #include <mach/mxc.h> |
63 | 142 | ||
143 | #define imx_map_entry(soc, name, _type) { \ | ||
144 | .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \ | ||
145 | .pfn = __phys_to_pfn(soc ## _ ## name ## _BASE_ADDR), \ | ||
146 | .length = soc ## _ ## name ## _SIZE, \ | ||
147 | .type = _type, \ | ||
148 | } | ||
149 | |||
64 | #endif /* __ASM_ARCH_MXC_HARDWARE_H__ */ | 150 | #endif /* __ASM_ARCH_MXC_HARDWARE_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h index 5263506b7ddf..9de8f062ad5d 100644 --- a/arch/arm/plat-mxc/include/mach/imxfb.h +++ b/arch/arm/plat-mxc/include/mach/imxfb.h | |||
@@ -1,6 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * This structure describes the machine which we are running on. | 2 | * This structure describes the machine which we are running on. |
3 | */ | 3 | */ |
4 | #ifndef __MACH_IMXFB_H__ | ||
5 | #define __MACH_IMXFB_H__ | ||
4 | 6 | ||
5 | #include <linux/fb.h> | 7 | #include <linux/fb.h> |
6 | 8 | ||
@@ -79,3 +81,4 @@ struct imx_fb_platform_data { | |||
79 | }; | 81 | }; |
80 | 82 | ||
81 | void set_imx_fb_info(struct imx_fb_platform_data *); | 83 | void set_imx_fb_info(struct imx_fb_platform_data *); |
84 | #endif /* ifndef __MACH_IMXFB_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx50.h b/arch/arm/plat-mxc/include/mach/iomux-mx50.h new file mode 100644 index 000000000000..058a922ca147 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/iomux-mx50.h | |||
@@ -0,0 +1,977 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_IOMUX_MX50_H__ | ||
20 | #define __MACH_IOMUX_MX50_H__ | ||
21 | |||
22 | #include <mach/iomux-v3.h> | ||
23 | |||
24 | #define MX50_ELCDIF_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH) | ||
25 | |||
26 | #define MX50_SD_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
27 | PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_HIGH) | ||
28 | |||
29 | #define MX50_UART_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE) | ||
30 | |||
31 | #define MX50_I2C_PAD_CTRL (PAD_CTL_ODE | PAD_CTL_DSE_HIGH | \ | ||
32 | PAD_CTL_PUS_100K_UP | PAD_CTL_HYS) | ||
33 | |||
34 | #define MX50_USB_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
35 | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_47K_UP) | ||
36 | |||
37 | #define MX50_FEC_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
38 | PAD_CTL_PUS_22K_UP | PAD_CTL_ODE | \ | ||
39 | PAD_CTL_DSE_HIGH) | ||
40 | |||
41 | #define MX50_OWIRE_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
42 | PAD_CTL_PUS_100K_UP | PAD_CTL_ODE | \ | ||
43 | PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST) | ||
44 | |||
45 | #define MX50_KEYPAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
46 | PAD_CTL_PUS_100K_UP | PAD_CTL_DSE_HIGH) | ||
47 | |||
48 | #define MX50_CSPI_SS_PAD (PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
49 | PAD_CTL_PUS_22K_UP | PAD_CTL_DSE_HIGH) | ||
50 | |||
51 | #define MX50_PAD_KEY_COL0__KEY_COL0 IOMUX_PAD(0x2CC, 0x20, 0, 0x0, 0, NO_PAD_CTRL) | ||
52 | #define MX50_PAD_KEY_COL0__GPIO_4_0 IOMUX_PAD(0x2CC, 0x20, 1, 0x0, 0, NO_PAD_CTRL) | ||
53 | #define MX50_PAD_KEY_COL0__NANDF_CLE IOMUX_PAD(0x2CC, 0x20, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
54 | |||
55 | #define MX50_PAD_KEY_ROW0__KEY_ROW0 IOMUX_PAD(0x2D0, 0x24, 0, 0x0, 0, MX50_KEYPAD_CTRL) | ||
56 | #define MX50_PAD_KEY_ROW0__GPIO_4_1 IOMUX_PAD(0x2D0, 0x24, 1, 0x0, 0, NO_PAD_CTRL) | ||
57 | #define MX50_PAD_KEY_ROW0__NANDF_ALE IOMUX_PAD(0x2D0, 0x24, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
58 | |||
59 | #define MX50_PAD_KEY_COL1__KEY_COL1 IOMUX_PAD(0x2D4, 0x28, 0, 0x0, 0, NO_PAD_CTRL) | ||
60 | #define MX50_PAD_KEY_COL1__GPIO_4_2 IOMUX_PAD(0x2D4, 0x28, 1, 0x0, 0, NO_PAD_CTRL) | ||
61 | #define MX50_PAD_KEY_COL1__NANDF_CE0 IOMUX_PAD(0x2D4, 0x28, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
62 | |||
63 | #define MX50_PAD_KEY_ROW1__KEY_ROW1 IOMUX_PAD(0x2D8, 0x2C, 0, 0x0, 0, MX50_KEYPAD_CTRL) | ||
64 | #define MX50_PAD_KEY_ROW1__GPIO_4_3 IOMUX_PAD(0x2D8, 0x2C, 1, 0x0, 0, NO_PAD_CTRL) | ||
65 | #define MX50_PAD_KEY_ROW1__NANDF_CE1 IOMUX_PAD(0x2D8, 0x2C, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
66 | |||
67 | #define MX50_PAD_KEY_COL2__KEY_COL2 IOMUX_PAD(0x2DC, 0x30, 0, 0x0, 0, MX50_KEYPAD_CTRL) | ||
68 | #define MX50_PAD_KEY_COL2__GPIO_4_4 IOMUX_PAD(0x2DC, 0x30, 1, 0x0, 0, NO_PAD_CTRL) | ||
69 | #define MX50_PAD_KEY_COL2__NANDF_CE2 IOMUX_PAD(0x2DC, 0x30, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
70 | |||
71 | #define MX50_PAD_KEY_ROW2__KEY_ROW2 IOMUX_PAD(0x2E0, 0x34, 0, 0x0, 0, MX50_KEYPAD_CTRL) | ||
72 | #define MX50_PAD_KEY_ROW2__GPIO_4_5 IOMUX_PAD(0x2E0, 0x34, 1, 0x0, 0, NO_PAD_CTRL) | ||
73 | #define MX50_PAD_KEY_ROW2__NANDF_CE3 IOMUX_PAD(0x2E0, 0x34, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
74 | |||
75 | #define MX50_PAD_KEY_COL3__KEY_COL3 IOMUX_PAD(0x2E4, 0x38, 0, 0x0, 0, NO_PAD_CTRL) | ||
76 | #define MX50_PAD_KEY_COL3__GPIO_4_6 IOMUX_PAD(0x2E4, 0x38, 1, 0x0, 0, NO_PAD_CTRL) | ||
77 | #define MX50_PAD_KEY_COL3__NANDF_READY IOMUX_PAD(0x2E4, 0x38, 2, 0x7b4, 0, PAD_CTL_PKE | \ | ||
78 | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP) | ||
79 | #define MX50_PAD_KEY_COL3__SDMA_EXT0 IOMUX_PAD(0x2E4, 0x38, 6, 0x7b8, 0, NO_PAD_CTRL) | ||
80 | |||
81 | #define MX50_PAD_KEY_ROW3__KEY_ROW3 IOMUX_PAD(0x2E8, 0x3C, 0, 0x0, 0, MX50_KEYPAD_CTRL) | ||
82 | #define MX50_PAD_KEY_ROW3__GPIO_4_7 IOMUX_PAD(0x2E8, 0x3C, 1, 0x0, 0, NO_PAD_CTRL) | ||
83 | #define MX50_PAD_KEY_ROW3__NANDF_DQS IOMUX_PAD(0x2E8, 0x3C, 2, 0x7b0, 0, PAD_CTL_DSE_HIGH) | ||
84 | #define MX50_PAD_KEY_ROW3__SDMA_EXT1 IOMUX_PAD(0x2E8, 0x3C, 6, 0x7bc, 0, NO_PAD_CTRL) | ||
85 | |||
86 | #define MX50_PAD_I2C1_SCL__I2C1_SCL IOMUX_PAD(0x2EC, 0x40, IOMUX_CONFIG_SION, 0x0, 0, \ | ||
87 | MX50_I2C_PAD_CTRL) | ||
88 | #define MX50_PAD_I2C1_SCL__GPIO_6_18 IOMUX_PAD(0x2EC, 0x40, 1, 0x0, 0, NO_PAD_CTRL) | ||
89 | #define MX50_PAD_I2C1_SCL__UART2_TXD IOMUX_PAD(0x2EC, 0x40, 2, 0x7cc, 0, MX50_UART_PAD_CTRL) | ||
90 | |||
91 | #define MX50_PAD_I2C1_SDA__I2C1_SDA IOMUX_PAD(0x2F0, 0x44, IOMUX_CONFIG_SION, 0x0, 0, \ | ||
92 | MX50_I2C_PAD_CTRL) | ||
93 | #define MX50_PAD_I2C1_SDA__GPIO_6_19 IOMUX_PAD(0x2F0, 0x44, 1, 0x0, 0, NO_PAD_CTRL) | ||
94 | #define MX50_PAD_I2C1_SDA__UART2_RXD IOMUX_PAD(0x2F0, 0x44, 2, 0x7cc, 1, MX50_UART_PAD_CTRL) | ||
95 | |||
96 | #define MX50_PAD_I2C2_SCL__I2C2_SCL IOMUX_PAD(0x2F4, 0x48, IOMUX_CONFIG_SION, 0x0, 0, \ | ||
97 | MX50_I2C_PAD_CTRL) | ||
98 | #define MX50_PAD_I2C2_SCL__GPIO_6_20 IOMUX_PAD(0x2F4, 0x48, 1, 0x0, 0, NO_PAD_CTRL) | ||
99 | #define MX50_PAD_I2C2_SCL__UART2_CTS IOMUX_PAD(0x2F4, 0x48, 2, 0x7c8, 0, MX50_UART_PAD_CTRL) | ||
100 | #define MX50_PAD_I2C2_SCL__DCDC_OK IOMUX_PAD(0x2F4, 0x48, 7, 0x0, 0, NO_PAD_CTRL) | ||
101 | |||
102 | #define MX50_PAD_I2C2_SDA__I2C2_SDA IOMUX_PAD(0x2F8, 0x4C, IOMUX_CONFIG_SION, 0x0, 0, \ | ||
103 | MX50_I2C_PAD_CTRL) | ||
104 | #define MX50_PAD_I2C2_SDA__GPIO_6_21 IOMUX_PAD(0x2F8, 0x4C, 1, 0x0, 0, NO_PAD_CTRL) | ||
105 | #define MX50_PAD_I2C2_SDA__UART2_RTS IOMUX_PAD(0x2F8, 0x4C, 2, 0x7c8, 1, MX50_UART_PAD_CTRL) | ||
106 | #define MX50_PAD_I2C2_SDA__PWRSTABLE IOMUX_PAD(0x2F8, 0x4C, 7, 0x0, 0, NO_PAD_CTRL) | ||
107 | |||
108 | #define MX50_PAD_I2C3_SCL__I2C3_SCL IOMUX_PAD(0x2FC, 0x50, IOMUX_CONFIG_SION, 0x0, 0, \ | ||
109 | MX50_I2C_PAD_CTRL) | ||
110 | #define MX50_PAD_I2C3_SCL__GPIO_6_22 IOMUX_PAD(0x2FC, 0x50, 1, 0x0, 0, NO_PAD_CTRL) | ||
111 | #define MX50_PAD_I2C3_SCL__FEC_MDC IOMUX_PAD(0x2FC, 0x50, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
112 | #define MX50_PAD_I2C3_SCL__PMIC_RDY IOMUX_PAD(0x2FC, 0x50, 3, 0x0, 0, NO_PAD_CTRL) | ||
113 | #define MX50_PAD_I2C3_SCL__GPT_CAPIN1 IOMUX_PAD(0x2FC, 0x50, 5, 0x0, 0, NO_PAD_CTRL) | ||
114 | #define MX50_PAD_I2C3_SCL__USBOTG_OC IOMUX_PAD(0x2FC, 0x50, 7, 0x7E8, 0, MX50_USB_PAD_CTRL) | ||
115 | |||
116 | #define MX50_PAD_I2C3_SDA__I2C3_SDA IOMUX_PAD(0x300, 0x54, IOMUX_CONFIG_SION, 0x0, 0, \ | ||
117 | MX50_I2C_PAD_CTRL) | ||
118 | #define MX50_PAD_I2C3_SDA__GPIO_6_23 IOMUX_PAD(0x300, 0x54, 1, 0x0, 0, NO_PAD_CTRL) | ||
119 | #define MX50_PAD_I2C3_SDA__FEC_MDIO IOMUX_PAD(0x300, 0x54, 2, 0x774, 0, MX50_FEC_PAD_CTRL) | ||
120 | #define MX50_PAD_I2C3_SDA__PWRFAIL_INT IOMUX_PAD(0x300, 0x54, 3, 0x0, 0, NO_PAD_CTRL) | ||
121 | #define MX50_PAD_I2C3_SDA__ALARM_DEB IOMUX_PAD(0x300, 0x54, 4, 0x0, 0, NO_PAD_CTRL) | ||
122 | #define MX50_PAD_I2C3_SDA__GPT_CAPIN1 IOMUX_PAD(0x300, 0x54, 5, 0x0, 0, NO_PAD_CTRL) | ||
123 | #define MX50_PAD_I2C3_SDA__USBOTG_PWR IOMUX_PAD(0x300, 0x54, 7, 0x0, 0, \ | ||
124 | PAD_CTL_PKE | PAD_CTL_DSE_HIGH) | ||
125 | |||
126 | #define MX50_PAD_PWM1__PWM1_PWMO IOMUX_PAD(0x304, 0x58, 0, 0x0, 0, NO_PAD_CTRL) | ||
127 | #define MX50_PAD_PWM1__GPIO_6_24 IOMUX_PAD(0x304, 0x58, 1, 0x0, 0, NO_PAD_CTRL) | ||
128 | #define MX50_PAD_PWM1__USBOTG_OC IOMUX_PAD(0x304, 0x58, 2, 0x7E8, 1, MX50_USB_PAD_CTRL) | ||
129 | #define MX50_PAD_PWM1__GPT_CMPOUT1 IOMUX_PAD(0x304, 0x58, 5, 0x0, 0, NO_PAD_CTRL) | ||
130 | |||
131 | #define MX50_PAD_PWM2__PWM2_PWMO IOMUX_PAD(0x308, 0x5C, 0, 0x0, 0, NO_PAD_CTRL) | ||
132 | #define MX50_PAD_PWM2__GPIO_6_25 IOMUX_PAD(0x308, 0x5C, 1, 0x0, 0, NO_PAD_CTRL) | ||
133 | #define MX50_PAD_PWM2__USBOTG_PWR IOMUX_PAD(0x308, 0x5C, 2, 0x0, 0, \ | ||
134 | PAD_CTL_PKE | PAD_CTL_DSE_HIGH) | ||
135 | #define MX50_PAD_PWM2__DCDC_PWM IOMUX_PAD(0x308, 0x5C, 4, 0x0, 0, NO_PAD_CTRL) | ||
136 | #define MX50_PAD_PWM2__GPT_CMPOUT2 IOMUX_PAD(0x308, 0x5C, 5, 0x0, 0, NO_PAD_CTRL) | ||
137 | #define MX50_PAD_PWM2__ANY_PU_RST IOMUX_PAD(0x308, 0x5C, 7, 0x0, 0, NO_PAD_CTRL) | ||
138 | |||
139 | #define MX50_PAD_OWIRE__OWIRE IOMUX_PAD(0x30C, 0x60, 0, 0x0, 0, MX50_OWIRE_PAD_CTRL) | ||
140 | #define MX50_PAD_OWIRE__GPIO_6_26 IOMUX_PAD(0x30C, 0x60, 1, 0x0, 0, NO_PAD_CTRL) | ||
141 | #define MX50_PAD_OWIRE__USBH1_OC IOMUX_PAD(0x30C, 0x60, 2, 0x0, 0, MX50_USB_PAD_CTRL) | ||
142 | #define MX50_PAD_OWIRE__SSI_EXT1_CLK IOMUX_PAD(0x30C, 0x60, 3, 0x0, 0, NO_PAD_CTRL) | ||
143 | #define MX50_PAD_OWIRE__EPDC_PWRIRQ IOMUX_PAD(0x30C, 0x60, 4, 0x0, 0, NO_PAD_CTRL) | ||
144 | #define MX50_PAD_OWIRE__GPT_CMPOUT3 IOMUX_PAD(0x30C, 0x60, 5, 0x0, 0, NO_PAD_CTRL) | ||
145 | |||
146 | #define MX50_PAD_EPITO__EPITO IOMUX_PAD(0x310, 0x64, 0, 0x0, 0, NO_PAD_CTRL) | ||
147 | #define MX50_PAD_EPITO__GPIO_6_27 IOMUX_PAD(0x310, 0x64, 1, 0x0, 0, NO_PAD_CTRL) | ||
148 | #define MX50_PAD_EPITO__USBH1_PWR IOMUX_PAD(0x310, 0x64, 2, 0x0, 0, \ | ||
149 | PAD_CTL_PKE | PAD_CTL_DSE_HIGH) | ||
150 | #define MX50_PAD_EPITO__SSI_EXT2_CLK IOMUX_PAD(0x310, 0x64, 3, 0x0, 0, NO_PAD_CTRL) | ||
151 | #define MX50_PAD_EPITO__TOG_EN IOMUX_PAD(0x310, 0x64, 4, 0x0, 0, NO_PAD_CTRL) | ||
152 | #define MX50_PAD_EPITO__GPT_CLKIN IOMUX_PAD(0x310, 0x64, 5, 0x0, 0, NO_PAD_CTRL) | ||
153 | |||
154 | #define MX50_PAD_WDOG__WDOG IOMUX_PAD(0x314, 0x68, 0, 0x0, 0, NO_PAD_CTRL) | ||
155 | #define MX50_PAD_WDOG__GPIO_6_28 IOMUX_PAD(0x314, 0x68, 1, 0x0, 0, NO_PAD_CTRL) | ||
156 | #define MX50_PAD_WDOG__WDOG_RST IOMUX_PAD(0x314, 0x68, 2, 0x0, 0, NO_PAD_CTRL) | ||
157 | #define MX50_PAD_WDOG__XTAL32K IOMUX_PAD(0x314, 0x68, 6, 0x0, 0, NO_PAD_CTRL) | ||
158 | |||
159 | #define MX50_PAD_SSI_TXFS__SSI_TXFS IOMUX_PAD(0x318, 0x6C, 0, 0x0, 0, NO_PAD_CTRL) | ||
160 | #define MX50_PAD_SSI_TXFS__GPIO_6_0 IOMUX_PAD(0x318, 0x6C, 1, 0x0, 0, NO_PAD_CTRL) | ||
161 | |||
162 | #define MX50_PAD_SSI_TXC__SSI_TXC IOMUX_PAD(0x31C, 0x70, 0, 0x0, 0, NO_PAD_CTRL) | ||
163 | #define MX50_PAD_SSI_TXC__GPIO_6_1 IOMUX_PAD(0x31C, 0x70, 1, 0x0, 0, NO_PAD_CTRL) | ||
164 | |||
165 | #define MX50_PAD_SSI_TXD__SSI_TXD IOMUX_PAD(0x320, 0x74, 0, 0x0, 0, NO_PAD_CTRL) | ||
166 | #define MX50_PAD_SSI_TXD__GPIO_6_2 IOMUX_PAD(0x320, 0x74, 1, 0x0, 0, NO_PAD_CTRL) | ||
167 | #define MX50_PAD_SSI_TXD__CSPI_RDY IOMUX_PAD(0x320, 0x74, 4, 0x6e8, 0, NO_PAD_CTRL) | ||
168 | |||
169 | #define MX50_PAD_SSI_RXD__SSI_RXD IOMUX_PAD(0x324, 0x78, 0, 0x0, 0, NO_PAD_CTRL) | ||
170 | #define MX50_PAD_SSI_RXD__GPIO_6_3 IOMUX_PAD(0x324, 0x78, 1, 0x0, 0, NO_PAD_CTRL) | ||
171 | #define MX50_PAD_SSI_RXD__CSPI_SS3 IOMUX_PAD(0x324, 0x78, 4, 0x6f4, 0, MX50_CSPI_SS_PAD) | ||
172 | |||
173 | #define MX50_PAD_SSI_RXFS__AUD3_RXFS IOMUX_PAD(0x328, 0x7C, 0, 0x0, 0, NO_PAD_CTRL) | ||
174 | #define MX50_PAD_SSI_RXFS__GPIO_6_4 IOMUX_PAD(0x328, 0x7C, 1, 0x0, 0, NO_PAD_CTRL) | ||
175 | #define MX50_PAD_SSI_RXFS__UART5_TXD IOMUX_PAD(0x328, 0x7C, 2, 0x7e4, 0, MX50_UART_PAD_CTRL) | ||
176 | #define MX50_PAD_SSI_RXFS__WEIM_D6 IOMUX_PAD(0x328, 0x7C, 3, 0x804, 0, NO_PAD_CTRL) | ||
177 | #define MX50_PAD_SSI_RXFS__CSPI_SS2 IOMUX_PAD(0x328, 0x7C, 4, 0x6f0, 0, MX50_CSPI_SS_PAD) | ||
178 | #define MX50_PAD_SSI_RXFS__FEC_COL IOMUX_PAD(0x328, 0x7C, 5, 0x770, 0, PAD_CTL_DSE_HIGH) | ||
179 | #define MX50_PAD_SSI_RXFS__FEC_MDC IOMUX_PAD(0x328, 0x7C, 6, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
180 | |||
181 | #define MX50_PAD_SSI_RXC__AUD3_RXC IOMUX_PAD(0x32C, 0x80, 0, 0x0, 0, NO_PAD_CTRL) | ||
182 | #define MX50_PAD_SSI_RXC__GPIO_6_5 IOMUX_PAD(0x32C, 0x80, 1, 0x0, 0, NO_PAD_CTRL) | ||
183 | #define MX50_PAD_SSI_RXC__UART5_RXD IOMUX_PAD(0x32C, 0x80, 2, 0x7e4, 1, MX50_UART_PAD_CTRL) | ||
184 | #define MX50_PAD_SSI_RXC__WEIM_D7 IOMUX_PAD(0x32C, 0x80, 3, 0x808, 0, NO_PAD_CTRL) | ||
185 | #define MX50_PAD_SSI_RXC__CSPI_SS1 IOMUX_PAD(0x32C, 0x80, 4, 0x6ec, 0, MX50_CSPI_SS_PAD) | ||
186 | #define MX50_PAD_SSI_RXC__FEC_RX_CLK IOMUX_PAD(0x32C, 0x80, 5, 0x780, 0, NO_PAD_CTRL) | ||
187 | #define MX50_PAD_SSI_RXC__FEC_MDIO IOMUX_PAD(0x32C, 0x80, 6, 0x774, 1, MX50_FEC_PAD_CTRL) | ||
188 | |||
189 | #define MX50_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x330, 0x84, 0, 0x7c4, 0, MX50_UART_PAD_CTRL) | ||
190 | #define MX50_PAD_UART1_TXD__GPIO_6_6 IOMUX_PAD(0x330, 0x84, 1, 0x0, 0, NO_PAD_CTRL) | ||
191 | |||
192 | #define MX50_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x334, 0x88, 0, 0x7c4, 1, MX50_UART_PAD_CTRL) | ||
193 | #define MX50_PAD_UART1_RXD__GPIO_6_7 IOMUX_PAD(0x334, 0x88, 1, 0x0, 0, NO_PAD_CTRL) | ||
194 | |||
195 | #define MX50_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(0x338, 0x8C, 0, 0x7c0, 0, MX50_UART_PAD_CTRL) | ||
196 | #define MX50_PAD_UART1_CTS__GPIO_6_8 IOMUX_PAD(0x338, 0x8C, 1, 0x0, 0, NO_PAD_CTRL) | ||
197 | #define MX50_PAD_UART1_CTS__UART5_TXD IOMUX_PAD(0x338, 0x8C, 2, 0x7e4, 2, MX50_UART_PAD_CTRL) | ||
198 | #define MX50_PAD_UART1_CTS__SD4_D4 IOMUX_PAD(0x338, 0x8C, 4, 0x760, 0, MX50_SD_PAD_CTRL) | ||
199 | #define MX50_PAD_UART1_CTS__SD4_CMD IOMUX_PAD(0x338, 0x8C, 5, 0x74c, 0, MX50_SD_PAD_CTRL) | ||
200 | |||
201 | #define MX50_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(0x33C, 0x90, 0, 0x7c0, 1, MX50_UART_PAD_CTRL) | ||
202 | #define MX50_PAD_UART1_RTS__GPIO_6_9 IOMUX_PAD(0x33C, 0x90, 1, 0x0, 0, NO_PAD_CTRL) | ||
203 | #define MX50_PAD_UART1_RTS__UART5_RXD IOMUX_PAD(0x33C, 0x90, 2, 0x7e4, 3, MX50_UART_PAD_CTRL) | ||
204 | #define MX50_PAD_UART1_RTS__SD4_D5 IOMUX_PAD(0x33C, 0x90, 4, 0x0, 1, MX50_SD_PAD_CTRL) | ||
205 | #define MX50_PAD_UART1_RTS__SD4_CLK IOMUX_PAD(0x33C, 0x90, 5, 0x0, 1, MX50_SD_PAD_CTRL) | ||
206 | |||
207 | #define MX50_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x340, 0x94, 0, 0x7cc, 2, MX50_UART_PAD_CTRL) | ||
208 | #define MX50_PAD_UART2_TXD__GPIO_6_10 IOMUX_PAD(0x340, 0x94, 1, 0x0, 0, NO_PAD_CTRL) | ||
209 | #define MX50_PAD_UART2_TXD__SD4_D6 IOMUX_PAD(0x340, 0x94, 4, 0x768, 0, MX50_SD_PAD_CTRL) | ||
210 | #define MX50_PAD_UART2_TXD__SD4_D4 IOMUX_PAD(0x340, 0x94, 5, 0x760, 1, MX50_SD_PAD_CTRL) | ||
211 | |||
212 | #define MX50_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x344, 0x98, 0, 0x7cc, 3, MX50_UART_PAD_CTRL) | ||
213 | #define MX50_PAD_UART2_RXD__GPIO_6_11 IOMUX_PAD(0x344, 0x98, 1, 0x0, 0, NO_PAD_CTRL) | ||
214 | #define MX50_PAD_UART2_RXD__SD4_D7 IOMUX_PAD(0x344, 0x98, 4, 0x76c, 0, MX50_SD_PAD_CTRL) | ||
215 | #define MX50_PAD_UART2_RXD__SD4_D5 IOMUX_PAD(0x344, 0x98, 5, 0x764, 1, MX50_SD_PAD_CTRL) | ||
216 | |||
217 | #define MX50_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(0x348, 0x9C, 0, 0x7c8, 2, MX50_UART_PAD_CTRL) | ||
218 | #define MX50_PAD_UART2_CTS__GPIO_6_12 IOMUX_PAD(0x348, 0x9C, 1, 0x0, 0, NO_PAD_CTRL) | ||
219 | #define MX50_PAD_UART2_CTS__SD4_CMD IOMUX_PAD(0x348, 0x9C, 4, 0x74c, 1, MX50_SD_PAD_CTRL) | ||
220 | #define MX50_PAD_UART2_CTS__SD4_D6 IOMUX_PAD(0x348, 0x9C, 5, 0x768, 1, MX50_SD_PAD_CTRL) | ||
221 | |||
222 | #define MX50_PAD_UART2_RTS__UART2_RTS IOMUX_PAD(0x34C, 0xA0, 0, 0x7c8, 3, MX50_UART_PAD_CTRL) | ||
223 | #define MX50_PAD_UART2_RTS__GPIO_6_13 IOMUX_PAD(0x34C, 0xA0, 1, 0x0, 0, NO_PAD_CTRL) | ||
224 | #define MX50_PAD_UART2_RTS__SD4_CLK IOMUX_PAD(0x34C, 0xA0, 4, 0x748, 1, MX50_SD_PAD_CTRL) | ||
225 | #define MX50_PAD_UART2_RTS__SD4_D7 IOMUX_PAD(0x34C, 0xA0, 5, 0x76c, 1, MX50_SD_PAD_CTRL) | ||
226 | |||
227 | #define MX50_PAD_UART3_TXD__UART3_TXD IOMUX_PAD(0x350, 0xA4, 0, 0x7d4, 0, MX50_UART_PAD_CTRL) | ||
228 | #define MX50_PAD_UART3_TXD__GPIO_6_14 IOMUX_PAD(0x350, 0xA4, 1, 0x0, 0, NO_PAD_CTRL) | ||
229 | #define MX50_PAD_UART3_TXD__SD1_D4 IOMUX_PAD(0x350, 0xA4, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
230 | #define MX50_PAD_UART3_TXD__SD4_D0 IOMUX_PAD(0x350, 0xA4, 4, 0x750, 0, MX50_SD_PAD_CTRL) | ||
231 | #define MX50_PAD_UART3_TXD__SD2_WP IOMUX_PAD(0x350, 0xA4, 5, 0x744, 0, MX50_SD_PAD_CTRL) | ||
232 | #define MX50_PAD_UART3_TXD__WEIM_D12 IOMUX_PAD(0x350, 0xA4, 6, 0x81c, 0, NO_PAD_CTRL) | ||
233 | |||
234 | #define MX50_PAD_UART3_RXD__UART3_RXD IOMUX_PAD(0x354, 0xA8, 0, 0x7d4, 1, MX50_UART_PAD_CTRL) | ||
235 | #define MX50_PAD_UART3_RXD__GPIO_6_15 IOMUX_PAD(0x354, 0xA8, 1, 0x0, 0, NO_PAD_CTRL) | ||
236 | #define MX50_PAD_UART3_RXD__SD1_D5 IOMUX_PAD(0x354, 0xA8, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
237 | #define MX50_PAD_UART3_RXD__SD4_D1 IOMUX_PAD(0x354, 0xA8, 4, 0x754, 0, MX50_SD_PAD_CTRL) | ||
238 | #define MX50_PAD_UART3_RXD__SD2_CD IOMUX_PAD(0x354, 0xA8, 5, 0x740, 0, MX50_SD_PAD_CTRL) | ||
239 | #define MX50_PAD_UART3_RXD__WEIM_D13 IOMUX_PAD(0x354, 0xA8, 6, 0x820, 0, NO_PAD_CTRL) | ||
240 | |||
241 | #define MX50_PAD_UART4_TXD__UART4_TXD IOMUX_PAD(0x358, 0xAC, 0, 0x7dc, 0, MX50_UART_PAD_CTRL) | ||
242 | #define MX50_PAD_UART4_TXD__GPIO_6_16 IOMUX_PAD(0x358, 0xAC, 1, 0x0, 0, NO_PAD_CTRL) | ||
243 | #define MX50_PAD_UART4_TXD__UART3_CTS IOMUX_PAD(0x358, 0xAC, 2, 0x7d0, 0, MX50_UART_PAD_CTRL) | ||
244 | #define MX50_PAD_UART4_TXD__SD1_D6 IOMUX_PAD(0x358, 0xAC, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
245 | #define MX50_PAD_UART4_TXD__SD4_D2 IOMUX_PAD(0x358, 0xAC, 4, 0x758, 0, MX50_SD_PAD_CTRL) | ||
246 | #define MX50_PAD_UART4_TXD__SD2_LCTL IOMUX_PAD(0x358, 0xAC, 5, 0x0, 0, MX50_SD_PAD_CTRL) | ||
247 | #define MX50_PAD_UART4_TXD__WEIM_D14 IOMUX_PAD(0x358, 0xAC, 6, 0x824, 0, NO_PAD_CTRL) | ||
248 | |||
249 | #define MX50_PAD_UART4_RXD__UART4_RXD IOMUX_PAD(0x35C, 0xB0, 0, 0x7dc, 1, MX50_UART_PAD_CTRL) | ||
250 | #define MX50_PAD_UART4_RXD__GPIO_6_17 IOMUX_PAD(0x35C, 0xB0, 1, 0x0, 0, NO_PAD_CTRL) | ||
251 | #define MX50_PAD_UART4_RXD__UART3_RTS IOMUX_PAD(0x35C, 0xB0, 2, 0x7d0, 1, MX50_UART_PAD_CTRL) | ||
252 | #define MX50_PAD_UART4_RXD__SD1_D7 IOMUX_PAD(0x35C, 0xB0, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
253 | #define MX50_PAD_UART4_RXD__SD4_D3 IOMUX_PAD(0x35C, 0xB0, 4, 0x75c, 0, MX50_SD_PAD_CTRL) | ||
254 | #define MX50_PAD_UART4_RXD__SD1_LCTL IOMUX_PAD(0x35C, 0xB0, 5, 0x0, 0, MX50_SD_PAD_CTRL) | ||
255 | #define MX50_PAD_UART4_RXD__WEIM_D15 IOMUX_PAD(0x35C, 0xB0, 6, 0x828, 0, NO_PAD_CTRL) | ||
256 | |||
257 | #define MX50_PAD_CSPI_SCLK__CSPI_SCLK IOMUX_PAD(0x360, 0xB4, 0, 0x0, 0, NO_PAD_CTRL) | ||
258 | #define MX50_PAD_CSPI_SCLK__GPIO_4_8 IOMUX_PAD(0x360, 0xB4, 1, 0x0, 0, NO_PAD_CTRL) | ||
259 | |||
260 | #define MX50_PAD_CSPI_MOSI__CSPI_MOSI IOMUX_PAD(0x364, 0xB8, 0, 0x0, 0, NO_PAD_CTRL) | ||
261 | #define MX50_PAD_CSPI_MOSI__GPIO_4_9 IOMUX_PAD(0x364, 0xB8, 1, 0x0, 0, NO_PAD_CTRL) | ||
262 | |||
263 | #define MX50_PAD_CSPI_MISO__CSPI_MISO IOMUX_PAD(0x368, 0xBC, 0, 0x0, 0, NO_PAD_CTRL) | ||
264 | #define MX50_PAD_CSPI_MISO__GPIO_4_10 IOMUX_PAD(0x368, 0xBC, 1, 0x0, 0, NO_PAD_CTRL) | ||
265 | |||
266 | #define MX50_PAD_CSPI_SS0__CSPI_SS0 IOMUX_PAD(0x36C, 0xC0, 0, 0x0, 0, MX50_CSPI_SS_PAD) | ||
267 | #define MX50_PAD_CSPI_SS0__GPIO_4_11 IOMUX_PAD(0x36C, 0xC0, 1, 0x0, 0, NO_PAD_CTRL) | ||
268 | |||
269 | #define MX50_PAD_ECSPI1_SCLK__ECSPI1_SCLK IOMUX_PAD(0x370, 0xC4, 0, 0x0, 0, NO_PAD_CTRL) | ||
270 | #define MX50_PAD_ECSPI1_SCLK__GPIO_4_12 IOMUX_PAD(0x370, 0xC4, 1, 0x0, 0, NO_PAD_CTRL) | ||
271 | #define MX50_PAD_ECSPI1_SCLK__CSPI_RDY IOMUX_PAD(0x370, 0xC4, 2, 0x6e8, 1, NO_PAD_CTRL) | ||
272 | #define MX50_PAD_ECSPI1_SCLK__ECSPI2_RDY IOMUX_PAD(0x370, 0xC4, 3, 0x0, 0, NO_PAD_CTRL) | ||
273 | #define MX50_PAD_ECSPI1_SCLK__UART3_RTS IOMUX_PAD(0x370, 0xC4, 4, 0x7d0, 2, MX50_UART_PAD_CTRL) | ||
274 | #define MX50_PAD_ECSPI1_SCLK__EPDC_SDCE6 IOMUX_PAD(0x370, 0xC4, 5, 0x0, 0, NO_PAD_CTRL) | ||
275 | #define MX50_PAD_ECSPI1_SCLK__WEIM_D8 IOMUX_PAD(0x370, 0xC4, 7, 0x80c, 0, NO_PAD_CTRL) | ||
276 | |||
277 | #define MX50_PAD_ECSPI1_MOSI__ECSPI1_MOSI IOMUX_PAD(0x374, 0xC8, 0, 0x0, 0, NO_PAD_CTRL) | ||
278 | #define MX50_PAD_ECSPI1_MOSI__GPIO_4_13 IOMUX_PAD(0x374, 0xC8, 1, 0x0, 0, NO_PAD_CTRL) | ||
279 | #define MX50_PAD_ECSPI1_MOSI__CSPI_SS1 IOMUX_PAD(0x374, 0xC8, 2, 0x6ec, 1, MX50_CSPI_SS_PAD) | ||
280 | #define MX50_PAD_ECSPI1_MOSI__ECSPI2_SS1 IOMUX_PAD(0x374, 0xC8, 3, 0x0, 0, MX50_CSPI_SS_PAD) | ||
281 | #define MX50_PAD_ECSPI1_MOSI__UART3_CTS IOMUX_PAD(0x374, 0xC8, 4, 0x7d0, 3, MX50_UART_PAD_CTRL) | ||
282 | #define MX50_PAD_ECSPI1_MOSI__EPDC_SDCE7 IOMUX_PAD(0x374, 0xC8, 5, 0x0, 0, NO_PAD_CTRL) | ||
283 | #define MX50_PAD_ECSPI1_MOSI__WEIM_D9 IOMUX_PAD(0x374, 0xC8, 7, 0x810, 0, NO_PAD_CTRL) | ||
284 | |||
285 | #define MX50_PAD_ECSPI1_MISO__ECSPI1_MISO IOMUX_PAD(0x378, 0xCC, 0, 0x0, 0, NO_PAD_CTRL) | ||
286 | #define MX50_PAD_ECSPI1_MISO__GPIO_4_14 IOMUX_PAD(0x378, 0xCC, 1, 0x0, 0, NO_PAD_CTRL) | ||
287 | #define MX50_PAD_ECSPI1_MISO__CSPI_SS2 IOMUX_PAD(0x378, 0xCC, 2, 0x6f0, 1, MX50_CSPI_SS_PAD) | ||
288 | #define MX50_PAD_ECSPI1_MISO__ECSPI2_SS2 IOMUX_PAD(0x378, 0xCC, 3, 0x0, 0, MX50_CSPI_SS_PAD) | ||
289 | #define MX50_PAD_ECSPI1_MISO__UART4_RTS IOMUX_PAD(0x378, 0xCC, 4, 0x7d8, 0, MX50_UART_PAD_CTRL) | ||
290 | #define MX50_PAD_ECSPI1_MISO__EPDC_SDCE8 IOMUX_PAD(0x378, 0xCC, 5, 0x0, 0, NO_PAD_CTRL) | ||
291 | #define MX50_PAD_ECSPI1_MISO__WEIM_D10 IOMUX_PAD(0x378, 0xCC, 7, 0x814, 0, NO_PAD_CTRL) | ||
292 | |||
293 | #define MX50_PAD_ECSPI1_SS0__ECSPI1_SS0 IOMUX_PAD(0x37C, 0xD0, 0, 0x0, 0, MX50_CSPI_SS_PAD) | ||
294 | #define MX50_PAD_ECSPI1_SS0__GPIO_4_15 IOMUX_PAD(0x37C, 0xD0, 1, 0x0, 0, PAD_CTL_PUS_100K_UP) | ||
295 | #define MX50_PAD_ECSPI1_SS0__CSPI_SS3 IOMUX_PAD(0x37C, 0xD0, 2, 0x6f4, 1, MX50_CSPI_SS_PAD) | ||
296 | #define MX50_PAD_ECSPI1_SS0__ECSPI2_SS3 IOMUX_PAD(0x37C, 0xD0, 3, 0x0, 0, MX50_CSPI_SS_PAD) | ||
297 | #define MX50_PAD_ECSPI1_SS0__UART4_CTS IOMUX_PAD(0x37C, 0xD0, 4, 0x7d8, 1, MX50_UART_PAD_CTRL) | ||
298 | #define MX50_PAD_ECSPI1_SS0__EPDC_SDCE9 IOMUX_PAD(0x37C, 0xD0, 5, 0x0, 0, NO_PAD_CTRL) | ||
299 | #define MX50_PAD_ECSPI1_SS0__WEIM_D11 IOMUX_PAD(0x37C, 0xD0, 7, 0x818, 0, NO_PAD_CTRL) | ||
300 | |||
301 | #define MX50_PAD_ECSPI2_SCLK__ECSPI2_SCLK IOMUX_PAD(0x380, 0xD4, 0, 0x0, 0, NO_PAD_CTRL) | ||
302 | #define MX50_PAD_ECSPI2_SCLK__GPIO_4_16 IOMUX_PAD(0x380, 0xD4, 1, 0x0, 0, NO_PAD_CTRL) | ||
303 | #define MX50_PAD_ECSPI2_SCLK__ELCDIF_WR IOMUX_PAD(0x380, 0xD4, 2, 0x0, 0, NO_PAD_CTRL) | ||
304 | #define MX50_PAD_ECSPI2_SCLK__ECSPI1_RDY IOMUX_PAD(0x380, 0xD4, 3, 0x0, 0, NO_PAD_CTRL) | ||
305 | #define MX50_PAD_ECSPI2_SCLK__UART5_RTS IOMUX_PAD(0x380, 0xD4, 4, 0x7e0, 0, MX50_UART_PAD_CTRL) | ||
306 | #define MX50_PAD_ECSPI2_SCLK__ELCDIF_DOTCLK IOMUX_PAD(0x380, 0xD4, 5, 0x0, 0, NO_PAD_CTRL) | ||
307 | #define MX50_PAD_ECSPI2_SCLK__NANDF_CEN4 IOMUX_PAD(0x380, 0xD4, 6, 0x0, 0, NO_PAD_CTRL) | ||
308 | #define MX50_PAD_ECSPI2_SCLK__WEIM_D8 IOMUX_PAD(0x380, 0xD4, 7, 0x80c, 1, NO_PAD_CTRL) | ||
309 | |||
310 | #define MX50_PAD_ECSPI2_MOSI__ECSPI2_MOSI IOMUX_PAD(0x384, 0xD8, 0, 0x0, 0, NO_PAD_CTRL) | ||
311 | #define MX50_PAD_ECSPI2_MOSI__GPIO_4_17 IOMUX_PAD(0x384, 0xD8, 1, 0x0, 0, NO_PAD_CTRL) | ||
312 | #define MX50_PAD_ECSPI2_MOSI__ELCDIF_RD IOMUX_PAD(0x384, 0xD8, 2, 0x0, 0, NO_PAD_CTRL) | ||
313 | #define MX50_PAD_ECSPI2_MOSI__ECSPI1_SS1 IOMUX_PAD(0x384, 0xD8, 3, 0x0, 0, MX50_CSPI_SS_PAD) | ||
314 | #define MX50_PAD_ECSPI2_MOSI__UART5_CTS IOMUX_PAD(0x384, 0xD8, 4, 0x7e0, 1, MX50_UART_PAD_CTRL) | ||
315 | #define MX50_PAD_ECSPI2_MOSI__ELCDIF_EN IOMUX_PAD(0x384, 0xD8, 5, 0x0, 0, NO_PAD_CTRL) | ||
316 | #define MX50_PAD_ECSPI2_MOSI__NANDF_CEN5 IOMUX_PAD(0x384, 0xD8, 6, 0x0, 0, NO_PAD_CTRL) | ||
317 | #define MX50_PAD_ECSPI2_MOSI__WEIM_D9 IOMUX_PAD(0x384, 0xD8, 7, 0x810, 1, NO_PAD_CTRL) | ||
318 | |||
319 | #define MX50_PAD_ECSPI2_MISO__ECSPI2_MISO IOMUX_PAD(0x388, 0xDC, 0, 0x73c, 0, NO_PAD_CTRL) | ||
320 | #define MX50_PAD_ECSPI2_MISO__GPIO_4_18 IOMUX_PAD(0x388, 0xDC, 1, 0x0, 0, PAD_CTL_PUS_100K_UP) | ||
321 | #define MX50_PAD_ECSPI2_MISO__ELCDIF_RS IOMUX_PAD(0x388, 0xDC, 2, 0x0, 0, NO_PAD_CTRL) | ||
322 | #define MX50_PAD_ECSPI2_MISO__ECSPI1_SS2 IOMUX_PAD(0x388, 0xDC, 3, 0x0, 0, MX50_CSPI_SS_PAD) | ||
323 | #define MX50_PAD_ECSPI2_MISO__UART5_TXD IOMUX_PAD(0x388, 0xDC, 4, 0x7e4, 4, MX50_UART_PAD_CTRL) | ||
324 | #define MX50_PAD_ECSPI2_MISO__ELCDIF_VSYNC IOMUX_PAD(0x388, 0xDC, 5, 0x0, 0, NO_PAD_CTRL) | ||
325 | #define MX50_PAD_ECSPI2_MISO__NANDF_CEN6 IOMUX_PAD(0x388, 0xDC, 6, 0x0, 0, NO_PAD_CTRL) | ||
326 | #define MX50_PAD_ECSPI2_MISO__WEIM_D10 IOMUX_PAD(0x388, 0xDC, 7, 0x814, 1, NO_PAD_CTRL) | ||
327 | |||
328 | #define MX50_PAD_ECSPI2_SS0__ECSPI2_SS0 IOMUX_PAD(0x38C, 0xE0, 0, 0x0, 0, MX50_CSPI_SS_PAD) | ||
329 | #define MX50_PAD_ECSPI2_SS0__GPIO_4_19 IOMUX_PAD(0x38C, 0xE0, 1, 0x0, 0, NO_PAD_CTRL) | ||
330 | #define MX50_PAD_ECSPI2_SS0__ELCDIF_CS IOMUX_PAD(0x38C, 0xE0, 2, 0x0, 0, NO_PAD_CTRL) | ||
331 | #define MX50_PAD_ECSPI2_SS0__ECSPI1_SS3 IOMUX_PAD(0x38C, 0xE0, 3, 0x0, 0, MX50_CSPI_SS_PAD) | ||
332 | #define MX50_PAD_ECSPI2_SS0__UART5_RXD IOMUX_PAD(0x38C, 0xE0, 4, 0x7e4, 5, MX50_UART_PAD_CTRL) | ||
333 | #define MX50_PAD_ECSPI2_SS0__ELCDIF_HSYNC IOMUX_PAD(0x38C, 0xE0, 5, 0x6f8, 0, NO_PAD_CTRL) | ||
334 | #define MX50_PAD_ECSPI2_SS0__NANDF_CEN7 IOMUX_PAD(0x38C, 0xE0, 6, 0x0, 0, NO_PAD_CTRL) | ||
335 | #define MX50_PAD_ECSPI2_SS0__WEIM_D11 IOMUX_PAD(0x38C, 0xE0, 7, 0x818, 1, NO_PAD_CTRL) | ||
336 | |||
337 | #define MX50_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x390, 0xE4, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL) | ||
338 | #define MX50_PAD_SD1_CLK__GPIO_5_0 IOMUX_PAD(0x390, 0xE4, 1, 0x0, 0, NO_PAD_CTRL) | ||
339 | #define MX50_PAD_SD1_CLK__CLKO IOMUX_PAD(0x390, 0xE4, 7, 0x0, 0, NO_PAD_CTRL) | ||
340 | |||
341 | #define MX50_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x394, 0xE8, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL) | ||
342 | #define MX50_PAD_SD1_CMD__GPIO_5_1 IOMUX_PAD(0x394, 0xE8, 1, 0x0, 0, NO_PAD_CTRL) | ||
343 | #define MX50_PAD_SD1_CMD__CLKO2 IOMUX_PAD(0x394, 0xE8, 7, 0x0, 0, NO_PAD_CTRL) | ||
344 | |||
345 | #define MX50_PAD_SD1_D0__SD1_D0 IOMUX_PAD(0x398, 0xEC, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
346 | #define MX50_PAD_SD1_D0__GPIO_5_2 IOMUX_PAD(0x398, 0xEC, 1, 0x0, 0, NO_PAD_CTRL) | ||
347 | #define MX50_PAD_SD1_D0__PLL1_BYP IOMUX_PAD(0x398, 0xEC, 7, 0x6dc, 0, NO_PAD_CTRL) | ||
348 | |||
349 | #define MX50_PAD_SD1_D1__SD1_D1 IOMUX_PAD(0x39C, 0xF0, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
350 | #define MX50_PAD_SD1_D1__GPIO_5_3 IOMUX_PAD(0x39C, 0xF0, 1, 0x0, 0, NO_PAD_CTRL) | ||
351 | #define MX50_PAD_SD1_D1__PLL2_BYP IOMUX_PAD(0x39C, 0xF0, 7, 0x6e0, 0, NO_PAD_CTRL) | ||
352 | |||
353 | #define MX50_PAD_SD1_D2__SD1_D2 IOMUX_PAD(0x3A0, 0xF4, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
354 | #define MX50_PAD_SD1_D2__GPIO_5_4 IOMUX_PAD(0x3A0, 0xF4, 1, 0x0, 0, NO_PAD_CTRL) | ||
355 | #define MX50_PAD_SD1_D2__PLL3_BYP IOMUX_PAD(0x3A0, 0xF4, 7, 0x6e4, 0, NO_PAD_CTRL) | ||
356 | |||
357 | #define MX50_PAD_SD1_D3__SD1_D3 IOMUX_PAD(0x3A4, 0xF8, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
358 | #define MX50_PAD_SD1_D3__GPIO_5_5 IOMUX_PAD(0x3A4, 0xF8, 1, 0x0, 0, NO_PAD_CTRL) | ||
359 | |||
360 | #define MX50_PAD_SD2_CLK__SD2_CLK IOMUX_PAD(0x3A8, 0xFC, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL) | ||
361 | #define MX50_PAD_SD2_CLK__GPIO_5_6 IOMUX_PAD(0x3A8, 0xFC, 1, 0x0, 0, NO_PAD_CTRL) | ||
362 | #define MX50_PAD_SD2_CLK__MSHC_SCLK IOMUX_PAD(0x3A8, 0xFC, 2, 0x0, 0, MX50_SD_PAD_CTRL) | ||
363 | |||
364 | #define MX50_PAD_SD2_CMD__SD2_CMD IOMUX_PAD(0x3AC, 0x100, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL) | ||
365 | #define MX50_PAD_SD2_CMD__GPIO_5_7 IOMUX_PAD(0x3AC, 0x100, 1, 0x0, 0, NO_PAD_CTRL) | ||
366 | #define MX50_PAD_SD2_CMD__MSHC_BS IOMUX_PAD(0x3AC, 0x100, 2, 0x0, 0, MX50_SD_PAD_CTRL) | ||
367 | |||
368 | #define MX50_PAD_SD2_D0__SD2_D0 IOMUX_PAD(0x3B0, 0x104, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
369 | #define MX50_PAD_SD2_D0__GPIO_5_8 IOMUX_PAD(0x3B0, 0x104, 1, 0x0, 0, NO_PAD_CTRL) | ||
370 | #define MX50_PAD_SD2_D0__MSHC_D0 IOMUX_PAD(0x3B0, 0x104, 2, 0x0, 0, MX50_SD_PAD_CTRL) | ||
371 | #define MX50_PAD_SD2_D0__KEY_COL4 IOMUX_PAD(0x3B0, 0x104, 3, 0x790, 0, NO_PAD_CTRL) | ||
372 | |||
373 | #define MX50_PAD_SD2_D1__SD2_D1 IOMUX_PAD(0x3B4, 0x108, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
374 | #define MX50_PAD_SD2_D1__GPIO_5_9 IOMUX_PAD(0x3B4, 0x108, 1, 0x0, 0, NO_PAD_CTRL) | ||
375 | #define MX50_PAD_SD2_D1__MSHC_D1 IOMUX_PAD(0x3B4, 0x108, 2, 0x0, 0, MX50_SD_PAD_CTRL) | ||
376 | #define MX50_PAD_SD2_D1__KEY_ROW4 IOMUX_PAD(0x3B4, 0x108, 3, 0x7a0, 0, NO_PAD_CTRL) | ||
377 | |||
378 | #define MX50_PAD_SD2_D2__SD2_D2 IOMUX_PAD(0x3B8, 0x10C, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
379 | #define MX50_PAD_SD2_D2__GPIO_5_10 IOMUX_PAD(0x3B8, 0x10C, 1, 0x0, 0, NO_PAD_CTRL) | ||
380 | #define MX50_PAD_SD2_D2__MSHC_D2 IOMUX_PAD(0x3B8, 0x10C, 2, 0x0, 0, MX50_SD_PAD_CTRL) | ||
381 | #define MX50_PAD_SD2_D2__KEY_COL5 IOMUX_PAD(0x3B8, 0x10C, 3, 0x794, 0, NO_PAD_CTRL) | ||
382 | |||
383 | #define MX50_PAD_SD2_D3__SD2_D3 IOMUX_PAD(0x3BC, 0x110, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
384 | #define MX50_PAD_SD2_D3__GPIO_5_11 IOMUX_PAD(0x3BC, 0x110, 1, 0x0, 0, NO_PAD_CTRL) | ||
385 | #define MX50_PAD_SD2_D3__MSHC_D3 IOMUX_PAD(0x3BC, 0x110, 2, 0x0, 0, MX50_SD_PAD_CTRL) | ||
386 | #define MX50_PAD_SD2_D3__KEY_ROW5 IOMUX_PAD(0x3BC, 0x110, 3, 0x7a4, 0, NO_PAD_CTRL) | ||
387 | |||
388 | #define MX50_PAD_SD2_D4__SD2_D4 IOMUX_PAD(0x3C0, 0x114, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
389 | #define MX50_PAD_SD2_D4__GPIO_5_12 IOMUX_PAD(0x3C0, 0x114, 1, 0x0, 0, NO_PAD_CTRL) | ||
390 | #define MX50_PAD_SD2_D4__AUD4_RXFS IOMUX_PAD(0x3C0, 0x114, 2, 0x6d0, 0, NO_PAD_CTRL) | ||
391 | #define MX50_PAD_SD2_D4__KEY_COL6 IOMUX_PAD(0x3C0, 0x114, 3, 0x798, 0, NO_PAD_CTRL) | ||
392 | #define MX50_PAD_SD2_D4__WEIM_D0 IOMUX_PAD(0x3C0, 0x114, 4, 0x7ec, 0, NO_PAD_CTRL) | ||
393 | #define MX50_PAD_SD2_D4__CCM_OUT0 IOMUX_PAD(0x3C0, 0x114, 7, 0x0, 0, NO_PAD_CTRL) | ||
394 | |||
395 | #define MX50_PAD_SD2_D5__SD2_D5 IOMUX_PAD(0x3C4, 0x118, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
396 | #define MX50_PAD_SD2_D5__GPIO_5_13 IOMUX_PAD(0x3C4, 0x118, 1, 0x0, 0, NO_PAD_CTRL) | ||
397 | #define MX50_PAD_SD2_D5__AUD4_RXC IOMUX_PAD(0x3C4, 0x118, 2, 0x6cc, 0, NO_PAD_CTRL) | ||
398 | #define MX50_PAD_SD2_D5__KEY_ROW6 IOMUX_PAD(0x3C4, 0x118, 3, 0x7a8, 0, NO_PAD_CTRL) | ||
399 | #define MX50_PAD_SD2_D5__WEIM_D1 IOMUX_PAD(0x3C4, 0x118, 4, 0x7f0, 0, NO_PAD_CTRL) | ||
400 | #define MX50_PAD_SD2_D5__CCM_OUT1 IOMUX_PAD(0x3C4, 0x118, 7, 0x0, 0, NO_PAD_CTRL) | ||
401 | |||
402 | #define MX50_PAD_SD2_D6__SD2_D6 IOMUX_PAD(0x3C8, 0x11C, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
403 | #define MX50_PAD_SD2_D6__GPIO_5_14 IOMUX_PAD(0x3C8, 0x11C, 1, 0x0, 0, NO_PAD_CTRL) | ||
404 | #define MX50_PAD_SD2_D6__AUD4_RXD IOMUX_PAD(0x3C8, 0x11C, 2, 0x6c4, 0, NO_PAD_CTRL) | ||
405 | #define MX50_PAD_SD2_D6__KEY_COL7 IOMUX_PAD(0x3C8, 0x11C, 3, 0x79c, 0, NO_PAD_CTRL) | ||
406 | #define MX50_PAD_SD2_D6__WEIM_D2 IOMUX_PAD(0x3C8, 0x11C, 4, 0x7f4, 0, NO_PAD_CTRL) | ||
407 | #define MX50_PAD_SD2_D6__CCM_OUT2 IOMUX_PAD(0x3C8, 0x11C, 7, 0x0, 0, NO_PAD_CTRL) | ||
408 | |||
409 | #define MX50_PAD_SD2_D7__SD2_D7 IOMUX_PAD(0x3CC, 0x120, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
410 | #define MX50_PAD_SD2_D7__GPIO_5_15 IOMUX_PAD(0x3CC, 0x120, 1, 0x0, 0, NO_PAD_CTRL) | ||
411 | #define MX50_PAD_SD2_D7__AUD4_TXFS IOMUX_PAD(0x3CC, 0x120, 2, 0x6d8, 0, NO_PAD_CTRL) | ||
412 | #define MX50_PAD_SD2_D7__KEY_ROW7 IOMUX_PAD(0x3CC, 0x120, 3, 0x7ac, 0, NO_PAD_CTRL) | ||
413 | #define MX50_PAD_SD2_D7__WEIM_D3 IOMUX_PAD(0x3CC, 0x120, 4, 0x7f8, 0, NO_PAD_CTRL) | ||
414 | #define MX50_PAD_SD2_D7__CCM_STOP IOMUX_PAD(0x3CC, 0x120, 7, 0x0, 0, NO_PAD_CTRL) | ||
415 | |||
416 | #define MX50_PAD_SD2_WP__SD2_WP IOMUX_PAD(0x3D0, 0x124, 0, 0x744, 1, MX50_SD_PAD_CTRL) | ||
417 | #define MX50_PAD_SD2_WP__GPIO_5_16 IOMUX_PAD(0x3D0, 0x124, 1, 0x0, 0, NO_PAD_CTRL) | ||
418 | #define MX50_PAD_SD2_WP__AUD4_TXD IOMUX_PAD(0x3D0, 0x124, 2, 0x6c8, 0, NO_PAD_CTRL) | ||
419 | #define MX50_PAD_SD2_WP__WEIM_D4 IOMUX_PAD(0x3D0, 0x124, 4, 0x7fc, 0, NO_PAD_CTRL) | ||
420 | #define MX50_PAD_SD2_WP__CCM_WAIT IOMUX_PAD(0x3D0, 0x124, 7, 0x0, 0, NO_PAD_CTRL) | ||
421 | |||
422 | #define MX50_PAD_SD2_CD__SD2_CD IOMUX_PAD(0x3D4, 0x128, 0, 0x740, 1, MX50_SD_PAD_CTRL) | ||
423 | #define MX50_PAD_SD2_CD__GPIO_5_17 IOMUX_PAD(0x3D4, 0x128, 1, 0x0, 0, NO_PAD_CTRL) | ||
424 | #define MX50_PAD_SD2_CD__AUD4_TXC IOMUX_PAD(0x3D4, 0x128, 2, 0x6d4, 0, NO_PAD_CTRL) | ||
425 | #define MX50_PAD_SD2_CD__WEIM_D5 IOMUX_PAD(0x3D4, 0x128, 4, 0x800, 0, NO_PAD_CTRL) | ||
426 | #define MX50_PAD_SD2_CD__CCM_REF_EN IOMUX_PAD(0x3D4, 0x128, 7, 0x0, 0, NO_PAD_CTRL) | ||
427 | |||
428 | #define MX50_PAD_PMIC_ON_REQ__PMIC_ON_REQ IOMUX_PAD(0x3D8, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
429 | |||
430 | #define MX50_PAD_PMIC_STBY_REQ__PMIC_STBY_REQ IOMUX_PAD(0x3DC, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
431 | |||
432 | #define MX50_PAD_PMIC_PORT_B__PMIC_PORT_B IOMUX_PAD(0x3E0, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
433 | |||
434 | #define MX50_PAD_PMIC_BOOT_MODE1__PMIC_BOOT_MODE1 IOMUX_PAD(0x3E4, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
435 | |||
436 | #define MX50_PAD_PMIC_RESET_IN_B__PMIC_RESET_IN_B IOMUX_PAD(0x3E8, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
437 | |||
438 | #define MX50_PAD_PMIC_BOOT_MODE0__PMIC_BOOT_MODE0 IOMUX_PAD(0x3EC, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
439 | |||
440 | #define MX50_PAD_PMIC_TEST_MODE__PMIC_TEST_MODE IOMUX_PAD(0x3F0, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
441 | |||
442 | #define MX50_PAD_PMIC_JTAG_TMS__PMIC_JTAG_TMS IOMUX_PAD(0x3F4, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
443 | |||
444 | #define MX50_PAD_PMIC_JTAG_MOD__PMIC_JTAG_MOD IOMUX_PAD(0x3F8, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
445 | |||
446 | #define MX50_PAD_PMIC_JTAG_TRSTB__PMIC_JTAG_TRSTB IOMUX_PAD(0x3FC, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
447 | |||
448 | #define MX50_PAD_PMIC_JTAG_TDI__PMIC_JTAG_TDI IOMUX_PAD(0x400, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
449 | |||
450 | #define MX50_PAD_PMIC_JTAG_TCK__PMIC_JTAG_TCK IOMUX_PAD(0x404, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
451 | |||
452 | #define MX50_PAD_PMIC_JTAG_TDO__PMIC_JTAG_TDO IOMUX_PAD(0x408, 0, 0, 0x0, 0, NO_PAD_CTRL) | ||
453 | |||
454 | #define MX50_PAD_DISP_D0__DISP_D0 IOMUX_PAD(0x40C, 0x12C, 0, 0x6fc, 0, MX50_ELCDIF_PAD_CTRL) | ||
455 | #define MX50_PAD_DISP_D0__GPIO_2_0 IOMUX_PAD(0x40C, 0x12C, 1, 0x0, 0, NO_PAD_CTRL) | ||
456 | #define MX50_PAD_DISP_D0__FEC_TXCLK IOMUX_PAD(0x40C, 0x12C, 2, 0x78c, 0, PAD_CTL_HYS | PAD_CTL_PKE) | ||
457 | |||
458 | #define MX50_PAD_DISP_D1__DISP_D1 IOMUX_PAD(0x410, 0x130, 0, 0x700, 0, MX50_ELCDIF_PAD_CTRL) | ||
459 | #define MX50_PAD_DISP_D1__GPIO_2_1 IOMUX_PAD(0x410, 0x130, 1, 0x0, 0, NO_PAD_CTRL) | ||
460 | #define MX50_PAD_DISP_D1__FEC_RX_ER IOMUX_PAD(0x410, 0x130, 2, 0x788, 0, PAD_CTL_HYS | PAD_CTL_PKE) | ||
461 | #define MX50_PAD_DISP_D1__WEIM_A17 IOMUX_PAD(0x410, 0x130, 3, 0x0, 0, NO_PAD_CTRL) | ||
462 | |||
463 | #define MX50_PAD_DISP_D2__DISP_D2 IOMUX_PAD(0x414, 0x134, 0, 0x704, 0, MX50_ELCDIF_PAD_CTRL) | ||
464 | #define MX50_PAD_DISP_D2__GPIO_2_2 IOMUX_PAD(0x414, 0x134, 1, 0x0, 0, NO_PAD_CTRL) | ||
465 | #define MX50_PAD_DISP_D2__FEC_RX_DV IOMUX_PAD(0x414, 0x134, 2, 0x784, 0, PAD_CTL_HYS | PAD_CTL_PKE) | ||
466 | #define MX50_PAD_DISP_D2__WEIM_A18 IOMUX_PAD(0x414, 0x134, 3, 0x0, 0, NO_PAD_CTRL) | ||
467 | |||
468 | #define MX50_PAD_DISP_D3__DISP_D3 IOMUX_PAD(0x418, 0x138, 0, 0x708, 0, MX50_ELCDIF_PAD_CTRL) | ||
469 | #define MX50_PAD_DISP_D3__GPIO_2_3 IOMUX_PAD(0x418, 0x138, 1, 0x0, 0, NO_PAD_CTRL) | ||
470 | #define MX50_PAD_DISP_D3__FEC_RXD1 IOMUX_PAD(0x418, 0x138, 2, 0x77C, 0, PAD_CTL_HYS | PAD_CTL_PKE) | ||
471 | #define MX50_PAD_DISP_D3__WEIM_A19 IOMUX_PAD(0x418, 0x138, 3, 0x0, 0, NO_PAD_CTRL) | ||
472 | #define MX50_PAD_DISP_D3__FEC_COL IOMUX_PAD(0x418, 0x138, 4, 0x770, 1, NO_PAD_CTRL) | ||
473 | |||
474 | #define MX50_PAD_DISP_D4__DISP_D4 IOMUX_PAD(0x41C, 0x13C, 0, 0x70c, 0, MX50_ELCDIF_PAD_CTRL) | ||
475 | #define MX50_PAD_DISP_D4__GPIO_2_4 IOMUX_PAD(0x41C, 0x13C, 1, 0x0, 0, NO_PAD_CTRL) | ||
476 | #define MX50_PAD_DISP_D4__FEC_RXD0 IOMUX_PAD(0x41C, 0x13C, 2, 0x778, 0, PAD_CTL_HYS | PAD_CTL_PKE) | ||
477 | #define MX50_PAD_DISP_D4__WEIM_A20 IOMUX_PAD(0x41C, 0x13C, 3, 0x0, 0, NO_PAD_CTRL) | ||
478 | |||
479 | #define MX50_PAD_DISP_D5__DISP_D5 IOMUX_PAD(0x420, 0x140, 0, 0x710, 0, MX50_ELCDIF_PAD_CTRL) | ||
480 | #define MX50_PAD_DISP_D5__GPIO_2_5 IOMUX_PAD(0x420, 0x140, 1, 0x0, 0, NO_PAD_CTRL) | ||
481 | #define MX50_PAD_DISP_D5__FEC_TX_EN IOMUX_PAD(0x420, 0x140, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
482 | #define MX50_PAD_DISP_D5__WEIM_A21 IOMUX_PAD(0x420, 0x140, 3, 0x0, 0, NO_PAD_CTRL) | ||
483 | |||
484 | #define MX50_PAD_DISP_D6__DISP_D6 IOMUX_PAD(0x424, 0x144, 0, 0x714, 0, MX50_ELCDIF_PAD_CTRL) | ||
485 | #define MX50_PAD_DISP_D6__GPIO_2_6 IOMUX_PAD(0x424, 0x144, 1, 0x0, 0, NO_PAD_CTRL) | ||
486 | #define MX50_PAD_DISP_D6__FEC_TXD1 IOMUX_PAD(0x424, 0x144, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
487 | #define MX50_PAD_DISP_D6__WEIM_A22 IOMUX_PAD(0x424, 0x144, 3, 0x0, 0, NO_PAD_CTRL) | ||
488 | #define MX50_PAD_DISP_D6__FEC_RX_CLK IOMUX_PAD(0x424, 0x144, 4, 0x780, 1, NO_PAD_CTRL) | ||
489 | |||
490 | #define MX50_PAD_DISP_D7__DISP_D7 IOMUX_PAD(0x428, 0x148, 0, 0x718, 0, MX50_ELCDIF_PAD_CTRL) | ||
491 | #define MX50_PAD_DISP_D7__GPIO_2_7 IOMUX_PAD(0x428, 0x148, 1, 0x0, 0, NO_PAD_CTRL) | ||
492 | #define MX50_PAD_DISP_D7__FEC_TXD0 IOMUX_PAD(0x428, 0x148, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
493 | #define MX50_PAD_DISP_D7__WEIM_A23 IOMUX_PAD(0x428, 0x148, 3, 0x0, 0, NO_PAD_CTRL) | ||
494 | |||
495 | |||
496 | #define MX50_PAD_DISP_WR__ELCDIF_WR IOMUX_PAD(0x42C, 0x14C, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
497 | #define MX50_PAD_DISP_WR__GPIO_2_16 IOMUX_PAD(0x42C, 0x14C, 1, 0x0, 0, NO_PAD_CTRL) | ||
498 | #define MX50_PAD_DISP_WR__ELCDIF_PIXCLK IOMUX_PAD(0x42C, 0x14C, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
499 | #define MX50_PAD_DISP_WR__WEIM_A24 IOMUX_PAD(0x42C, 0x14C, 3, 0x0, 0, NO_PAD_CTRL) | ||
500 | |||
501 | #define MX50_PAD_DISP_RD__ELCDIF_RD IOMUX_PAD(0x430, 0x150, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
502 | #define MX50_PAD_DISP_RD__GPIO_2_19 IOMUX_PAD(0x430, 0x150, 1, 0x0, 0, NO_PAD_CTRL) | ||
503 | #define MX50_PAD_DISP_RD__ELCDIF_EN IOMUX_PAD(0x430, 0x150, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
504 | #define MX50_PAD_DISP_RD__WEIM_A25 IOMUX_PAD(0x430, 0x150, 3, 0x0, 0, NO_PAD_CTRL) | ||
505 | |||
506 | #define MX50_PAD_DISP_RS__ELCDIF_RS IOMUX_PAD(0x434, 0x154, 0, 0x73c, 1, MX50_ELCDIF_PAD_CTRL) | ||
507 | #define MX50_PAD_DISP_RS__GPIO_2_17 IOMUX_PAD(0x434, 0x154, 1, 0x0, 0, NO_PAD_CTRL) | ||
508 | #define MX50_PAD_DISP_RS__ELCDIF_VSYNC IOMUX_PAD(0x434, 0x154, 2, 0x73c, 1, MX50_ELCDIF_PAD_CTRL) | ||
509 | #define MX50_PAD_DISP_RS__WEIM_A26 IOMUX_PAD(0x434, 0x154, 3, 0x0, 0, NO_PAD_CTRL) | ||
510 | |||
511 | #define MX50_PAD_DISP_CS__ELCDIF_CS IOMUX_PAD(0x438, 0x158, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
512 | #define MX50_PAD_DISP_CS__GPIO_2_21 IOMUX_PAD(0x438, 0x158, 1, 0x0, 0, NO_PAD_CTRL) | ||
513 | #define MX50_PAD_DISP_CS__ELCDIF_HSYNC IOMUX_PAD(0x438, 0x158, 2, 0x6f8, 1, MX50_ELCDIF_PAD_CTRL) | ||
514 | #define MX50_PAD_DISP_CS__WEIM_A27 IOMUX_PAD(0x438, 0x158, 3, 0x0, 0, NO_PAD_CTRL) | ||
515 | #define MX50_PAD_DISP_CS__WEIM_CS3 IOMUX_PAD(0x438, 0x158, 4, 0x0, 0, NO_PAD_CTRL) | ||
516 | |||
517 | #define MX50_PAD_DISP_BUSY__ELCDIF_HSYNC IOMUX_PAD(0x43C, 0x15C, 0, 0x6f8, 2, MX50_ELCDIF_PAD_CTRL) | ||
518 | #define MX50_PAD_DISP_BUSY__GPIO_2_18 IOMUX_PAD(0x43C, 0x15C, 1, 0x0, 0, NO_PAD_CTRL) | ||
519 | #define MX50_PAD_DISP_BUSY__WEIM_CS3 IOMUX_PAD(0x43C, 0x15C, 3, 0x0, 0, NO_PAD_CTRL) | ||
520 | |||
521 | #define MX50_PAD_DISP_RESET__ELCDIF_RST IOMUX_PAD(0x440, 0x160, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
522 | #define MX50_PAD_DISP_RESET__GPIO_2_20 IOMUX_PAD(0x440, 0x160, 1, 0x0, 0, NO_PAD_CTRL) | ||
523 | #define MX50_PAD_DISP_RESET__WEIM_CS3 IOMUX_PAD(0x440, 0x160, 4, 0x0, 0, NO_PAD_CTRL) | ||
524 | |||
525 | #define MX50_PAD_SD3_CMD__SD3_CMD IOMUX_PAD(0x444, 0x164, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
526 | #define MX50_PAD_SD3_CMD__GPIO_5_18 IOMUX_PAD(0x444, 0x164, 1, 0x0, 0, NO_PAD_CTRL) | ||
527 | #define MX50_PIN_SD3_CMD__NANDF_WRN IOMUX_PAD(0x444, 0x164, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
528 | #define MX50_PAD_SD3_CMD__SSP_CMD IOMUX_PAD(0x444, 0x164, 3, 0x0, 0, NO_PAD_CTRL) | ||
529 | |||
530 | #define MX50_PAD_SD3_CLK__SD3_CLK IOMUX_PAD(0x448, 0x168, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
531 | #define MX50_PAD_SD3_CLK__GPIO_5_19 IOMUX_PAD(0x448, 0x168, 1, 0x0, 0, NO_PAD_CTRL) | ||
532 | #define MX50_PIN_SD3_CLK__NANDF_RDN IOMUX_PAD(0x448, 0x168, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
533 | #define MX50_PAD_SD3_CLK__SSP_CLK IOMUX_PAD(0x448, 0x168, 3, 0x0, 0, NO_PAD_CTRL) | ||
534 | |||
535 | #define MX50_PAD_SD3_D0__SD3_D0 IOMUX_PAD(0x44C, 0x16C, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
536 | #define MX50_PAD_SD3_D0__GPIO_5_20 IOMUX_PAD(0x44C, 0x16C, 1, 0x0, 0, NO_PAD_CTRL) | ||
537 | #define MX50_PIN_SD3_D0__NANDF_D4 IOMUX_PAD(0x44C, 0x16C, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
538 | #define MX50_PAD_SD3_D0__SSP_D0 IOMUX_PAD(0x44C, 0x16C, 3, 0x0, 0, NO_PAD_CTRL) | ||
539 | #define MX50_PAD_SD3_D0__PLL1_BYP IOMUX_PAD(0x44C, 0x16C, 7, 0x6dc, 1, NO_PAD_CTRL) | ||
540 | |||
541 | #define MX50_PAD_SD3_D1__SD3_D1 IOMUX_PAD(0x450, 0x170, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
542 | #define MX50_PAD_SD3_D1__GPIO_5_21 IOMUX_PAD(0x450, 0x170, 1, 0x0, 0, NO_PAD_CTRL) | ||
543 | #define MX50_PIN_SD3_D1__NANDF_D5 IOMUX_PAD(0x450, 0x170, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
544 | #define MX50_PAD_SD3_D1__PLL2_BYP IOMUX_PAD(0x450, 0x170, 7, 0x6e0, 1, NO_PAD_CTRL) | ||
545 | |||
546 | #define MX50_PAD_SD3_D2__SD3_D2 IOMUX_PAD(0x454, 0x174, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
547 | #define MX50_PAD_SD3_D2__GPIO_5_22 IOMUX_PAD(0x454, 0x174, 1, 0x0, 0, NO_PAD_CTRL) | ||
548 | #define MX50_PIN_SD3_D2__NANDF_D6 IOMUX_PAD(0x454, 0x174, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
549 | #define MX50_PAD_SD3_D2__SSP_D2 IOMUX_PAD(0x454, 0x174, 3, 0x0, 0, NO_PAD_CTRL) | ||
550 | #define MX50_PAD_SD3_D2__PLL3_BYP IOMUX_PAD(0x454, 0x174, 7, 0x6e4, 1, NO_PAD_CTRL) | ||
551 | |||
552 | #define MX50_PAD_SD3_D3__SD3_D3 IOMUX_PAD(0x458, 0x178, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
553 | #define MX50_PAD_SD3_D3__GPIO_5_23 IOMUX_PAD(0x458, 0x178, 1, 0x0, 0, NO_PAD_CTRL) | ||
554 | #define MX50_PIN_SD3_D3__NANDF_D7 IOMUX_PAD(0x458, 0x178, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
555 | #define MX50_PAD_SD3_D3__SSP_D3 IOMUX_PAD(0x458, 0x178, 3, 0x0, 0, NO_PAD_CTRL) | ||
556 | |||
557 | #define MX50_PAD_SD3_D4__SD3_D4 IOMUX_PAD(0x45C, 0x17C, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
558 | #define MX50_PAD_SD3_D4__GPIO_5_24 IOMUX_PAD(0x45C, 0x17C, 1, 0x0, 0, NO_PAD_CTRL) | ||
559 | #define MX50_PIN_SD3_D4__NANDF_D0 IOMUX_PAD(0x45C, 0x17C, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
560 | #define MX50_PAD_SD3_D4__SSP_D4 IOMUX_PAD(0x45C, 0x17C, 1, 0x0, 0, NO_PAD_CTRL) | ||
561 | |||
562 | #define MX50_PAD_SD3_D5__SD3_D5 IOMUX_PAD(0x460, 0x180, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
563 | #define MX50_PAD_SD3_D5__GPIO_5_25 IOMUX_PAD(0x460, 0x180, 1, 0x0, 0, NO_PAD_CTRL) | ||
564 | #define MX50_PIN_SD3_D5__NANDF_D1 IOMUX_PAD(0x460, 0x180, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
565 | #define MX50_PAD_SD3_D5__SSP_D5 IOMUX_PAD(0x460, 0x180, 3, 0x0, 0, NO_PAD_CTRL) | ||
566 | |||
567 | #define MX50_PAD_SD3_D6__SD3_D6 IOMUX_PAD(0x464, 0x184, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
568 | #define MX50_PAD_SD3_D6__GPIO_5_26 IOMUX_PAD(0x464, 0x184, 1, 0x0, 0, NO_PAD_CTRL) | ||
569 | #define MX50_PIN_SD3_D6__NANDF_D2 IOMUX_PAD(0x464, 0x184, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
570 | #define MX50_PAD_SD3_D6__SSP_D6 IOMUX_PAD(0x464, 0x184, 3, 0x0, 0, NO_PAD_CTRL) | ||
571 | |||
572 | #define MX50_PAD_SD3_D7__SD3_D7 IOMUX_PAD(0x468, 0x188, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
573 | #define MX50_PAD_SD3_D7__GPIO_5_27 IOMUX_PAD(0x468, 0x188, 1, 0x0, 0, NO_PAD_CTRL) | ||
574 | #define MX50_PIN_SD3_D7__NANDF_D3 IOMUX_PAD(0x468, 0x188, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
575 | #define MX50_PAD_SD3_D7__SSP_D7 IOMUX_PAD(0x468, 0x188, 3, 0x0, 0, NO_PAD_CTRL) | ||
576 | |||
577 | #define MX50_PAD_SD3_WP__SD3_WP IOMUX_PAD(0x46C, 0x18C, 0, 0x0, 0, MX50_SD_PAD_CTRL) | ||
578 | #define MX50_PAD_SD3_WP__GPIO_5_28 IOMUX_PAD(0x46C, 0x18C, 1, 0x0, 0, NO_PAD_CTRL) | ||
579 | #define MX50_PIN_SD3_WP__NANDF_RESETN IOMUX_PAD(0x46C, 0x18C, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
580 | #define MX50_PAD_SD3_WP__SSP_CD IOMUX_PAD(0x46C, 0x18C, 3, 0x0, 0, NO_PAD_CTRL) | ||
581 | #define MX50_PAD_SD3_WP__SD4_LCTL IOMUX_PAD(0x46C, 0x18C, 4, 0x0, 0, MX50_SD_PAD_CTRL) | ||
582 | #define MX50_PAD_SD3_WP__WEIM_CS3 IOMUX_PAD(0x46C, 0x18C, 5, 0x0, 0, NO_PAD_CTRL) | ||
583 | |||
584 | #define MX50_PAD_DISP_D8__DISP_D8 IOMUX_PAD(0x470, 0x190, 0, 0x71c, 0, MX50_ELCDIF_PAD_CTRL) | ||
585 | #define MX50_PAD_DISP_D8__GPIO_2_8 IOMUX_PAD(0x470, 0x190, 1, 0x0, 0, NO_PAD_CTRL) | ||
586 | #define MX50_PAD_DISP_D8__NANDF_CLE IOMUX_PAD(0x470, 0x190, 2, 0x0, 0, NO_PAD_CTRL) | ||
587 | #define MX50_PAD_DISP_D8__SD1_LCTL IOMUX_PAD(0x470, 0x190, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
588 | #define MX50_PAD_DISP_D8__SD4_CMD IOMUX_PAD(0x470, 0x190, 4, 0x74c, 2, MX50_SD_PAD_CTRL) | ||
589 | #define MX50_PAD_DISP_D8__KEY_COL4 IOMUX_PAD(0x470, 0x190, 5, 0x790, 1, NO_PAD_CTRL) | ||
590 | #define MX50_PAD_DISP_D8__FEC_TX_CLK IOMUX_PAD(0x470, 0x190, 6, 0x78c, 1, NO_PAD_CTRL) | ||
591 | |||
592 | #define MX50_PAD_DISP_D9__DISP_D9 IOMUX_PAD(0x474, 0x194, 0, 0x720, 0, MX50_ELCDIF_PAD_CTRL) | ||
593 | #define MX50_PAD_DISP_D9__GPIO_2_9 IOMUX_PAD(0x474, 0x194, 1, 0x0, 0, NO_PAD_CTRL) | ||
594 | #define MX50_PAD_DISP_D9__NANDF_ALE IOMUX_PAD(0x474, 0x194, 2, 0x0, 0, NO_PAD_CTRL) | ||
595 | #define MX50_PAD_DISP_D9__SD2_LCTL IOMUX_PAD(0x474, 0x194, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
596 | #define MX50_PAD_DISP_D9__SD4_CLK IOMUX_PAD(0x474, 0x194, 4, 0x748, 2, MX50_SD_PAD_CTRL) | ||
597 | #define MX50_PAD_DISP_D9__KEY_ROW4 IOMUX_PAD(0x474, 0x194, 5, 0x7a0, 1, NO_PAD_CTRL) | ||
598 | #define MX50_PAD_DISP_D9__FEC_RX_ER IOMUX_PAD(0x474, 0x194, 6, 0x788, 1, NO_PAD_CTRL) | ||
599 | |||
600 | #define MX50_PAD_DISP_D10__DISP_D10 IOMUX_PAD(0x478, 0x198, 0, 0x724, 0, MX50_ELCDIF_PAD_CTRL) | ||
601 | #define MX50_PAD_DISP_D10__GPIO_2_10 IOMUX_PAD(0x478, 0x198, 1, 0x0, 0, NO_PAD_CTRL) | ||
602 | #define MX50_PAD_DISP_D10__NANDF_CEN0 IOMUX_PAD(0x478, 0x198, 2, 0x0, 0, NO_PAD_CTRL) | ||
603 | #define MX50_PAD_DISP_D10__SD3_LCTL IOMUX_PAD(0x478, 0x198, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
604 | #define MX50_PAD_DISP_D10__SD4_D0 IOMUX_PAD(0x478, 0x198, 4, 0x750, 1, MX50_SD_PAD_CTRL) | ||
605 | #define MX50_PAD_DISP_D10__KEY_COL5 IOMUX_PAD(0x478, 0x198, 5, 0x794, 1, NO_PAD_CTRL) | ||
606 | #define MX50_PAD_DISP_D10__FEC_RX_DV IOMUX_PAD(0x478, 0x198, 6, 0x784, 1, NO_PAD_CTRL) | ||
607 | |||
608 | #define MX50_PAD_DISP_D11__DISP_D11 IOMUX_PAD(0x47C, 0x19C, 0, 0x728, 0, MX50_ELCDIF_PAD_CTRL) | ||
609 | #define MX50_PAD_DISP_D11__GPIO_2_11 IOMUX_PAD(0x47C, 0x19C, 1, 0x0, 0, NO_PAD_CTRL) | ||
610 | #define MX50_PAD_DISP_D11__NANDF_CEN1 IOMUX_PAD(0x47C, 0x19C, 2, 0x0, 0, NO_PAD_CTRL) | ||
611 | #define MX50_PAD_DISP_D11__SD4_D1 IOMUX_PAD(0x47C, 0x19C, 4, 0x754, 1, MX50_SD_PAD_CTRL) | ||
612 | #define MX50_PAD_DISP_D11__KEY_ROW5 IOMUX_PAD(0x47C, 0x19C, 5, 0x7a4, 1, NO_PAD_CTRL) | ||
613 | #define MX50_PAD_DISP_D11__FEC_RDAT1 IOMUX_PAD(0x47C, 0x19C, 6, 0x77c, 1, NO_PAD_CTRL) | ||
614 | |||
615 | #define MX50_PAD_DISP_D12__DISP_D12 IOMUX_PAD(0x480, 0x1A0, 0, 0x72c, 0, MX50_ELCDIF_PAD_CTRL) | ||
616 | #define MX50_PAD_DISP_D12__GPIO_2_12 IOMUX_PAD(0x480, 0x1A0, 1, 0x0, 0, NO_PAD_CTRL) | ||
617 | #define MX50_PAD_DISP_D12__NANDF_CEN2 IOMUX_PAD(0x480, 0x1A0, 2, 0x0, 0, NO_PAD_CTRL) | ||
618 | #define MX50_PAD_DISP_D12__SD1_CD IOMUX_PAD(0x480, 0x1A0, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
619 | #define MX50_PAD_DISP_D12__SD4_D2 IOMUX_PAD(0x480, 0x1A0, 4, 0x758, 1, MX50_SD_PAD_CTRL) | ||
620 | #define MX50_PAD_DISP_D12__KEY_COL6 IOMUX_PAD(0x480, 0x1A0, 5, 0x798, 1, NO_PAD_CTRL) | ||
621 | #define MX50_PAD_DISP_D12__FEC_RDAT0 IOMUX_PAD(0x480, 0x1A0, 6, 0x778, 1, NO_PAD_CTRL) | ||
622 | |||
623 | #define MX50_PAD_DISP_D13__DISP_D13 IOMUX_PAD(0x484, 0x1A4, 0, 0x730, 0, MX50_ELCDIF_PAD_CTRL) | ||
624 | #define MX50_PAD_DISP_D13__GPIO_2_13 IOMUX_PAD(0x484, 0x1A4, 1, 0x0, 0, NO_PAD_CTRL) | ||
625 | #define MX50_PAD_DISP_D13__NANDF_CEN3 IOMUX_PAD(0x484, 0x1A4, 2, 0x0, 0, NO_PAD_CTRL) | ||
626 | #define MX50_PAD_DISP_D13__SD3_CD IOMUX_PAD(0x484, 0x1A4, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
627 | #define MX50_PAD_DISP_D13__SD4_D3 IOMUX_PAD(0x484, 0x1A4, 4, 0x75c, 1, MX50_SD_PAD_CTRL) | ||
628 | #define MX50_PAD_DISP_D13__KEY_ROW6 IOMUX_PAD(0x484, 0x1A4, 5, 0x7a8, 1, NO_PAD_CTRL) | ||
629 | #define MX50_PAD_DISP_D13__FEC_TX_EN IOMUX_PAD(0x484, 0x1A4, 6, 0x0, 0, NO_PAD_CTRL) | ||
630 | |||
631 | #define MX50_PAD_DISP_D14__DISP_D14 IOMUX_PAD(0x488, 0x1A8, 0, 0x734, 0, MX50_ELCDIF_PAD_CTRL) | ||
632 | #define MX50_PAD_DISP_D14__GPIO_2_14 IOMUX_PAD(0x488, 0x1A8, 1, 0x0, 0, NO_PAD_CTRL) | ||
633 | #define MX50_PAD_DISP_D14__NANDF_RDY0 IOMUX_PAD(0x488, 0x1A8, 2, 0x7b4, 1, NO_PAD_CTRL) | ||
634 | #define MX50_PAD_DISP_D14__SD1_WP IOMUX_PAD(0x488, 0x1A8, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
635 | #define MX50_PAD_DISP_D14__SD4_WP IOMUX_PAD(0x488, 0x1A8, 4, 0x0, 0, MX50_SD_PAD_CTRL) | ||
636 | #define MX50_PAD_DISP_D14__KEY_COL7 IOMUX_PAD(0x488, 0x1A8, 5, 0x79c, 1, NO_PAD_CTRL) | ||
637 | #define MX50_PAD_DISP_D14__FEC_TDAT1 IOMUX_PAD(0x488, 0x1A8, 6, 0x0, 0, NO_PAD_CTRL) | ||
638 | |||
639 | #define MX50_PAD_DISP_D15__DISP_D15 IOMUX_PAD(0x48C, 0x1AC, 0, 0x738, 0, MX50_ELCDIF_PAD_CTRL) | ||
640 | #define MX50_PAD_DISP_D15__GPIO_2_15 IOMUX_PAD(0x48C, 0x1AC, 1, 0x0, 0, NO_PAD_CTRL) | ||
641 | #define MX50_PAD_DISP_D15__NANDF_DQS IOMUX_PAD(0x48C, 0x1AC, 2, 0x7b0, 1, NO_PAD_CTRL) | ||
642 | #define MX50_PAD_DISP_D15__SD3_RST IOMUX_PAD(0x48C, 0x1AC, 3, 0x0, 0, MX50_SD_PAD_CTRL) | ||
643 | #define MX50_PAD_DISP_D15__SD4_CD IOMUX_PAD(0x48C, 0x1AC, 4, 0x0, 0, MX50_SD_PAD_CTRL) | ||
644 | #define MX50_PAD_DISP_D15__KEY_ROW7 IOMUX_PAD(0x48C, 0x1AC, 5, 0x7ac, 1, NO_PAD_CTRL) | ||
645 | #define MX50_PAD_DISP_D15__FEC_TDAT0 IOMUX_PAD(0x48C, 0x1AC, 6, 0x0, 0, NO_PAD_CTRL) | ||
646 | |||
647 | #define MX50_PAD_EPDC_D0__EPDC_D0 IOMUX_PAD(0x54C, 0x1B0, 0, 0x0, 0, NO_PAD_CTRL) | ||
648 | #define MX50_PAD_EPDC_D0__GPIO_3_0 IOMUX_PAD(0x54C, 0x1B0, 1, 0x0, 0, NO_PAD_CTRL) | ||
649 | #define MX50_PAD_EPDC_D0__WEIM_D0 IOMUX_PAD(0x54C, 0x1B0, 2, 0x7ec, 1, NO_PAD_CTRL) | ||
650 | #define MX50_PAD_EPDC_D0__ELCDIF_RS IOMUX_PAD(0x54C, 0x1B0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
651 | #define MX50_PAD_EPDC_D0__ELCDIF_PIXCLK IOMUX_PAD(0x54C, 0x1B0, 4, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
652 | |||
653 | #define MX50_PAD_EPDC_D1__EPDC_D1 IOMUX_PAD(0x550, 0x1B4, 0, 0x0, 0, NO_PAD_CTRL) | ||
654 | #define MX50_PAD_EPDC_D1__GPIO_3_1 IOMUX_PAD(0x550, 0x1B4, 1, 0x0, 0, NO_PAD_CTRL) | ||
655 | #define MX50_PAD_EPDC_D1__WEIM_D1 IOMUX_PAD(0x550, 0x1B4, 2, 0x7f0, 1, NO_PAD_CTRL) | ||
656 | #define MX50_PAD_EPDC_D1__ELCDIF_CS IOMUX_PAD(0x550, 0x1B4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
657 | #define MX50_PAD_EPDC_D1__ELCDIF_EN IOMUX_PAD(0x550, 0x1B4, 4, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
658 | |||
659 | #define MX50_PAD_EPDC_D2__EPDC_D2 IOMUX_PAD(0x554, 0x1B8, 0, 0x0, 0, NO_PAD_CTRL) | ||
660 | #define MX50_PAD_EPDC_D2__GPIO_3_2 IOMUX_PAD(0x554, 0x1B8, 1, 0x0, 0, NO_PAD_CTRL) | ||
661 | #define MX50_PAD_EPDC_D2__WEIM_D2 IOMUX_PAD(0x554, 0x1B8, 2, 0x7f4, 1, NO_PAD_CTRL) | ||
662 | #define MX50_PAD_EPDC_D2__ELCDIF_WR IOMUX_PAD(0x554, 0x1B8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
663 | #define MX50_PAD_EPDC_D2__ELCDIF_VSYNC IOMUX_PAD(0x554, 0x1B8, 4, 0x73c, 2, MX50_ELCDIF_PAD_CTRL) | ||
664 | |||
665 | #define MX50_PAD_EPDC_D3__EPDC_D3 IOMUX_PAD(0x558, 0x1BC, 0, 0x0, 0, NO_PAD_CTRL) | ||
666 | #define MX50_PAD_EPDC_D3__GPIO_3_3 IOMUX_PAD(0x558, 0x1BC, 1, 0x0, 0, NO_PAD_CTRL) | ||
667 | #define MX50_PAD_EPDC_D3__WEIM_D3 IOMUX_PAD(0x558, 0x1BC, 2, 0x7f8, 1, NO_PAD_CTRL) | ||
668 | #define MX50_PAD_EPDC_D3__ELCDIF_RD IOMUX_PAD(0x558, 0x1BC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
669 | #define MX50_PAD_EPDC_D3__ELCDIF_HSYNC IOMUX_PAD(0x558, 0x1BC, 4, 0x6f8, 3, MX50_ELCDIF_PAD_CTRL) | ||
670 | |||
671 | #define MX50_PAD_EPDC_D4__EPDC_D4 IOMUX_PAD(0x55C, 0x1C0, 0, 0x0, 0, NO_PAD_CTRL) | ||
672 | #define MX50_PAD_EPDC_D4__GPIO_3_4 IOMUX_PAD(0x55C, 0x1C0, 1, 0x0, 0, NO_PAD_CTRL) | ||
673 | #define MX50_PAD_EPDC_D4__WEIM_D4 IOMUX_PAD(0x55C, 0x1C0, 2, 0x7fc, 1, NO_PAD_CTRL) | ||
674 | |||
675 | #define MX50_PAD_EPDC_D5__EPDC_D5 IOMUX_PAD(0x560, 0x1C4, 0, 0x0, 0, NO_PAD_CTRL) | ||
676 | #define MX50_PAD_EPDC_D5__GPIO_3_5 IOMUX_PAD(0x560, 0x1C4, 1, 0x0, 0, NO_PAD_CTRL) | ||
677 | #define MX50_PAD_EPDC_D5__WEIM_D5 IOMUX_PAD(0x560, 0x1C4, 2, 0x800, 1, NO_PAD_CTRL) | ||
678 | |||
679 | #define MX50_PAD_EPDC_D6__EPDC_D6 IOMUX_PAD(0x564, 0x1C8, 0, 0x0, 0, NO_PAD_CTRL) | ||
680 | #define MX50_PAD_EPDC_D6__GPIO_3_6 IOMUX_PAD(0x564, 0x1C8, 1, 0x0, 0, NO_PAD_CTRL) | ||
681 | #define MX50_PAD_EPDC_D6__WEIM_D6 IOMUX_PAD(0x564, 0x1C8, 2, 0x804, 1, NO_PAD_CTRL) | ||
682 | |||
683 | #define MX50_PAD_EPDC_D7__EPDC_D7 IOMUX_PAD(0x568, 0x1CC, 0, 0x0, 0, NO_PAD_CTRL) | ||
684 | #define MX50_PAD_EPDC_D7__GPIO_3_7 IOMUX_PAD(0x568, 0x1CC, 1, 0x0, 0, NO_PAD_CTRL) | ||
685 | #define MX50_PAD_EPDC_D7__WEIM_D7 IOMUX_PAD(0x568, 0x1CC, 2, 0x808, 1, NO_PAD_CTRL) | ||
686 | |||
687 | #define MX50_PAD_EPDC_D8__EPDC_D8 IOMUX_PAD(0x56C, 0x1D0, 0, 0x0, 0, NO_PAD_CTRL) | ||
688 | #define MX50_PAD_EPDC_D8__GPIO_3_8 IOMUX_PAD(0x56C, 0x1D0, 1, 0x0, 0, NO_PAD_CTRL) | ||
689 | #define MX50_PAD_EPDC_D8__WEIM_D8 IOMUX_PAD(0x56C, 0x1D0, 2, 0x80c, 2, NO_PAD_CTRL) | ||
690 | #define MX50_PAD_EPDC_D8__ELCDIF_D24 IOMUX_PAD(0x56C, 0x1D0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
691 | |||
692 | #define MX50_PAD_EPDC_D9__EPDC_D9 IOMUX_PAD(0x570, 0x1D4, 0, 0x0, 0, NO_PAD_CTRL) | ||
693 | #define MX50_PAD_EPDC_D9__GPIO_3_9 IOMUX_PAD(0x570, 0x1D4, 1, 0x0, 0, NO_PAD_CTRL) | ||
694 | #define MX50_PAD_EPDC_D9__WEIM_D9 IOMUX_PAD(0x570, 0x1D4, 2, 0x0, 0, NO_PAD_CTRL) | ||
695 | #define MX50_PAD_EPDC_D9__ELCDIF_D25 IOMUX_PAD(0x570, 0x1D4, 3, 0x810, 2, MX50_ELCDIF_PAD_CTRL) | ||
696 | |||
697 | #define MX50_PAD_EPDC_D10__EPDC_D10 IOMUX_PAD(0x574, 0x1D8, 0, 0x0, 0, NO_PAD_CTRL) | ||
698 | #define MX50_PAD_EPDC_D10__GPIO_3_10 IOMUX_PAD(0x574, 0x1D8, 1, 0x0, 0, NO_PAD_CTRL) | ||
699 | #define MX50_PAD_EPDC_D10__WEIM_D10 IOMUX_PAD(0x574, 0x1D8, 2, 0x814, 2, NO_PAD_CTRL) | ||
700 | #define MX50_PAD_EPDC_D10__ELCDIF_D26 IOMUX_PAD(0x574, 0x1D8, 3, 0x0, 0, NO_PAD_CTRL) | ||
701 | |||
702 | #define MX50_PAD_EPDC_D11__EPDC_D11 IOMUX_PAD(0x578, 0x1DC, 0, 0x0, 0, NO_PAD_CTRL) | ||
703 | #define MX50_PAD_EPDC_D11__GPIO_3_11 IOMUX_PAD(0x578, 0x1DC, 1, 0x0, 0, NO_PAD_CTRL) | ||
704 | #define MX50_PAD_EPDC_D11__WEIM_D11 IOMUX_PAD(0x578, 0x1DC, 2, 0x818, 2, NO_PAD_CTRL) | ||
705 | #define MX50_PAD_EPDC_D11__ELCDIF_D27 IOMUX_PAD(0x578, 0x1DC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
706 | |||
707 | #define MX50_PAD_EPDC_D12__EPDC_D12 IOMUX_PAD(0x57C, 0x1E0, 0, 0x0, 0, NO_PAD_CTRL) | ||
708 | #define MX50_PAD_EPDC_D12__GPIO_3_12 IOMUX_PAD(0x57C, 0x1E0, 1, 0x0, 0, NO_PAD_CTRL) | ||
709 | #define MX50_PAD_EPDC_D12__WEIM_D12 IOMUX_PAD(0x57C, 0x1E0, 2, 0x81c, 1, NO_PAD_CTRL) | ||
710 | #define MX50_PAD_EPDC_D12__ELCDIF_D28 IOMUX_PAD(0x57C, 0x1E0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
711 | |||
712 | #define MX50_PAD_EPDC_D13__EPDC_D13 IOMUX_PAD(0x580, 0x1E4, 0, 0x0, 0, NO_PAD_CTRL) | ||
713 | #define MX50_PAD_EPDC_D13__GPIO_3_13 IOMUX_PAD(0x580, 0x1E4, 1, 0x0, 0, NO_PAD_CTRL) | ||
714 | #define MX50_PAD_EPDC_D13__WEIM_D13 IOMUX_PAD(0x580, 0x1E4, 2, 0x820, 1, NO_PAD_CTRL) | ||
715 | #define MX50_PAD_EPDC_D13__ELCDIF_D29 IOMUX_PAD(0x580, 0x1E4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
716 | |||
717 | #define MX50_PAD_EPDC_D14__EPDC_D14 IOMUX_PAD(0x584, 0x1E8, 0, 0x0, 0, NO_PAD_CTRL) | ||
718 | #define MX50_PAD_EPDC_D14__GPIO_3_14 IOMUX_PAD(0x584, 0x1E8, 1, 0x0, 0, NO_PAD_CTRL) | ||
719 | #define MX50_PAD_EPDC_D14__WEIM_D14 IOMUX_PAD(0x584, 0x1E8, 2, 0x824, 1, NO_PAD_CTRL) | ||
720 | #define MX50_PAD_EPDC_D14__ELCDIF_D30 IOMUX_PAD(0x584, 0x1E8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
721 | #define MX50_PAD_EPDC_D14__AUD6_TXD IOMUX_PAD(0x584, 0x1E8, 4, 0x0, 0, NO_PAD_CTRL) | ||
722 | |||
723 | #define MX50_PAD_EPDC_D15__EPDC_D15 IOMUX_PAD(0x588, 0x1EC, 0, 0x0, 0, NO_PAD_CTRL) | ||
724 | #define MX50_PAD_EPDC_D15__GPIO_3_15 IOMUX_PAD(0x588, 0x1EC, 1, 0x0, 0, NO_PAD_CTRL) | ||
725 | #define MX50_PAD_EPDC_D15__WEIM_D15 IOMUX_PAD(0x588, 0x1EC, 2, 0x828, 1, NO_PAD_CTRL) | ||
726 | #define MX50_PAD_EPDC_D15__ELCDIF_D31 IOMUX_PAD(0x588, 0x1EC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
727 | #define MX50_PAD_EPDC_D15__AUD6_TXC IOMUX_PAD(0x588, 0x1EC, 4, 0x0, 0, NO_PAD_CTRL) | ||
728 | |||
729 | #define MX50_PAD_EPDC_GDCLK__EPDC_GDCLK IOMUX_PAD(0x58C, 0x1F0, 0, 0x0, 0, NO_PAD_CTRL) | ||
730 | #define MX50_PAD_EPDC_GDCLK__GPIO_3_16 IOMUX_PAD(0x58C, 0x1F0, 1, 0x0, 0, NO_PAD_CTRL) | ||
731 | #define MX50_PAD_EPDC_GDCLK__WEIM_D16 IOMUX_PAD(0x58C, 0x1F0, 2, 0x0, 0, NO_PAD_CTRL) | ||
732 | #define MX50_PAD_EPDC_GDCLK__ELCDIF_D16 IOMUX_PAD(0x58C, 0x1F0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
733 | #define MX50_PAD_EPDC_GDCLK__AUD6_TXFS IOMUX_PAD(0x58C, 0x1F0, 4, 0x0, 0, NO_PAD_CTRL) | ||
734 | |||
735 | #define MX50_PAD_EPDC_GDSP__EPDC_GDSP IOMUX_PAD(0x590, 0x1F4, 0, 0x0, 0, NO_PAD_CTRL) | ||
736 | #define MX50_PAD_EPDC_GDSP__GPIO_3_17 IOMUX_PAD(0x590, 0x1F4, 1, 0x0, 0, NO_PAD_CTRL) | ||
737 | #define MX50_PAD_EPDC_GDSP__WEIM_D17 IOMUX_PAD(0x590, 0x1F4, 2, 0x0, 0, NO_PAD_CTRL) | ||
738 | #define MX50_PAD_EPDC_GDSP__ELCDIF_D17 IOMUX_PAD(0x590, 0x1F4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
739 | #define MX50_PAD_EPDC_GDSP__AUD6_RXD IOMUX_PAD(0x590, 0x1F4, 4, 0x0, 0, NO_PAD_CTRL) | ||
740 | |||
741 | #define MX50_PAD_EPDC_GDOE__EPDC_GDOE IOMUX_PAD(0x594, 0x1F8, 0, 0x0, 0, NO_PAD_CTRL) | ||
742 | #define MX50_PAD_EPDC_GDOE__GPIO_3_18 IOMUX_PAD(0x594, 0x1F8, 1, 0x0, 0, NO_PAD_CTRL) | ||
743 | #define MX50_PAD_EPDC_GDOE__WEIM_D18 IOMUX_PAD(0x594, 0x1F8, 2, 0x0, 0, NO_PAD_CTRL) | ||
744 | #define MX50_PAD_EPDC_GDOE__ELCDIF_D18 IOMUX_PAD(0x594, 0x1F8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
745 | #define MX50_PAD_EPDC_GDOE__AUD6_RXC IOMUX_PAD(0x594, 0x1F8, 4, 0x0, 0, NO_PAD_CTRL) | ||
746 | |||
747 | #define MX50_PAD_EPDC_GDRL__EPDC_GDRL IOMUX_PAD(0x598, 0x1FC, 0, 0x0, 0, NO_PAD_CTRL) | ||
748 | #define MX50_PAD_EPDC_GDRL__GPIO_3_19 IOMUX_PAD(0x598, 0x1FC, 1, 0x0, 0, NO_PAD_CTRL) | ||
749 | #define MX50_PAD_EPDC_GDRL__WEIM_D19 IOMUX_PAD(0x598, 0x1FC, 2, 0x0, 0, NO_PAD_CTRL) | ||
750 | #define MX50_PAD_EPDC_GDRL__ELCDIF_D19 IOMUX_PAD(0x598, 0x1FC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
751 | #define MX50_PAD_EPDC_GDRL__AUD6_RXFS IOMUX_PAD(0x598, 0x1FC, 4, 0x0, 0, NO_PAD_CTRL) | ||
752 | |||
753 | #define MX50_PAD_EPDC_SDCLK__EPDC_SDCLK IOMUX_PAD(0x59C, 0x200, 0, 0x0, 0, NO_PAD_CTRL) | ||
754 | #define MX50_PAD_EPDC_SDCLK__GPIO_3_20 IOMUX_PAD(0x59C, 0x200, 1, 0x0, 0, NO_PAD_CTRL) | ||
755 | #define MX50_PAD_EPDC_SDCLK__WEIM_D20 IOMUX_PAD(0x59C, 0x200, 2, 0x0, 0, NO_PAD_CTRL) | ||
756 | #define MX50_PAD_EPDC_SDCLK__ELCDIF_D20 IOMUX_PAD(0x59C, 0x200, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
757 | #define MX50_PAD_EPDC_SDCLK__AUD5_TXD IOMUX_PAD(0x59C, 0x200, 4, 0x0, 0, NO_PAD_CTRL) | ||
758 | |||
759 | #define MX50_PAD_EPDC_SDOEZ__EPDC_SDOEZ IOMUX_PAD(0x5A0, 0x204, 0, 0x0, 0, NO_PAD_CTRL) | ||
760 | #define MX50_PAD_EPDC_SDOEZ__GPIO_3_21 IOMUX_PAD(0x5A0, 0x204, 1, 0x0, 0, NO_PAD_CTRL) | ||
761 | #define MX50_PAD_EPDC_SDOEZ__WEIM_D21 IOMUX_PAD(0x5A0, 0x204, 2, 0x0, 0, NO_PAD_CTRL) | ||
762 | #define MX50_PAD_EPDC_SDOEZ__ELCDIF_D21 IOMUX_PAD(0x5A0, 0x204, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
763 | #define MX50_PAD_EPDC_SDOEZ__AUD5_TXC IOMUX_PAD(0x5A0, 0x204, 4, 0x0, 0, NO_PAD_CTRL) | ||
764 | |||
765 | #define MX50_PAD_EPDC_SDOED__EPDC_SDOED IOMUX_PAD(0x5A4, 0x208, 0, 0x0, 0, NO_PAD_CTRL) | ||
766 | #define MX50_PAD_EPDC_SDOED__GPIO_3_22 IOMUX_PAD(0x5A4, 0x208, 1, 0x0, 0, NO_PAD_CTRL) | ||
767 | #define MX50_PAD_EPDC_SDOED__WEIM_D22 IOMUX_PAD(0x5A4, 0x208, 2, 0x0, 0, NO_PAD_CTRL) | ||
768 | #define MX50_PAD_EPDC_SDOED__ELCDIF_D22 IOMUX_PAD(0x5A4, 0x208, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
769 | #define MX50_PAD_EPDC_SDOED__AUD5_TXFS IOMUX_PAD(0x5A4, 0x208, 4, 0x0, 0, NO_PAD_CTRL) | ||
770 | |||
771 | #define MX50_PAD_EPDC_SDOE__EPDC_SDOE IOMUX_PAD(0x5A8, 0x20C, 0, 0x0, 0, NO_PAD_CTRL) | ||
772 | #define MX50_PAD_EPDC_SDOE__GPIO_3_23 IOMUX_PAD(0x5A8, 0x20C, 1, 0x0, 0, NO_PAD_CTRL) | ||
773 | #define MX50_PAD_EPDC_SDOE__WEIM_D23 IOMUX_PAD(0x5A8, 0x20C, 2, 0x0, 0, NO_PAD_CTRL) | ||
774 | #define MX50_PAD_EPDC_SDOE__ELCDIF_D23 IOMUX_PAD(0x5A8, 0x20C, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL) | ||
775 | #define MX50_PAD_EPDC_SDOE__AUD5_RXD IOMUX_PAD(0x5A8, 0x20C, 4, 0x0, 0, NO_PAD_CTRL) | ||
776 | |||
777 | #define MX50_PAD_EPDC_SDLE__EPDC_SDLE IOMUX_PAD(0x5AC, 0x210, 0, 0x0, 0, NO_PAD_CTRL) | ||
778 | #define MX50_PAD_EPDC_SDLE__GPIO_3_24 IOMUX_PAD(0x5AC, 0x210, 1, 0x0, 0, NO_PAD_CTRL) | ||
779 | #define MX50_PAD_EPDC_SDLE__WEIM_D24 IOMUX_PAD(0x5AC, 0x210, 2, 0x0, 0, NO_PAD_CTRL) | ||
780 | #define MX50_PAD_EPDC_SDLE__ELCDIF_D8 IOMUX_PAD(0x5AC, 0x210, 3, 0x71c, 1, MX50_ELCDIF_PAD_CTRL) | ||
781 | #define MX50_PAD_EPDC_SDLE__AUD5_RXC IOMUX_PAD(0x5AC, 0x210, 4, 0x0, 0, NO_PAD_CTRL) | ||
782 | |||
783 | #define MX50_PAD_EPDC_SDCLKN__EPDC_SDCLKN IOMUX_PAD(0x5B0, 0x214, 0, 0x0, 0, NO_PAD_CTRL) | ||
784 | #define MX50_PAD_EPDC_SDCLKN__GPIO_3_25 IOMUX_PAD(0x5B0, 0x214, 1, 0x0, 0, NO_PAD_CTRL) | ||
785 | #define MX50_PAD_EPDC_SDCLKN__WEIM_D25 IOMUX_PAD(0x5B0, 0x214, 2, 0x0, 0, NO_PAD_CTRL) | ||
786 | #define MX50_PAD_EPDC_SDCLKN__ELCDIF_D9 IOMUX_PAD(0x5B0, 0x214, 3, 0x720, 1, MX50_ELCDIF_PAD_CTRL) | ||
787 | #define MX50_PAD_EPDC_SDCLKN__AUD5_RXFS IOMUX_PAD(0x5B0, 0x214, 4, 0x0, 0, NO_PAD_CTRL) | ||
788 | |||
789 | #define MX50_PAD_EPDC_SDSHR__EPDC_SDSHR IOMUX_PAD(0x5B4, 0x218, 0, 0x0, 0, NO_PAD_CTRL) | ||
790 | #define MX50_PAD_EPDC_SDSHR__GPIO_3_26 IOMUX_PAD(0x5B4, 0x218, 1, 0x0, 0, NO_PAD_CTRL) | ||
791 | #define MX50_PAD_EPDC_SDSHR__WEIM_D26 IOMUX_PAD(0x5B4, 0x218, 2, 0x0, 0, NO_PAD_CTRL) | ||
792 | #define MX50_PAD_EPDC_SDSHR__ELCDIF_D10 IOMUX_PAD(0x5B4, 0x218, 3, 0x724, 1, MX50_ELCDIF_PAD_CTRL) | ||
793 | #define MX50_PAD_EPDC_SDSHR__AUD4_TXD IOMUX_PAD(0x5B4, 0x218, 4, 0x6c8, 1, NO_PAD_CTRL) | ||
794 | |||
795 | #define MX50_PAD_EPDC_PWRCOM__EPDC_PWRCOM IOMUX_PAD(0x5B8, 0x21C, 0, 0x0, 0, NO_PAD_CTRL) | ||
796 | #define MX50_PAD_EPDC_PWRCOM__GPIO_3_27 IOMUX_PAD(0x5B8, 0x21C, 1, 0x0, 0, NO_PAD_CTRL) | ||
797 | #define MX50_PAD_EPDC_PWRCOM__WEIM_D27 IOMUX_PAD(0x5B8, 0x21C, 2, 0x0, 0, NO_PAD_CTRL) | ||
798 | #define MX50_PAD_EPDC_PWRCOM__ELCDIF_D11 IOMUX_PAD(0x5B8, 0x21C, 3, 0x728, 1, MX50_ELCDIF_PAD_CTRL) | ||
799 | #define MX50_PAD_EPDC_PWRCOM__AUD4_TXC IOMUX_PAD(0x5B8, 0x21C, 4, 0x6d4, 1, NO_PAD_CTRL) | ||
800 | |||
801 | #define MX50_PAD_EPDC_PWRSTAT__EPDC_PWRSTAT IOMUX_PAD(0x5BC, 0x220, 0, 0x0, 0, NO_PAD_CTRL) | ||
802 | #define MX50_PAD_EPDC_PWRSTAT__GPIO_3_28 IOMUX_PAD(0x5BC, 0x220, 1, 0x0, 0, NO_PAD_CTRL) | ||
803 | #define MX50_PAD_EPDC_PWRSTAT__WEIM_D28 IOMUX_PAD(0x5BC, 0x220, 2, 0x0, 0, NO_PAD_CTRL) | ||
804 | #define MX50_PAD_EPDC_PWRSTAT__ELCDIF_D12 IOMUX_PAD(0x5BC, 0x220, 3, 0x72c, 1, MX50_ELCDIF_PAD_CTRL) | ||
805 | #define MX50_PAD_EPDC_PWRSTAT__AUD4_TXFS IOMUX_PAD(0x5BC, 0x220, 4, 0x6d8, 1, NO_PAD_CTRL) | ||
806 | |||
807 | #define MX50_PAD_EPDC_PWRCTRL0__EPDC_PWRCTRL0 IOMUX_PAD(0x5C0, 0x224, 0, 0x0, 0, NO_PAD_CTRL) | ||
808 | #define MX50_PAD_EPDC_PWRCTRL0__GPIO_3_29 IOMUX_PAD(0x5C0, 0x224, 1, 0x0, 0, NO_PAD_CTRL) | ||
809 | #define MX50_PAD_EPDC_PWRCTRL0__WEIM_D29 IOMUX_PAD(0x5C0, 0x224, 2, 0x0, 0, NO_PAD_CTRL) | ||
810 | #define MX50_PAD_EPDC_PWRCTRL0__ELCDIF_D13 IOMUX_PAD(0x5C0, 0x224, 3, 0x730, 1, MX50_ELCDIF_PAD_CTRL) | ||
811 | #define MX50_PAD_EPDC_PWRCTRL0__AUD4_RXD IOMUX_PAD(0x5C0, 0x224, 4, 0x6c4, 1, NO_PAD_CTRL) | ||
812 | |||
813 | #define MX50_PAD_EPDC_PWRCTRL1__EPDC_PWRCTRL1 IOMUX_PAD(0x5C4, 0x228, 0, 0x0, 0, NO_PAD_CTRL) | ||
814 | #define MX50_PAD_EPDC_PWRCTRL1__GPIO_3_30 IOMUX_PAD(0x5C4, 0x228, 1, 0x0, 0, NO_PAD_CTRL) | ||
815 | #define MX50_PAD_EPDC_PWRCTRL1__WEIM_D30 IOMUX_PAD(0x5C4, 0x228, 2, 0x0, 0, NO_PAD_CTRL) | ||
816 | #define MX50_PAD_EPDC_PWRCTRL1__ELCDIF_D14 IOMUX_PAD(0x5C4, 0x228, 3, 0x734, 1, MX50_ELCDIF_PAD_CTRL) | ||
817 | #define MX50_PAD_EPDC_PWRCTRL1__AUD4_RXC IOMUX_PAD(0x5C4, 0x228, 4, 0x6cc, 1, NO_PAD_CTRL) | ||
818 | |||
819 | #define MX50_PAD_EPDC_PWRCTRL2__EPDC_PWRCTRL2 IOMUX_PAD(0x5C8, 0x22C, 0, 0x0, 0, NO_PAD_CTRL) | ||
820 | #define MX50_PAD_EPDC_PWRCTRL2__GPIO_3_31 IOMUX_PAD(0x5C8, 0x22C, 1, 0x0, 0, NO_PAD_CTRL) | ||
821 | #define MX50_PAD_EPDC_PWRCTRL2__WEIM_D31 IOMUX_PAD(0x5C8, 0x22C, 2, 0x0, 0, NO_PAD_CTRL) | ||
822 | #define MX50_PAD_EPDC_PWRCTRL2__ELCDIF_D15 IOMUX_PAD(0x5C8, 0x22C, 3, 0x738, 1, MX50_ELCDIF_PAD_CTRL) | ||
823 | #define MX50_PAD_EPDC_PWRCTRL2__AUD4_RXFS IOMUX_PAD(0x5C8, 0x22C, 4, 0x6d0, 1, NO_PAD_CTRL) | ||
824 | #define MX50_PAD_EPDC_PWRCTRL2__SDMA_EXT0 IOMUX_PAD(0x5C8, 0x22C, 6, 0x7b8, 1, NO_PAD_CTRL) | ||
825 | |||
826 | #define MX50_PAD_EPDC_PWRCTRL3__PWRCTRL3 IOMUX_PAD(0x5CC, 0x230, 0, 0x0, 0, NO_PAD_CTRL) | ||
827 | #define MX50_PAD_EPDC_PWRCTRL3__GPIO_4_20 IOMUX_PAD(0x5CC, 0x230, 1, 0x0, 0, NO_PAD_CTRL) | ||
828 | #define MX50_PAD_EPDC_PWRCTRL3__WEIM_EB2 IOMUX_PAD(0x5CC, 0x230, 2, 0x0, 0, NO_PAD_CTRL) | ||
829 | #define MX50_PAD_EPDC_PWRCTRL3__SDMA_EXT1 IOMUX_PAD(0x5CC, 0x230, 6, 0x7bc, 1, NO_PAD_CTRL) | ||
830 | |||
831 | #define MX50_PAD_EPDC_VCOM0__EPDC_VCOM0 IOMUX_PAD(0x5D0, 0x234, 0, 0x0, 0, NO_PAD_CTRL) | ||
832 | #define MX50_PAD_EPDC_VCOM0__GPIO_4_21 IOMUX_PAD(0x5D0, 0x234, 1, 0x0, 0, NO_PAD_CTRL) | ||
833 | #define MX50_PAD_EPDC_VCOM0__WEIM_EB3 IOMUX_PAD(0x5D0, 0x234, 2, 0x0, 0, NO_PAD_CTRL) | ||
834 | |||
835 | #define MX50_PAD_EPDC_VCOM1__EPDC_VCOM1 IOMUX_PAD(0x5D4, 0x238, 0, 0x0, 0, NO_PAD_CTRL) | ||
836 | #define MX50_PAD_EPDC_VCOM1__GPIO_4_22 IOMUX_PAD(0x5D4, 0x238, 1, 0x0, 0, NO_PAD_CTRL) | ||
837 | #define MX50_PAD_EPDC_VCOM1__WEIM_CS3 IOMUX_PAD(0x5D4, 0x238, 2, 0x0, 0, NO_PAD_CTRL) | ||
838 | |||
839 | #define MX50_PAD_EPDC_BDR0__EPDC_BDR0 IOMUX_PAD(0x5D8, 0x23C, 0, 0x0, 0, NO_PAD_CTRL) | ||
840 | #define MX50_PAD_EPDC_BDR0__GPIO_4_23 IOMUX_PAD(0x5D8, 0x23C, 1, 0x0, 0, NO_PAD_CTRL) | ||
841 | #define MX50_PAD_EPDC_BDR0__ELCDIF_D7 IOMUX_PAD(0x5D8, 0x23C, 3, 0x718, 1, MX50_ELCDIF_PAD_CTRL) | ||
842 | |||
843 | #define MX50_PAD_EPDC_BDR1__EPDC_BDR1 IOMUX_PAD(0x5DC, 0x240, 0, 0x0, 0, NO_PAD_CTRL) | ||
844 | #define MX50_PAD_EPDC_BDR1__GPIO_4_24 IOMUX_PAD(0x5DC, 0x240, 1, 0x0, 0, NO_PAD_CTRL) | ||
845 | #define MX50_PAD_EPDC_BDR1__ELCDIF_D6 IOMUX_PAD(0x5DC, 0x240, 3, 0x714, 1, MX50_ELCDIF_PAD_CTRL) | ||
846 | |||
847 | #define MX50_PAD_EPDC_SDCE0__EPDC_SDCE0 IOMUX_PAD(0x5E0, 0x244, 0, 0x0, 0, NO_PAD_CTRL) | ||
848 | #define MX50_PAD_EPDC_SDCE0__GPIO_4_25 IOMUX_PAD(0x5E0, 0x244, 1, 0x0, 0, NO_PAD_CTRL) | ||
849 | #define MX50_PAD_EPDC_SDCE0__ELCDIF_D5 IOMUX_PAD(0x5E0, 0x244, 3, 0x710, 1, MX50_ELCDIF_PAD_CTRL) | ||
850 | |||
851 | #define MX50_PAD_EPDC_SDCE1__EPDC_SDCE1 IOMUX_PAD(0x5E4, 0x248, 0, 0x0, 0, NO_PAD_CTRL) | ||
852 | #define MX50_PAD_EPDC_SDCE1__GPIO_4_26 IOMUX_PAD(0x5E4, 0x248, 1, 0x0, 0, NO_PAD_CTRL) | ||
853 | #define MX50_PAD_EPDC_SDCE1__ELCDIF_D4 IOMUX_PAD(0x5E4, 0x248, 2, 0x70c, 1, MX50_ELCDIF_PAD_CTRL) | ||
854 | |||
855 | #define MX50_PAD_EPDC_SDCE2__EPDC_SDCE2 IOMUX_PAD(0x5E8, 0x24C, 0, 0x0, 0, NO_PAD_CTRL) | ||
856 | #define MX50_PAD_EPDC_SDCE2__GPIO_4_27 IOMUX_PAD(0x5E8, 0x24C, 1, 0x0, 0, NO_PAD_CTRL) | ||
857 | #define MX50_PAD_EPDC_SDCE2__ELCDIF_DAT3 IOMUX_PAD(0x5E8, 0x24C, 3, 0x708, 1, MX50_ELCDIF_PAD_CTRL) | ||
858 | |||
859 | #define MX50_PAD_EPDC_SDCE3__EPDC_SDCE3 IOMUX_PAD(0x5EC, 0x250, 0, 0x0, 0, NO_PAD_CTRL) | ||
860 | #define MX50_PAD_EPDC_SDCE3__GPIO_4_28 IOMUX_PAD(0x5EC, 0x250, 1, 0x0, 0, NO_PAD_CTRL) | ||
861 | #define MX50_PAD_EPDC_SDCE3__ELCDIF_D2 IOMUX_PAD(0x5EC, 0x250, 3, 0x704, 1, MX50_ELCDIF_PAD_CTRL) | ||
862 | |||
863 | #define MX50_PAD_EPDC_SDCE4__EPDC_SDCE4 IOMUX_PAD(0x5F0, 0x254, 0, 0x0, 0, NO_PAD_CTRL) | ||
864 | #define MX50_PAD_EPDC_SDCE4__GPIO_4_29 IOMUX_PAD(0x5F0, 0x254, 1, 0x0, 0, NO_PAD_CTRL) | ||
865 | #define MX50_PAD_EPDC_SDCE4__ELCDIF_D1 IOMUX_PAD(0x5F0, 0x254, 3, 0x700, 1, MX50_ELCDIF_PAD_CTRL) | ||
866 | |||
867 | #define MX50_PAD_EPDC_SDCE5__EPDC_SDCE5 IOMUX_PAD(0x5F4, 0x258, 0, 0x0, 0, NO_PAD_CTRL) | ||
868 | #define MX50_PAD_EPDC_SDCE5__GPIO_4_30 IOMUX_PAD(0x5F4, 0x258, 1, 0x0, 0, NO_PAD_CTRL) | ||
869 | #define MX50_PAD_EPDC_SDCE5__ELCDIF_D0 IOMUX_PAD(0x5F4, 0x258, 3, 0x6fc, 1, MX50_ELCDIF_PAD_CTRL) | ||
870 | |||
871 | #define MX50_PAD_EIM_DA0__WEIM_A0 IOMUX_PAD(0x5F8, 0x25C, 0, 0x0, 0, NO_PAD_CTRL) | ||
872 | #define MX50_PAD_EIM_DA0__GPIO_1_0 IOMUX_PAD(0x5F8, 0x25C, 1, 0x0, 0, NO_PAD_CTRL) | ||
873 | #define MX50_PAD_EIM_DA0__KEY_COL4 IOMUX_PAD(0x5f8, 0x25C, 3, 0x790, 2, NO_PAD_CTRL) | ||
874 | |||
875 | #define MX50_PAD_EIM_DA1__WEIM_A1 IOMUX_PAD(0x5FC, 0x260, 0, 0x0, 0, NO_PAD_CTRL) | ||
876 | #define MX50_PAD_EIM_DA1__GPIO_1_1 IOMUX_PAD(0x5FC, 0x260, 1, 0x0, 0, NO_PAD_CTRL) | ||
877 | #define MX50_PAD_EIM_DA1__KEY_ROW4 IOMUX_PAD(0x5fc, 0x260, 3, 0x7a0, 2, MX50_KEYPAD_CTRL) | ||
878 | |||
879 | #define MX50_PAD_EIM_DA2__WEIM_A2 IOMUX_PAD(0x600, 0x264, 0, 0x0, 0, NO_PAD_CTRL) | ||
880 | #define MX50_PAD_EIM_DA2__GPIO_1_2 IOMUX_PAD(0x600, 0x264, 1, 0x0, 0, NO_PAD_CTRL) | ||
881 | #define MX50_PAD_EIM_DA2__KEY_COL5 IOMUX_PAD(0x600, 0x264, 3, 0x794, 2, NO_PAD_CTRL) | ||
882 | |||
883 | #define MX50_PAD_EIM_DA3__WEIM_A3 IOMUX_PAD(0x604, 0x268, 0, 0x0, 0, NO_PAD_CTRL) | ||
884 | #define MX50_PAD_EIM_DA3__GPIO_1_3 IOMUX_PAD(0x604, 0x268, 1, 0x0, 0, NO_PAD_CTRL) | ||
885 | #define MX50_PAD_EIM_DA3__KEY_ROW5 IOMUX_PAD(0x604, 0x268, 3, 0x7a4, 2, MX50_KEYPAD_CTRL) | ||
886 | |||
887 | #define MX50_PAD_EIM_DA4__WEIM_A4 IOMUX_PAD(0x608, 0x26C, 0, 0x0, 0, NO_PAD_CTRL) | ||
888 | #define MX50_PAD_EIM_DA4__GPIO_1_4 IOMUX_PAD(0x608, 0x26C, 1, 0x0, 0, NO_PAD_CTRL) | ||
889 | #define MX50_PAD_EIM_DA4__KEY_COL6 IOMUX_PAD(0x608, 0x26C, 3, 0x798, 2, NO_PAD_CTRL) | ||
890 | |||
891 | #define MX50_PAD_EIM_DA5__WEIM_A5 IOMUX_PAD(0x60C, 0x270, 0, 0x0, 0, NO_PAD_CTRL) | ||
892 | #define MX50_PAD_EIM_DA5__GPIO_1_5 IOMUX_PAD(0x60C, 0x270, 1, 0x0, 0, NO_PAD_CTRL) | ||
893 | #define MX50_PAD_EIM_DA5__KEY_ROW6 IOMUX_PAD(0x60C, 0x270, 3, 0x7a8, 2, MX50_KEYPAD_CTRL) | ||
894 | |||
895 | #define MX50_PAD_EIM_DA6__WEIM_A6 IOMUX_PAD(0x610, 0x274, 0, 0x0, 0, NO_PAD_CTRL) | ||
896 | #define MX50_PAD_EIM_DA6__GPIO_1_6 IOMUX_PAD(0x610, 0x274, 1, 0x0, 0, NO_PAD_CTRL) | ||
897 | #define MX50_PAD_EIM_DA6__KEY_COL7 IOMUX_PAD(0x610, 0x274, 3, 0x79c, 2, NO_PAD_CTRL) | ||
898 | |||
899 | #define MX50_PAD_EIM_DA7__WEIM_A7 IOMUX_PAD(0x614, 0x278, 0, 0x0, 0, NO_PAD_CTRL) | ||
900 | #define MX50_PAD_EIM_DA7__GPIO_1_7 IOMUX_PAD(0x614, 0x278, 1, 0x0, 0, NO_PAD_CTRL) | ||
901 | #define MX50_PAD_EIM_DA7__KEY_ROW7 IOMUX_PAD(0x614, 0x278, 3, 0x7ac, 2, MX50_KEYPAD_CTRL) | ||
902 | |||
903 | #define MX50_PAD_EIM_DA8__WEIM_A8 IOMUX_PAD(0x618, 0x27C, 0, 0x0, 0, NO_PAD_CTRL) | ||
904 | #define MX50_PAD_EIM_DA8__GPIO_1_8 IOMUX_PAD(0x618, 0x27C, 1, 0x0, 0, NO_PAD_CTRL) | ||
905 | #define MX50_PIN_EIM_DA8__NANDF_CLE IOMUX_PAD(0x618, 0x27C, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
906 | |||
907 | #define MX50_PAD_EIM_DA9__WEIM_A9 IOMUX_PAD(0x61C, 0x280, 0, 0x0, 0, NO_PAD_CTRL) | ||
908 | #define MX50_PAD_EIM_DA9__GPIO_1_9 IOMUX_PAD(0x61C, 0x280, 1, 0x0, 0, NO_PAD_CTRL) | ||
909 | #define MX50_PIN_EIM_DA9__NANDF_ALE IOMUX_PAD(0x61C, 0x280, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
910 | |||
911 | #define MX50_PAD_EIM_DA10__WEIM_A10 IOMUX_PAD(0x620, 0x284, 0, 0x0, 0, NO_PAD_CTRL) | ||
912 | #define MX50_PAD_EIM_DA10__GPIO_1_10 IOMUX_PAD(0x620, 0x284, 1, 0x0, 0, NO_PAD_CTRL) | ||
913 | #define MX50_PIN_EIM_DA10__NANDF_CE0 IOMUX_PAD(0x620, 0x284, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
914 | |||
915 | #define MX50_PAD_EIM_DA11__WEIM_A11 IOMUX_PAD(0x624, 0x288, 0, 0x0, 0, NO_PAD_CTRL) | ||
916 | #define MX50_PAD_EIM_DA11__GPIO_1_11 IOMUX_PAD(0x624, 0x288, 1, 0x0, 0, NO_PAD_CTRL) | ||
917 | #define MX50_PIN_EIM_DA11__NANDF_CE1 IOMUX_PAD(0x624, 0x288, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
918 | |||
919 | #define MX50_PAD_EIM_DA12__WEIM_A12 IOMUX_PAD(0x628, 0x28C, 0, 0x0, 0, NO_PAD_CTRL) | ||
920 | #define MX50_PAD_EIM_DA12__GPIO_1_12 IOMUX_PAD(0x628, 0x28C, 1, 0x0, 0, NO_PAD_CTRL) | ||
921 | #define MX50_PIN_EIM_DA12__NANDF_CE2 IOMUX_PAD(0x628, 0x28C, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
922 | #define MX50_PAD_EIM_DA12__EPDC_SDCE6 IOMUX_PAD(0x628, 0x28C, 3, 0x0, 0, NO_PAD_CTRL) | ||
923 | |||
924 | #define MX50_PAD_EIM_DA13__WEIM_A13 IOMUX_PAD(0x62C, 0x290, 0, 0x0, 0, NO_PAD_CTRL) | ||
925 | #define MX50_PAD_EIM_DA13__GPIO_1_13 IOMUX_PAD(0x62C, 0x290, 1, 0x0, 0, NO_PAD_CTRL) | ||
926 | #define MX50_PIN_EIM_DA13__NANDF_CE3 IOMUX_PAD(0x62C, 0x290, 2, 0x0, 0, PAD_CTL_DSE_HIGH) | ||
927 | #define MX50_PIN_EIM_DA13__EPDC_SDCE7 IOMUX_PAD(0x62C, 0x290, 3, 0x0, 0, NO_PAD_CTRL) | ||
928 | |||
929 | #define MX50_PAD_EIM_DA14__WEIM_A14 IOMUX_PAD(0x630, 0x294, 0, 0x0, 0, NO_PAD_CTRL) | ||
930 | #define MX50_PAD_EIM_DA14__GPIO_1_14 IOMUX_PAD(0x630, 0x294, 1, 0x0, 0, NO_PAD_CTRL) | ||
931 | #define MX50_PAD_EIM_DA14__NANDF_READY IOMUX_PAD(0x630, 0x294, 2, 0x7B4, 2, PAD_CTL_PKE | \ | ||
932 | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP) | ||
933 | #define MX50_PAD_EIM_DA14__EPDC_SDCE8 IOMUX_PAD(0x630, 0x294, 3, 0x0, 0, NO_PAD_CTRL) | ||
934 | |||
935 | #define MX50_PAD_EIM_DA15__WEIM_A15 IOMUX_PAD(0x634, 0x298, 0, 0x0, 0, NO_PAD_CTRL) | ||
936 | #define MX50_PAD_EIM_DA15__GPIO_1_15 IOMUX_PAD(0x634, 0x298, 1, 0x0, 0, NO_PAD_CTRL) | ||
937 | #define MX50_PIN_EIM_DA15__NANDF_DQS IOMUX_PAD(0x634, 0x298, 2, 0x7B0, 2, PAD_CTL_DSE_HIGH) | ||
938 | #define MX50_PAD_EIM_DA15__EPDC_SDCE9 IOMUX_PAD(0x634, 0x298, 3, 0x0, 0, NO_PAD_CTRL) | ||
939 | |||
940 | #define MX50_PAD_EIM_CS2__WEIM_CS2 IOMUX_PAD(0x638, 0x29C, 0, 0x0, 0, NO_PAD_CTRL) | ||
941 | #define MX50_PAD_EIM_CS2__GPIO_1_16 IOMUX_PAD(0x638, 0x29C, 1, 0x0, 0, NO_PAD_CTRL) | ||
942 | #define MX50_PAD_EIM_CS2__WEIM_A27 IOMUX_PAD(0x638, 0x29C, 2, 0x0, 0, NO_PAD_CTRL) | ||
943 | |||
944 | #define MX50_PAD_EIM_CS1__WEIM_CS1 IOMUX_PAD(0x63C, 0x2A0, 0, 0x0, 0, NO_PAD_CTRL) | ||
945 | #define MX50_PAD_EIM_CS1__GPIO_1_17 IOMUX_PAD(0x63C, 0x2A0, 1, 0x0, 0, NO_PAD_CTRL) | ||
946 | |||
947 | #define MX50_PAD_EIM_CS0__WEIM_CS0 IOMUX_PAD(0x640, 0x2A4, 0, 0x0, 0, NO_PAD_CTRL) | ||
948 | #define MX50_PAD_EIM_CS0__GPIO_1_18 IOMUX_PAD(0x640, 0x2A4, 1, 0x0, 0, NO_PAD_CTRL) | ||
949 | |||
950 | #define MX50_PAD_EIM_EB0__WEIM_EB0 IOMUX_PAD(0x644, 0x2A8, 0, 0x0, 0, NO_PAD_CTRL) | ||
951 | #define MX50_PAD_EIM_EB0__GPIO_1_19 IOMUX_PAD(0x644, 0x2A8, 1, 0x0, 0, NO_PAD_CTRL) | ||
952 | |||
953 | #define MX50_PAD_EIM_EB1__WEIM_EB1 IOMUX_PAD(0x648, 0x2AC, 0, 0x0, 0, NO_PAD_CTRL) | ||
954 | #define MX50_PAD_EIM_EB1__GPIO_1_20 IOMUX_PAD(0x648, 0x2AC, 1, 0x0, 0, NO_PAD_CTRL) | ||
955 | |||
956 | #define MX50_PAD_EIM_WAIT__WEIM_WAIT IOMUX_PAD(0x64C, 0x2B0, 0, 0x0, 0, NO_PAD_CTRL) | ||
957 | #define MX50_PAD_EIM_WAIT__GPIO_1_21 IOMUX_PAD(0x64C, 0x2B0, 1, 0x0, 0, NO_PAD_CTRL) | ||
958 | |||
959 | #define MX50_PAD_EIM_BCLK__WEIM_BCLK IOMUX_PAD(0x650, 0x2B4, 0, 0x0, 0, NO_PAD_CTRL) | ||
960 | #define MX50_PAD_EIM_BCLK__GPIO_1_22 IOMUX_PAD(0x650, 0x2B4, 1, 0x0, 0, NO_PAD_CTRL) | ||
961 | |||
962 | #define MX50_PAD_EIM_RDY__WEIM_RDY IOMUX_PAD(0x654, 0x2B8, 0, 0x0, 0, NO_PAD_CTRL) | ||
963 | #define MX50_PAD_EIM_RDY__GPIO_1_23 IOMUX_PAD(0x654, 0x2B8, 1, 0x0, 0, NO_PAD_CTRL) | ||
964 | |||
965 | #define MX50_PAD_EIM_OE__WEIM_OE IOMUX_PAD(0x658, 0x2BC, 0, 0x0, 0, NO_PAD_CTRL) | ||
966 | #define MX50_PAD_EIM_OE__GPIO_1_24 IOMUX_PAD(0x658, 0x2BC, 1, 0x0, 0, NO_PAD_CTRL) | ||
967 | |||
968 | #define MX50_PAD_EIM_RW__WEIM_RW IOMUX_PAD(0x65C, 0x2C0, 0, 0x0, 0, NO_PAD_CTRL) | ||
969 | #define MX50_PAD_EIM_RW__GPIO_1_25 IOMUX_PAD(0x65C, 0x2C0, 1, 0x0, 0, NO_PAD_CTRL) | ||
970 | |||
971 | #define MX50_PAD_EIM_LBA__WEIM_LBA IOMUX_PAD(0x660, 0x2C4, 0, 0x0, 0, NO_PAD_CTRL) | ||
972 | #define MX50_PAD_EIM_LBA__GPIO_1_26 IOMUX_PAD(0x660, 0x2C4, 1, 0x0, 0, NO_PAD_CTRL) | ||
973 | |||
974 | #define MX50_PAD_EIM_CRE__WEIM_CRE IOMUX_PAD(0x664, 0x2C8, 0, 0x0, 0, NO_PAD_CTRL) | ||
975 | #define MX50_PAD_EIM_CRE__GPIO_1_27 IOMUX_PAD(0x664, 0x2C8, 1, 0x0, 0, NO_PAD_CTRL) | ||
976 | |||
977 | #endif /* __MACH_IOMUX_MX50_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h index d7a41e9a2605..b6767f90ef14 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h +++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h | |||
@@ -15,373 +15,1553 @@ | |||
15 | 15 | ||
16 | #include <mach/iomux-v3.h> | 16 | #include <mach/iomux-v3.h> |
17 | 17 | ||
18 | /* | ||
19 | * various IOMUX alternate output functions (1-7) | ||
20 | */ | ||
21 | typedef enum iomux_config { | ||
22 | IOMUX_CONFIG_ALT0, | ||
23 | IOMUX_CONFIG_ALT1, | ||
24 | IOMUX_CONFIG_ALT2, | ||
25 | IOMUX_CONFIG_ALT3, | ||
26 | IOMUX_CONFIG_ALT4, | ||
27 | IOMUX_CONFIG_ALT5, | ||
28 | IOMUX_CONFIG_ALT6, | ||
29 | IOMUX_CONFIG_ALT7, | ||
30 | IOMUX_CONFIG_GPIO, /* added to help user use GPIO mode */ | ||
31 | IOMUX_CONFIG_SION = 0x1 << 4, /* LOOPBACK:MUX SION bit */ | ||
32 | } iomux_pin_cfg_t; | ||
33 | |||
34 | /* Pad control groupings */ | 18 | /* Pad control groupings */ |
35 | #define MX51_UART1_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \ | 19 | #define MX51_UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_DSE_HIGH | \ |
36 | PAD_CTL_DSE_HIGH) | 20 | PAD_CTL_HYS | PAD_CTL_SRE_FAST) |
37 | #define MX51_UART2_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_DSE_HIGH | \ | ||
38 | PAD_CTL_SRE_FAST) | ||
39 | #define MX51_UART3_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \ | ||
40 | PAD_CTL_SRE_FAST) | ||
41 | #define MX51_I2C_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_ODE | \ | 21 | #define MX51_I2C_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_ODE | \ |
42 | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP | PAD_CTL_HYS) | 22 | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP | \ |
43 | #define MX51_USBH1_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \ | 23 | PAD_CTL_HYS) |
44 | PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \ | 24 | #define MX51_ESDHC_PAD_CTRL (PAD_CTL_SRE_FAST | PAD_CTL_ODE | \ |
45 | PAD_CTL_PKE | PAD_CTL_HYS) | 25 | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP | \ |
46 | #define MX51_GPIO_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE | \ | 26 | PAD_CTL_HYS) |
47 | PAD_CTL_SRE_FAST) | 27 | #define MX51_USBH1_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_SRE_FAST | \ |
48 | #define MX51_GPIO_PAD_CTRL_2 (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \ | 28 | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP | \ |
49 | PAD_CTL_PUS_100K_UP) | 29 | PAD_CTL_HYS | PAD_CTL_PUE) |
50 | #define MX51_ECSPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \ | 30 | #define MX51_ECSPI_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_HYS | \ |
51 | PAD_CTL_SRE_FAST) | 31 | PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST) |
52 | #define MX51_SDHCI_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PUS_47K_UP | \ | 32 | #define MX51_SDHCI_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \ |
53 | PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_SRE_FAST | \ | 33 | PAD_CTL_PUS_47K_UP | PAD_CTL_PUE | \ |
54 | PAD_CTL_DVS) | 34 | PAD_CTL_SRE_FAST | PAD_CTL_DVS) |
35 | #define MX51_GPIO_PAD_CTRL (PAD_CTL_DSE_HIGH | PAD_CTL_PKE | PAD_CTL_SRE_FAST) | ||
55 | 36 | ||
56 | #define MX51_PAD_CTRL_1 (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \ | 37 | #define MX51_PAD_CTRL_2 (PAD_CTL_PKE | PAD_CTL_HYS) |
57 | PAD_CTL_PUE | PAD_CTL_PKE | PAD_CTL_HYS) | 38 | #define MX51_PAD_CTRL_3 (PAD_CTL_PKE | PAD_CTL_PUS_100K_UP) |
58 | #define MX51_PAD_CTRL_2 (PAD_CTL_HYS | PAD_CTL_PKE) | 39 | #define MX51_PAD_CTRL_4 (PAD_CTL_PKE | PAD_CTL_DVS | PAD_CTL_HYS) |
59 | #define MX51_PAD_CTRL_3 (PAD_CTL_PKE | PAD_CTL_PUS_100K_UP) | 40 | #define MX51_PAD_CTRL_5 (PAD_CTL_DVS | PAD_CTL_DSE_HIGH) |
60 | #define MX51_PAD_CTRL_4 (PAD_CTL_DVS | PAD_CTL_HYS | PAD_CTL_PKE) | ||
61 | #define MX51_PAD_CTRL_5 (PAD_CTL_DVS | PAD_CTL_DSE_HIGH) | ||
62 | 41 | ||
63 | /* | 42 | /* |
64 | * The naming convention for the pad modes is MX51_PAD_<padname>__<padmode> | 43 | * The naming convention for the pad modes is MX51_PAD_<padname>__<padmode> |
65 | * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num> | 44 | * If <padname> or <padmode> refers to a GPIO, it is named GPIO<unit>_<num> |
66 | * See also iomux-v3.h | 45 | * See also iomux-v3.h |
67 | */ | 46 | */ |
68 | 47 | ||
69 | /* PAD MUX ALT INPSE PATH PADCTRL */ | 48 | /* Raw pin modes without pad control */ |
70 | #define MX51_PAD_EIM_DA0__EIM_DA0 IOMUX_PAD(0x7a8, 0x01c, 0, 0x0, 0, NO_PAD_CTRL) | 49 | /* PAD MUX ALT INPSE PATH PADCTRL */ |
71 | #define MX51_PAD_EIM_DA1__EIM_DA1 IOMUX_PAD(0x7a8, 0x020, 0, 0x0, 0, NO_PAD_CTRL) | 50 | #define _MX51_PAD_EIM_D16__AUD4_RXFS IOMUX_PAD(0x3f0, 0x5c, 5, 0x0000, 0, 0) |
72 | #define MX51_PAD_EIM_DA2__EIM_DA2 IOMUX_PAD(0x7a8, 0x024, 0, 0x0, 0, NO_PAD_CTRL) | 51 | #define _MX51_PAD_EIM_D16__AUD5_TXD IOMUX_PAD(0x3f0, 0x5c, 7, 0x08d8, 0, 0) |
73 | #define MX51_PAD_EIM_DA3__EIM_DA3 IOMUX_PAD(0x7a8, 0x028, 0, 0x0, 0, NO_PAD_CTRL) | 52 | #define _MX51_PAD_EIM_D16__EIM_D16 IOMUX_PAD(0x3f0, 0x5c, 0, 0x0000, 0, 0) |
74 | #define MX51_PAD_EIM_DA4__EIM_DA4 IOMUX_PAD(0x7ac, 0x02c, 0, 0x0, 0, NO_PAD_CTRL) | 53 | #define _MX51_PAD_EIM_D16__GPIO2_0 IOMUX_PAD(0x3f0, 0x5c, 1, 0x0000, 0, 0) |
75 | #define MX51_PAD_EIM_DA5__EIM_DA5 IOMUX_PAD(0x7ac, 0x030, 0, 0x0, 0, NO_PAD_CTRL) | 54 | #define _MX51_PAD_EIM_D16__I2C1_SDA IOMUX_PAD(0x3f0, 0x5c, 0x14, 0x09b4, 0, 0) |
76 | #define MX51_PAD_EIM_DA6__EIM_DA6 IOMUX_PAD(0x7ac, 0x034, 0, 0x0, 0, NO_PAD_CTRL) | 55 | #define _MX51_PAD_EIM_D16__UART2_CTS IOMUX_PAD(0x3f0, 0x5c, 3, 0x0000, 0, 0) |
77 | #define MX51_PAD_EIM_DA7__EIM_DA7 IOMUX_PAD(0x7ac, 0x038, 0, 0x0, 0, NO_PAD_CTRL) | 56 | #define _MX51_PAD_EIM_D16__USBH2_DATA0 IOMUX_PAD(0x3f0, 0x5c, 2, 0x0000, 0, 0) |
78 | #define MX51_PAD_EIM_DA8__EIM_DA8 IOMUX_PAD(0x7b0, 0x03c, 0, 0x0, 0, NO_PAD_CTRL) | 57 | #define _MX51_PAD_EIM_D17__AUD5_RXD IOMUX_PAD(0x3f4, 0x60, 7, 0x08d4, 0, 0) |
79 | #define MX51_PAD_EIM_DA9__EIM_DA9 IOMUX_PAD(0x7b0, 0x040, 0, 0x0, 0, NO_PAD_CTRL) | 58 | #define _MX51_PAD_EIM_D17__EIM_D17 IOMUX_PAD(0x3f4, 0x60, 0, 0x0000, 0, 0) |
80 | #define MX51_PAD_EIM_DA10__EIM_DA10 IOMUX_PAD(0x7b0, 0x044, 0, 0x0, 0, NO_PAD_CTRL) | 59 | #define _MX51_PAD_EIM_D17__GPIO2_1 IOMUX_PAD(0x3f4, 0x60, 1, 0x0000, 0, 0) |
81 | #define MX51_PAD_EIM_DA11__EIM_DA11 IOMUX_PAD(0x7b0, 0x048, 0, 0x0, 0, NO_PAD_CTRL) | 60 | #define _MX51_PAD_EIM_D17__UART2_RXD IOMUX_PAD(0x3f4, 0x60, 3, 0x09ec, 0, 0) |
82 | #define MX51_PAD_EIM_DA12__EIM_DA12 IOMUX_PAD(0x7bc, 0x04c, 0, 0x0, 0, NO_PAD_CTRL) | 61 | #define _MX51_PAD_EIM_D17__UART3_CTS IOMUX_PAD(0x3f4, 0x60, 4, 0x0000, 0, 0) |
83 | #define MX51_PAD_EIM_DA13__EIM_DA13 IOMUX_PAD(0x7bc, 0x050, 0, 0x0, 0, NO_PAD_CTRL) | 62 | #define _MX51_PAD_EIM_D17__USBH2_DATA1 IOMUX_PAD(0x3f4, 0x60, 2, 0x0000, 0, 0) |
84 | #define MX51_PAD_EIM_DA14__EIM_DA14 IOMUX_PAD(0x7bc, 0x054, 0, 0x0, 0, NO_PAD_CTRL) | 63 | #define _MX51_PAD_EIM_D18__AUD5_TXC IOMUX_PAD(0x3f8, 0x64, 7, 0x08e4, 0, 0) |
85 | #define MX51_PAD_EIM_DA15__EIM_DA15 IOMUX_PAD(0x7bc, 0x058, 0, 0x0, 0, NO_PAD_CTRL) | 64 | #define _MX51_PAD_EIM_D18__EIM_D18 IOMUX_PAD(0x3f8, 0x64, 0, 0x0000, 0, 0) |
86 | #define MX51_PAD_EIM_D16__GPIO_2_0 IOMUX_PAD(0x3f0, 0x05c, 1, 0x0, 0, NO_PAD_CTRL) | 65 | #define _MX51_PAD_EIM_D18__GPIO2_2 IOMUX_PAD(0x3f8, 0x64, 1, 0x0000, 0, 0) |
87 | #define MX51_PAD_EIM_D16__I2C1_SDA IOMUX_PAD(0x3f0, 0x05c, (4 | IOMUX_CONFIG_SION), \ | 66 | #define _MX51_PAD_EIM_D18__UART2_TXD IOMUX_PAD(0x3f8, 0x64, 3, 0x0000, 0, 0) |
88 | 0x09b4, 0, MX51_I2C_PAD_CTRL) | 67 | #define _MX51_PAD_EIM_D18__UART3_RTS IOMUX_PAD(0x3f8, 0x64, 4, 0x09f0, 1, 0) |
89 | #define MX51_PAD_EIM_D17__GPIO_2_1 IOMUX_PAD(0x3f4, 0x060, 1, 0x0, 0, NO_PAD_CTRL) | 68 | #define _MX51_PAD_EIM_D18__USBH2_DATA2 IOMUX_PAD(0x3f8, 0x64, 2, 0x0000, 0, 0) |
90 | #define MX51_PAD_EIM_D18__GPIO_2_2 IOMUX_PAD(0x3f8, 0x064, 1, 0x0, 0, NO_PAD_CTRL) | 69 | #define _MX51_PAD_EIM_D19__AUD4_RXC IOMUX_PAD(0x3fc, 0x68, 5, 0x0000, 0, 0) |
91 | #define MX51_PAD_EIM_D19__GPIO_2_3 IOMUX_PAD(0x3fc, 0x068, 1, 0x0, 0, NO_PAD_CTRL) | 70 | #define _MX51_PAD_EIM_D19__AUD5_TXFS IOMUX_PAD(0x3fc, 0x68, 7, 0x08e8, 0, 0) |
92 | #define MX51_PAD_EIM_D19__I2C1_SCL IOMUX_PAD(0x3fc, 0x068, (4 | IOMUX_CONFIG_SION), \ | 71 | #define _MX51_PAD_EIM_D19__EIM_D19 IOMUX_PAD(0x3fc, 0x68, 0, 0x0000, 0, 0) |
93 | 0x09b0, 0, MX51_I2C_PAD_CTRL) | 72 | #define _MX51_PAD_EIM_D19__GPIO2_3 IOMUX_PAD(0x3fc, 0x68, 1, 0x0000, 0, 0) |
94 | #define MX51_PAD_EIM_D20__GPIO_2_4 IOMUX_PAD(0x400, 0x06c, 1, 0x0, 0, NO_PAD_CTRL) | 73 | #define _MX51_PAD_EIM_D19__I2C1_SCL IOMUX_PAD(0x3fc, 0x68, 0x14, 0x09b0, 0, 0) |
95 | #define MX51_PAD_EIM_D21__GPIO_2_5 IOMUX_PAD(0x404, 0x070, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 74 | #define _MX51_PAD_EIM_D19__UART2_RTS IOMUX_PAD(0x3fc, 0x68, 3, 0x09e8, 1, 0) |
96 | #define MX51_PAD_EIM_D22__GPIO_2_6 IOMUX_PAD(0x408, 0x074, 1, 0x0, 0, NO_PAD_CTRL) | 75 | #define _MX51_PAD_EIM_D19__USBH2_DATA3 IOMUX_PAD(0x3fc, 0x68, 2, 0x0000, 0, 0) |
97 | #define MX51_PAD_EIM_D23__GPIO_2_7 IOMUX_PAD(0x40c, 0x078, 1, 0x0, 0, NO_PAD_CTRL) | 76 | #define _MX51_PAD_EIM_D20__AUD4_TXD IOMUX_PAD(0x400, 0x6c, 5, 0x08c8, 0, 0) |
98 | #define MX51_PAD_EIM_D24__UART3_CTS IOMUX_PAD(0x410, 0x07c, 3, 0x0, 0, MX51_UART3_PAD_CTRL) | 77 | #define _MX51_PAD_EIM_D20__EIM_D20 IOMUX_PAD(0x400, 0x6c, 0, 0x0000, 0, 0) |
99 | #define MX51_PAD_EIM_D25__UART3_RXD IOMUX_PAD(0x414, 0x080, 3, 0x9f4, 0, MX51_UART3_PAD_CTRL) | 78 | #define _MX51_PAD_EIM_D20__GPIO2_4 IOMUX_PAD(0x400, 0x6c, 1, 0x0000, 0, 0) |
100 | #define MX51_PAD_EIM_D25__UART2_CTS IOMUX_PAD(0x414, 0x080, 4, 0x0, 0, MX51_UART2_PAD_CTRL) | 79 | #define _MX51_PAD_EIM_D20__SRTC_ALARM_DEB IOMUX_PAD(0x400, 0x6c, 4, 0x0000, 0, 0) |
101 | #define MX51_PAD_EIM_D26__UART3_TXD IOMUX_PAD(0x418, 0x084, 3, 0x0, 0, MX51_UART3_PAD_CTRL) | 80 | #define _MX51_PAD_EIM_D20__USBH2_DATA4 IOMUX_PAD(0x400, 0x6c, 2, 0x0000, 0, 0) |
102 | #define MX51_PAD_EIM_D26__UART2_RTS IOMUX_PAD(0x418, 0x084, 4, 0x9e8, 3, MX51_UART2_PAD_CTRL) | 81 | #define _MX51_PAD_EIM_D21__AUD4_RXD IOMUX_PAD(0x404, 0x70, 5, 0x08c4, 0, 0) |
103 | #define MX51_PAD_EIM_D27__UART3_RTS IOMUX_PAD(0x41c, 0x088, 3, 0x9f0, 3, MX51_UART3_PAD_CTRL) | 82 | #define _MX51_PAD_EIM_D21__EIM_D21 IOMUX_PAD(0x404, 0x70, 0, 0x0000, 0, 0) |
104 | #define MX51_PAD_EIM_D28__EIM_D28 IOMUX_PAD(0x420, 0x08c, 0, 0x0, 0, NO_PAD_CTRL) | 83 | #define _MX51_PAD_EIM_D21__GPIO2_5 IOMUX_PAD(0x404, 0x70, 1, 0x0000, 0, 0) |
105 | #define MX51_PAD_EIM_D29__EIM_D29 IOMUX_PAD(0x424, 0x090, 0, 0x0, 0, NO_PAD_CTRL) | 84 | #define _MX51_PAD_EIM_D21__SRTC_ALARM_DEB IOMUX_PAD(0x404, 0x70, 3, 0x0000, 0, 0) |
106 | #define MX51_PAD_EIM_D30__EIM_D30 IOMUX_PAD(0x428, 0x094, 0, 0x0, 0, NO_PAD_CTRL) | 85 | #define _MX51_PAD_EIM_D21__USBH2_DATA5 IOMUX_PAD(0x404, 0x70, 2, 0x0000, 0, 0) |
107 | #define MX51_PAD_EIM_D31__EIM_D31 IOMUX_PAD(0x42c, 0x09c, 0, 0x0, 0, NO_PAD_CTRL) | 86 | #define _MX51_PAD_EIM_D22__AUD4_TXC IOMUX_PAD(0x408, 0x74, 5, 0x08cc, 0, 0) |
108 | #define MX51_PAD_EIM_A16__GPIO_2_10 IOMUX_PAD(0x430, 0x09c, 1, 0x0, 0, NO_PAD_CTRL) | 87 | #define _MX51_PAD_EIM_D22__EIM_D22 IOMUX_PAD(0x408, 0x74, 0, 0x0000, 0, 0) |
109 | #define MX51_PAD_EIM_A17__GPIO_2_11 IOMUX_PAD(0x434, 0x0a0, 1, 0x0, 0, NO_PAD_CTRL) | 88 | #define _MX51_PAD_EIM_D22__GPIO2_6 IOMUX_PAD(0x408, 0x74, 1, 0x0000, 0, 0) |
110 | #define MX51_PAD_EIM_A18__GPIO_2_12 IOMUX_PAD(0x438, 0x0a4, 1, 0x0, 0, NO_PAD_CTRL) | 89 | #define _MX51_PAD_EIM_D22__USBH2_DATA6 IOMUX_PAD(0x408, 0x74, 2, 0x0000, 0, 0) |
111 | #define MX51_PAD_EIM_A19__GPIO_2_13 IOMUX_PAD(0x43c, 0x0a8, 1, 0x0, 0, NO_PAD_CTRL) | 90 | #define _MX51_PAD_EIM_D23__AUD4_TXFS IOMUX_PAD(0x40c, 0x78, 5, 0x08d0, 0, 0) |
112 | #define MX51_PAD_EIM_A20__GPIO_2_14 IOMUX_PAD(0x440, 0x0ac, 1, 0x0, 0, NO_PAD_CTRL) | 91 | #define _MX51_PAD_EIM_D23__EIM_D23 IOMUX_PAD(0x40c, 0x78, 0, 0x0000, 0, 0) |
113 | #define MX51_PAD_EIM_A21__GPIO_2_15 IOMUX_PAD(0x444, 0x0b0, 1, 0x0, 0, NO_PAD_CTRL) | 92 | #define _MX51_PAD_EIM_D23__GPIO2_7 IOMUX_PAD(0x40c, 0x78, 1, 0x0000, 0, 0) |
114 | #define MX51_PAD_EIM_A22__GPIO_2_16 IOMUX_PAD(0x448, 0x0b4, 1, 0x0, 0, NO_PAD_CTRL) | 93 | #define _MX51_PAD_EIM_D23__SPDIF_OUT1 IOMUX_PAD(0x40c, 0x78, 4, 0x0000, 0, 0) |
115 | #define MX51_PAD_EIM_A23__GPIO_2_17 IOMUX_PAD(0x44c, 0x0b8, 1, 0x0, 0, NO_PAD_CTRL) | 94 | #define _MX51_PAD_EIM_D23__USBH2_DATA7 IOMUX_PAD(0x40c, 0x78, 2, 0x0000, 0, 0) |
116 | #define MX51_PAD_EIM_A24__GPIO_2_18 IOMUX_PAD(0x450, 0x0bc, 1, 0x0, 0, NO_PAD_CTRL) | 95 | #define _MX51_PAD_EIM_D24__AUD6_RXFS IOMUX_PAD(0x410, 0x7c, 5, 0x08f8, 0, 0) |
117 | #define MX51_PAD_EIM_A25__GPIO_2_19 IOMUX_PAD(0x454, 0x0c0, 1, 0x0, 0, NO_PAD_CTRL) | 96 | #define _MX51_PAD_EIM_D24__EIM_D24 IOMUX_PAD(0x410, 0x7c, 0, 0x0000, 0, 0) |
118 | #define MX51_PAD_EIM_A26__GPIO_2_20 IOMUX_PAD(0x458, 0x0c4, 1, 0x0, 0, NO_PAD_CTRL) | 97 | #define _MX51_PAD_EIM_D24__GPIO2_8 IOMUX_PAD(0x410, 0x7c, 1, 0x0000, 0, 0) |
119 | #define MX51_PAD_EIM_A27__GPIO_2_21 IOMUX_PAD(0x45c, 0x0c8, 1, 0x0, 0, NO_PAD_CTRL) | 98 | #define _MX51_PAD_EIM_D24__I2C2_SDA IOMUX_PAD(0x410, 0x7c, 0x14, 0x09bc, 0, 0) |
120 | #define MX51_PAD_EIM_EB0__EIM_EB0 IOMUX_PAD(0x460, 0x0cc, 0, 0x0, 0, NO_PAD_CTRL) | 99 | #define _MX51_PAD_EIM_D24__UART3_CTS IOMUX_PAD(0x410, 0x7c, 3, 0x0000, 0, 0) |
121 | #define MX51_PAD_EIM_EB1__EIM_EB1 IOMUX_PAD(0x464, 0x0d0, 0, 0x0, 0, NO_PAD_CTRL) | 100 | #define _MX51_PAD_EIM_D24__USBOTG_DATA0 IOMUX_PAD(0x410, 0x7c, 2, 0x0000, 0, 0) |
122 | #define MX51_PAD_EIM_EB2__GPIO_2_22 IOMUX_PAD(0x468, 0x0d4, 1, 0x0, 0, NO_PAD_CTRL) | 101 | #define _MX51_PAD_EIM_D25__EIM_D25 IOMUX_PAD(0x414, 0x80, 0, 0x0000, 0, 0) |
123 | #define MX51_PAD_EIM_EB2__FEC_MDIO IOMUX_PAD(0x468, 0x0d4, 3, 0x0, 0, MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) | 102 | #define _MX51_PAD_EIM_D25__KEY_COL6 IOMUX_PAD(0x414, 0x80, 1, 0x09c8, 0, 0) |
124 | #define MX51_PAD_EIM_EB3__GPIO_2_23 IOMUX_PAD(0x46c, 0x0d8, 1, 0x0, 0, NO_PAD_CTRL) | 103 | #define _MX51_PAD_EIM_D25__UART2_CTS IOMUX_PAD(0x414, 0x80, 4, 0x0000, 0, 0) |
125 | #define MX51_PAD_EIM_EB3__FEC_RDAT1 IOMUX_PAD(0x46c, 0x0d8, 3, 0x0, 0, MX51_PAD_CTRL_2) | 104 | #define _MX51_PAD_EIM_D25__UART3_RXD IOMUX_PAD(0x414, 0x80, 3, 0x09f4, 0, 0) |
126 | #define MX51_PAD_EIM_OE__GPIO_2_24 IOMUX_PAD(0x470, 0x0dc, 1, 0x0, 0, NO_PAD_CTRL) | 105 | #define _MX51_PAD_EIM_D25__USBOTG_DATA1 IOMUX_PAD(0x414, 0x80, 2, 0x0000, 0, 0) |
127 | #define MX51_PAD_EIM_CS0__GPIO_2_25 IOMUX_PAD(0x474, 0x0e0, 1, 0x0, 0, NO_PAD_CTRL) | 106 | #define _MX51_PAD_EIM_D26__EIM_D26 IOMUX_PAD(0x418, 0x84, 0, 0x0000, 0, 0) |
128 | #define MX51_PAD_EIM_CS1__GPIO_2_26 IOMUX_PAD(0x478, 0x0e4, 1, 0x0, 0, NO_PAD_CTRL) | 107 | #define _MX51_PAD_EIM_D26__KEY_COL7 IOMUX_PAD(0x418, 0x84, 1, 0x09cc, 0, 0) |
129 | #define MX51_PAD_EIM_CS2__GPIO_2_27 IOMUX_PAD(0x47c, 0x0e8, 1, 0x0, 0, NO_PAD_CTRL) | 108 | #define _MX51_PAD_EIM_D26__UART2_RTS IOMUX_PAD(0x418, 0x84, 4, 0x09e8, 3, 0) |
130 | #define MX51_PAD_EIM_CS2__FEC_RDAT2 IOMUX_PAD(0x47c, 0x0e8, 3, 0x0, 0, MX51_PAD_CTRL_2) | 109 | #define _MX51_PAD_EIM_D26__UART3_TXD IOMUX_PAD(0x418, 0x84, 3, 0x0000, 0, 0) |
131 | #define MX51_PAD_EIM_CS3__GPIO_2_28 IOMUX_PAD(0x480, 0x0ec, 1, 0x0, 0, NO_PAD_CTRL) | 110 | #define _MX51_PAD_EIM_D26__USBOTG_DATA2 IOMUX_PAD(0x418, 0x84, 2, 0x0000, 0, 0) |
132 | #define MX51_PAD_EIM_CS3__FEC_RDAT3 IOMUX_PAD(0x480, 0x0ec, 3, 0x0, 0, MX51_PAD_CTRL_2) | 111 | #define _MX51_PAD_EIM_D27__AUD6_RXC IOMUX_PAD(0x41c, 0x88, 5, 0x08f4, 0, 0) |
133 | #define MX51_PAD_EIM_CS4__GPIO_2_29 IOMUX_PAD(0x484, 0x0f0, 1, 0x0, 0, NO_PAD_CTRL) | 112 | #define _MX51_PAD_EIM_D27__EIM_D27 IOMUX_PAD(0x41c, 0x88, 0, 0x0000, 0, 0) |
134 | #define MX51_PAD_EIM_CS4__FEC_RX_ER IOMUX_PAD(0x484, 0x0f0, 3, 0x0, 0, MX51_PAD_CTRL_2) | 113 | #define _MX51_PAD_EIM_D27__GPIO2_9 IOMUX_PAD(0x41c, 0x88, 1, 0x0000, 0, 0) |
135 | #define MX51_PAD_EIM_CS5__GPIO_2_30 IOMUX_PAD(0x488, 0x0f4, 1, 0x0, 0, NO_PAD_CTRL) | 114 | #define _MX51_PAD_EIM_D27__I2C2_SCL IOMUX_PAD(0x41c, 0x88, 0x14, 0x09b8, 0, 0) |
136 | #define MX51_PAD_EIM_CS5__FEC_CRS IOMUX_PAD(0x488, 0x0f4, 3, 0x0, 0, MX51_PAD_CTRL_2) | 115 | #define _MX51_PAD_EIM_D27__UART3_RTS IOMUX_PAD(0x41c, 0x88, 3, 0x09f0, 3, 0) |
137 | #define MX51_PAD_EIM_DTACK__GPIO_2_31 IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, NO_PAD_CTRL) | 116 | #define _MX51_PAD_EIM_D27__USBOTG_DATA3 IOMUX_PAD(0x41c, 0x88, 2, 0x0000, 0, 0) |
138 | #define MX51_PAD_EIM_LBA__GPIO_3_1 IOMUX_PAD(0x494, 0x0FC, 1, 0x0, 0, NO_PAD_CTRL) | 117 | #define _MX51_PAD_EIM_D28__AUD6_TXD IOMUX_PAD(0x420, 0x8c, 5, 0x08f0, 0, 0) |
139 | #define MX51_PAD_EIM_CRE__GPIO_3_2 IOMUX_PAD(0x4A0, 0x100, 1, 0x0, 0, NO_PAD_CTRL) | 118 | #define _MX51_PAD_EIM_D28__EIM_D28 IOMUX_PAD(0x420, 0x8c, 0, 0x0000, 0, 0) |
140 | #define MX51_PAD_DRAM_CS1__DRAM_CS1 IOMUX_PAD(0x4D0, 0x104, 0, 0x0, 0, NO_PAD_CTRL) | 119 | #define _MX51_PAD_EIM_D28__KEY_ROW4 IOMUX_PAD(0x420, 0x8c, 1, 0x09d0, 0, 0) |
141 | #define MX51_PAD_NANDF_WE_B__GPIO_3_3 IOMUX_PAD(0x4E4, 0x108, 3, 0x0, 0, NO_PAD_CTRL) | 120 | #define _MX51_PAD_EIM_D28__USBOTG_DATA4 IOMUX_PAD(0x420, 0x8c, 2, 0x0000, 0, 0) |
142 | #define MX51_PAD_NANDF_RE_B__GPIO_3_4 IOMUX_PAD(0x4E8, 0x10C, 3, 0x0, 0, NO_PAD_CTRL) | 121 | #define _MX51_PAD_EIM_D29__AUD6_RXD IOMUX_PAD(0x424, 0x90, 5, 0x08ec, 0, 0) |
143 | #define MX51_PAD_NANDF_ALE__GPIO_3_5 IOMUX_PAD(0x4EC, 0x110, 3, 0x0, 0, NO_PAD_CTRL) | 122 | #define _MX51_PAD_EIM_D29__EIM_D29 IOMUX_PAD(0x424, 0x90, 0, 0x0000, 0, 0) |
144 | #define MX51_PAD_NANDF_CLE__GPIO_3_6 IOMUX_PAD(0x4F0, 0x114, 3, 0x0, 0, NO_PAD_CTRL) | 123 | #define _MX51_PAD_EIM_D29__KEY_ROW5 IOMUX_PAD(0x424, 0x90, 1, 0x09d4, 0, 0) |
145 | #define MX51_PAD_NANDF_WP_B__GPIO_3_7 IOMUX_PAD(0x4F4, 0x118, 3, 0x0, 0, NO_PAD_CTRL) | 124 | #define _MX51_PAD_EIM_D29__USBOTG_DATA5 IOMUX_PAD(0x424, 0x90, 2, 0x0000, 0, 0) |
146 | #define MX51_PAD_NANDF_RB0__GPIO_3_8 IOMUX_PAD(0x4F8, 0x11C, 3, 0x0, 0, NO_PAD_CTRL) | 125 | #define _MX51_PAD_EIM_D30__AUD6_TXC IOMUX_PAD(0x428, 0x94, 5, 0x08fc, 0, 0) |
147 | #define MX51_PAD_NANDF_RB1__GPIO_3_9 IOMUX_PAD(0x4FC, 0x120, 3, 0x0, 0, NO_PAD_CTRL) | 126 | #define _MX51_PAD_EIM_D30__EIM_D30 IOMUX_PAD(0x428, 0x94, 0, 0x0000, 0, 0) |
148 | #define MX51_PAD_NANDF_RB2__GPIO_3_10 IOMUX_PAD(0x500, 0x124, 3, 0x0, 0, NO_PAD_CTRL) | 127 | #define _MX51_PAD_EIM_D30__KEY_ROW6 IOMUX_PAD(0x428, 0x94, 1, 0x09d8, 0, 0) |
149 | #define MX51_PAD_NANDF_RB2__ECSPI2_SCLK IOMUX_PAD(0x500, 0x124, 2, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 128 | #define _MX51_PAD_EIM_D30__USBOTG_DATA6 IOMUX_PAD(0x428, 0x94, 2, 0x0000, 0, 0) |
150 | #define MX51_PAD_NANDF_RB2__FEC_COL IOMUX_PAD(0x500, 0x124, 1, 0x0, 0, MX51_PAD_CTRL_2) | 129 | #define _MX51_PAD_EIM_D31__AUD6_TXFS IOMUX_PAD(0x42c, 0x98, 5, 0x0900, 0, 0) |
151 | #define MX51_PAD_NANDF_RB3__GPIO_3_11 IOMUX_PAD(0x504, 0x128, 3, 0x0, 0, NO_PAD_CTRL) | 130 | #define _MX51_PAD_EIM_D31__EIM_D31 IOMUX_PAD(0x42c, 0x98, 0, 0x0000, 0, 0) |
152 | #define MX51_PAD_NANDF_RB3__ECSPI2_MISO IOMUX_PAD(0x504, 0x128, 2, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 131 | #define _MX51_PAD_EIM_D31__KEY_ROW7 IOMUX_PAD(0x42c, 0x98, 1, 0x09dc, 0, 0) |
153 | #define MX51_PAD_NANDF_RB3__FEC_RXCLK IOMUX_PAD(0x504, 0x128, 1, 0x0, 0, MX51_PAD_CTRL_2) | 132 | #define _MX51_PAD_EIM_D31__USBOTG_DATA7 IOMUX_PAD(0x42c, 0x98, 2, 0x0000, 0, 0) |
154 | #define MX51_PAD_NANDF_RB6__FEC_RDAT0 IOMUX_PAD(0x5DC, 0x134, 1, 0x0, 0, MX51_PAD_CTRL_4) | 133 | #define _MX51_PAD_EIM_A16__EIM_A16 IOMUX_PAD(0x430, 0x9c, 0, 0x0000, 0, 0) |
155 | #define MX51_PAD_NANDF_RB7__FEC_TDAT0 IOMUX_PAD(0x5E0, 0x138, 1, 0x0, 0, MX51_PAD_CTRL_5) | 134 | #define _MX51_PAD_EIM_A16__GPIO2_10 IOMUX_PAD(0x430, 0x9c, 1, 0x0000, 0, 0) |
156 | #define MX51_PAD_GPIO_NAND__GPIO_3_12 IOMUX_PAD(0x514, 0x12C, 3, 0x0, 0, NO_PAD_CTRL) | 135 | #define _MX51_PAD_EIM_A16__OSC_FREQ_SEL0 IOMUX_PAD(0x430, 0x9c, 7, 0x0000, 0, 0) |
157 | #define MX51_PAD_NANDF_CS0__GPIO_3_16 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, NO_PAD_CTRL) | 136 | #define _MX51_PAD_EIM_A17__EIM_A17 IOMUX_PAD(0x434, 0xa0, 0, 0x0000, 0, 0) |
158 | #define MX51_PAD_NANDF_CS1__GPIO_3_17 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, NO_PAD_CTRL) | 137 | #define _MX51_PAD_EIM_A17__GPIO2_11 IOMUX_PAD(0x434, 0xa0, 1, 0x0000, 0, 0) |
159 | #define MX51_PAD_NANDF_CS2__GPIO_3_18 IOMUX_PAD(0x520, 0x138, 3, 0x0, 0, NO_PAD_CTRL) | 138 | #define _MX51_PAD_EIM_A17__OSC_FREQ_SEL1 IOMUX_PAD(0x434, 0xa0, 7, 0x0000, 0, 0) |
160 | #define MX51_PAD_NANDF_CS2__FEC_TX_ER IOMUX_PAD(0x520, 0x138, 2, 0x0, 0, MX51_PAD_CTRL_5) | 139 | #define _MX51_PAD_EIM_A18__BOOT_LPB0 IOMUX_PAD(0x438, 0xa4, 7, 0x0000, 0, 0) |
161 | #define MX51_PAD_NANDF_CS3__GPIO_3_19 IOMUX_PAD(0x524, 0x13C, 3, 0x0, 0, NO_PAD_CTRL) | 140 | #define _MX51_PAD_EIM_A18__EIM_A18 IOMUX_PAD(0x438, 0xa4, 0, 0x0000, 0, 0) |
162 | #define MX51_PAD_NANDF_CS3__FEC_MDC IOMUX_PAD(0x524, 0x13C, 2, 0x0, 0, MX51_PAD_CTRL_5) | 141 | #define _MX51_PAD_EIM_A18__GPIO2_12 IOMUX_PAD(0x438, 0xa4, 1, 0x0000, 0, 0) |
163 | #define MX51_PAD_NANDF_CS4__GPIO_3_20 IOMUX_PAD(0x528, 0x140, 3, 0x0, 0, NO_PAD_CTRL) | 142 | #define _MX51_PAD_EIM_A19__BOOT_LPB1 IOMUX_PAD(0x43c, 0xa8, 7, 0x0000, 0, 0) |
164 | #define MX51_PAD_NANDF_CS4__FEC_TDAT1 IOMUX_PAD(0x528, 0x140, 2, 0x0, 0, MX51_PAD_CTRL_5) | 143 | #define _MX51_PAD_EIM_A19__EIM_A19 IOMUX_PAD(0x43c, 0xa8, 0, 0x0000, 0, 0) |
165 | #define MX51_PAD_NANDF_CS5__GPIO_3_21 IOMUX_PAD(0x52C, 0x144, 3, 0x0, 0, NO_PAD_CTRL) | 144 | #define _MX51_PAD_EIM_A19__GPIO2_13 IOMUX_PAD(0x43c, 0xa8, 1, 0x0000, 0, 0) |
166 | #define MX51_PAD_NANDF_CS5__FEC_TDAT2 IOMUX_PAD(0x52C, 0x144, 2, 0x0, 0, MX51_PAD_CTRL_5) | 145 | #define _MX51_PAD_EIM_A20__BOOT_UART_SRC0 IOMUX_PAD(0x440, 0xac, 7, 0x0000, 0, 0) |
167 | #define MX51_PAD_NANDF_CS6__GPIO_3_22 IOMUX_PAD(0x530, 0x148, 3, 0x0, 0, NO_PAD_CTRL) | 146 | #define _MX51_PAD_EIM_A20__EIM_A20 IOMUX_PAD(0x440, 0xac, 0, 0x0000, 0, 0) |
168 | #define MX51_PAD_NANDF_CS6__FEC_TDAT3 IOMUX_PAD(0x530, 0x148, 2, 0x0, 0, MX51_PAD_CTRL_5) | 147 | #define _MX51_PAD_EIM_A20__GPIO2_14 IOMUX_PAD(0x440, 0xac, 1, 0x0000, 0, 0) |
169 | #define MX51_PAD_NANDF_CS7__GPIO_3_23 IOMUX_PAD(0x534, 0x14C, 3, 0x0, 0, NO_PAD_CTRL) | 148 | #define _MX51_PAD_EIM_A21__BOOT_UART_SRC1 IOMUX_PAD(0x444, 0xb0, 7, 0x0000, 0, 0) |
170 | #define MX51_PAD_NANDF_CS7__FEC_TX_EN IOMUX_PAD(0x534, 0x14C, 1, 0x0, 0, MX51_PAD_CTRL_5) | 149 | #define _MX51_PAD_EIM_A21__EIM_A21 IOMUX_PAD(0x444, 0xb0, 0, 0x0000, 0, 0) |
171 | #define MX51_PAD_NANDF_RDY_INT__GPIO_3_24 IOMUX_PAD(0x538, 0x150, 3, 0x0, 0, NO_PAD_CTRL) | 150 | #define _MX51_PAD_EIM_A21__GPIO2_15 IOMUX_PAD(0x444, 0xb0, 1, 0x0000, 0, 0) |
172 | #define MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK IOMUX_PAD(0x538, 0x150, 1, 0x0, 0, MX51_PAD_CTRL_4) | 151 | #define _MX51_PAD_EIM_A22__EIM_A22 IOMUX_PAD(0x448, 0xb4, 0, 0x0000, 0, 0) |
173 | #define MX51_PAD_NANDF_D15__GPIO_3_25 IOMUX_PAD(0x53C, 0x154, 3, 0x0, 0, NO_PAD_CTRL) | 152 | #define _MX51_PAD_EIM_A22__GPIO2_16 IOMUX_PAD(0x448, 0xb4, 1, 0x0000, 0, 0) |
174 | #define MX51_PAD_NANDF_D15__ECSPI2_MOSI IOMUX_PAD(0x53C, 0x154, 2, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 153 | #define _MX51_PAD_EIM_A23__BOOT_HPN_EN IOMUX_PAD(0x44c, 0xb8, 7, 0x0000, 0, 0) |
175 | #define MX51_PAD_NANDF_D14__GPIO_3_26 IOMUX_PAD(0x540, 0x158, 3, 0x0, 0, NO_PAD_CTRL) | 154 | #define _MX51_PAD_EIM_A23__EIM_A23 IOMUX_PAD(0x44c, 0xb8, 0, 0x0000, 0, 0) |
176 | #define MX51_PAD_NANDF_D13__GPIO_3_27 IOMUX_PAD(0x544, 0x15C, 3, 0x0, 0, NO_PAD_CTRL) | 155 | #define _MX51_PAD_EIM_A23__GPIO2_17 IOMUX_PAD(0x44c, 0xb8, 1, 0x0000, 0, 0) |
177 | #define MX51_PAD_NANDF_D12__GPIO_3_28 IOMUX_PAD(0x548, 0x160, 3, 0x0, 0, NO_PAD_CTRL) | 156 | #define _MX51_PAD_EIM_A24__EIM_A24 IOMUX_PAD(0x450, 0xbc, 0, 0x0000, 0, 0) |
178 | #define MX51_PAD_NANDF_D11__GPIO_3_29 IOMUX_PAD(0x54C, 0x164, 3, 0x0, 0, NO_PAD_CTRL) | 157 | #define _MX51_PAD_EIM_A24__GPIO2_18 IOMUX_PAD(0x450, 0xbc, 1, 0x0000, 0, 0) |
179 | #define MX51_PAD_NANDF_D10__GPIO_3_30 IOMUX_PAD(0x550, 0x168, 3, 0x0, 0, NO_PAD_CTRL) | 158 | #define _MX51_PAD_EIM_A24__USBH2_CLK IOMUX_PAD(0x450, 0xbc, 2, 0x0000, 0, 0) |
180 | #define MX51_PAD_NANDF_D9__GPIO_3_31 IOMUX_PAD(0x554, 0x16C, 3, 0x0, 0, NO_PAD_CTRL) | 159 | #define _MX51_PAD_EIM_A25__DISP1_PIN4 IOMUX_PAD(0x454, 0xc0, 6, 0x0000, 0, 0) |
181 | #define MX51_PAD_NANDF_D8__GPIO_4_0 IOMUX_PAD(0x558, 0x170, 3, 0x0, 0, NO_PAD_CTRL) | 160 | #define _MX51_PAD_EIM_A25__EIM_A25 IOMUX_PAD(0x454, 0xc0, 0, 0x0000, 0, 0) |
182 | #define MX51_PAD_NANDF_D7__GPIO_4_1 IOMUX_PAD(0x55C, 0x174, 3, 0x0, 0, NO_PAD_CTRL) | 161 | #define _MX51_PAD_EIM_A25__GPIO2_19 IOMUX_PAD(0x454, 0xc0, 1, 0x0000, 0, 0) |
183 | #define MX51_PAD_NANDF_D6__GPIO_4_2 IOMUX_PAD(0x560, 0x178, 3, 0x0, 0, NO_PAD_CTRL) | 162 | #define _MX51_PAD_EIM_A25__USBH2_DIR IOMUX_PAD(0x454, 0xc0, 2, 0x0000, 0, 0) |
184 | #define MX51_PAD_NANDF_D5__GPIO_4_3 IOMUX_PAD(0x564, 0x17C, 3, 0x0, 0, NO_PAD_CTRL) | 163 | #define _MX51_PAD_EIM_A26__CSI1_DATA_EN IOMUX_PAD(0x458, 0xc4, 5, 0x09a0, 0, 0) |
185 | #define MX51_PAD_NANDF_D4__GPIO_4_4 IOMUX_PAD(0x568, 0x180, 3, 0x0, 0, NO_PAD_CTRL) | 164 | #define _MX51_PAD_EIM_A26__DISP2_EXT_CLK IOMUX_PAD(0x458, 0xc4, 6, 0x0908, 0, 0) |
186 | #define MX51_PAD_NANDF_D3__GPIO_4_5 IOMUX_PAD(0x56C, 0x184, 3, 0x0, 0, NO_PAD_CTRL) | 165 | #define _MX51_PAD_EIM_A26__EIM_A26 IOMUX_PAD(0x458, 0xc4, 0, 0x0000, 0, 0) |
187 | #define MX51_PAD_NANDF_D2__GPIO_4_6 IOMUX_PAD(0x570, 0x188, 3, 0x0, 0, NO_PAD_CTRL) | 166 | #define _MX51_PAD_EIM_A26__GPIO2_20 IOMUX_PAD(0x458, 0xc4, 1, 0x0000, 0, 0) |
188 | #define MX51_PAD_NANDF_D1__GPIO_4_7 IOMUX_PAD(0x574, 0x18C, 3, 0x0, 0, NO_PAD_CTRL) | 167 | #define _MX51_PAD_EIM_A26__USBH2_STP IOMUX_PAD(0x458, 0xc4, 2, 0x0000, 0, 0) |
189 | #define MX51_PAD_NANDF_D0__GPIO_4_8 IOMUX_PAD(0x578, 0x190, 3, 0x0, 0, NO_PAD_CTRL) | 168 | #define _MX51_PAD_EIM_A27__CSI2_DATA_EN IOMUX_PAD(0x45c, 0xc8, 5, 0x099c, 0, 0) |
190 | #define MX51_PAD_CSI1_D8__GPIO_3_12 IOMUX_PAD(0x57C, 0x194, 3, 0x0, 0, NO_PAD_CTRL) | 169 | #define _MX51_PAD_EIM_A27__DISP1_PIN1 IOMUX_PAD(0x45c, 0xc8, 6, 0x09a4, 0, 0) |
191 | #define MX51_PAD_CSI1_D9__GPIO_3_13 IOMUX_PAD(0x580, 0x198, 3, 0x0, 0, NO_PAD_CTRL) | 170 | #define _MX51_PAD_EIM_A27__EIM_A27 IOMUX_PAD(0x45c, 0xc8, 0, 0x0000, 0, 0) |
192 | #define MX51_PAD_CSI1_D10__CSI1_D10 IOMUX_PAD(0x584, 0x19C, 0, 0x0, 0, NO_PAD_CTRL) | 171 | #define _MX51_PAD_EIM_A27__GPIO2_21 IOMUX_PAD(0x45c, 0xc8, 1, 0x0000, 0, 0) |
193 | #define MX51_PAD_CSI1_D11__CSI1_D11 IOMUX_PAD(0x588, 0x1A0, 0, 0x0, 0, NO_PAD_CTRL) | 172 | #define _MX51_PAD_EIM_A27__USBH2_NXT IOMUX_PAD(0x45c, 0xc8, 2, 0x0000, 0, 0) |
194 | #define MX51_PAD_CSI1_D12__CSI1_D12 IOMUX_PAD(0x58C, 0x1A4, 0, 0x0, 0, NO_PAD_CTRL) | 173 | #define _MX51_PAD_EIM_EB0__EIM_EB0 IOMUX_PAD(0x460, 0xcc, 0, 0x0000, 0, 0) |
195 | #define MX51_PAD_CSI1_D13__CSI1_D13 IOMUX_PAD(0x590, 0x1A8, 0, 0x0, 0, NO_PAD_CTRL) | 174 | #define _MX51_PAD_EIM_EB1__EIM_EB1 IOMUX_PAD(0x464, 0xd0, 0, 0x0000, 0, 0) |
196 | #define MX51_PAD_CSI1_D14__CSI1_D14 IOMUX_PAD(0x594, 0x1AC, 0, 0x0, 0, NO_PAD_CTRL) | 175 | #define _MX51_PAD_EIM_EB2__AUD5_RXFS IOMUX_PAD(0x468, 0xd4, 6, 0x08e0, 0, 0) |
197 | #define MX51_PAD_CSI1_D15__CSI1_D15 IOMUX_PAD(0x598, 0x1B0, 0, 0x0, 0, NO_PAD_CTRL) | 176 | #define _MX51_PAD_EIM_EB2__CSI1_D2 IOMUX_PAD(0x468, 0xd4, 5, 0x0000, 0, 0) |
198 | #define MX51_PAD_CSI1_D16__CSI1_D16 IOMUX_PAD(0x59C, 0x1B4, 0, 0x0, 0, NO_PAD_CTRL) | 177 | #define _MX51_PAD_EIM_EB2__EIM_EB2 IOMUX_PAD(0x468, 0xd4, 0, 0x0000, 0, 0) |
199 | #define MX51_PAD_CSI1_D17__CSI1_D17 IOMUX_PAD(0x5A0, 0x1B8, 0, 0x0, 0, NO_PAD_CTRL) | 178 | #define _MX51_PAD_EIM_EB2__FEC_MDIO IOMUX_PAD(0x468, 0xd4, 3, 0x0954, 0, 0) |
200 | #define MX51_PAD_CSI1_D18__CSI1_D18 IOMUX_PAD(0x5A4, 0x1BC, 0, 0x0, 0, NO_PAD_CTRL) | 179 | #define _MX51_PAD_EIM_EB2__GPIO2_22 IOMUX_PAD(0x468, 0xd4, 1, 0x0000, 0, 0) |
201 | #define MX51_PAD_CSI1_D19__CSI1_D19 IOMUX_PAD(0x5A8, 0x1C0, 0, 0x0, 0, NO_PAD_CTRL) | 180 | #define _MX51_PAD_EIM_EB2__GPT_CMPOUT1 IOMUX_PAD(0x468, 0xd4, 7, 0x0000, 0, 0) |
202 | #define MX51_PAD_CSI1_VSYNC__CSI1_VSYNC IOMUX_PAD(0x5AC, 0x1C4, 0, 0x0, 0, NO_PAD_CTRL) | 181 | #define _MX51_PAD_EIM_EB3__AUD5_RXC IOMUX_PAD(0x46c, 0xd8, 6, 0x08dc, 0, 0) |
203 | #define MX51_PAD_CSI1_HSYNC__CSI1_HSYNC IOMUX_PAD(0x5B0, 0x1C8, 0, 0x0, 0, NO_PAD_CTRL) | 182 | #define _MX51_PAD_EIM_EB3__CSI1_D3 IOMUX_PAD(0x46c, 0xd8, 5, 0x0000, 0, 0) |
204 | #define MX51_PAD_CSI1_PIXCLK__CSI1_PIXCLK IOMUX_PAD(0x5B4, 0x000, 0, 0x0, 0, NO_PAD_CTRL) | 183 | #define _MX51_PAD_EIM_EB3__EIM_EB3 IOMUX_PAD(0x46c, 0xd8, 0, 0x0000, 0, 0) |
205 | #define MX51_PAD_CSI1_MCLK__CSI1_MCLK IOMUX_PAD(0x5B8, 0x000, 0, 0x0, 0, NO_PAD_CTRL) | 184 | #define _MX51_PAD_EIM_EB3__FEC_RDATA1 IOMUX_PAD(0x46c, 0xd8, 3, 0x095c, 0, 0) |
206 | #define MX51_PAD_CSI1_PKE0__CSI1_PKE0 IOMUX_PAD(0x860, 0x000, 0, 0x0, 0, NO_PAD_CTRL) | 185 | #define _MX51_PAD_EIM_EB3__GPIO2_23 IOMUX_PAD(0x46c, 0xd8, 1, 0x0000, 0, 0) |
207 | #define MX51_PAD_CSI2_D12__GPIO_4_9 IOMUX_PAD(0x5BC, 0x1CC, 3, 0x0, 0, NO_PAD_CTRL) | 186 | #define _MX51_PAD_EIM_EB3__GPT_CMPOUT2 IOMUX_PAD(0x46c, 0xd8, 7, 0x0000, 0, 0) |
208 | #define MX51_PAD_CSI2_D13__GPIO_4_10 IOMUX_PAD(0x5C0, 0x1D0, 3, 0x0, 0, NO_PAD_CTRL) | 187 | #define _MX51_PAD_EIM_OE__EIM_OE IOMUX_PAD(0x470, 0xdc, 0, 0x0000, 0, 0) |
209 | #define MX51_PAD_CSI2_D14__GPIO_4_11 IOMUX_PAD(0x5C4, 0x1D4, 3, 0x0, 0, NO_PAD_CTRL) | 188 | #define _MX51_PAD_EIM_OE__GPIO2_24 IOMUX_PAD(0x470, 0xdc, 1, 0x0000, 0, 0) |
210 | #define MX51_PAD_CSI2_D15__GPIO_4_12 IOMUX_PAD(0x5C8, 0x1D8, 3, 0x0, 0, NO_PAD_CTRL) | 189 | #define _MX51_PAD_EIM_CS0__EIM_CS0 IOMUX_PAD(0x474, 0xe0, 0, 0x0000, 0, 0) |
211 | #define MX51_PAD_CSI2_D16__GPIO_4_11 IOMUX_PAD(0x5CC, 0x1DC, 3, 0x0, 0, NO_PAD_CTRL) | 190 | #define _MX51_PAD_EIM_CS0__GPIO2_25 IOMUX_PAD(0x474, 0xe0, 1, 0x0000, 0, 0) |
212 | #define MX51_PAD_CSI2_D17__GPIO_4_12 IOMUX_PAD(0x5D0, 0x1E0, 3, 0x0, 0, NO_PAD_CTRL) | 191 | #define _MX51_PAD_EIM_CS1__EIM_CS1 IOMUX_PAD(0x478, 0xe4, 0, 0x0000, 0, 0) |
213 | #define MX51_PAD_CSI2_D18__GPIO_4_11 IOMUX_PAD(0x5D4, 0x1E4, 3, 0x0, 0, NO_PAD_CTRL) | 192 | #define _MX51_PAD_EIM_CS1__GPIO2_26 IOMUX_PAD(0x478, 0xe4, 1, 0x0000, 0, 0) |
214 | #define MX51_PAD_CSI2_D19__GPIO_4_12 IOMUX_PAD(0x5D8, 0x1E8, 3, 0x0, 0, NO_PAD_CTRL) | 193 | #define _MX51_PAD_EIM_CS2__AUD5_TXD IOMUX_PAD(0x47c, 0xe8, 6, 0x08d8, 1, 0) |
215 | #define MX51_PAD_CSI2_VSYNC__GPIO_4_13 IOMUX_PAD(0x5DC, 0x1EC, 3, 0x0, 0, NO_PAD_CTRL) | 194 | #define _MX51_PAD_EIM_CS2__CSI1_D4 IOMUX_PAD(0x47c, 0xe8, 5, 0x0000, 0, 0) |
216 | #define MX51_PAD_CSI2_HSYNC__GPIO_4_14 IOMUX_PAD(0x5E0, 0x1F0, 3, 0x0, 0, NO_PAD_CTRL) | 195 | #define _MX51_PAD_EIM_CS2__EIM_CS2 IOMUX_PAD(0x47c, 0xe8, 0, 0x0000, 0, 0) |
217 | #define MX51_PAD_CSI2_PIXCLK__GPIO_4_15 IOMUX_PAD(0x5E4, 0x1F4, 3, 0x0, 0, NO_PAD_CTRL) | 196 | #define _MX51_PAD_EIM_CS2__FEC_RDATA2 IOMUX_PAD(0x47c, 0xe8, 3, 0x0960, 0, 0) |
218 | #define MX51_PAD_I2C1_CLK__GPIO_4_16 IOMUX_PAD(0x5E8, 0x1F8, 3, 0x0, 0, NO_PAD_CTRL) | 197 | #define _MX51_PAD_EIM_CS2__GPIO2_27 IOMUX_PAD(0x47c, 0xe8, 1, 0x0000, 0, 0) |
219 | #define MX51_PAD_I2C1_CLK__HSI2C_CLK IOMUX_PAD(0x5E8, 0x1F8, 0, 0x0, 0, NO_PAD_CTRL) | 198 | #define _MX51_PAD_EIM_CS2__USBOTG_STP IOMUX_PAD(0x47c, 0xe8, 2, 0x0000, 0, 0) |
220 | #define MX51_PAD_I2C1_DAT__GPIO_4_17 IOMUX_PAD(0x5EC, 0x1FC, 3, 0x0, 0, NO_PAD_CTRL) | 199 | #define _MX51_PAD_EIM_CS3__AUD5_RXD IOMUX_PAD(0x480, 0xec, 6, 0x08d4, 1, 0) |
221 | #define MX51_PAD_I2C1_DAT__HSI2C_DAT IOMUX_PAD(0x5EC, 0x1FC, 0, 0x0, 0, NO_PAD_CTRL) | 200 | #define _MX51_PAD_EIM_CS3__CSI1_D5 IOMUX_PAD(0x480, 0xec, 5, 0x0000, 0, 0) |
222 | #define MX51_PAD_AUD3_BB_TXD__AUD3_BB_TXD IOMUX_PAD(0x5F0, 0x200, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | 201 | #define _MX51_PAD_EIM_CS3__EIM_CS3 IOMUX_PAD(0x480, 0xec, 0, 0x0000, 0, 0) |
223 | #define MX51_PAD_AUD3_BB_TXD__GPIO_4_18 IOMUX_PAD(0x5F0, 0x200, 3, 0x0, 0, NO_PAD_CTRL) | 202 | #define _MX51_PAD_EIM_CS3__FEC_RDATA3 IOMUX_PAD(0x480, 0xec, 3, 0x0964, 0, 0) |
224 | #define MX51_PAD_AUD3_BB_RXD__AUD3_BB_RXD IOMUX_PAD(0x5F4, 0x204, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | 203 | #define _MX51_PAD_EIM_CS3__GPIO2_28 IOMUX_PAD(0x480, 0xec, 1, 0x0000, 0, 0) |
225 | #define MX51_PAD_AUD3_BB_RXD__GPIO_4_19 IOMUX_PAD(0x5F4, 0x204, 3, 0x0, 0, NO_PAD_CTRL) | 204 | #define _MX51_PAD_EIM_CS3__USBOTG_NXT IOMUX_PAD(0x480, 0xec, 2, 0x0000, 0, 0) |
226 | #define MX51_PAD_AUD3_BB_CK__AUD3_BB_CK IOMUX_PAD(0x5F8, 0x208, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | 205 | #define _MX51_PAD_EIM_CS4__AUD5_TXC IOMUX_PAD(0x484, 0xf0, 6, 0x08e4, 1, 0) |
227 | #define MX51_PAD_AUD3_BB_CK__GPIO_4_20 IOMUX_PAD(0x5F8, 0x208, 3, 0x0, 0, NO_PAD_CTRL) | 206 | #define _MX51_PAD_EIM_CS4__CSI1_D6 IOMUX_PAD(0x484, 0xf0, 5, 0x0000, 0, 0) |
228 | #define MX51_PAD_AUD3_BB_FS__AUD3_BB_FS IOMUX_PAD(0x5FC, 0x20C, IOMUX_CONFIG_SION, 0x0, 0, NO_PAD_CTRL) | 207 | #define _MX51_PAD_EIM_CS4__EIM_CS4 IOMUX_PAD(0x484, 0xf0, 0, 0x0000, 0, 0) |
229 | #define MX51_PAD_AUD3_BB_FS__GPIO_4_21 IOMUX_PAD(0x5FC, 0x20C, 3, 0x0, 0, NO_PAD_CTRL) | 208 | #define _MX51_PAD_EIM_CS4__FEC_RX_ER IOMUX_PAD(0x484, 0xf0, 3, 0x0970, 0, 0) |
230 | #define MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI IOMUX_PAD(0x600, 0x210, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 209 | #define _MX51_PAD_EIM_CS4__GPIO2_29 IOMUX_PAD(0x484, 0xf0, 1, 0x0000, 0, 0) |
231 | #define MX51_PAD_CSPI1_MOSI__GPIO_4_22 IOMUX_PAD(0x600, 0x210, 3, 0x0, 0, NO_PAD_CTRL) | 210 | #define _MX51_PAD_EIM_CS4__USBOTG_CLK IOMUX_PAD(0x484, 0xf0, 2, 0x0000, 0, 0) |
232 | #define MX51_PAD_CSPI1_MISO__ECSPI1_MISO IOMUX_PAD(0x604, 0x214, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 211 | #define _MX51_PAD_EIM_CS5__AUD5_TXFS IOMUX_PAD(0x488, 0xf4, 6, 0x08e8, 1, 0) |
233 | #define MX51_PAD_CSPI1_MISO__GPIO_4_23 IOMUX_PAD(0x604, 0x214, 3, 0x0, 0, NO_PAD_CTRL) | 212 | #define _MX51_PAD_EIM_CS5__CSI1_D7 IOMUX_PAD(0x488, 0xf4, 5, 0x0000, 0, 0) |
234 | #define MX51_PAD_CSPI1_SS0__ECSPI1_SS0 IOMUX_PAD(0x608, 0x218, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 213 | #define _MX51_PAD_EIM_CS5__DISP1_EXT_CLK IOMUX_PAD(0x488, 0xf4, 4, 0x0904, 0, 0) |
235 | #define MX51_PAD_CSPI1_SS0__GPIO_4_24 IOMUX_PAD(0x608, 0x218, 3, 0x0, 0, NO_PAD_CTRL) | 214 | #define _MX51_PAD_EIM_CS5__EIM_CS5 IOMUX_PAD(0x488, 0xf4, 0, 0x0000, 0, 0) |
236 | #define MX51_PAD_CSPI1_SS1__ECSPI1_SS1 IOMUX_PAD(0x60C, 0x21C, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 215 | #define _MX51_PAD_EIM_CS5__FEC_CRS IOMUX_PAD(0x488, 0xf4, 3, 0x0950, 0, 0) |
237 | #define MX51_PAD_CSPI1_SS1__GPIO_4_25 IOMUX_PAD(0x60C, 0x21C, 3, 0x0, 0, NO_PAD_CTRL) | 216 | #define _MX51_PAD_EIM_CS5__GPIO2_30 IOMUX_PAD(0x488, 0xf4, 1, 0x0000, 0, 0) |
238 | #define MX51_PAD_CSPI1_RDY__ECSPI1_RDY IOMUX_PAD(0x610, 0x220, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 217 | #define _MX51_PAD_EIM_CS5__USBOTG_DIR IOMUX_PAD(0x488, 0xf4, 2, 0x0000, 0, 0) |
239 | #define MX51_PAD_CSPI1_RDY__GPIO_4_26 IOMUX_PAD(0x610, 0x220, 3, 0x0, 0, NO_PAD_CTRL) | 218 | #define _MX51_PAD_EIM_DTACK__EIM_DTACK IOMUX_PAD(0x48c, 0xf8, 0, 0x0000, 0, 0) |
240 | #define MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK IOMUX_PAD(0x614, 0x224, 0, 0x0, 0, MX51_ECSPI_PAD_CTRL) | 219 | #define _MX51_PAD_EIM_DTACK__GPIO2_31 IOMUX_PAD(0x48c, 0xf8, 1, 0x0000, 0, 0) |
241 | #define MX51_PAD_CSPI1_SCLK__GPIO_4_27 IOMUX_PAD(0x614, 0x224, 3, 0x0, 0, NO_PAD_CTRL) | 220 | #define _MX51_PAD_EIM_LBA__EIM_LBA IOMUX_PAD(0x494, 0xfc, 0, 0x0000, 0, 0) |
242 | #define MX51_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x618, 0x228, 0, 0x9e4, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST) | 221 | #define _MX51_PAD_EIM_LBA__GPIO3_1 IOMUX_PAD(0x494, 0xfc, 1, 0x0978, 0, 0) |
243 | #define MX51_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x61C, 0x22C, 0, 0x0, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST) | 222 | #define _MX51_PAD_EIM_CRE__EIM_CRE IOMUX_PAD(0x4a0, 0x100, 0, 0x0000, 0, 0) |
244 | #define MX51_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(0x620, 0x230, 0, 0x9e0, 0, MX51_UART1_PAD_CTRL) | 223 | #define _MX51_PAD_EIM_CRE__GPIO3_2 IOMUX_PAD(0x4a0, 0x100, 1, 0x097c, 0, 0) |
245 | #define MX51_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(0x624, 0x234, 0, 0x0, 0, MX51_UART1_PAD_CTRL) | 224 | #define _MX51_PAD_DRAM_CS1__DRAM_CS1 IOMUX_PAD(0x4d0, 0x104, 0, 0x0000, 0, 0) |
246 | #define MX51_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x628, 0x238, 0, 0x9ec, 2, MX51_UART2_PAD_CTRL) | 225 | #define _MX51_PAD_NANDF_WE_B__GPIO3_3 IOMUX_PAD(0x4e4, 0x108, 3, 0x0980, 0, 0) |
247 | #define MX51_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x62C, 0x23C, 0, 0x0, 0, MX51_UART2_PAD_CTRL) | 226 | #define _MX51_PAD_NANDF_WE_B__NANDF_WE_B IOMUX_PAD(0x4e4, 0x108, 0, 0x0000, 0, 0) |
248 | #define MX51_PAD_UART3_RXD__UART3_RXD IOMUX_PAD(0x630, 0x240, 1, 0x9f4, 4, MX51_UART3_PAD_CTRL) | 227 | #define _MX51_PAD_NANDF_WE_B__PATA_DIOW IOMUX_PAD(0x4e4, 0x108, 1, 0x0000, 0, 0) |
249 | #define MX51_PAD_UART3_RXD__GPIO_1_22 IOMUX_PAD(0x630, 0x240, 3, 0x0, 0, NO_PAD_CTRL) | 228 | #define _MX51_PAD_NANDF_WE_B__SD3_DATA0 IOMUX_PAD(0x4e4, 0x108, 2, 0x093c, 0, 0) |
250 | #define MX51_PAD_UART3_TXD__UART3_TXD IOMUX_PAD(0x634, 0x244, 1, 0x0, 0, MX51_UART3_PAD_CTRL) | 229 | #define _MX51_PAD_NANDF_RE_B__GPIO3_4 IOMUX_PAD(0x4e8, 0x10c, 3, 0x0984, 0, 0) |
251 | #define MX51_PAD_UART3_TXD__GPIO_1_23 IOMUX_PAD(0x634, 0x244, 3, 0x0, 0, NO_PAD_CTRL) | 230 | #define _MX51_PAD_NANDF_RE_B__NANDF_RE_B IOMUX_PAD(0x4e8, 0x10c, 0, 0x0000, 0, 0) |
252 | #define MX51_PAD_OWIRE_LINE__GPIO_1_24 IOMUX_PAD(0x638, 0x248, 3, 0x0, 0, NO_PAD_CTRL) | 231 | #define _MX51_PAD_NANDF_RE_B__PATA_DIOR IOMUX_PAD(0x4e8, 0x10c, 1, 0x0000, 0, 0) |
253 | #define MX51_PAD_KEY_ROW0__KEY_ROW0 IOMUX_PAD(0x63C, 0x24C, 0, 0x0, 0, NO_PAD_CTRL) | 232 | #define _MX51_PAD_NANDF_RE_B__SD3_DATA1 IOMUX_PAD(0x4e8, 0x10c, 2, 0x0940, 0, 0) |
254 | #define MX51_PAD_KEY_ROW1__KEY_ROW1 IOMUX_PAD(0x640, 0x250, 0, 0x0, 0, NO_PAD_CTRL) | 233 | #define _MX51_PAD_NANDF_ALE__GPIO3_5 IOMUX_PAD(0x4ec, 0x110, 3, 0x0988, 0, 0) |
255 | #define MX51_PAD_KEY_ROW2__KEY_ROW2 IOMUX_PAD(0x644, 0x254, 0, 0x0, 0, NO_PAD_CTRL) | 234 | #define _MX51_PAD_NANDF_ALE__NANDF_ALE IOMUX_PAD(0x4ec, 0x110, 0, 0x0000, 0, 0) |
256 | #define MX51_PAD_KEY_ROW3__KEY_ROW3 IOMUX_PAD(0x648, 0x258, 0, 0x0, 0, NO_PAD_CTRL) | 235 | #define _MX51_PAD_NANDF_ALE__PATA_BUFFER_EN IOMUX_PAD(0x4ec, 0x110, 1, 0x0000, 0, 0) |
257 | #define MX51_PAD_KEY_COL0__KEY_COL0 IOMUX_PAD(0x64C, 0x25C, 0, 0x0, 0, NO_PAD_CTRL) | 236 | #define _MX51_PAD_NANDF_CLE__GPIO3_6 IOMUX_PAD(0x4f0, 0x114, 3, 0x098c, 0, 0) |
258 | #define MX51_PAD_KEY_COL1__KEY_COL1 IOMUX_PAD(0x650, 0x260, 0, 0x0, 0, NO_PAD_CTRL) | 237 | #define _MX51_PAD_NANDF_CLE__NANDF_CLE IOMUX_PAD(0x4f0, 0x114, 0, 0x0000, 0, 0) |
259 | #define MX51_PAD_KEY_COL2__KEY_COL2 IOMUX_PAD(0x654, 0x264, 0, 0x0, 0, NO_PAD_CTRL) | 238 | #define _MX51_PAD_NANDF_CLE__PATA_RESET_B IOMUX_PAD(0x4f0, 0x114, 1, 0x0000, 0, 0) |
260 | #define MX51_PAD_KEY_COL3__KEY_COL3 IOMUX_PAD(0x658, 0x268, 0, 0x0, 0, NO_PAD_CTRL) | 239 | #define _MX51_PAD_NANDF_WP_B__GPIO3_7 IOMUX_PAD(0x4f4, 0x118, 3, 0x0990, 0, 0) |
261 | #define MX51_PAD_KEY_COL4__KEY_COL4 IOMUX_PAD(0x65C, 0x26C, 0, 0x0, 0, NO_PAD_CTRL) | 240 | #define _MX51_PAD_NANDF_WP_B__NANDF_WP_B IOMUX_PAD(0x4f4, 0x118, 0, 0x0000, 0, 0) |
262 | #define MX51_PAD_KEY_COL4__UART3_RTS IOMUX_PAD(0x65C, 0x26C, 2, 0x9f0, 4, MX51_UART3_PAD_CTRL) | 241 | #define _MX51_PAD_NANDF_WP_B__PATA_DMACK IOMUX_PAD(0x4f4, 0x118, 1, 0x0000, 0, 0) |
263 | #define MX51_PAD_KEY_COL4__I2C2_SCL IOMUX_PAD(0x65C, 0x26C, (3 | IOMUX_CONFIG_SION), \ | 242 | #define _MX51_PAD_NANDF_WP_B__SD3_DATA2 IOMUX_PAD(0x4f4, 0x118, 2, 0x0944, 0, 0) |
264 | 0x09b8, 1, MX51_I2C_PAD_CTRL) | 243 | #define _MX51_PAD_NANDF_RB0__ECSPI2_SS1 IOMUX_PAD(0x4f8, 0x11c, 5, 0x0930, 0, 0) |
265 | #define MX51_PAD_KEY_COL5__KEY_COL5 IOMUX_PAD(0x660, 0x270, 0, 0x0, 0, NO_PAD_CTRL) | 244 | #define _MX51_PAD_NANDF_RB0__GPIO3_8 IOMUX_PAD(0x4f8, 0x11c, 3, 0x0994, 0, 0) |
266 | #define MX51_PAD_KEY_COL5__UART3_CTS IOMUX_PAD(0x660, 0x270, 2, 0, 0, MX51_UART3_PAD_CTRL) | 245 | #define _MX51_PAD_NANDF_RB0__NANDF_RB0 IOMUX_PAD(0x4f8, 0x11c, 0, 0x0000, 0, 0) |
267 | #define MX51_PAD_KEY_COL5__I2C2_SDA IOMUX_PAD(0x660, 0x270, (3 | IOMUX_CONFIG_SION), \ | 246 | #define _MX51_PAD_NANDF_RB0__PATA_DMARQ IOMUX_PAD(0x4f8, 0x11c, 1, 0x0000, 0, 0) |
268 | 0x09bc, 1, MX51_I2C_PAD_CTRL) | 247 | #define _MX51_PAD_NANDF_RB0__SD3_DATA3 IOMUX_PAD(0x4f8, 0x11c, 2, 0x0948, 0, 0) |
269 | #define MX51_PAD_USBH1_CLK__USBH1_CLK IOMUX_PAD(0x678, 0x278, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 248 | #define _MX51_PAD_NANDF_RB1__CSPI_MOSI IOMUX_PAD(0x4fc, 0x120, 6, 0x091c, 0, 0) |
270 | #define MX51_PAD_USBH1_DIR__USBH1_DIR IOMUX_PAD(0x67C, 0x27C, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 249 | #define _MX51_PAD_NANDF_RB1__ECSPI2_RDY IOMUX_PAD(0x4fc, 0x120, 2, 0x0000, 0, 0) |
271 | #define MX51_PAD_USBH1_STP__USBH1_STP IOMUX_PAD(0x680, 0x280, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 250 | #define _MX51_PAD_NANDF_RB1__GPIO3_9 IOMUX_PAD(0x4fc, 0x120, 3, 0x0000, 0, 0) |
272 | #define MX51_PAD_USBH1_STP__GPIO_1_27 IOMUX_PAD(0x680, 0x280, 2, 0x0, 0, MX51_USBH1_PAD_CTRL) | 251 | #define _MX51_PAD_NANDF_RB1__NANDF_RB1 IOMUX_PAD(0x4fc, 0x120, 0, 0x0000, 0, 0) |
273 | #define MX51_PAD_USBH1_NXT__USBH1_NXT IOMUX_PAD(0x684, 0x284, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 252 | #define _MX51_PAD_NANDF_RB1__PATA_IORDY IOMUX_PAD(0x4fc, 0x120, 1, 0x0000, 0, 0) |
274 | #define MX51_PAD_USBH1_DATA0__USBH1_DATA0 IOMUX_PAD(0x688, 0x288, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 253 | #define _MX51_PAD_NANDF_RB1__SD4_CMD IOMUX_PAD(0x4fc, 0x120, 5, 0x0000, 0, 0) |
275 | #define MX51_PAD_USBH1_DATA1__USBH1_DATA1 IOMUX_PAD(0x68C, 0x28C, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 254 | #define _MX51_PAD_NANDF_RB2__DISP2_WAIT IOMUX_PAD(0x500, 0x124, 5, 0x09a8, 0, 0) |
276 | #define MX51_PAD_USBH1_DATA2__USBH1_DATA2 IOMUX_PAD(0x690, 0x290, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 255 | #define _MX51_PAD_NANDF_RB2__ECSPI2_SCLK IOMUX_PAD(0x500, 0x124, 2, 0x0000, 0, 0) |
277 | #define MX51_PAD_USBH1_DATA3__USBH1_DATA3 IOMUX_PAD(0x694, 0x294, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 256 | #define _MX51_PAD_NANDF_RB2__FEC_COL IOMUX_PAD(0x500, 0x124, 1, 0x094c, 0, 0) |
278 | #define MX51_PAD_USBH1_DATA4__USBH1_DATA4 IOMUX_PAD(0x698, 0x298, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 257 | #define _MX51_PAD_NANDF_RB2__GPIO3_10 IOMUX_PAD(0x500, 0x124, 3, 0x0000, 0, 0) |
279 | #define MX51_PAD_USBH1_DATA5__USBH1_DATA5 IOMUX_PAD(0x69C, 0x29C, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 258 | #define _MX51_PAD_NANDF_RB2__NANDF_RB2 IOMUX_PAD(0x500, 0x124, 0, 0x0000, 0, 0) |
280 | #define MX51_PAD_USBH1_DATA6__USBH1_DATA6 IOMUX_PAD(0x6A0, 0x2A0, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 259 | #define _MX51_PAD_NANDF_RB2__USBH3_H3_DP IOMUX_PAD(0x500, 0x124, 7, 0x0000, 0, 0) |
281 | #define MX51_PAD_USBH1_DATA7__USBH1_DATA7 IOMUX_PAD(0x6A4, 0x2A4, 0, 0x0, 0, MX51_USBH1_PAD_CTRL) | 260 | #define _MX51_PAD_NANDF_RB2__USBH3_NXT IOMUX_PAD(0x500, 0x124, 6, 0x0a20, 0, 0) |
282 | #define MX51_PAD_DI1_PIN11__GPIO_3_0 IOMUX_PAD(0x6A8, 0x2A8, 4, 0x0, 0, NO_PAD_CTRL) | 261 | #define _MX51_PAD_NANDF_RB3__DISP1_WAIT IOMUX_PAD(0x504, 0x128, 5, 0x0000, 0, 0) |
283 | #define MX51_PAD_DI1_PIN12__GPIO_3_1 IOMUX_PAD(0x6AC, 0x2AC, 4, 0x978, 1, NO_PAD_CTRL) | 262 | #define _MX51_PAD_NANDF_RB3__ECSPI2_MISO IOMUX_PAD(0x504, 0x128, 2, 0x0000, 0, 0) |
284 | #define MX51_PAD_DI1_PIN13__GPIO_3_2 IOMUX_PAD(0x6B0, 0x2B0, 4, 0x97c, 1, NO_PAD_CTRL) | 263 | #define _MX51_PAD_NANDF_RB3__FEC_RX_CLK IOMUX_PAD(0x504, 0x128, 1, 0x0968, 0, 0) |
285 | #define MX51_PAD_DI1_D0_CS__GPIO_3_3 IOMUX_PAD(0x6B4, 0x2B4, 4, 0x980, 1, NO_PAD_CTRL) | 264 | #define _MX51_PAD_NANDF_RB3__GPIO3_11 IOMUX_PAD(0x504, 0x128, 3, 0x0000, 0, 0) |
286 | #define MX51_PAD_DI1_D1_CS__GPIO_3_4 IOMUX_PAD(0x6B8, 0x2B8, 4, 0x984, 1, NO_PAD_CTRL) | 265 | #define _MX51_PAD_NANDF_RB3__NANDF_RB3 IOMUX_PAD(0x504, 0x128, 0, 0x0000, 0, 0) |
287 | #define MX51_PAD_DISPB2_SER_DIN__GPIO_3_5 IOMUX_PAD(0x6BC, 0x2BC, 4, 0x988, 1, NO_PAD_CTRL) | 266 | #define _MX51_PAD_NANDF_RB3__USBH3_CLK IOMUX_PAD(0x504, 0x128, 6, 0x09f8, 0, 0) |
288 | #define MX51_PAD_DISPB2_SER_DIO__GPIO_3_6 IOMUX_PAD(0x6C0, 0x2C0, 4, 0x98c, 1, NO_PAD_CTRL) | 267 | #define _MX51_PAD_NANDF_RB3__USBH3_H3_DM IOMUX_PAD(0x504, 0x128, 7, 0x0000, 0, 0) |
289 | #define MX51_PAD_DISPB2_SER_CLK__GPIO_3_7 IOMUX_PAD(0x6C4, 0x2C4, 4, 0x990, 1, NO_PAD_CTRL) | 268 | #define _MX51_PAD_GPIO_NAND__GPIO_NAND IOMUX_PAD(0x514, 0x12c, 0, 0x0998, 0, 0) |
290 | #define MX51_PAD_DISPB2_SER_RS__GPIO_3_8 IOMUX_PAD(0x6C8, 0x2C8, 4, 0x994, 1, NO_PAD_CTRL) | 269 | #define _MX51_PAD_GPIO_NAND__PATA_INTRQ IOMUX_PAD(0x514, 0x12c, 1, 0x0000, 0, 0) |
291 | #define MX51_PAD_DISP1_DAT0__DISP1_DAT0 IOMUX_PAD(0x6CC, 0x2CC, 0, 0x0, 0, NO_PAD_CTRL) | 270 | #define _MX51_PAD_NANDF_CS0__GPIO3_16 IOMUX_PAD(0x518, 0x130, 3, 0x0000, 0, 0) |
292 | #define MX51_PAD_DISP1_DAT1__DISP1_DAT1 IOMUX_PAD(0x6D0, 0x2D0, 0, 0x0, 0, NO_PAD_CTRL) | 271 | #define _MX51_PAD_NANDF_CS0__NANDF_CS0 IOMUX_PAD(0x518, 0x130, 0, 0x0000, 0, 0) |
293 | #define MX51_PAD_DISP1_DAT2__DISP1_DAT2 IOMUX_PAD(0x6D4, 0x2D4, 0, 0x0, 0, NO_PAD_CTRL) | 272 | #define _MX51_PAD_NANDF_CS1__GPIO3_17 IOMUX_PAD(0x51c, 0x134, 3, 0x0000, 0, 0) |
294 | #define MX51_PAD_DISP1_DAT3__DISP1_DAT3 IOMUX_PAD(0x6D8, 0x2D8, 0, 0x0, 0, NO_PAD_CTRL) | 273 | #define _MX51_PAD_NANDF_CS1__NANDF_CS1 IOMUX_PAD(0x51c, 0x134, 0, 0x0000, 0, 0) |
295 | #define MX51_PAD_DISP1_DAT4__DISP1_DAT4 IOMUX_PAD(0x6DC, 0x2DC, 0, 0x0, 0, NO_PAD_CTRL) | 274 | #define _MX51_PAD_NANDF_CS2__CSPI_SCLK IOMUX_PAD(0x520, 0x138, 6, 0x0914, 0, 0) |
296 | #define MX51_PAD_DISP1_DAT5__DISP1_DAT5 IOMUX_PAD(0x6E0, 0x2E0, 0, 0x0, 0, NO_PAD_CTRL) | 275 | #define _MX51_PAD_NANDF_CS2__FEC_TX_ER IOMUX_PAD(0x520, 0x138, 2, 0x0000, 0, 0) |
297 | #define MX51_PAD_DISP1_DAT6__DISP1_DAT6 IOMUX_PAD(0x6E4, 0x2E4, 0, 0x0, 0, NO_PAD_CTRL) | 276 | #define _MX51_PAD_NANDF_CS2__GPIO3_18 IOMUX_PAD(0x520, 0x138, 3, 0x0000, 0, 0) |
298 | #define MX51_PAD_DISP1_DAT7__DISP1_DAT7 IOMUX_PAD(0x6E8, 0x2E8, 0, 0x0, 0, NO_PAD_CTRL) | 277 | #define _MX51_PAD_NANDF_CS2__NANDF_CS2 IOMUX_PAD(0x520, 0x138, 0, 0x0000, 0, 0) |
299 | #define MX51_PAD_DISP1_DAT8__DISP1_DAT8 IOMUX_PAD(0x6EC, 0x2EC, 0, 0x0, 0, NO_PAD_CTRL) | 278 | #define _MX51_PAD_NANDF_CS2__PATA_CS_0 IOMUX_PAD(0x520, 0x138, 1, 0x0000, 0, 0) |
300 | #define MX51_PAD_DISP1_DAT9__DISP1_DAT9 IOMUX_PAD(0x6F0, 0x2F0, 0, 0x0, 0, NO_PAD_CTRL) | 279 | #define _MX51_PAD_NANDF_CS2__SD4_CLK IOMUX_PAD(0x520, 0x138, 5, 0x0000, 0, 0) |
301 | #define MX51_PAD_DISP1_DAT10__DISP1_DAT10 IOMUX_PAD(0x6F4, 0x2F4, 0, 0x0, 0, NO_PAD_CTRL) | 280 | #define _MX51_PAD_NANDF_CS2__USBH3_H1_DP IOMUX_PAD(0x520, 0x138, 7, 0x0000, 0, 0) |
302 | #define MX51_PAD_DISP1_DAT11__DISP1_DAT11 IOMUX_PAD(0x6F8, 0x2F8, 0, 0x0, 0, NO_PAD_CTRL) | 281 | #define _MX51_PAD_NANDF_CS3__FEC_MDC IOMUX_PAD(0x524, 0x13c, 2, 0x0000, 0, 0) |
303 | #define MX51_PAD_DISP1_DAT12__DISP1_DAT12 IOMUX_PAD(0x6FC, 0x2FC, 0, 0x0, 0, NO_PAD_CTRL) | 282 | #define _MX51_PAD_NANDF_CS3__GPIO3_19 IOMUX_PAD(0x524, 0x13c, 3, 0x0000, 0, 0) |
304 | #define MX51_PAD_DISP1_DAT13__DISP1_DAT13 IOMUX_PAD(0x700, 0x300, 0, 0x0, 0, NO_PAD_CTRL) | 283 | #define _MX51_PAD_NANDF_CS3__NANDF_CS3 IOMUX_PAD(0x524, 0x13c, 0, 0x0000, 0, 0) |
305 | #define MX51_PAD_DISP1_DAT14__DISP1_DAT14 IOMUX_PAD(0x704, 0x304, 0, 0x0, 0, NO_PAD_CTRL) | 284 | #define _MX51_PAD_NANDF_CS3__PATA_CS_1 IOMUX_PAD(0x524, 0x13c, 1, 0x0000, 0, 0) |
306 | #define MX51_PAD_DISP1_DAT15__DISP1_DAT15 IOMUX_PAD(0x708, 0x308, 0, 0x0, 0, NO_PAD_CTRL) | 285 | #define _MX51_PAD_NANDF_CS3__SD4_DAT0 IOMUX_PAD(0x524, 0x13c, 5, 0x0000, 0, 0) |
307 | #define MX51_PAD_DISP1_DAT16__DISP1_DAT16 IOMUX_PAD(0x70C, 0x30C, 0, 0x0, 0, NO_PAD_CTRL) | 286 | #define _MX51_PAD_NANDF_CS3__USBH3_H1_DM IOMUX_PAD(0x524, 0x13c, 7, 0x0000, 0, 0) |
308 | #define MX51_PAD_DISP1_DAT17__DISP1_DAT17 IOMUX_PAD(0x710, 0x310, 0, 0x0, 0, NO_PAD_CTRL) | 287 | #define _MX51_PAD_NANDF_CS4__FEC_TDATA1 IOMUX_PAD(0x528, 0x140, 2, 0x0000, 0, 0) |
309 | #define MX51_PAD_DISP1_DAT18__DISP1_DAT18 IOMUX_PAD(0x714, 0x314, 0, 0x0, 0, NO_PAD_CTRL) | 288 | #define _MX51_PAD_NANDF_CS4__GPIO3_20 IOMUX_PAD(0x528, 0x140, 3, 0x0000, 0, 0) |
310 | #define MX51_PAD_DISP1_DAT19__DISP1_DAT19 IOMUX_PAD(0x718, 0x318, 0, 0x0, 0, NO_PAD_CTRL) | 289 | #define _MX51_PAD_NANDF_CS4__NANDF_CS4 IOMUX_PAD(0x528, 0x140, 0, 0x0000, 0, 0) |
311 | #define MX51_PAD_DISP1_DAT20__DISP1_DAT20 IOMUX_PAD(0x71C, 0x31C, 0, 0x0, 0, NO_PAD_CTRL) | 290 | #define _MX51_PAD_NANDF_CS4__PATA_DA_0 IOMUX_PAD(0x528, 0x140, 1, 0x0000, 0, 0) |
312 | #define MX51_PAD_DISP1_DAT21__DISP1_DAT21 IOMUX_PAD(0x720, 0x320, 0, 0x0, 0, NO_PAD_CTRL) | 291 | #define _MX51_PAD_NANDF_CS4__SD4_DAT1 IOMUX_PAD(0x528, 0x140, 5, 0x0000, 0, 0) |
313 | #define MX51_PAD_DISP1_DAT22__DISP1_DAT22 IOMUX_PAD(0x724, 0x324, 0, 0x0, 0, NO_PAD_CTRL) | 292 | #define _MX51_PAD_NANDF_CS4__USBH3_STP IOMUX_PAD(0x528, 0x140, 7, 0x0a24, 0, 0) |
314 | #define MX51_PAD_DISP1_DAT23__DISP1_DAT23 IOMUX_PAD(0x728, 0x328, 0, 0x0, 0, NO_PAD_CTRL) | 293 | #define _MX51_PAD_NANDF_CS5__FEC_TDATA2 IOMUX_PAD(0x52c, 0x144, 2, 0x0000, 0, 0) |
315 | #define MX51_PAD_DI1_PIN3__DI1_PIN3 IOMUX_PAD(0x72C, 0x32C, 0, 0x0, 0, NO_PAD_CTRL) | 294 | #define _MX51_PAD_NANDF_CS5__GPIO3_21 IOMUX_PAD(0x52c, 0x144, 3, 0x0000, 0, 0) |
316 | #define MX51_PAD_DI1_PIN2__DI1_PIN2 IOMUX_PAD(0x734, 0x330, 0, 0x0, 0, NO_PAD_CTRL) | 295 | #define _MX51_PAD_NANDF_CS5__NANDF_CS5 IOMUX_PAD(0x52c, 0x144, 0, 0x0000, 0, 0) |
317 | #define MX51_PAD_DI_GP1__DI_GP1 IOMUX_PAD(0x73C, 0x334, 0, 0x0, 0, NO_PAD_CTRL) | 296 | #define _MX51_PAD_NANDF_CS5__PATA_DA_1 IOMUX_PAD(0x52c, 0x144, 1, 0x0000, 0, 0) |
318 | #define MX51_PAD_DI_GP2__DI_GP2 IOMUX_PAD(0x740, 0x338, 0, 0x0, 0, NO_PAD_CTRL) | 297 | #define _MX51_PAD_NANDF_CS5__SD4_DAT2 IOMUX_PAD(0x52c, 0x144, 5, 0x0000, 0, 0) |
319 | #define MX51_PAD_DI_GP3__DI_GP3 IOMUX_PAD(0x744, 0x33C, 0, 0x0, 0, NO_PAD_CTRL) | 298 | #define _MX51_PAD_NANDF_CS5__USBH3_DIR IOMUX_PAD(0x52c, 0x144, 7, 0x0a1c, 0, 0) |
320 | #define MX51_PAD_DI2_PIN4__DI2_PIN4 IOMUX_PAD(0x748, 0x340, 0, 0x0, 0, NO_PAD_CTRL) | 299 | #define _MX51_PAD_NANDF_CS6__CSPI_SS3 IOMUX_PAD(0x530, 0x148, 7, 0x0928, 0, 0) |
321 | #define MX51_PAD_DI2_PIN2__DI2_PIN2 IOMUX_PAD(0x74C, 0x344, 0, 0x0, 0, NO_PAD_CTRL) | 300 | #define _MX51_PAD_NANDF_CS6__FEC_TDATA3 IOMUX_PAD(0x530, 0x148, 2, 0x0000, 0, 0) |
322 | #define MX51_PAD_DI2_PIN3__DI2_PIN3 IOMUX_PAD(0x750, 0x348, 0, 0x0, 0, NO_PAD_CTRL) | 301 | #define _MX51_PAD_NANDF_CS6__GPIO3_22 IOMUX_PAD(0x530, 0x148, 3, 0x0000, 0, 0) |
323 | #define MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK IOMUX_PAD(0x754, 0x34C, 0, 0x0, 0, NO_PAD_CTRL) | 302 | #define _MX51_PAD_NANDF_CS6__NANDF_CS6 IOMUX_PAD(0x530, 0x148, 0, 0x0000, 0, 0) |
324 | #define MX51_PAD_DI_GP4__DI_GP4 IOMUX_PAD(0x758, 0x350, 0, 0x0, 0, NO_PAD_CTRL) | 303 | #define _MX51_PAD_NANDF_CS6__PATA_DA_2 IOMUX_PAD(0x530, 0x148, 1, 0x0000, 0, 0) |
325 | #define MX51_PAD_DISP2_DAT0__DISP2_DAT0 IOMUX_PAD(0x75C, 0x354, 0, 0x0, 0, NO_PAD_CTRL) | 304 | #define _MX51_PAD_NANDF_CS6__SD4_DAT3 IOMUX_PAD(0x530, 0x148, 5, 0x0000, 0, 0) |
326 | #define MX51_PAD_DISP2_DAT1__DISP2_DAT1 IOMUX_PAD(0x760, 0x358, 0, 0x0, 0, NO_PAD_CTRL) | 305 | #define _MX51_PAD_NANDF_CS7__FEC_TX_EN IOMUX_PAD(0x534, 0x14c, 1, 0x0000, 0, 0) |
327 | #define MX51_PAD_DISP2_DAT2__DISP2_DAT2 IOMUX_PAD(0x764, 0x35C, 0, 0x0, 0, NO_PAD_CTRL) | 306 | #define _MX51_PAD_NANDF_CS7__GPIO3_23 IOMUX_PAD(0x534, 0x14c, 3, 0x0000, 0, 0) |
328 | #define MX51_PAD_DISP2_DAT3__DISP2_DAT3 IOMUX_PAD(0x768, 0x360, 0, 0x0, 0, NO_PAD_CTRL) | 307 | #define _MX51_PAD_NANDF_CS7__NANDF_CS7 IOMUX_PAD(0x534, 0x14c, 0, 0x0000, 0, 0) |
329 | #define MX51_PAD_DISP2_DAT4__DISP2_DAT4 IOMUX_PAD(0x76C, 0x364, 0, 0x0, 0, NO_PAD_CTRL) | 308 | #define _MX51_PAD_NANDF_CS7__SD3_CLK IOMUX_PAD(0x534, 0x14c, 5, 0x0000, 0, 0) |
330 | #define MX51_PAD_DISP2_DAT5__DISP2_DAT5 IOMUX_PAD(0x770, 0x368, 0, 0x0, 0, NO_PAD_CTRL) | 309 | #define _MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 IOMUX_PAD(0x538, 0x150, 2, 0x0000, 0, 0) |
331 | #define MX51_PAD_DISP2_DAT6__GPIO_1_19 IOMUX_PAD(0x774, 0x36C, 5, 0x0, 0, NO_PAD_CTRL) | 310 | #define _MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK IOMUX_PAD(0x538, 0x150, 1, 0x0974, 0, 0) |
332 | #define MX51_PAD_DISP2_DAT7__GPIO_1_29 IOMUX_PAD(0x778, 0x370, 5, 0x0, 0, NO_PAD_CTRL) | 311 | #define _MX51_PAD_NANDF_RDY_INT__GPIO3_24 IOMUX_PAD(0x538, 0x150, 3, 0x0000, 0, 0) |
333 | #define MX51_PAD_DISP2_DAT8__GPIO_1_30 IOMUX_PAD(0x77C, 0x374, 5, 0x0, 0, NO_PAD_CTRL) | 312 | #define _MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT IOMUX_PAD(0x538, 0x150, 0, 0x0938, 0, 0) |
334 | #define MX51_PAD_DISP2_DAT9__GPIO_1_31 IOMUX_PAD(0x780, 0x378, 5, 0x0, 0, NO_PAD_CTRL) | 313 | #define _MX51_PAD_NANDF_RDY_INT__SD3_CMD IOMUX_PAD(0x538, 0x150, 5, 0x0000, 0, 0) |
335 | #define MX51_PAD_DISP2_DAT10__DISP2_DAT10 IOMUX_PAD(0x784, 0x37C, 0, 0x0, 0, NO_PAD_CTRL) | 314 | #define _MX51_PAD_NANDF_D15__ECSPI2_MOSI IOMUX_PAD(0x53c, 0x154, 2, 0x0000, 0, 0) |
336 | #define MX51_PAD_DISP2_DAT11__DISP2_DAT11 IOMUX_PAD(0x788, 0x380, 0, 0x0, 0, NO_PAD_CTRL) | 315 | #define _MX51_PAD_NANDF_D15__GPIO3_25 IOMUX_PAD(0x53c, 0x154, 3, 0x0000, 0, 0) |
337 | #define MX51_PAD_DISP2_DAT12__DISP2_DAT12 IOMUX_PAD(0x78C, 0x384, 0, 0x0, 0, NO_PAD_CTRL) | 316 | #define _MX51_PAD_NANDF_D15__NANDF_D15 IOMUX_PAD(0x53c, 0x154, 0, 0x0000, 0, 0) |
338 | #define MX51_PAD_DISP2_DAT13__DISP2_DAT13 IOMUX_PAD(0x790, 0x388, 0, 0x0, 0, NO_PAD_CTRL) | 317 | #define _MX51_PAD_NANDF_D15__PATA_DATA15 IOMUX_PAD(0x53c, 0x154, 1, 0x0000, 0, 0) |
339 | #define MX51_PAD_DISP2_DAT14__DISP2_DAT14 IOMUX_PAD(0x794, 0x38C, 0, 0x0, 0, NO_PAD_CTRL) | 318 | #define _MX51_PAD_NANDF_D15__SD3_DAT7 IOMUX_PAD(0x53c, 0x154, 5, 0x0000, 0, 0) |
340 | #define MX51_PAD_DISP2_DAT15__DISP2_DAT15 IOMUX_PAD(0x798, 0x390, 0, 0x0, 0, NO_PAD_CTRL) | 319 | #define _MX51_PAD_NANDF_D14__ECSPI2_SS3 IOMUX_PAD(0x540, 0x158, 2, 0x0934, 0, 0) |
341 | #define MX51_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x79C, 0x394, IOMUX_CONFIG_SION, 0x0, 0, \ | 320 | #define _MX51_PAD_NANDF_D14__GPIO3_26 IOMUX_PAD(0x540, 0x158, 3, 0x0000, 0, 0) |
342 | MX51_SDHCI_PAD_CTRL) | 321 | #define _MX51_PAD_NANDF_D14__NANDF_D14 IOMUX_PAD(0x540, 0x158, 0, 0x0000, 0, 0) |
343 | #define MX51_PAD_SD1_CMD__AUD5_RXFS IOMUX_PAD(0x79C, 0x394, 1, 0x8e0, 1, NO_PAD_CTRL) | 322 | #define _MX51_PAD_NANDF_D14__PATA_DATA14 IOMUX_PAD(0x540, 0x158, 1, 0x0000, 0, 0) |
344 | #define MX51_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x7A0, 0x398, IOMUX_CONFIG_SION, 0x0, 0, \ | 323 | #define _MX51_PAD_NANDF_D14__SD3_DAT6 IOMUX_PAD(0x540, 0x158, 5, 0x0000, 0, 0) |
345 | MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS) | 324 | #define _MX51_PAD_NANDF_D13__ECSPI2_SS2 IOMUX_PAD(0x544, 0x15c, 2, 0x0000, 0, 0) |
346 | #define MX51_PAD_SD1_CLK__AUD5_RXC IOMUX_PAD(0x7A0, 0x398, 1, 0x8dc, 1, NO_PAD_CTRL) | 325 | #define _MX51_PAD_NANDF_D13__GPIO3_27 IOMUX_PAD(0x544, 0x15c, 3, 0x0000, 0, 0) |
347 | #define MX51_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x7A4, 0x39C, IOMUX_CONFIG_SION, 0x0, 0, \ | 326 | #define _MX51_PAD_NANDF_D13__NANDF_D13 IOMUX_PAD(0x544, 0x15c, 0, 0x0000, 0, 0) |
348 | MX51_SDHCI_PAD_CTRL) | 327 | #define _MX51_PAD_NANDF_D13__PATA_DATA13 IOMUX_PAD(0x544, 0x15c, 1, 0x0000, 0, 0) |
349 | #define MX51_PAD_SD1_DATA0__AUD5_TXD IOMUX_PAD(0x7A4, 0x39C, 1, 0x8d8, 2, NO_PAD_CTRL) | 328 | #define _MX51_PAD_NANDF_D13__SD3_DAT5 IOMUX_PAD(0x544, 0x15c, 5, 0x0000, 0, 0) |
350 | #define MX51_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(0x7A8, 0x3A0, IOMUX_CONFIG_SION, 0x0, 0, \ | 329 | #define _MX51_PAD_NANDF_D12__ECSPI2_SS1 IOMUX_PAD(0x548, 0x160, 2, 0x0930, 1, 0) |
351 | MX51_SDHCI_PAD_CTRL) | 330 | #define _MX51_PAD_NANDF_D12__GPIO3_28 IOMUX_PAD(0x548, 0x160, 3, 0x0000, 0, 0) |
352 | #define MX51_PAD_SD1_DATA1__AUD5_RXD IOMUX_PAD(0x7A8, 0x3A0, 1, 0x8d4, 2, NO_PAD_CTRL) | 331 | #define _MX51_PAD_NANDF_D12__NANDF_D12 IOMUX_PAD(0x548, 0x160, 0, 0x0000, 0, 0) |
353 | #define MX51_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x7AC, 0x3A4, IOMUX_CONFIG_SION, 0x0, 0, \ | 332 | #define _MX51_PAD_NANDF_D12__PATA_DATA12 IOMUX_PAD(0x548, 0x160, 1, 0x0000, 0, 0) |
354 | MX51_SDHCI_PAD_CTRL) | 333 | #define _MX51_PAD_NANDF_D12__SD3_DAT4 IOMUX_PAD(0x548, 0x160, 5, 0x0000, 0, 0) |
355 | #define MX51_PAD_SD1_DATA2__AUD5_TXC IOMUX_PAD(0x7AC, 0x3A4, 1, 0x8e4, 2, NO_PAD_CTRL) | 334 | #define _MX51_PAD_NANDF_D11__FEC_RX_DV IOMUX_PAD(0x54c, 0x164, 2, 0x096c, 0, 0) |
356 | #define MX51_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x7B0, 0x3A8, IOMUX_CONFIG_SION, 0x0, 0, \ | 335 | #define _MX51_PAD_NANDF_D11__GPIO3_29 IOMUX_PAD(0x54c, 0x164, 3, 0x0000, 0, 0) |
357 | MX51_SDHCI_PAD_CTRL) | 336 | #define _MX51_PAD_NANDF_D11__NANDF_D11 IOMUX_PAD(0x54c, 0x164, 0, 0x0000, 0, 0) |
358 | #define MX51_PAD_SD1_DATA3__AUD5_TXFS IOMUX_PAD(0x7B0, 0x3A8, 1, 0x8e8, 2, NO_PAD_CTRL) | 337 | #define _MX51_PAD_NANDF_D11__PATA_DATA11 IOMUX_PAD(0x54c, 0x164, 1, 0x0000, 0, 0) |
359 | #define MX51_PAD_SD2_CMD__SD2_CMD IOMUX_PAD(0x7BC, 0x3B4, IOMUX_CONFIG_SION, 0x0, 1, \ | 338 | #define _MX51_PAD_NANDF_D11__SD3_DATA3 IOMUX_PAD(0x54c, 0x164, 5, 0x0948, 1, 0) |
360 | MX51_SDHCI_PAD_CTRL) | 339 | #define _MX51_PAD_NANDF_D10__GPIO3_30 IOMUX_PAD(0x550, 0x168, 3, 0x0000, 0, 0) |
361 | #define MX51_PAD_SD2_CLK__SD2_CLK IOMUX_PAD(0x7C0, 0x3B8, IOMUX_CONFIG_SION, 0x0, 0, \ | 340 | #define _MX51_PAD_NANDF_D10__NANDF_D10 IOMUX_PAD(0x550, 0x168, 0, 0x0000, 0, 0) |
362 | MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS) | 341 | #define _MX51_PAD_NANDF_D10__PATA_DATA10 IOMUX_PAD(0x550, 0x168, 1, 0x0000, 0, 0) |
363 | #define MX51_PAD_SD2_DATA0__SD2_DATA0 IOMUX_PAD(0x7C4, 0x3BC, IOMUX_CONFIG_SION, 0x0, 0, \ | 342 | #define _MX51_PAD_NANDF_D10__SD3_DATA2 IOMUX_PAD(0x550, 0x168, 5, 0x0944, 1, 0) |
364 | MX51_SDHCI_PAD_CTRL) | 343 | #define _MX51_PAD_NANDF_D9__FEC_RDATA0 IOMUX_PAD(0x554, 0x16c, 0x12, 0x0958, 0, 0) |
365 | #define MX51_PAD_SD2_DATA1__SD2_DATA1 IOMUX_PAD(0x7C8, 0x3C0, IOMUX_CONFIG_SION, 0x0, 0, \ | 344 | #define _MX51_PAD_NANDF_D9__GPIO3_31 IOMUX_PAD(0x554, 0x16c, 3, 0x0000, 0, 0) |
366 | MX51_SDHCI_PAD_CTRL) | 345 | #define _MX51_PAD_NANDF_D9__NANDF_D9 IOMUX_PAD(0x554, 0x16c, 0, 0x0000, 0, 0) |
367 | #define MX51_PAD_SD2_DATA2__SD2_DATA2 IOMUX_PAD(0x7CC, 0x3C4, IOMUX_CONFIG_SION, 0x0, 0, \ | 346 | #define _MX51_PAD_NANDF_D9__PATA_DATA9 IOMUX_PAD(0x554, 0x16c, 1, 0x0000, 0, 0) |
368 | MX51_SDHCI_PAD_CTRL) | 347 | #define _MX51_PAD_NANDF_D9__SD3_DATA1 IOMUX_PAD(0x554, 0x16c, 5, 0x0940, 1, 0) |
369 | #define MX51_PAD_SD2_DATA3__SD2_DATA3 IOMUX_PAD(0x7D0, 0x3C8, IOMUX_CONFIG_SION, 0x0, 0, \ | 348 | #define _MX51_PAD_NANDF_D8__FEC_TDATA0 IOMUX_PAD(0x558, 0x170, 2, 0x0000, 0, 0) |
370 | MX51_SDHCI_PAD_CTRL) | 349 | #define _MX51_PAD_NANDF_D8__GPIO4_0 IOMUX_PAD(0x558, 0x170, 3, 0x0000, 0, 0) |
371 | #define MX51_PAD_GPIO_1_0__GPIO_1_0 IOMUX_PAD(0x7B4, 0x3AC, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 350 | #define _MX51_PAD_NANDF_D8__NANDF_D8 IOMUX_PAD(0x558, 0x170, 0, 0x0000, 0, 0) |
372 | #define MX51_PAD_GPIO_1_1__GPIO_1_1 IOMUX_PAD(0x7B8, 0x3B0, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 351 | #define _MX51_PAD_NANDF_D8__PATA_DATA8 IOMUX_PAD(0x558, 0x170, 1, 0x0000, 0, 0) |
373 | #define MX51_PAD_GPIO_1_2__GPIO_1_2 IOMUX_PAD(0x7D4, 0x3CC, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 352 | #define _MX51_PAD_NANDF_D8__SD3_DATA0 IOMUX_PAD(0x558, 0x170, 5, 0x093c, 1, 0) |
374 | #define MX51_PAD_GPIO_1_2__I2C2_SCL IOMUX_PAD(0x7D4, 0x3CC, (2 | IOMUX_CONFIG_SION), \ | 353 | #define _MX51_PAD_NANDF_D7__GPIO4_1 IOMUX_PAD(0x55c, 0x174, 3, 0x0000, 0, 0) |
375 | 0x9b8, 3, MX51_I2C_PAD_CTRL) | 354 | #define _MX51_PAD_NANDF_D7__NANDF_D7 IOMUX_PAD(0x55c, 0x174, 0, 0x0000, 0, 0) |
376 | #define MX51_PAD_GPIO_1_3__GPIO_1_3 IOMUX_PAD(0x7D8, 0x3D0, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 355 | #define _MX51_PAD_NANDF_D7__PATA_DATA7 IOMUX_PAD(0x55c, 0x174, 1, 0x0000, 0, 0) |
377 | #define MX51_PAD_GPIO_1_3__I2C2_SDA IOMUX_PAD(0x7D8, 0x3D0, (2 | IOMUX_CONFIG_SION), \ | 356 | #define _MX51_PAD_NANDF_D7__USBH3_DATA0 IOMUX_PAD(0x55c, 0x174, 5, 0x09fc, 0, 0) |
378 | 0x9bc, 3, MX51_I2C_PAD_CTRL) | 357 | #define _MX51_PAD_NANDF_D6__GPIO4_2 IOMUX_PAD(0x560, 0x178, 3, 0x0000, 0, 0) |
379 | #define MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ IOMUX_PAD(0x7FC, 0x3D4, 0, 0x0, 0, NO_PAD_CTRL) | 358 | #define _MX51_PAD_NANDF_D6__NANDF_D6 IOMUX_PAD(0x560, 0x178, 0, 0x0000, 0, 0) |
380 | #define MX51_PAD_GPIO_1_4__GPIO_1_4 IOMUX_PAD(0x804, 0x3D8, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 359 | #define _MX51_PAD_NANDF_D6__PATA_DATA6 IOMUX_PAD(0x560, 0x178, 1, 0x0000, 0, 0) |
381 | #define MX51_PAD_GPIO_1_5__GPIO_1_5 IOMUX_PAD(0x808, 0x3DC, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 360 | #define _MX51_PAD_NANDF_D6__SD4_LCTL IOMUX_PAD(0x560, 0x178, 2, 0x0000, 0, 0) |
382 | #define MX51_PAD_GPIO_1_6__GPIO_1_6 IOMUX_PAD(0x80C, 0x3E0, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 361 | #define _MX51_PAD_NANDF_D6__USBH3_DATA1 IOMUX_PAD(0x560, 0x178, 5, 0x0a00, 0, 0) |
383 | #define MX51_PAD_GPIO_1_7__GPIO_1_7 IOMUX_PAD(0x810, 0x3E4, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 362 | #define _MX51_PAD_NANDF_D5__GPIO4_3 IOMUX_PAD(0x564, 0x17c, 3, 0x0000, 0, 0) |
384 | #define MX51_PAD_GPIO_1_8__GPIO_1_8 IOMUX_PAD(0x814, 0x3E8, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 363 | #define _MX51_PAD_NANDF_D5__NANDF_D5 IOMUX_PAD(0x564, 0x17c, 0, 0x0000, 0, 0) |
385 | #define MX51_PAD_GPIO_1_9__GPIO_1_9 IOMUX_PAD(0x818, 0x3EC, 1, 0x0, 0, MX51_GPIO_PAD_CTRL) | 364 | #define _MX51_PAD_NANDF_D5__PATA_DATA5 IOMUX_PAD(0x564, 0x17c, 1, 0x0000, 0, 0) |
365 | #define _MX51_PAD_NANDF_D5__SD4_WP IOMUX_PAD(0x564, 0x17c, 2, 0x0000, 0, 0) | ||
366 | #define _MX51_PAD_NANDF_D5__USBH3_DATA2 IOMUX_PAD(0x564, 0x17c, 5, 0x0a04, 0, 0) | ||
367 | #define _MX51_PAD_NANDF_D4__GPIO4_4 IOMUX_PAD(0x568, 0x180, 3, 0x0000, 0, 0) | ||
368 | #define _MX51_PAD_NANDF_D4__NANDF_D4 IOMUX_PAD(0x568, 0x180, 0, 0x0000, 0, 0) | ||
369 | #define _MX51_PAD_NANDF_D4__PATA_DATA4 IOMUX_PAD(0x568, 0x180, 1, 0x0000, 0, 0) | ||
370 | #define _MX51_PAD_NANDF_D4__SD4_CD IOMUX_PAD(0x568, 0x180, 2, 0x0000, 0, 0) | ||
371 | #define _MX51_PAD_NANDF_D4__USBH3_DATA3 IOMUX_PAD(0x568, 0x180, 5, 0x0a08, 0, 0) | ||
372 | #define _MX51_PAD_NANDF_D3__GPIO4_5 IOMUX_PAD(0x56c, 0x184, 3, 0x0000, 0, 0) | ||
373 | #define _MX51_PAD_NANDF_D3__NANDF_D3 IOMUX_PAD(0x56c, 0x184, 0, 0x0000, 0, 0) | ||
374 | #define _MX51_PAD_NANDF_D3__PATA_DATA3 IOMUX_PAD(0x56c, 0x184, 1, 0x0000, 0, 0) | ||
375 | #define _MX51_PAD_NANDF_D3__SD4_DAT4 IOMUX_PAD(0x56c, 0x184, 2, 0x0000, 0, 0) | ||
376 | #define _MX51_PAD_NANDF_D3__USBH3_DATA4 IOMUX_PAD(0x56c, 0x184, 5, 0x0a0c, 0, 0) | ||
377 | #define _MX51_PAD_NANDF_D2__GPIO4_6 IOMUX_PAD(0x570, 0x188, 3, 0x0000, 0, 0) | ||
378 | #define _MX51_PAD_NANDF_D2__NANDF_D2 IOMUX_PAD(0x570, 0x188, 0, 0x0000, 0, 0) | ||
379 | #define _MX51_PAD_NANDF_D2__PATA_DATA2 IOMUX_PAD(0x570, 0x188, 1, 0x0000, 0, 0) | ||
380 | #define _MX51_PAD_NANDF_D2__SD4_DAT5 IOMUX_PAD(0x570, 0x188, 2, 0x0000, 0, 0) | ||
381 | #define _MX51_PAD_NANDF_D2__USBH3_DATA5 IOMUX_PAD(0x570, 0x188, 5, 0x0a10, 0, 0) | ||
382 | #define _MX51_PAD_NANDF_D1__GPIO4_7 IOMUX_PAD(0x574, 0x18c, 3, 0x0000, 0, 0) | ||
383 | #define _MX51_PAD_NANDF_D1__NANDF_D1 IOMUX_PAD(0x574, 0x18c, 0, 0x0000, 0, 0) | ||
384 | #define _MX51_PAD_NANDF_D1__PATA_DATA1 IOMUX_PAD(0x574, 0x18c, 1, 0x0000, 0, 0) | ||
385 | #define _MX51_PAD_NANDF_D1__SD4_DAT6 IOMUX_PAD(0x574, 0x18c, 2, 0x0000, 0, 0) | ||
386 | #define _MX51_PAD_NANDF_D1__USBH3_DATA6 IOMUX_PAD(0x574, 0x18c, 5, 0x0a14, 0, 0) | ||
387 | #define _MX51_PAD_NANDF_D0__GPIO4_8 IOMUX_PAD(0x578, 0x190, 3, 0x0000, 0, 0) | ||
388 | #define _MX51_PAD_NANDF_D0__NANDF_D0 IOMUX_PAD(0x578, 0x190, 0, 0x0000, 0, 0) | ||
389 | #define _MX51_PAD_NANDF_D0__PATA_DATA0 IOMUX_PAD(0x578, 0x190, 1, 0x0000, 0, 0) | ||
390 | #define _MX51_PAD_NANDF_D0__SD4_DAT7 IOMUX_PAD(0x578, 0x190, 2, 0x0000, 0, 0) | ||
391 | #define _MX51_PAD_NANDF_D0__USBH3_DATA7 IOMUX_PAD(0x578, 0x190, 5, 0x0a18, 0, 0) | ||
392 | #define _MX51_PAD_CSI1_D8__CSI1_D8 IOMUX_PAD(0x57c, 0x194, 0, 0x0000, 0, 0) | ||
393 | #define _MX51_PAD_CSI1_D8__GPIO3_12 IOMUX_PAD(0x57c, 0x194, 3, 0x0998, 1, 0) | ||
394 | #define _MX51_PAD_CSI1_D9__CSI1_D9 IOMUX_PAD(0x580, 0x198, 0, 0x0000, 0, 0) | ||
395 | #define _MX51_PAD_CSI1_D9__GPIO3_13 IOMUX_PAD(0x580, 0x198, 3, 0x0000, 0, 0) | ||
396 | #define _MX51_PAD_CSI1_D10__CSI1_D10 IOMUX_PAD(0x584, 0x19c, 0, 0x0000, 0, 0) | ||
397 | #define _MX51_PAD_CSI1_D11__CSI1_D11 IOMUX_PAD(0x588, 0x1a0, 0, 0x0000, 0, 0) | ||
398 | #define _MX51_PAD_CSI1_D12__CSI1_D12 IOMUX_PAD(0x58c, 0x1a4, 0, 0x0000, 0, 0) | ||
399 | #define _MX51_PAD_CSI1_D13__CSI1_D13 IOMUX_PAD(0x590, 0x1a8, 0, 0x0000, 0, 0) | ||
400 | #define _MX51_PAD_CSI1_D14__CSI1_D14 IOMUX_PAD(0x594, 0x1ac, 0, 0x0000, 0, 0) | ||
401 | #define _MX51_PAD_CSI1_D15__CSI1_D15 IOMUX_PAD(0x598, 0x1b0, 0, 0x0000, 0, 0) | ||
402 | #define _MX51_PAD_CSI1_D16__CSI1_D16 IOMUX_PAD(0x59c, 0x1b4, 0, 0x0000, 0, 0) | ||
403 | #define _MX51_PAD_CSI1_D17__CSI1_D17 IOMUX_PAD(0x5a0, 0x1b8, 0, 0x0000, 0, 0) | ||
404 | #define _MX51_PAD_CSI1_D18__CSI1_D18 IOMUX_PAD(0x5a4, 0x1bc, 0, 0x0000, 0, 0) | ||
405 | #define _MX51_PAD_CSI1_D19__CSI1_D19 IOMUX_PAD(0x5a8, 0x1c0, 0, 0x0000, 0, 0) | ||
406 | #define _MX51_PAD_CSI1_VSYNC__CSI1_VSYNC IOMUX_PAD(0x5ac, 0x1c4, 0, 0x0000, 0, 0) | ||
407 | #define _MX51_PAD_CSI1_VSYNC__GPIO3_14 IOMUX_PAD(0x5ac, 0x1c4, 3, 0x0000, 0, 0) | ||
408 | #define _MX51_PAD_CSI1_HSYNC__CSI1_HSYNC IOMUX_PAD(0x5b0, 0x1c8, 0, 0x0000, 0, 0) | ||
409 | #define _MX51_PAD_CSI1_HSYNC__GPIO3_15 IOMUX_PAD(0x5b0, 0x1c8, 3, 0x0000, 0, 0) | ||
410 | #define _MX51_PAD_CSI1_PIXCLK__CSI1_PIXCLK IOMUX_PAD(0x5b4, 0x000, 0, 0x0000, 0, 0) | ||
411 | #define _MX51_PAD_CSI1_MCLK__CSI1_MCLK IOMUX_PAD(0x5b8, 0x000, 0, 0x0000, 0, 0) | ||
412 | #define _MX51_PAD_CSI2_D12__CSI2_D12 IOMUX_PAD(0x5bc, 0x1cc, 0, 0x0000, 0, 0) | ||
413 | #define _MX51_PAD_CSI2_D12__GPIO4_9 IOMUX_PAD(0x5bc, 0x1cc, 3, 0x0000, 0, 0) | ||
414 | #define _MX51_PAD_CSI2_D13__CSI2_D13 IOMUX_PAD(0x5c0, 0x1d0, 0, 0x0000, 0, 0) | ||
415 | #define _MX51_PAD_CSI2_D13__GPIO4_10 IOMUX_PAD(0x5c0, 0x1d0, 3, 0x0000, 0, 0) | ||
416 | #define _MX51_PAD_CSI2_D14__CSI2_D14 IOMUX_PAD(0x5c4, 0x1d4, 0, 0x0000, 0, 0) | ||
417 | #define _MX51_PAD_CSI2_D15__CSI2_D15 IOMUX_PAD(0x5c8, 0x1d8, 0, 0x0000, 0, 0) | ||
418 | #define _MX51_PAD_CSI2_D16__CSI2_D16 IOMUX_PAD(0x5cc, 0x1dc, 0, 0x0000, 0, 0) | ||
419 | #define _MX51_PAD_CSI2_D17__CSI2_D17 IOMUX_PAD(0x5d0, 0x1e0, 0, 0x0000, 0, 0) | ||
420 | #define _MX51_PAD_CSI2_D18__CSI2_D18 IOMUX_PAD(0x5d4, 0x1e4, 0, 0x0000, 0, 0) | ||
421 | #define _MX51_PAD_CSI2_D18__GPIO4_11 IOMUX_PAD(0x5d4, 0x1e4, 3, 0x0000, 0, 0) | ||
422 | #define _MX51_PAD_CSI2_D19__CSI2_D19 IOMUX_PAD(0x5d8, 0x1e8, 0, 0x0000, 0, 0) | ||
423 | #define _MX51_PAD_CSI2_D19__GPIO4_12 IOMUX_PAD(0x5d8, 0x1e8, 3, 0x0000, 0, 0) | ||
424 | #define _MX51_PAD_CSI2_VSYNC__CSI2_VSYNC IOMUX_PAD(0x5dc, 0x1ec, 0, 0x0000, 0, 0) | ||
425 | #define _MX51_PAD_CSI2_VSYNC__GPIO4_13 IOMUX_PAD(0x5dc, 0x1ec, 3, 0x0000, 0, 0) | ||
426 | #define _MX51_PAD_CSI2_HSYNC__CSI2_HSYNC IOMUX_PAD(0x5e0, 0x1f0, 0, 0x0000, 0, 0) | ||
427 | #define _MX51_PAD_CSI2_HSYNC__GPIO4_14 IOMUX_PAD(0x5e0, 0x1f0, 3, 0x0000, 0, 0) | ||
428 | #define _MX51_PAD_CSI2_PIXCLK__CSI2_PIXCLK IOMUX_PAD(0x5e4, 0x1f4, 0, 0x0000, 0, 0) | ||
429 | #define _MX51_PAD_CSI2_PIXCLK__GPIO4_15 IOMUX_PAD(0x5e4, 0x1f4, 3, 0x0000, 0, 0) | ||
430 | #define _MX51_PAD_I2C1_CLK__GPIO4_16 IOMUX_PAD(0x5e8, 0x1f8, 3, 0x0000, 0, 0) | ||
431 | #define _MX51_PAD_I2C1_CLK__I2C1_CLK IOMUX_PAD(0x5e8, 0x1f8, 0x10, 0x0000, 0, 0) | ||
432 | #define _MX51_PAD_I2C1_DAT__GPIO4_17 IOMUX_PAD(0x5ec, 0x1fc, 3, 0x0000, 0, 0) | ||
433 | #define _MX51_PAD_I2C1_DAT__I2C1_DAT IOMUX_PAD(0x5ec, 0x1fc, 0x10, 0x0000, 0, 0) | ||
434 | #define _MX51_PAD_AUD3_BB_TXD__AUD3_TXD IOMUX_PAD(0x5f0, 0x200, 0, 0x0000, 0, 0) | ||
435 | #define _MX51_PAD_AUD3_BB_TXD__GPIO4_18 IOMUX_PAD(0x5f0, 0x200, 3, 0x0000, 0, 0) | ||
436 | #define _MX51_PAD_AUD3_BB_RXD__AUD3_RXD IOMUX_PAD(0x5f4, 0x204, 0, 0x0000, 0, 0) | ||
437 | #define _MX51_PAD_AUD3_BB_RXD__GPIO4_19 IOMUX_PAD(0x5f4, 0x204, 3, 0x0000, 0, 0) | ||
438 | #define _MX51_PAD_AUD3_BB_RXD__UART3_RXD IOMUX_PAD(0x5f4, 0x204, 1, 0x09f4, 2, 0) | ||
439 | #define _MX51_PAD_AUD3_BB_CK__AUD3_TXC IOMUX_PAD(0x5f8, 0x208, 0, 0x0000, 0, 0) | ||
440 | #define _MX51_PAD_AUD3_BB_CK__GPIO4_20 IOMUX_PAD(0x5f8, 0x208, 3, 0x0000, 0, 0) | ||
441 | #define _MX51_PAD_AUD3_BB_FS__AUD3_TXFS IOMUX_PAD(0x5fc, 0x20c, 0, 0x0000, 0, 0) | ||
442 | #define _MX51_PAD_AUD3_BB_FS__GPIO4_21 IOMUX_PAD(0x5fc, 0x20c, 3, 0x0000, 0, 0) | ||
443 | #define _MX51_PAD_AUD3_BB_FS__UART3_TXD IOMUX_PAD(0x5fc, 0x20c, 1, 0x0000, 0, 0) | ||
444 | #define _MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI IOMUX_PAD(0x600, 0x210, 0, 0x0000, 0, 0) | ||
445 | #define _MX51_PAD_CSPI1_MOSI__GPIO4_22 IOMUX_PAD(0x600, 0x210, 3, 0x0000, 0, 0) | ||
446 | #define _MX51_PAD_CSPI1_MOSI__I2C1_SDA IOMUX_PAD(0x600, 0x210, 0x11, 0x09b4, 1, 0) | ||
447 | #define _MX51_PAD_CSPI1_MISO__AUD4_RXD IOMUX_PAD(0x604, 0x214, 1, 0x08c4, 1, 0) | ||
448 | #define _MX51_PAD_CSPI1_MISO__ECSPI1_MISO IOMUX_PAD(0x604, 0x214, 0, 0x0000, 0, 0) | ||
449 | #define _MX51_PAD_CSPI1_MISO__GPIO4_23 IOMUX_PAD(0x604, 0x214, 3, 0x0000, 0, 0) | ||
450 | #define _MX51_PAD_CSPI1_SS0__AUD4_TXC IOMUX_PAD(0x608, 0x218, 1, 0x08cc, 1, 0) | ||
451 | #define _MX51_PAD_CSPI1_SS0__ECSPI1_SS0 IOMUX_PAD(0x608, 0x218, 0, 0x0000, 0, 0) | ||
452 | #define _MX51_PAD_CSPI1_SS0__GPIO4_24 IOMUX_PAD(0x608, 0x218, 3, 0x0000, 0, 0) | ||
453 | #define _MX51_PAD_CSPI1_SS1__AUD4_TXD IOMUX_PAD(0x60c, 0x21c, 1, 0x08c8, 1, 0) | ||
454 | #define _MX51_PAD_CSPI1_SS1__ECSPI1_SS1 IOMUX_PAD(0x60c, 0x21c, 0, 0x0000, 0, 0) | ||
455 | #define _MX51_PAD_CSPI1_SS1__GPIO4_25 IOMUX_PAD(0x60c, 0x21c, 3, 0x0000, 0, 0) | ||
456 | #define _MX51_PAD_CSPI1_RDY__AUD4_TXFS IOMUX_PAD(0x610, 0x220, 1, 0x08d0, 1, 0) | ||
457 | #define _MX51_PAD_CSPI1_RDY__ECSPI1_RDY IOMUX_PAD(0x610, 0x220, 0, 0x0000, 0, 0) | ||
458 | #define _MX51_PAD_CSPI1_RDY__GPIO4_26 IOMUX_PAD(0x610, 0x220, 3, 0x0000, 0, 0) | ||
459 | #define _MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK IOMUX_PAD(0x614, 0x224, 0, 0x0000, 0, 0) | ||
460 | #define _MX51_PAD_CSPI1_SCLK__GPIO4_27 IOMUX_PAD(0x614, 0x224, 3, 0x0000, 0, 0) | ||
461 | #define _MX51_PAD_CSPI1_SCLK__I2C1_SCL IOMUX_PAD(0x614, 0x224, 0x11, 0x09b0, 1, 0) | ||
462 | #define _MX51_PAD_UART1_RXD__GPIO4_28 IOMUX_PAD(0x618, 0x228, 3, 0x0000, 0, 0) | ||
463 | #define _MX51_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x618, 0x228, 0, 0x09e4, 0, 0) | ||
464 | #define _MX51_PAD_UART1_TXD__GPIO4_29 IOMUX_PAD(0x61c, 0x22c, 3, 0x0000, 0, 0) | ||
465 | #define _MX51_PAD_UART1_TXD__PWM2_PWMO IOMUX_PAD(0x61c, 0x22c, 1, 0x0000, 0, 0) | ||
466 | #define _MX51_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x61c, 0x22c, 0, 0x0000, 0, 0) | ||
467 | #define _MX51_PAD_UART1_RTS__GPIO4_30 IOMUX_PAD(0x620, 0x230, 3, 0x0000, 0, 0) | ||
468 | #define _MX51_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(0x620, 0x230, 0, 0x09e0, 0, 0) | ||
469 | #define _MX51_PAD_UART1_CTS__GPIO4_31 IOMUX_PAD(0x624, 0x234, 3, 0x0000, 0, 0) | ||
470 | #define _MX51_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(0x624, 0x234, 0, 0x0000, 0, 0) | ||
471 | #define _MX51_PAD_UART2_RXD__FIRI_TXD IOMUX_PAD(0x628, 0x238, 1, 0x0000, 0, 0) | ||
472 | #define _MX51_PAD_UART2_RXD__GPIO1_20 IOMUX_PAD(0x628, 0x238, 3, 0x0000, 0, 0) | ||
473 | #define _MX51_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x628, 0x238, 0, 0x09ec, 2, 0) | ||
474 | #define _MX51_PAD_UART2_TXD__FIRI_RXD IOMUX_PAD(0x62c, 0x23c, 1, 0x0000, 0, 0) | ||
475 | #define _MX51_PAD_UART2_TXD__GPIO1_21 IOMUX_PAD(0x62c, 0x23c, 3, 0x0000, 0, 0) | ||
476 | #define _MX51_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x62c, 0x23c, 0, 0x09ec, 3, 0) | ||
477 | #define _MX51_PAD_UART3_RXD__CSI1_D0 IOMUX_PAD(0x630, 0x240, 2, 0x0000, 0, 0) | ||
478 | #define _MX51_PAD_UART3_RXD__GPIO1_22 IOMUX_PAD(0x630, 0x240, 3, 0x0000, 0, 0) | ||
479 | #define _MX51_PAD_UART3_RXD__UART1_DTR IOMUX_PAD(0x630, 0x240, 0, 0x0000, 0, 0) | ||
480 | #define _MX51_PAD_UART3_RXD__UART3_RXD IOMUX_PAD(0x630, 0x240, 1, 0x09f4, 4, 0) | ||
481 | #define _MX51_PAD_UART3_TXD__CSI1_D1 IOMUX_PAD(0x634, 0x244, 2, 0x0000, 0, 0) | ||
482 | #define _MX51_PAD_UART3_TXD__GPIO1_23 IOMUX_PAD(0x634, 0x244, 3, 0x0000, 0, 0) | ||
483 | #define _MX51_PAD_UART3_TXD__UART1_DSR IOMUX_PAD(0x634, 0x244, 0, 0x0000, 0, 0) | ||
484 | #define _MX51_PAD_UART3_TXD__UART3_TXD IOMUX_PAD(0x634, 0x244, 1, 0x0000, 0, 0) | ||
485 | #define _MX51_PAD_OWIRE_LINE__GPIO1_24 IOMUX_PAD(0x638, 0x248, 3, 0x0000, 0, 0) | ||
486 | #define _MX51_PAD_OWIRE_LINE__OWIRE_LINE IOMUX_PAD(0x638, 0x248, 0, 0x0000, 0, 0) | ||
487 | #define _MX51_PAD_OWIRE_LINE__SPDIF_OUT IOMUX_PAD(0x638, 0x248, 6, 0x0000, 0, 0) | ||
488 | #define _MX51_PAD_KEY_ROW0__KEY_ROW0 IOMUX_PAD(0x63c, 0x24c, 0, 0x0000, 0, 0) | ||
489 | #define _MX51_PAD_KEY_ROW1__KEY_ROW1 IOMUX_PAD(0x640, 0x250, 0, 0x0000, 0, 0) | ||
490 | #define _MX51_PAD_KEY_ROW2__KEY_ROW2 IOMUX_PAD(0x644, 0x254, 0, 0x0000, 0, 0) | ||
491 | #define _MX51_PAD_KEY_ROW3__KEY_ROW3 IOMUX_PAD(0x648, 0x258, 0, 0x0000, 0, 0) | ||
492 | #define _MX51_PAD_KEY_COL0__KEY_COL0 IOMUX_PAD(0x64c, 0x25c, 0, 0x0000, 0, 0) | ||
493 | #define _MX51_PAD_KEY_COL0__PLL1_BYP IOMUX_PAD(0x64c, 0x25c, 7, 0x090c, 0, 0) | ||
494 | #define _MX51_PAD_KEY_COL1__KEY_COL1 IOMUX_PAD(0x650, 0x260, 0, 0x0000, 0, 0) | ||
495 | #define _MX51_PAD_KEY_COL1__PLL2_BYP IOMUX_PAD(0x650, 0x260, 7, 0x0910, 0, 0) | ||
496 | #define _MX51_PAD_KEY_COL2__KEY_COL2 IOMUX_PAD(0x654, 0x264, 0, 0x0000, 0, 0) | ||
497 | #define _MX51_PAD_KEY_COL2__PLL3_BYP IOMUX_PAD(0x654, 0x264, 7, 0x0000, 0, 0) | ||
498 | #define _MX51_PAD_KEY_COL3__KEY_COL3 IOMUX_PAD(0x658, 0x268, 0, 0x0000, 0, 0) | ||
499 | #define _MX51_PAD_KEY_COL4__I2C2_SCL IOMUX_PAD(0x65c, 0x26c, 0x13, 0x09b8, 1, 0) | ||
500 | #define _MX51_PAD_KEY_COL4__KEY_COL4 IOMUX_PAD(0x65c, 0x26c, 0, 0x0000, 0, 0) | ||
501 | #define _MX51_PAD_KEY_COL4__SPDIF_OUT1 IOMUX_PAD(0x65c, 0x26c, 6, 0x0000, 0, 0) | ||
502 | #define _MX51_PAD_KEY_COL4__UART1_RI IOMUX_PAD(0x65c, 0x26c, 1, 0x0000, 0, 0) | ||
503 | #define _MX51_PAD_KEY_COL4__UART3_RTS IOMUX_PAD(0x65c, 0x26c, 2, 0x09f0, 4, 0) | ||
504 | #define _MX51_PAD_KEY_COL5__I2C2_SDA IOMUX_PAD(0x660, 0x270, 0x13, 0x09bc, 1, 0) | ||
505 | #define _MX51_PAD_KEY_COL5__KEY_COL5 IOMUX_PAD(0x660, 0x270, 0, 0x0000, 0, 0) | ||
506 | #define _MX51_PAD_KEY_COL5__UART1_DCD IOMUX_PAD(0x660, 0x270, 1, 0x0000, 0, 0) | ||
507 | #define _MX51_PAD_KEY_COL5__UART3_CTS IOMUX_PAD(0x660, 0x270, 2, 0x0000, 0, 0) | ||
508 | #define _MX51_PAD_USBH1_CLK__CSPI_SCLK IOMUX_PAD(0x678, 0x278, 1, 0x0914, 1, 0) | ||
509 | #define _MX51_PAD_USBH1_CLK__GPIO1_25 IOMUX_PAD(0x678, 0x278, 2, 0x0000, 0, 0) | ||
510 | #define _MX51_PAD_USBH1_CLK__I2C2_SCL IOMUX_PAD(0x678, 0x278, 0x15, 0x09b8, 2, 0) | ||
511 | #define _MX51_PAD_USBH1_CLK__USBH1_CLK IOMUX_PAD(0x678, 0x278, 0, 0x0000, 0, 0) | ||
512 | #define _MX51_PAD_USBH1_DIR__CSPI_MOSI IOMUX_PAD(0x67c, 0x27c, 1, 0x091c, 1, 0) | ||
513 | #define _MX51_PAD_USBH1_DIR__GPIO1_26 IOMUX_PAD(0x67c, 0x27c, 2, 0x0000, 0, 0) | ||
514 | #define _MX51_PAD_USBH1_DIR__I2C2_SDA IOMUX_PAD(0x67c, 0x27c, 0x15, 0x09bc, 2, 0) | ||
515 | #define _MX51_PAD_USBH1_DIR__USBH1_DIR IOMUX_PAD(0x67c, 0x27c, 0, 0x0000, 0, 0) | ||
516 | #define _MX51_PAD_USBH1_STP__CSPI_RDY IOMUX_PAD(0x680, 0x280, 1, 0x0000, 0, 0) | ||
517 | #define _MX51_PAD_USBH1_STP__GPIO1_27 IOMUX_PAD(0x680, 0x280, 2, 0x0000, 0, 0) | ||
518 | #define _MX51_PAD_USBH1_STP__UART3_RXD IOMUX_PAD(0x680, 0x280, 5, 0x09f4, 6, 0) | ||
519 | #define _MX51_PAD_USBH1_STP__USBH1_STP IOMUX_PAD(0x680, 0x280, 0, 0x0000, 0, 0) | ||
520 | #define _MX51_PAD_USBH1_NXT__CSPI_MISO IOMUX_PAD(0x684, 0x284, 1, 0x0918, 0, 0) | ||
521 | #define _MX51_PAD_USBH1_NXT__GPIO1_28 IOMUX_PAD(0x684, 0x284, 2, 0x0000, 0, 0) | ||
522 | #define _MX51_PAD_USBH1_NXT__UART3_TXD IOMUX_PAD(0x684, 0x284, 5, 0x0000, 0, 0) | ||
523 | #define _MX51_PAD_USBH1_NXT__USBH1_NXT IOMUX_PAD(0x684, 0x284, 0, 0x0000, 0, 0) | ||
524 | #define _MX51_PAD_USBH1_DATA0__GPIO1_11 IOMUX_PAD(0x688, 0x288, 2, 0x0000, 0, 0) | ||
525 | #define _MX51_PAD_USBH1_DATA0__UART2_CTS IOMUX_PAD(0x688, 0x288, 1, 0x0000, 0, 0) | ||
526 | #define _MX51_PAD_USBH1_DATA0__USBH1_DATA0 IOMUX_PAD(0x688, 0x288, 0, 0x0000, 0, 0) | ||
527 | #define _MX51_PAD_USBH1_DATA1__GPIO1_12 IOMUX_PAD(0x68c, 0x28c, 2, 0x0000, 0, 0) | ||
528 | #define _MX51_PAD_USBH1_DATA1__UART2_RXD IOMUX_PAD(0x68c, 0x28c, 1, 0x09ec, 4, 0) | ||
529 | #define _MX51_PAD_USBH1_DATA1__USBH1_DATA1 IOMUX_PAD(0x68c, 0x28c, 0, 0x0000, 0, 0) | ||
530 | #define _MX51_PAD_USBH1_DATA2__GPIO1_13 IOMUX_PAD(0x690, 0x290, 2, 0x0000, 0, 0) | ||
531 | #define _MX51_PAD_USBH1_DATA2__UART2_TXD IOMUX_PAD(0x690, 0x290, 1, 0x09ec, 5, 0) | ||
532 | #define _MX51_PAD_USBH1_DATA2__USBH1_DATA2 IOMUX_PAD(0x690, 0x290, 0, 0x0000, 0, 0) | ||
533 | #define _MX51_PAD_USBH1_DATA3__GPIO1_14 IOMUX_PAD(0x694, 0x294, 2, 0x0000, 0, 0) | ||
534 | #define _MX51_PAD_USBH1_DATA3__UART2_RTS IOMUX_PAD(0x694, 0x294, 1, 0x09e8, 5, 0) | ||
535 | #define _MX51_PAD_USBH1_DATA3__USBH1_DATA3 IOMUX_PAD(0x694, 0x294, 0, 0x0000, 0, 0) | ||
536 | #define _MX51_PAD_USBH1_DATA4__CSPI_SS0 IOMUX_PAD(0x698, 0x298, 1, 0x0000, 0, 0) | ||
537 | #define _MX51_PAD_USBH1_DATA4__GPIO1_15 IOMUX_PAD(0x698, 0x298, 2, 0x0000, 0, 0) | ||
538 | #define _MX51_PAD_USBH1_DATA4__USBH1_DATA4 IOMUX_PAD(0x698, 0x298, 0, 0x0000, 0, 0) | ||
539 | #define _MX51_PAD_USBH1_DATA5__CSPI_SS1 IOMUX_PAD(0x69c, 0x29c, 1, 0x0920, 0, 0) | ||
540 | #define _MX51_PAD_USBH1_DATA5__GPIO1_16 IOMUX_PAD(0x69c, 0x29c, 2, 0x0000, 0, 0) | ||
541 | #define _MX51_PAD_USBH1_DATA5__USBH1_DATA5 IOMUX_PAD(0x69c, 0x29c, 0, 0x0000, 0, 0) | ||
542 | #define _MX51_PAD_USBH1_DATA6__CSPI_SS3 IOMUX_PAD(0x6a0, 0x2a0, 1, 0x0928, 1, 0) | ||
543 | #define _MX51_PAD_USBH1_DATA6__GPIO1_17 IOMUX_PAD(0x6a0, 0x2a0, 2, 0x0000, 0, 0) | ||
544 | #define _MX51_PAD_USBH1_DATA6__USBH1_DATA6 IOMUX_PAD(0x6a0, 0x2a0, 0, 0x0000, 0, 0) | ||
545 | #define _MX51_PAD_USBH1_DATA7__ECSPI1_SS3 IOMUX_PAD(0x6a4, 0x2a4, 1, 0x0000, 0, 0) | ||
546 | #define _MX51_PAD_USBH1_DATA7__ECSPI2_SS3 IOMUX_PAD(0x6a4, 0x2a4, 5, 0x0934, 1, 0) | ||
547 | #define _MX51_PAD_USBH1_DATA7__GPIO1_18 IOMUX_PAD(0x6a4, 0x2a4, 2, 0x0000, 0, 0) | ||
548 | #define _MX51_PAD_USBH1_DATA7__USBH1_DATA7 IOMUX_PAD(0x6a4, 0x2a4, 0, 0x0000, 0, 0) | ||
549 | #define _MX51_PAD_DI1_PIN11__DI1_PIN11 IOMUX_PAD(0x6a8, 0x2a8, 0, 0x0000, 0, 0) | ||
550 | #define _MX51_PAD_DI1_PIN11__ECSPI1_SS2 IOMUX_PAD(0x6a8, 0x2a8, 7, 0x0000, 0, 0) | ||
551 | #define _MX51_PAD_DI1_PIN11__GPIO3_0 IOMUX_PAD(0x6a8, 0x2a8, 4, 0x0000, 0, 0) | ||
552 | #define _MX51_PAD_DI1_PIN12__DI1_PIN12 IOMUX_PAD(0x6ac, 0x2ac, 0, 0x0000, 0, 0) | ||
553 | #define _MX51_PAD_DI1_PIN12__GPIO3_1 IOMUX_PAD(0x6ac, 0x2ac, 4, 0x0978, 1, 0) | ||
554 | #define _MX51_PAD_DI1_PIN13__DI1_PIN13 IOMUX_PAD(0x6b0, 0x2b0, 0, 0x0000, 0, 0) | ||
555 | #define _MX51_PAD_DI1_PIN13__GPIO3_2 IOMUX_PAD(0x6b0, 0x2b0, 4, 0x097c, 1, 0) | ||
556 | #define _MX51_PAD_DI1_D0_CS__DI1_D0_CS IOMUX_PAD(0x6b4, 0x2b4, 0, 0x0000, 0, 0) | ||
557 | #define _MX51_PAD_DI1_D0_CS__GPIO3_3 IOMUX_PAD(0x6b4, 0x2b4, 4, 0x0980, 1, 0) | ||
558 | #define _MX51_PAD_DI1_D1_CS__DI1_D1_CS IOMUX_PAD(0x6b8, 0x2b8, 0, 0x0000, 0, 0) | ||
559 | #define _MX51_PAD_DI1_D1_CS__DISP1_PIN14 IOMUX_PAD(0x6b8, 0x2b8, 2, 0x0000, 0, 0) | ||
560 | #define _MX51_PAD_DI1_D1_CS__DISP1_PIN5 IOMUX_PAD(0x6b8, 0x2b8, 3, 0x0000, 0, 0) | ||
561 | #define _MX51_PAD_DI1_D1_CS__GPIO3_4 IOMUX_PAD(0x6b8, 0x2b8, 4, 0x0984, 1, 0) | ||
562 | #define _MX51_PAD_DISPB2_SER_DIN__DISP1_PIN1 IOMUX_PAD(0x6bc, 0x2bc, 2, 0x09a4, 1, 0) | ||
563 | #define _MX51_PAD_DISPB2_SER_DIN__DISPB2_SER_DIN IOMUX_PAD(0x6bc, 0x2bc, 0, 0x09c4, 0, 0) | ||
564 | #define _MX51_PAD_DISPB2_SER_DIN__GPIO3_5 IOMUX_PAD(0x6bc, 0x2bc, 4, 0x0988, 1, 0) | ||
565 | #define _MX51_PAD_DISPB2_SER_DIO__DISP1_PIN6 IOMUX_PAD(0x6c0, 0x2c0, 3, 0x0000, 0, 0) | ||
566 | #define _MX51_PAD_DISPB2_SER_DIO__DISPB2_SER_DIO IOMUX_PAD(0x6c0, 0x2c0, 0, 0x09c4, 1, 0) | ||
567 | #define _MX51_PAD_DISPB2_SER_DIO__GPIO3_6 IOMUX_PAD(0x6c0, 0x2c0, 4, 0x098c, 1, 0) | ||
568 | #define _MX51_PAD_DISPB2_SER_CLK__DISP1_PIN17 IOMUX_PAD(0x6c4, 0x2c4, 2, 0x0000, 0, 0) | ||
569 | #define _MX51_PAD_DISPB2_SER_CLK__DISP1_PIN7 IOMUX_PAD(0x6c4, 0x2c4, 3, 0x0000, 0, 0) | ||
570 | #define _MX51_PAD_DISPB2_SER_CLK__DISPB2_SER_CLK IOMUX_PAD(0x6c4, 0x2c4, 0, 0x0000, 0, 0) | ||
571 | #define _MX51_PAD_DISPB2_SER_CLK__GPIO3_7 IOMUX_PAD(0x6c4, 0x2c4, 4, 0x0990, 1, 0) | ||
572 | #define _MX51_PAD_DISPB2_SER_RS__DISP1_EXT_CLK IOMUX_PAD(0x6c8, 0x2c8, 2, 0x0000, 0, 0) | ||
573 | #define _MX51_PAD_DISPB2_SER_RS__DISP1_PIN16 IOMUX_PAD(0x6c8, 0x2c8, 2, 0x0000, 0, 0) | ||
574 | #define _MX51_PAD_DISPB2_SER_RS__DISP1_PIN8 IOMUX_PAD(0x6c8, 0x2c8, 3, 0x0000, 0, 0) | ||
575 | #define _MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS IOMUX_PAD(0x6c8, 0x2c8, 0, 0x0000, 0, 0) | ||
576 | #define _MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS IOMUX_PAD(0x6c8, 0x2c8, 0, 0x0000, 0, 0) | ||
577 | #define _MX51_PAD_DISPB2_SER_RS__GPIO3_8 IOMUX_PAD(0x6c8, 0x2c8, 4, 0x0994, 1, 0) | ||
578 | #define _MX51_PAD_DISP1_DAT0__DISP1_DAT0 IOMUX_PAD(0x6cc, 0x2cc, 0, 0x0000, 0, 0) | ||
579 | #define _MX51_PAD_DISP1_DAT1__DISP1_DAT1 IOMUX_PAD(0x6d0, 0x2d0, 0, 0x0000, 0, 0) | ||
580 | #define _MX51_PAD_DISP1_DAT2__DISP1_DAT2 IOMUX_PAD(0x6d4, 0x2d4, 0, 0x0000, 0, 0) | ||
581 | #define _MX51_PAD_DISP1_DAT3__DISP1_DAT3 IOMUX_PAD(0x6d8, 0x2d8, 0, 0x0000, 0, 0) | ||
582 | #define _MX51_PAD_DISP1_DAT4__DISP1_DAT4 IOMUX_PAD(0x6dc, 0x2dc, 0, 0x0000, 0, 0) | ||
583 | #define _MX51_PAD_DISP1_DAT5__DISP1_DAT5 IOMUX_PAD(0x6e0, 0x2e0, 0, 0x0000, 0, 0) | ||
584 | #define _MX51_PAD_DISP1_DAT6__BOOT_USB_SRC IOMUX_PAD(0x6e4, 0x2e4, 7, 0x0000, 0, 0) | ||
585 | #define _MX51_PAD_DISP1_DAT6__DISP1_DAT6 IOMUX_PAD(0x6e4, 0x2e4, 0, 0x0000, 0, 0) | ||
586 | #define _MX51_PAD_DISP1_DAT7__BOOT_EEPROM_CFG IOMUX_PAD(0x6e8, 0x2e8, 7, 0x0000, 0, 0) | ||
587 | #define _MX51_PAD_DISP1_DAT7__DISP1_DAT7 IOMUX_PAD(0x6e8, 0x2e8, 0, 0x0000, 0, 0) | ||
588 | #define _MX51_PAD_DISP1_DAT8__BOOT_SRC0 IOMUX_PAD(0x6ec, 0x2ec, 7, 0x0000, 0, 0) | ||
589 | #define _MX51_PAD_DISP1_DAT8__DISP1_DAT8 IOMUX_PAD(0x6ec, 0x2ec, 0, 0x0000, 0, 0) | ||
590 | #define _MX51_PAD_DISP1_DAT9__BOOT_SRC1 IOMUX_PAD(0x6f0, 0x2f0, 7, 0x0000, 0, 0) | ||
591 | #define _MX51_PAD_DISP1_DAT9__DISP1_DAT9 IOMUX_PAD(0x6f0, 0x2f0, 0, 0x0000, 0, 0) | ||
592 | #define _MX51_PAD_DISP1_DAT10__BOOT_SPARE_SIZE IOMUX_PAD(0x6f4, 0x2f4, 7, 0x0000, 0, 0) | ||
593 | #define _MX51_PAD_DISP1_DAT10__DISP1_DAT10 IOMUX_PAD(0x6f4, 0x2f4, 0, 0x0000, 0, 0) | ||
594 | #define _MX51_PAD_DISP1_DAT11__BOOT_LPB_FREQ2 IOMUX_PAD(0x6f8, 0x2f8, 7, 0x0000, 0, 0) | ||
595 | #define _MX51_PAD_DISP1_DAT11__DISP1_DAT11 IOMUX_PAD(0x6f8, 0x2f8, 0, 0x0000, 0, 0) | ||
596 | #define _MX51_PAD_DISP1_DAT12__BOOT_MLC_SEL IOMUX_PAD(0x6fc, 0x2fc, 7, 0x0000, 0, 0) | ||
597 | #define _MX51_PAD_DISP1_DAT12__DISP1_DAT12 IOMUX_PAD(0x6fc, 0x2fc, 0, 0x0000, 0, 0) | ||
598 | #define _MX51_PAD_DISP1_DAT13__BOOT_MEM_CTL0 IOMUX_PAD(0x700, 0x300, 7, 0x0000, 0, 0) | ||
599 | #define _MX51_PAD_DISP1_DAT13__DISP1_DAT13 IOMUX_PAD(0x700, 0x300, 0, 0x0000, 0, 0) | ||
600 | #define _MX51_PAD_DISP1_DAT14__BOOT_MEM_CTL1 IOMUX_PAD(0x704, 0x304, 7, 0x0000, 0, 0) | ||
601 | #define _MX51_PAD_DISP1_DAT14__DISP1_DAT14 IOMUX_PAD(0x704, 0x304, 0, 0x0000, 0, 0) | ||
602 | #define _MX51_PAD_DISP1_DAT15__BOOT_BUS_WIDTH IOMUX_PAD(0x708, 0x308, 7, 0x0000, 0, 0) | ||
603 | #define _MX51_PAD_DISP1_DAT15__DISP1_DAT15 IOMUX_PAD(0x708, 0x308, 0, 0x0000, 0, 0) | ||
604 | #define _MX51_PAD_DISP1_DAT16__BOOT_PAGE_SIZE0 IOMUX_PAD(0x70c, 0x30c, 7, 0x0000, 0, 0) | ||
605 | #define _MX51_PAD_DISP1_DAT16__DISP1_DAT16 IOMUX_PAD(0x70c, 0x30c, 0, 0x0000, 0, 0) | ||
606 | #define _MX51_PAD_DISP1_DAT17__BOOT_PAGE_SIZE1 IOMUX_PAD(0x710, 0x310, 7, 0x0000, 0, 0) | ||
607 | #define _MX51_PAD_DISP1_DAT17__DISP1_DAT17 IOMUX_PAD(0x710, 0x310, 0, 0x0000, 0, 0) | ||
608 | #define _MX51_PAD_DISP1_DAT18__BOOT_WEIM_MUXED0 IOMUX_PAD(0x714, 0x314, 7, 0x0000, 0, 0) | ||
609 | #define _MX51_PAD_DISP1_DAT18__DISP1_DAT18 IOMUX_PAD(0x714, 0x314, 0, 0x0000, 0, 0) | ||
610 | #define _MX51_PAD_DISP1_DAT18__DISP2_PIN11 IOMUX_PAD(0x714, 0x314, 5, 0x0000, 0, 0) | ||
611 | #define _MX51_PAD_DISP1_DAT18__DISP2_PIN5 IOMUX_PAD(0x714, 0x314, 4, 0x0000, 0, 0) | ||
612 | #define _MX51_PAD_DISP1_DAT19__BOOT_WEIM_MUXED1 IOMUX_PAD(0x718, 0x318, 7, 0x0000, 0, 0) | ||
613 | #define _MX51_PAD_DISP1_DAT19__DISP1_DAT19 IOMUX_PAD(0x718, 0x318, 0, 0x0000, 0, 0) | ||
614 | #define _MX51_PAD_DISP1_DAT19__DISP2_PIN12 IOMUX_PAD(0x718, 0x318, 5, 0x0000, 0, 0) | ||
615 | #define _MX51_PAD_DISP1_DAT19__DISP2_PIN6 IOMUX_PAD(0x718, 0x318, 4, 0x0000, 0, 0) | ||
616 | #define _MX51_PAD_DISP1_DAT20__BOOT_MEM_TYPE0 IOMUX_PAD(0x71c, 0x31c, 7, 0x0000, 0, 0) | ||
617 | #define _MX51_PAD_DISP1_DAT20__DISP1_DAT20 IOMUX_PAD(0x71c, 0x31c, 0, 0x0000, 0, 0) | ||
618 | #define _MX51_PAD_DISP1_DAT20__DISP2_PIN13 IOMUX_PAD(0x71c, 0x31c, 5, 0x0000, 0, 0) | ||
619 | #define _MX51_PAD_DISP1_DAT20__DISP2_PIN7 IOMUX_PAD(0x71c, 0x31c, 4, 0x0000, 0, 0) | ||
620 | #define _MX51_PAD_DISP1_DAT21__BOOT_MEM_TYPE1 IOMUX_PAD(0x720, 0x320, 7, 0x0000, 0, 0) | ||
621 | #define _MX51_PAD_DISP1_DAT21__DISP1_DAT21 IOMUX_PAD(0x720, 0x320, 0, 0x0000, 0, 0) | ||
622 | #define _MX51_PAD_DISP1_DAT21__DISP2_PIN14 IOMUX_PAD(0x720, 0x320, 5, 0x0000, 0, 0) | ||
623 | #define _MX51_PAD_DISP1_DAT21__DISP2_PIN8 IOMUX_PAD(0x720, 0x320, 4, 0x0000, 0, 0) | ||
624 | #define _MX51_PAD_DISP1_DAT22__BOOT_LPB_FREQ0 IOMUX_PAD(0x724, 0x324, 7, 0x0000, 0, 0) | ||
625 | #define _MX51_PAD_DISP1_DAT22__DISP1_DAT22 IOMUX_PAD(0x724, 0x324, 0, 0x0000, 0, 0) | ||
626 | #define _MX51_PAD_DISP1_DAT22__DISP2_D0_CS IOMUX_PAD(0x724, 0x324, 6, 0x0000, 0, 0) | ||
627 | #define _MX51_PAD_DISP1_DAT22__DISP2_DAT16 IOMUX_PAD(0x724, 0x324, 5, 0x0000, 0, 0) | ||
628 | #define _MX51_PAD_DISP1_DAT23__BOOT_LPB_FREQ1 IOMUX_PAD(0x728, 0x328, 7, 0x0000, 0, 0) | ||
629 | #define _MX51_PAD_DISP1_DAT23__DISP1_DAT23 IOMUX_PAD(0x728, 0x328, 0, 0x0000, 0, 0) | ||
630 | #define _MX51_PAD_DISP1_DAT23__DISP2_D1_CS IOMUX_PAD(0x728, 0x328, 6, 0x0000, 0, 0) | ||
631 | #define _MX51_PAD_DISP1_DAT23__DISP2_DAT17 IOMUX_PAD(0x728, 0x328, 5, 0x0000, 0, 0) | ||
632 | #define _MX51_PAD_DISP1_DAT23__DISP2_SER_CS IOMUX_PAD(0x728, 0x328, 4, 0x0000, 0, 0) | ||
633 | #define _MX51_PAD_DI1_PIN3__DI1_PIN3 IOMUX_PAD(0x72c, 0x32c, 0, 0x0000, 0, 0) | ||
634 | #define _MX51_PAD_DI1_PIN2__DI1_PIN2 IOMUX_PAD(0x734, 0x330, 0, 0x0000, 0, 0) | ||
635 | #define _MX51_PAD_DI_GP2__DISP1_SER_CLK IOMUX_PAD(0x740, 0x338, 0, 0x0000, 0, 0) | ||
636 | #define _MX51_PAD_DI_GP2__DISP2_WAIT IOMUX_PAD(0x740, 0x338, 2, 0x09a8, 1, 0) | ||
637 | #define _MX51_PAD_DI_GP3__CSI1_DATA_EN IOMUX_PAD(0x744, 0x33c, 3, 0x09a0, 1, 0) | ||
638 | #define _MX51_PAD_DI_GP3__DISP1_SER_DIO IOMUX_PAD(0x744, 0x33c, 0, 0x09c0, 0, 0) | ||
639 | #define _MX51_PAD_DI_GP3__FEC_TX_ER IOMUX_PAD(0x744, 0x33c, 2, 0x0000, 0, 0) | ||
640 | #define _MX51_PAD_DI2_PIN4__CSI2_DATA_EN IOMUX_PAD(0x748, 0x340, 3, 0x099c, 1, 0) | ||
641 | #define _MX51_PAD_DI2_PIN4__DI2_PIN4 IOMUX_PAD(0x748, 0x340, 0, 0x0000, 0, 0) | ||
642 | #define _MX51_PAD_DI2_PIN4__FEC_CRS IOMUX_PAD(0x748, 0x340, 2, 0x0950, 1, 0) | ||
643 | #define _MX51_PAD_DI2_PIN2__DI2_PIN2 IOMUX_PAD(0x74c, 0x344, 0, 0x0000, 0, 0) | ||
644 | #define _MX51_PAD_DI2_PIN2__FEC_MDC IOMUX_PAD(0x74c, 0x344, 2, 0x0000, 0, 0) | ||
645 | #define _MX51_PAD_DI2_PIN3__DI2_PIN3 IOMUX_PAD(0x750, 0x348, 0, 0x0000, 0, 0) | ||
646 | #define _MX51_PAD_DI2_PIN3__FEC_MDIO IOMUX_PAD(0x750, 0x348, 2, 0x0954, 1, 0) | ||
647 | #define _MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK IOMUX_PAD(0x754, 0x34c, 0, 0x0000, 0, 0) | ||
648 | #define _MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 IOMUX_PAD(0x754, 0x34c, 2, 0x095c, 1, 0) | ||
649 | #define _MX51_PAD_DI_GP4__DI2_PIN15 IOMUX_PAD(0x758, 0x350, 4, 0x0000, 0, 0) | ||
650 | #define _MX51_PAD_DI_GP4__DISP1_SER_DIN IOMUX_PAD(0x758, 0x350, 0, 0x09c0, 1, 0) | ||
651 | #define _MX51_PAD_DI_GP4__DISP2_PIN1 IOMUX_PAD(0x758, 0x350, 3, 0x0000, 0, 0) | ||
652 | #define _MX51_PAD_DI_GP4__FEC_RDATA2 IOMUX_PAD(0x758, 0x350, 2, 0x0960, 1, 0) | ||
653 | #define _MX51_PAD_DISP2_DAT0__DISP2_DAT0 IOMUX_PAD(0x75c, 0x354, 0, 0x0000, 0, 0) | ||
654 | #define _MX51_PAD_DISP2_DAT0__FEC_RDATA3 IOMUX_PAD(0x75c, 0x354, 2, 0x0964, 1, 0) | ||
655 | #define _MX51_PAD_DISP2_DAT0__KEY_COL6 IOMUX_PAD(0x75c, 0x354, 4, 0x09c8, 1, 0) | ||
656 | #define _MX51_PAD_DISP2_DAT0__UART3_RXD IOMUX_PAD(0x75c, 0x354, 5, 0x09f4, 8, 0) | ||
657 | #define _MX51_PAD_DISP2_DAT0__USBH3_CLK IOMUX_PAD(0x75c, 0x354, 3, 0x09f8, 1, 0) | ||
658 | #define _MX51_PAD_DISP2_DAT1__DISP2_DAT1 IOMUX_PAD(0x760, 0x358, 0, 0x0000, 0, 0) | ||
659 | #define _MX51_PAD_DISP2_DAT1__FEC_RX_ER IOMUX_PAD(0x760, 0x358, 2, 0x0970, 1, 0) | ||
660 | #define _MX51_PAD_DISP2_DAT1__KEY_COL7 IOMUX_PAD(0x760, 0x358, 4, 0x09cc, 1, 0) | ||
661 | #define _MX51_PAD_DISP2_DAT1__UART3_TXD IOMUX_PAD(0x760, 0x358, 5, 0x0000, 0, 0) | ||
662 | #define _MX51_PAD_DISP2_DAT1__USBH3_DIR IOMUX_PAD(0x760, 0x358, 3, 0x0a1c, 1, 0) | ||
663 | #define _MX51_PAD_DISP2_DAT2__DISP2_DAT2 IOMUX_PAD(0x764, 0x35c, 0, 0x0000, 0, 0) | ||
664 | #define _MX51_PAD_DISP2_DAT3__DISP2_DAT3 IOMUX_PAD(0x768, 0x360, 0, 0x0000, 0, 0) | ||
665 | #define _MX51_PAD_DISP2_DAT4__DISP2_DAT4 IOMUX_PAD(0x76c, 0x364, 0, 0x0000, 0, 0) | ||
666 | #define _MX51_PAD_DISP2_DAT5__DISP2_DAT5 IOMUX_PAD(0x770, 0x368, 0, 0x0000, 0, 0) | ||
667 | #define _MX51_PAD_DISP2_DAT6__DISP2_DAT6 IOMUX_PAD(0x774, 0x36c, 0, 0x0000, 0, 0) | ||
668 | #define _MX51_PAD_DISP2_DAT6__FEC_TDATA1 IOMUX_PAD(0x774, 0x36c, 2, 0x0000, 0, 0) | ||
669 | #define _MX51_PAD_DISP2_DAT6__GPIO1_19 IOMUX_PAD(0x774, 0x36c, 5, 0x0000, 0, 0) | ||
670 | #define _MX51_PAD_DISP2_DAT6__KEY_ROW4 IOMUX_PAD(0x774, 0x36c, 4, 0x09d0, 1, 0) | ||
671 | #define _MX51_PAD_DISP2_DAT6__USBH3_STP IOMUX_PAD(0x774, 0x36c, 3, 0x0a24, 1, 0) | ||
672 | #define _MX51_PAD_DISP2_DAT7__DISP2_DAT7 IOMUX_PAD(0x778, 0x370, 0, 0x0000, 0, 0) | ||
673 | #define _MX51_PAD_DISP2_DAT7__FEC_TDATA2 IOMUX_PAD(0x778, 0x370, 2, 0x0000, 0, 0) | ||
674 | #define _MX51_PAD_DISP2_DAT7__GPIO1_29 IOMUX_PAD(0x778, 0x370, 5, 0x0000, 0, 0) | ||
675 | #define _MX51_PAD_DISP2_DAT7__KEY_ROW5 IOMUX_PAD(0x778, 0x370, 4, 0x09d4, 1, 0) | ||
676 | #define _MX51_PAD_DISP2_DAT7__USBH3_NXT IOMUX_PAD(0x778, 0x370, 3, 0x0a20, 1, 0) | ||
677 | #define _MX51_PAD_DISP2_DAT8__DISP2_DAT8 IOMUX_PAD(0x77c, 0x374, 0, 0x0000, 0, 0) | ||
678 | #define _MX51_PAD_DISP2_DAT8__FEC_TDATA3 IOMUX_PAD(0x77c, 0x374, 2, 0x0000, 0, 0) | ||
679 | #define _MX51_PAD_DISP2_DAT8__GPIO1_30 IOMUX_PAD(0x77c, 0x374, 5, 0x0000, 0, 0) | ||
680 | #define _MX51_PAD_DISP2_DAT8__KEY_ROW6 IOMUX_PAD(0x77c, 0x374, 4, 0x09d8, 1, 0) | ||
681 | #define _MX51_PAD_DISP2_DAT8__USBH3_DATA0 IOMUX_PAD(0x77c, 0x374, 3, 0x09fc, 1, 0) | ||
682 | #define _MX51_PAD_DISP2_DAT9__AUD6_RXC IOMUX_PAD(0x780, 0x378, 4, 0x08f4, 1, 0) | ||
683 | #define _MX51_PAD_DISP2_DAT9__DISP2_DAT9 IOMUX_PAD(0x780, 0x378, 0, 0x0000, 0, 0) | ||
684 | #define _MX51_PAD_DISP2_DAT9__FEC_TX_EN IOMUX_PAD(0x780, 0x378, 2, 0x0000, 0, 0) | ||
685 | #define _MX51_PAD_DISP2_DAT9__GPIO1_31 IOMUX_PAD(0x780, 0x378, 5, 0x0000, 0, 0) | ||
686 | #define _MX51_PAD_DISP2_DAT9__USBH3_DATA1 IOMUX_PAD(0x780, 0x378, 3, 0x0a00, 1, 0) | ||
687 | #define _MX51_PAD_DISP2_DAT10__DISP2_DAT10 IOMUX_PAD(0x784, 0x37c, 0, 0x0000, 0, 0) | ||
688 | #define _MX51_PAD_DISP2_DAT10__DISP2_SER_CS IOMUX_PAD(0x784, 0x37c, 5, 0x0000, 0, 0) | ||
689 | #define _MX51_PAD_DISP2_DAT10__FEC_COL IOMUX_PAD(0x784, 0x37c, 2, 0x094c, 1, 0) | ||
690 | #define _MX51_PAD_DISP2_DAT10__KEY_ROW7 IOMUX_PAD(0x784, 0x37c, 4, 0x09dc, 1, 0) | ||
691 | #define _MX51_PAD_DISP2_DAT10__USBH3_DATA2 IOMUX_PAD(0x784, 0x37c, 3, 0x0a04, 1, 0) | ||
692 | #define _MX51_PAD_DISP2_DAT11__AUD6_TXD IOMUX_PAD(0x788, 0x380, 4, 0x08f0, 1, 0) | ||
693 | #define _MX51_PAD_DISP2_DAT11__DISP2_DAT11 IOMUX_PAD(0x788, 0x380, 0, 0x0000, 0, 0) | ||
694 | #define _MX51_PAD_DISP2_DAT11__FEC_RX_CLK IOMUX_PAD(0x788, 0x380, 2, 0x0968, 1, 0) | ||
695 | #define _MX51_PAD_DISP2_DAT11__GPIO1_10 IOMUX_PAD(0x788, 0x380, 7, 0x0000, 0, 0) | ||
696 | #define _MX51_PAD_DISP2_DAT11__USBH3_DATA3 IOMUX_PAD(0x788, 0x380, 3, 0x0a08, 1, 0) | ||
697 | #define _MX51_PAD_DISP2_DAT12__AUD6_RXD IOMUX_PAD(0x78c, 0x384, 4, 0x08ec, 1, 0) | ||
698 | #define _MX51_PAD_DISP2_DAT12__DISP2_DAT12 IOMUX_PAD(0x78c, 0x384, 0, 0x0000, 0, 0) | ||
699 | #define _MX51_PAD_DISP2_DAT12__FEC_RX_DV IOMUX_PAD(0x78c, 0x384, 2, 0x096c, 1, 0) | ||
700 | #define _MX51_PAD_DISP2_DAT12__USBH3_DATA4 IOMUX_PAD(0x78c, 0x384, 3, 0x0a0c, 1, 0) | ||
701 | #define _MX51_PAD_DISP2_DAT13__AUD6_TXC IOMUX_PAD(0x790, 0x388, 4, 0x08fc, 1, 0) | ||
702 | #define _MX51_PAD_DISP2_DAT13__DISP2_DAT13 IOMUX_PAD(0x790, 0x388, 0, 0x0000, 0, 0) | ||
703 | #define _MX51_PAD_DISP2_DAT13__FEC_TX_CLK IOMUX_PAD(0x790, 0x388, 2, 0x0974, 1, 0) | ||
704 | #define _MX51_PAD_DISP2_DAT13__USBH3_DATA5 IOMUX_PAD(0x790, 0x388, 3, 0x0a10, 1, 0) | ||
705 | #define _MX51_PAD_DISP2_DAT14__AUD6_TXFS IOMUX_PAD(0x794, 0x38c, 4, 0x0900, 1, 0) | ||
706 | #define _MX51_PAD_DISP2_DAT14__DISP2_DAT14 IOMUX_PAD(0x794, 0x38c, 0, 0x0000, 0, 0) | ||
707 | #define _MX51_PAD_DISP2_DAT14__FEC_RDATA0 IOMUX_PAD(0x794, 0x38c, 2, 0x0958, 1, 0) | ||
708 | #define _MX51_PAD_DISP2_DAT14__USBH3_DATA6 IOMUX_PAD(0x794, 0x38c, 3, 0x0a14, 1, 0) | ||
709 | #define _MX51_PAD_DISP2_DAT15__AUD6_RXFS IOMUX_PAD(0x798, 0x390, 4, 0x08f8, 1, 0) | ||
710 | #define _MX51_PAD_DISP2_DAT15__DISP1_SER_CS IOMUX_PAD(0x798, 0x390, 5, 0x0000, 0, 0) | ||
711 | #define _MX51_PAD_DISP2_DAT15__DISP2_DAT15 IOMUX_PAD(0x798, 0x390, 0, 0x0000, 0, 0) | ||
712 | #define _MX51_PAD_DISP2_DAT15__FEC_TDATA0 IOMUX_PAD(0x798, 0x390, 2, 0x0000, 0, 0) | ||
713 | #define _MX51_PAD_DISP2_DAT15__USBH3_DATA7 IOMUX_PAD(0x798, 0x390, 3, 0x0a18, 1, 0) | ||
714 | #define _MX51_PAD_SD1_CMD__AUD5_RXFS IOMUX_PAD(0x79c, 0x394, 1, 0x08e0, 1, 0) | ||
715 | #define _MX51_PAD_SD1_CMD__CSPI_MOSI IOMUX_PAD(0x79c, 0x394, 2, 0x091c, 2, 0) | ||
716 | #define _MX51_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x79c, 0x394, 0x10, 0x0000, 0, 0) | ||
717 | #define _MX51_PAD_SD1_CLK__AUD5_RXC IOMUX_PAD(0x7a0, 0x398, 1, 0x08dc, 1, 0) | ||
718 | #define _MX51_PAD_SD1_CLK__CSPI_SCLK IOMUX_PAD(0x7a0, 0x398, 2, 0x0914, 2, 0) | ||
719 | #define _MX51_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x7a0, 0x398, 0x10, 0x0000, 0, 0) | ||
720 | #define _MX51_PAD_SD1_DATA0__AUD5_TXD IOMUX_PAD(0x7a4, 0x39c, 1, 0x08d8, 2, 0) | ||
721 | #define _MX51_PAD_SD1_DATA0__CSPI_MISO IOMUX_PAD(0x7a4, 0x39c, 2, 0x0918, 1, 0) | ||
722 | #define _MX51_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x7a4, 0x39c, 0x10, 0x0000, 0, 0) | ||
723 | #define _MX51_PAD_EIM_DA0__EIM_DA0 IOMUX_PAD(0x000, 0x01c, 0, 0x0000, 0, 0) | ||
724 | #define _MX51_PAD_EIM_DA1__EIM_DA1 IOMUX_PAD(0x000, 0x020, 0, 0x0000, 0, 0) | ||
725 | #define _MX51_PAD_EIM_DA2__EIM_DA2 IOMUX_PAD(0x000, 0x024, 0, 0x0000, 0, 0) | ||
726 | #define _MX51_PAD_EIM_DA3__EIM_DA3 IOMUX_PAD(0x000, 0x028, 0, 0x0000, 0, 0) | ||
727 | #define _MX51_PAD_SD1_DATA1__AUD5_RXD IOMUX_PAD(0x7a8, 0x3a0, 1, 0x08d4, 2, 0) | ||
728 | #define _MX51_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(0x7a8, 0x3a0, 0x10, 0x0000, 0, 0) | ||
729 | #define _MX51_PAD_EIM_DA4__EIM_DA4 IOMUX_PAD(0x000, 0x02c, 0, 0x0000, 0, 0) | ||
730 | #define _MX51_PAD_EIM_DA5__EIM_DA5 IOMUX_PAD(0x000, 0x030, 0, 0x0000, 0, 0) | ||
731 | #define _MX51_PAD_EIM_DA6__EIM_DA6 IOMUX_PAD(0x000, 0x034, 0, 0x0000, 0, 0) | ||
732 | #define _MX51_PAD_EIM_DA7__EIM_DA7 IOMUX_PAD(0x000, 0x038, 0, 0x0000, 0, 0) | ||
733 | #define _MX51_PAD_SD1_DATA2__AUD5_TXC IOMUX_PAD(0x7ac, 0x3a4, 1, 0x08e4, 2, 0) | ||
734 | #define _MX51_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x7ac, 0x3a4, 0x10, 0x0000, 0, 0) | ||
735 | #define _MX51_PAD_EIM_DA10__EIM_DA10 IOMUX_PAD(0x000, 0x044, 0, 0x0000, 0, 0) | ||
736 | #define _MX51_PAD_EIM_DA11__EIM_DA11 IOMUX_PAD(0x000, 0x048, 0, 0x0000, 0, 0) | ||
737 | #define _MX51_PAD_EIM_DA8__EIM_DA8 IOMUX_PAD(0x000, 0x03c, 0, 0x0000, 0, 0) | ||
738 | #define _MX51_PAD_EIM_DA9__EIM_DA9 IOMUX_PAD(0x000, 0x040, 0, 0x0000, 0, 0) | ||
739 | #define _MX51_PAD_SD1_DATA3__AUD5_TXFS IOMUX_PAD(0x7b0, 0x3a8, 1, 0x08e8, 2, 0) | ||
740 | #define _MX51_PAD_SD1_DATA3__CSPI_SS1 IOMUX_PAD(0x7b0, 0x3a8, 2, 0x0920, 1, 0) | ||
741 | #define _MX51_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x7b0, 0x3a8, 0x10, 0x0000, 0, 0) | ||
742 | #define _MX51_PAD_GPIO1_0__CSPI_SS2 IOMUX_PAD(0x7b4, 0x3ac, 2, 0x0924, 0, 0) | ||
743 | #define _MX51_PAD_GPIO1_0__GPIO1_0 IOMUX_PAD(0x7b4, 0x3ac, 1, 0x0000, 0, 0) | ||
744 | #define _MX51_PAD_GPIO1_0__SD1_CD IOMUX_PAD(0x7b4, 0x3ac, 0, 0x0000, 0, 0) | ||
745 | #define _MX51_PAD_GPIO1_1__CSPI_MISO IOMUX_PAD(0x7b8, 0x3b0, 2, 0x0918, 2, 0) | ||
746 | #define _MX51_PAD_GPIO1_1__GPIO1_1 IOMUX_PAD(0x7b8, 0x3b0, 1, 0x0000, 0, 0) | ||
747 | #define _MX51_PAD_GPIO1_1__SD1_WP IOMUX_PAD(0x7b8, 0x3b0, 0, 0x0000, 0, 0) | ||
748 | #define _MX51_PAD_EIM_DA12__EIM_DA12 IOMUX_PAD(0x000, 0x04c, 0, 0x0000, 0, 0) | ||
749 | #define _MX51_PAD_EIM_DA13__EIM_DA13 IOMUX_PAD(0x000, 0x050, 0, 0x0000, 0, 0) | ||
750 | #define _MX51_PAD_EIM_DA14__EIM_DA14 IOMUX_PAD(0x000, 0x054, 0, 0x0000, 0, 0) | ||
751 | #define _MX51_PAD_EIM_DA15__EIM_DA15 IOMUX_PAD(0x000, 0x058, 0, 0x0000, 0, 0) | ||
752 | #define _MX51_PAD_SD2_CMD__CSPI_MOSI IOMUX_PAD(0x000, 0x3b4, 2, 0x091c, 3, 0) | ||
753 | #define _MX51_PAD_SD2_CMD__I2C1_SCL IOMUX_PAD(0x7bc, 0x3b4, 0x11, 0x09b0, 2, 0) | ||
754 | #define _MX51_PAD_SD2_CMD__SD2_CMD IOMUX_PAD(0x7bc, 0x3b4, 0x10, 0x0000, 0, 0) | ||
755 | #define _MX51_PAD_SD2_CLK__CSPI_SCLK IOMUX_PAD(0x7c0, 0x3b8, 2, 0x0914, 3, 0) | ||
756 | #define _MX51_PAD_SD2_CLK__I2C1_SDA IOMUX_PAD(0x7c0, 0x3b8, 0x11, 0x09b4, 2, 0) | ||
757 | #define _MX51_PAD_SD2_CLK__SD2_CLK IOMUX_PAD(0x7c0, 0x3b8, 0x10, 0x0000, 0, 0) | ||
758 | #define _MX51_PAD_SD2_DATA0__CSPI_MISO IOMUX_PAD(0x7c4, 0x3bc, 2, 0x0918, 3, 0) | ||
759 | #define _MX51_PAD_SD2_DATA0__SD1_DAT4 IOMUX_PAD(0x7c4, 0x3bc, 1, 0x0000, 0, 0) | ||
760 | #define _MX51_PAD_SD2_DATA0__SD2_DATA0 IOMUX_PAD(0x7c4, 0x3bc, 0x10, 0x0000, 0, 0) | ||
761 | #define _MX51_PAD_SD2_DATA1__SD1_DAT5 IOMUX_PAD(0x7c8, 0x3c0, 1, 0x0000, 0, 0) | ||
762 | #define _MX51_PAD_SD2_DATA1__SD2_DATA1 IOMUX_PAD(0x7c8, 0x3c0, 0x10, 0x0000, 0, 0) | ||
763 | #define _MX51_PAD_SD2_DATA1__USBH3_H2_DP IOMUX_PAD(0x7c8, 0x3c0, 2, 0x0000, 0, 0) | ||
764 | #define _MX51_PAD_SD2_DATA2__SD1_DAT6 IOMUX_PAD(0x7cc, 0x3c4, 1, 0x0000, 0, 0) | ||
765 | #define _MX51_PAD_SD2_DATA2__SD2_DATA2 IOMUX_PAD(0x7cc, 0x3c4, 0x10, 0x0000, 0, 0) | ||
766 | #define _MX51_PAD_SD2_DATA2__USBH3_H2_DM IOMUX_PAD(0x7cc, 0x3c4, 2, 0x0000, 0, 0) | ||
767 | #define _MX51_PAD_SD2_DATA3__CSPI_SS2 IOMUX_PAD(0x7d0, 0x3c8, 2, 0x0924, 1, 0) | ||
768 | #define _MX51_PAD_SD2_DATA3__SD1_DAT7 IOMUX_PAD(0x7d0, 0x3c8, 1, 0x0000, 0, 0) | ||
769 | #define _MX51_PAD_SD2_DATA3__SD2_DATA3 IOMUX_PAD(0x7d0, 0x3c8, 0x10, 0x0000, 0, 0) | ||
770 | #define _MX51_PAD_GPIO1_2__CCM_OUT_2 IOMUX_PAD(0x7d4, 0x3cc, 5, 0x0000, 0, 0) | ||
771 | #define _MX51_PAD_GPIO1_2__GPIO1_2 IOMUX_PAD(0x7d4, 0x3cc, 0, 0x0000, 0, 0) | ||
772 | #define _MX51_PAD_GPIO1_2__I2C2_SCL IOMUX_PAD(0x7d4, 0x3cc, 0x12, 0x09b8, 3, 0) | ||
773 | #define _MX51_PAD_GPIO1_2__PLL1_BYP IOMUX_PAD(0x7d4, 0x3cc, 7, 0x090c, 1, 0) | ||
774 | #define _MX51_PAD_GPIO1_2__PWM1_PWMO IOMUX_PAD(0x7d4, 0x3cc, 1, 0x0000, 0, 0) | ||
775 | #define _MX51_PAD_GPIO1_3__GPIO1_3 IOMUX_PAD(0x7d8, 0x3d0, 0, 0x0000, 0, 0) | ||
776 | #define _MX51_PAD_GPIO1_3__I2C2_SDA IOMUX_PAD(0x7d8, 0x3d0, 0x12, 0x09bc, 3, 0) | ||
777 | #define _MX51_PAD_GPIO1_3__PLL2_BYP IOMUX_PAD(0x7d8, 0x3d0, 7, 0x0910, 1, 0) | ||
778 | #define _MX51_PAD_GPIO1_3__PWM2_PWMO IOMUX_PAD(0x7d8, 0x3d0, 1, 0x0000, 0, 0) | ||
779 | #define _MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ IOMUX_PAD(0x7fc, 0x3d4, 0, 0x0000, 0, 0) | ||
780 | #define _MX51_PAD_PMIC_INT_REQ__PMIC_PMU_IRQ_B IOMUX_PAD(0x7fc, 0x3d4, 1, 0x0000, 0, 0) | ||
781 | #define _MX51_PAD_GPIO1_4__DISP2_EXT_CLK IOMUX_PAD(0x804, 0x3d8, 4, 0x0908, 1, 0) | ||
782 | #define _MX51_PAD_GPIO1_4__EIM_RDY IOMUX_PAD(0x804, 0x3d8, 3, 0x0938, 1, 0) | ||
783 | #define _MX51_PAD_GPIO1_4__GPIO1_4 IOMUX_PAD(0x804, 0x3d8, 0, 0x0000, 0, 0) | ||
784 | #define _MX51_PAD_GPIO1_4__WDOG1_WDOG_B IOMUX_PAD(0x804, 0x3d8, 2, 0x0000, 0, 0) | ||
785 | #define _MX51_PAD_GPIO1_5__CSI2_MCLK IOMUX_PAD(0x808, 0x3dc, 6, 0x0000, 0, 0) | ||
786 | #define _MX51_PAD_GPIO1_5__DISP2_PIN16 IOMUX_PAD(0x808, 0x3dc, 3, 0x0000, 0, 0) | ||
787 | #define _MX51_PAD_GPIO1_5__GPIO1_5 IOMUX_PAD(0x808, 0x3dc, 0, 0x0000, 0, 0) | ||
788 | #define _MX51_PAD_GPIO1_5__WDOG2_WDOG_B IOMUX_PAD(0x808, 0x3dc, 2, 0x0000, 0, 0) | ||
789 | #define _MX51_PAD_GPIO1_6__DISP2_PIN17 IOMUX_PAD(0x80c, 0x3e0, 4, 0x0000, 0, 0) | ||
790 | #define _MX51_PAD_GPIO1_6__GPIO1_6 IOMUX_PAD(0x80c, 0x3e0, 0, 0x0000, 0, 0) | ||
791 | #define _MX51_PAD_GPIO1_6__REF_EN_B IOMUX_PAD(0x80c, 0x3e0, 3, 0x0000, 0, 0) | ||
792 | #define _MX51_PAD_GPIO1_7__CCM_OUT_0 IOMUX_PAD(0x810, 0x3e4, 3, 0x0000, 0, 0) | ||
793 | #define _MX51_PAD_GPIO1_7__GPIO1_7 IOMUX_PAD(0x810, 0x3e4, 0, 0x0000, 0, 0) | ||
794 | #define _MX51_PAD_GPIO1_7__SD2_WP IOMUX_PAD(0x810, 0x3e4, 6, 0x0000, 0, 0) | ||
795 | #define _MX51_PAD_GPIO1_7__SPDIF_OUT1 IOMUX_PAD(0x810, 0x3e4, 2, 0x0000, 0, 0) | ||
796 | #define _MX51_PAD_GPIO1_8__CSI2_DATA_EN IOMUX_PAD(0x814, 0x3e8, 2, 0x099c, 2, 0) | ||
797 | #define _MX51_PAD_GPIO1_8__GPIO1_8 IOMUX_PAD(0x814, 0x3e8, 0, 0x0000, 0, 0) | ||
798 | #define _MX51_PAD_GPIO1_8__SD2_CD IOMUX_PAD(0x814, 0x3e8, 6, 0x0000, 0, 0) | ||
799 | #define _MX51_PAD_GPIO1_8__USBH3_PWR IOMUX_PAD(0x814, 0x3e8, 1, 0x0000, 0, 0) | ||
800 | #define _MX51_PAD_GPIO1_9__CCM_OUT_1 IOMUX_PAD(0x818, 0x3ec, 3, 0x0000, 0, 0) | ||
801 | #define _MX51_PAD_GPIO1_9__DISP2_D1_CS IOMUX_PAD(0x818, 0x3ec, 2, 0x0000, 0, 0) | ||
802 | #define _MX51_PAD_GPIO1_9__DISP2_SER_CS IOMUX_PAD(0x818, 0x3ec, 7, 0x0000, 0, 0) | ||
803 | #define _MX51_PAD_GPIO1_9__GPIO1_9 IOMUX_PAD(0x818, 0x3ec, 0, 0x0000, 0, 0) | ||
804 | #define _MX51_PAD_GPIO1_9__SD2_LCTL IOMUX_PAD(0x818, 0x3ec, 6, 0x0000, 0, 0) | ||
805 | #define _MX51_PAD_GPIO1_9__USBH3_OC IOMUX_PAD(0x818, 0x3ec, 1, 0x0000, 0, 0) | ||
806 | |||
807 | /* The same pins as above but with the default pad control values applied */ | ||
808 | #define MX51_PAD_EIM_D16__AUD4_RXFS (_MX51_PAD_EIM_D16__AUD4_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
809 | #define MX51_PAD_EIM_D16__AUD5_TXD (_MX51_PAD_EIM_D16__AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
810 | #define MX51_PAD_EIM_D16__EIM_D16 (_MX51_PAD_EIM_D16__EIM_D16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
811 | #define MX51_PAD_EIM_D16__GPIO2_0 (_MX51_PAD_EIM_D16__GPIO2_0 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
812 | #define MX51_PAD_EIM_D16__I2C1_SDA (_MX51_PAD_EIM_D16__I2C1_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
813 | #define MX51_PAD_EIM_D16__UART2_CTS (_MX51_PAD_EIM_D16__UART2_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
814 | #define MX51_PAD_EIM_D16__USBH2_DATA0 (_MX51_PAD_EIM_D16__USBH2_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
815 | #define MX51_PAD_EIM_D17__AUD5_RXD (_MX51_PAD_EIM_D17__AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
816 | #define MX51_PAD_EIM_D17__EIM_D17 (_MX51_PAD_EIM_D17__EIM_D17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
817 | #define MX51_PAD_EIM_D17__GPIO2_1 (_MX51_PAD_EIM_D17__GPIO2_1 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
818 | #define MX51_PAD_EIM_D17__UART2_RXD (_MX51_PAD_EIM_D17__UART2_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
819 | #define MX51_PAD_EIM_D17__UART3_CTS (_MX51_PAD_EIM_D17__UART3_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
820 | #define MX51_PAD_EIM_D17__USBH2_DATA1 (_MX51_PAD_EIM_D17__USBH2_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
821 | #define MX51_PAD_EIM_D18__AUD5_TXC (_MX51_PAD_EIM_D18__AUD5_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
822 | #define MX51_PAD_EIM_D18__EIM_D18 (_MX51_PAD_EIM_D18__EIM_D18 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
823 | #define MX51_PAD_EIM_D18__GPIO2_2 (_MX51_PAD_EIM_D18__GPIO2_2 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
824 | #define MX51_PAD_EIM_D18__UART2_TXD (_MX51_PAD_EIM_D18__UART2_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
825 | #define MX51_PAD_EIM_D18__UART3_RTS (_MX51_PAD_EIM_D18__UART3_RTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
826 | #define MX51_PAD_EIM_D18__USBH2_DATA2 (_MX51_PAD_EIM_D18__USBH2_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
827 | #define MX51_PAD_EIM_D19__AUD4_RXC (_MX51_PAD_EIM_D19__AUD4_RXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
828 | #define MX51_PAD_EIM_D19__AUD5_TXFS (_MX51_PAD_EIM_D19__AUD5_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
829 | #define MX51_PAD_EIM_D19__EIM_D19 (_MX51_PAD_EIM_D19__EIM_D19 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
830 | #define MX51_PAD_EIM_D19__GPIO2_3 (_MX51_PAD_EIM_D19__GPIO2_3 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
831 | #define MX51_PAD_EIM_D19__I2C1_SCL (_MX51_PAD_EIM_D19__I2C1_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
832 | #define MX51_PAD_EIM_D19__UART2_RTS (_MX51_PAD_EIM_D19__UART2_RTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
833 | #define MX51_PAD_EIM_D19__USBH2_DATA3 (_MX51_PAD_EIM_D19__USBH2_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
834 | #define MX51_PAD_EIM_D20__AUD4_TXD (_MX51_PAD_EIM_D20__AUD4_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
835 | #define MX51_PAD_EIM_D20__EIM_D20 (_MX51_PAD_EIM_D20__EIM_D20 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
836 | #define MX51_PAD_EIM_D20__GPIO2_4 (_MX51_PAD_EIM_D20__GPIO2_4 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
837 | #define MX51_PAD_EIM_D20__SRTC_ALARM_DEB (_MX51_PAD_EIM_D20__SRTC_ALARM_DEB | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
838 | #define MX51_PAD_EIM_D20__USBH2_DATA4 (_MX51_PAD_EIM_D20__USBH2_DATA4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
839 | #define MX51_PAD_EIM_D21__AUD4_RXD (_MX51_PAD_EIM_D21__AUD4_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
840 | #define MX51_PAD_EIM_D21__EIM_D21 (_MX51_PAD_EIM_D21__EIM_D21 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
841 | #define MX51_PAD_EIM_D21__GPIO2_5 (_MX51_PAD_EIM_D21__GPIO2_5 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
842 | #define MX51_PAD_EIM_D21__SRTC_ALARM_DEB (_MX51_PAD_EIM_D21__SRTC_ALARM_DEB | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
843 | #define MX51_PAD_EIM_D21__USBH2_DATA5 (_MX51_PAD_EIM_D21__USBH2_DATA5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
844 | #define MX51_PAD_EIM_D22__AUD4_TXC (_MX51_PAD_EIM_D22__AUD4_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
845 | #define MX51_PAD_EIM_D22__EIM_D22 (_MX51_PAD_EIM_D22__EIM_D22 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
846 | #define MX51_PAD_EIM_D22__GPIO2_6 (_MX51_PAD_EIM_D22__GPIO2_6 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
847 | #define MX51_PAD_EIM_D22__USBH2_DATA6 (_MX51_PAD_EIM_D22__USBH2_DATA6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
848 | #define MX51_PAD_EIM_D23__AUD4_TXFS (_MX51_PAD_EIM_D23__AUD4_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
849 | #define MX51_PAD_EIM_D23__EIM_D23 (_MX51_PAD_EIM_D23__EIM_D23 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
850 | #define MX51_PAD_EIM_D23__GPIO2_7 (_MX51_PAD_EIM_D23__GPIO2_7 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
851 | #define MX51_PAD_EIM_D23__SPDIF_OUT1 (_MX51_PAD_EIM_D23__SPDIF_OUT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
852 | #define MX51_PAD_EIM_D23__USBH2_DATA7 (_MX51_PAD_EIM_D23__USBH2_DATA7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
853 | #define MX51_PAD_EIM_D24__AUD6_RXFS (_MX51_PAD_EIM_D24__AUD6_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
854 | #define MX51_PAD_EIM_D24__EIM_D24 (_MX51_PAD_EIM_D24__EIM_D24 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
855 | #define MX51_PAD_EIM_D24__GPIO2_8 (_MX51_PAD_EIM_D24__GPIO2_8 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
856 | #define MX51_PAD_EIM_D24__I2C2_SDA (_MX51_PAD_EIM_D24__I2C2_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
857 | #define MX51_PAD_EIM_D24__UART3_CTS (_MX51_PAD_EIM_D24__UART3_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
858 | #define MX51_PAD_EIM_D24__USBOTG_DATA0 (_MX51_PAD_EIM_D24__USBOTG_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
859 | #define MX51_PAD_EIM_D25__EIM_D25 (_MX51_PAD_EIM_D25__EIM_D25 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
860 | #define MX51_PAD_EIM_D25__KEY_COL6 (_MX51_PAD_EIM_D25__KEY_COL6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
861 | #define MX51_PAD_EIM_D25__UART2_CTS (_MX51_PAD_EIM_D25__UART2_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
862 | #define MX51_PAD_EIM_D25__UART3_RXD (_MX51_PAD_EIM_D25__UART3_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
863 | #define MX51_PAD_EIM_D25__USBOTG_DATA1 (_MX51_PAD_EIM_D25__USBOTG_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
864 | #define MX51_PAD_EIM_D26__EIM_D26 (_MX51_PAD_EIM_D26__EIM_D26 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
865 | #define MX51_PAD_EIM_D26__KEY_COL7 (_MX51_PAD_EIM_D26__KEY_COL7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
866 | #define MX51_PAD_EIM_D26__UART2_RTS (_MX51_PAD_EIM_D26__UART2_RTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
867 | #define MX51_PAD_EIM_D26__UART3_TXD (_MX51_PAD_EIM_D26__UART3_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
868 | #define MX51_PAD_EIM_D26__USBOTG_DATA2 (_MX51_PAD_EIM_D26__USBOTG_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
869 | #define MX51_PAD_EIM_D27__AUD6_RXC (_MX51_PAD_EIM_D27__AUD6_RXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
870 | #define MX51_PAD_EIM_D27__EIM_D27 (_MX51_PAD_EIM_D27__EIM_D27 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
871 | #define MX51_PAD_EIM_D27__GPIO2_9 (_MX51_PAD_EIM_D27__GPIO2_9 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
872 | #define MX51_PAD_EIM_D27__I2C2_SCL (_MX51_PAD_EIM_D27__I2C2_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
873 | #define MX51_PAD_EIM_D27__UART3_RTS (_MX51_PAD_EIM_D27__UART3_RTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
874 | #define MX51_PAD_EIM_D27__USBOTG_DATA3 (_MX51_PAD_EIM_D27__USBOTG_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
875 | #define MX51_PAD_EIM_D28__AUD6_TXD (_MX51_PAD_EIM_D28__AUD6_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
876 | #define MX51_PAD_EIM_D28__EIM_D28 (_MX51_PAD_EIM_D28__EIM_D28 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
877 | #define MX51_PAD_EIM_D28__KEY_ROW4 (_MX51_PAD_EIM_D28__KEY_ROW4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
878 | #define MX51_PAD_EIM_D28__USBOTG_DATA4 (_MX51_PAD_EIM_D28__USBOTG_DATA4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
879 | #define MX51_PAD_EIM_D29__AUD6_RXD (_MX51_PAD_EIM_D29__AUD6_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
880 | #define MX51_PAD_EIM_D29__EIM_D29 (_MX51_PAD_EIM_D29__EIM_D29 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
881 | #define MX51_PAD_EIM_D29__KEY_ROW5 (_MX51_PAD_EIM_D29__KEY_ROW5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
882 | #define MX51_PAD_EIM_D29__USBOTG_DATA5 (_MX51_PAD_EIM_D29__USBOTG_DATA5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
883 | #define MX51_PAD_EIM_D30__AUD6_TXC (_MX51_PAD_EIM_D30__AUD6_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
884 | #define MX51_PAD_EIM_D30__EIM_D30 (_MX51_PAD_EIM_D30__EIM_D30 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
885 | #define MX51_PAD_EIM_D30__KEY_ROW6 (_MX51_PAD_EIM_D30__KEY_ROW6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
886 | #define MX51_PAD_EIM_D30__USBOTG_DATA6 (_MX51_PAD_EIM_D30__USBOTG_DATA6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
887 | #define MX51_PAD_EIM_D31__AUD6_TXFS (_MX51_PAD_EIM_D31__AUD6_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
888 | #define MX51_PAD_EIM_D31__EIM_D31 (_MX51_PAD_EIM_D31__EIM_D31 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
889 | #define MX51_PAD_EIM_D31__KEY_ROW7 (_MX51_PAD_EIM_D31__KEY_ROW7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
890 | #define MX51_PAD_EIM_D31__USBOTG_DATA7 (_MX51_PAD_EIM_D31__USBOTG_DATA7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
891 | #define MX51_PAD_EIM_A16__EIM_A16 (_MX51_PAD_EIM_A16__EIM_A16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
892 | #define MX51_PAD_EIM_A16__GPIO2_10 (_MX51_PAD_EIM_A16__GPIO2_10 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
893 | #define MX51_PAD_EIM_A16__OSC_FREQ_SEL0 (_MX51_PAD_EIM_A16__OSC_FREQ_SEL0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
894 | #define MX51_PAD_EIM_A17__EIM_A17 (_MX51_PAD_EIM_A17__EIM_A17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
895 | #define MX51_PAD_EIM_A17__GPIO2_11 (_MX51_PAD_EIM_A17__GPIO2_11 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
896 | #define MX51_PAD_EIM_A17__OSC_FREQ_SEL1 (_MX51_PAD_EIM_A17__OSC_FREQ_SEL1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
897 | #define MX51_PAD_EIM_A18__BOOT_LPB0 (_MX51_PAD_EIM_A18__BOOT_LPB0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
898 | #define MX51_PAD_EIM_A18__EIM_A18 (_MX51_PAD_EIM_A18__EIM_A18 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
899 | #define MX51_PAD_EIM_A18__GPIO2_12 (_MX51_PAD_EIM_A18__GPIO2_12 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
900 | #define MX51_PAD_EIM_A19__BOOT_LPB1 (_MX51_PAD_EIM_A19__BOOT_LPB1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
901 | #define MX51_PAD_EIM_A19__EIM_A19 (_MX51_PAD_EIM_A19__EIM_A19 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
902 | #define MX51_PAD_EIM_A19__GPIO2_13 (_MX51_PAD_EIM_A19__GPIO2_13 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
903 | #define MX51_PAD_EIM_A20__BOOT_UART_SRC0 (_MX51_PAD_EIM_A20__BOOT_UART_SRC0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
904 | #define MX51_PAD_EIM_A20__EIM_A20 (_MX51_PAD_EIM_A20__EIM_A20 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
905 | #define MX51_PAD_EIM_A20__GPIO2_14 (_MX51_PAD_EIM_A20__GPIO2_14 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
906 | #define MX51_PAD_EIM_A21__BOOT_UART_SRC1 (_MX51_PAD_EIM_A21__BOOT_UART_SRC1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
907 | #define MX51_PAD_EIM_A21__EIM_A21 (_MX51_PAD_EIM_A21__EIM_A21 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
908 | #define MX51_PAD_EIM_A21__GPIO2_15 (_MX51_PAD_EIM_A21__GPIO2_15 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
909 | #define MX51_PAD_EIM_A22__EIM_A22 (_MX51_PAD_EIM_A22__EIM_A22 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
910 | #define MX51_PAD_EIM_A22__GPIO2_16 (_MX51_PAD_EIM_A22__GPIO2_16 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
911 | #define MX51_PAD_EIM_A23__BOOT_HPN_EN (_MX51_PAD_EIM_A23__BOOT_HPN_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
912 | #define MX51_PAD_EIM_A23__EIM_A23 (_MX51_PAD_EIM_A23__EIM_A23 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
913 | #define MX51_PAD_EIM_A23__GPIO2_17 (_MX51_PAD_EIM_A23__GPIO2_17 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
914 | #define MX51_PAD_EIM_A24__EIM_A24 (_MX51_PAD_EIM_A24__EIM_A24 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
915 | #define MX51_PAD_EIM_A24__GPIO2_18 (_MX51_PAD_EIM_A24__GPIO2_18 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
916 | #define MX51_PAD_EIM_A24__USBH2_CLK (_MX51_PAD_EIM_A24__USBH2_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
917 | #define MX51_PAD_EIM_A25__DISP1_PIN4 (_MX51_PAD_EIM_A25__DISP1_PIN4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
918 | #define MX51_PAD_EIM_A25__EIM_A25 (_MX51_PAD_EIM_A25__EIM_A25 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
919 | #define MX51_PAD_EIM_A25__GPIO2_19 (_MX51_PAD_EIM_A25__GPIO2_19 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
920 | #define MX51_PAD_EIM_A25__USBH2_DIR (_MX51_PAD_EIM_A25__USBH2_DIR | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
921 | #define MX51_PAD_EIM_A26__CSI1_DATA_EN (_MX51_PAD_EIM_A26__CSI1_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
922 | #define MX51_PAD_EIM_A26__DISP2_EXT_CLK (_MX51_PAD_EIM_A26__DISP2_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
923 | #define MX51_PAD_EIM_A26__EIM_A26 (_MX51_PAD_EIM_A26__EIM_A26 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
924 | #define MX51_PAD_EIM_A26__GPIO2_20 (_MX51_PAD_EIM_A26__GPIO2_20 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
925 | #define MX51_PAD_EIM_A26__USBH2_STP (_MX51_PAD_EIM_A26__USBH2_STP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
926 | #define MX51_PAD_EIM_A27__CSI2_DATA_EN (_MX51_PAD_EIM_A27__CSI2_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
927 | #define MX51_PAD_EIM_A27__DISP1_PIN1 (_MX51_PAD_EIM_A27__DISP1_PIN1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
928 | #define MX51_PAD_EIM_A27__EIM_A27 (_MX51_PAD_EIM_A27__EIM_A27 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
929 | #define MX51_PAD_EIM_A27__GPIO2_21 (_MX51_PAD_EIM_A27__GPIO2_21 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
930 | #define MX51_PAD_EIM_A27__USBH2_NXT (_MX51_PAD_EIM_A27__USBH2_NXT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
931 | #define MX51_PAD_EIM_EB0__EIM_EB0 (_MX51_PAD_EIM_EB0__EIM_EB0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
932 | #define MX51_PAD_EIM_EB1__EIM_EB1 (_MX51_PAD_EIM_EB1__EIM_EB1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
933 | #define MX51_PAD_EIM_EB2__AUD5_RXFS (_MX51_PAD_EIM_EB2__AUD5_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
934 | #define MX51_PAD_EIM_EB2__CSI1_D2 (_MX51_PAD_EIM_EB2__CSI1_D2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
935 | #define MX51_PAD_EIM_EB2__EIM_EB2 (_MX51_PAD_EIM_EB2__EIM_EB2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
936 | #define MX51_PAD_EIM_EB2__FEC_MDIO (_MX51_PAD_EIM_EB2__FEC_MDIO | \ | ||
937 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | PAD_CTL_PKE | PAD_CTL_SRE_FAST | \ | ||
938 | PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS)) | ||
939 | #define MX51_PAD_EIM_EB2__GPIO2_22 (_MX51_PAD_EIM_EB2__GPIO2_22 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
940 | #define MX51_PAD_EIM_EB2__GPT_CMPOUT1 (_MX51_PAD_EIM_EB2__GPT_CMPOUT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
941 | #define MX51_PAD_EIM_EB3__AUD5_RXC (_MX51_PAD_EIM_EB3__AUD5_RXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
942 | #define MX51_PAD_EIM_EB3__CSI1_D3 (_MX51_PAD_EIM_EB3__CSI1_D3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
943 | #define MX51_PAD_EIM_EB3__EIM_EB3 (_MX51_PAD_EIM_EB3__EIM_EB3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
944 | #define MX51_PAD_EIM_EB3__FEC_RDATA1 (_MX51_PAD_EIM_EB3__FEC_RDATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
945 | #define MX51_PAD_EIM_EB3__GPIO2_23 (_MX51_PAD_EIM_EB3__GPIO2_23 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
946 | #define MX51_PAD_EIM_EB3__GPT_CMPOUT2 (_MX51_PAD_EIM_EB3__GPT_CMPOUT2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
947 | #define MX51_PAD_EIM_OE__EIM_OE (_MX51_PAD_EIM_OE__EIM_OE | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
948 | #define MX51_PAD_EIM_OE__GPIO2_24 (_MX51_PAD_EIM_OE__GPIO2_24 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
949 | #define MX51_PAD_EIM_CS0__EIM_CS0 (_MX51_PAD_EIM_CS0__EIM_CS0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
950 | #define MX51_PAD_EIM_CS0__GPIO2_25 (_MX51_PAD_EIM_CS0__GPIO2_25 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
951 | #define MX51_PAD_EIM_CS1__EIM_CS1 (_MX51_PAD_EIM_CS1__EIM_CS1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
952 | #define MX51_PAD_EIM_CS1__GPIO2_26 (_MX51_PAD_EIM_CS1__GPIO2_26 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
953 | #define MX51_PAD_EIM_CS2__AUD5_TXD (_MX51_PAD_EIM_CS2__AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
954 | #define MX51_PAD_EIM_CS2__CSI1_D4 (_MX51_PAD_EIM_CS2__CSI1_D4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
955 | #define MX51_PAD_EIM_CS2__EIM_CS2 (_MX51_PAD_EIM_CS2__EIM_CS2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
956 | #define MX51_PAD_EIM_CS2__FEC_RDATA2 (_MX51_PAD_EIM_CS2__FEC_RDATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
957 | #define MX51_PAD_EIM_CS2__GPIO2_27 (_MX51_PAD_EIM_CS2__GPIO2_27 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
958 | #define MX51_PAD_EIM_CS2__USBOTG_STP (_MX51_PAD_EIM_CS2__USBOTG_STP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
959 | #define MX51_PAD_EIM_CS3__AUD5_RXD (_MX51_PAD_EIM_CS3__AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
960 | #define MX51_PAD_EIM_CS3__CSI1_D5 (_MX51_PAD_EIM_CS3__CSI1_D5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
961 | #define MX51_PAD_EIM_CS3__EIM_CS3 (_MX51_PAD_EIM_CS3__EIM_CS3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
962 | #define MX51_PAD_EIM_CS3__FEC_RDATA3 (_MX51_PAD_EIM_CS3__FEC_RDATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
963 | #define MX51_PAD_EIM_CS3__GPIO2_28 (_MX51_PAD_EIM_CS3__GPIO2_28 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
964 | #define MX51_PAD_EIM_CS3__USBOTG_NXT (_MX51_PAD_EIM_CS3__USBOTG_NXT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
965 | #define MX51_PAD_EIM_CS4__AUD5_TXC (_MX51_PAD_EIM_CS4__AUD5_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
966 | #define MX51_PAD_EIM_CS4__CSI1_D6 (_MX51_PAD_EIM_CS4__CSI1_D6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
967 | #define MX51_PAD_EIM_CS4__EIM_CS4 (_MX51_PAD_EIM_CS4__EIM_CS4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
968 | #define MX51_PAD_EIM_CS4__FEC_RX_ER (_MX51_PAD_EIM_CS4__FEC_RX_ER | MUX_PAD_CTRL(MX51_PAD_CTRL_2)) | ||
969 | #define MX51_PAD_EIM_CS4__GPIO2_29 (_MX51_PAD_EIM_CS4__GPIO2_29 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
970 | #define MX51_PAD_EIM_CS4__USBOTG_CLK (_MX51_PAD_EIM_CS4__USBOTG_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
971 | #define MX51_PAD_EIM_CS5__AUD5_TXFS (_MX51_PAD_EIM_CS5__AUD5_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
972 | #define MX51_PAD_EIM_CS5__CSI1_D7 (_MX51_PAD_EIM_CS5__CSI1_D7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
973 | #define MX51_PAD_EIM_CS5__DISP1_EXT_CLK (_MX51_PAD_EIM_CS5__DISP1_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
974 | #define MX51_PAD_EIM_CS5__EIM_CS5 (_MX51_PAD_EIM_CS5__EIM_CS5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
975 | #define MX51_PAD_EIM_CS5__FEC_CRS (_MX51_PAD_EIM_CS5__FEC_CRS | MUX_PAD_CTRL(MX51_PAD_CTRL_2)) | ||
976 | #define MX51_PAD_EIM_CS5__GPIO2_30 (_MX51_PAD_EIM_CS5__GPIO2_30 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
977 | #define MX51_PAD_EIM_CS5__USBOTG_DIR (_MX51_PAD_EIM_CS5__USBOTG_DIR | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
978 | #define MX51_PAD_EIM_DTACK__EIM_DTACK (_MX51_PAD_EIM_DTACK__EIM_DTACK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
979 | #define MX51_PAD_EIM_DTACK__GPIO2_31 (_MX51_PAD_EIM_DTACK__GPIO2_31 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
980 | #define MX51_PAD_EIM_LBA__EIM_LBA (_MX51_PAD_EIM_LBA__EIM_LBA | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
981 | #define MX51_PAD_EIM_LBA__GPIO3_1 (_MX51_PAD_EIM_LBA__GPIO3_1 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
982 | #define MX51_PAD_EIM_CRE__EIM_CRE (_MX51_PAD_EIM_CRE__EIM_CRE | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
983 | #define MX51_PAD_EIM_CRE__GPIO3_2 (_MX51_PAD_EIM_CRE__GPIO3_2 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
984 | #define MX51_PAD_DRAM_CS1__DRAM_CS1 (_MX51_PAD_DRAM_CS1__DRAM_CS1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
985 | #define MX51_PAD_NANDF_WE_B__GPIO3_3 (_MX51_PAD_NANDF_WE_B__GPIO3_3 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
986 | #define MX51_PAD_NANDF_WE_B__NANDF_WE_B (_MX51_PAD_NANDF_WE_B__NANDF_WE_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
987 | #define MX51_PAD_NANDF_WE_B__PATA_DIOW (_MX51_PAD_NANDF_WE_B__PATA_DIOW | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
988 | #define MX51_PAD_NANDF_WE_B__SD3_DATA0 (_MX51_PAD_NANDF_WE_B__SD3_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
989 | #define MX51_PAD_NANDF_RE_B__GPIO3_4 (_MX51_PAD_NANDF_RE_B__GPIO3_4 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
990 | #define MX51_PAD_NANDF_RE_B__NANDF_RE_B (_MX51_PAD_NANDF_RE_B__NANDF_RE_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
991 | #define MX51_PAD_NANDF_RE_B__PATA_DIOR (_MX51_PAD_NANDF_RE_B__PATA_DIOR | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
992 | #define MX51_PAD_NANDF_RE_B__SD3_DATA1 (_MX51_PAD_NANDF_RE_B__SD3_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
993 | #define MX51_PAD_NANDF_ALE__GPIO3_5 (_MX51_PAD_NANDF_ALE__GPIO3_5 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
994 | #define MX51_PAD_NANDF_ALE__NANDF_ALE (_MX51_PAD_NANDF_ALE__NANDF_ALE | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
995 | #define MX51_PAD_NANDF_ALE__PATA_BUFFER_EN (_MX51_PAD_NANDF_ALE__PATA_BUFFER_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
996 | #define MX51_PAD_NANDF_CLE__GPIO3_6 (_MX51_PAD_NANDF_CLE__GPIO3_6 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
997 | #define MX51_PAD_NANDF_CLE__NANDF_CLE (_MX51_PAD_NANDF_CLE__NANDF_CLE | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
998 | #define MX51_PAD_NANDF_CLE__PATA_RESET_B (_MX51_PAD_NANDF_CLE__PATA_RESET_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
999 | #define MX51_PAD_NANDF_WP_B__GPIO3_7 (_MX51_PAD_NANDF_WP_B__GPIO3_7 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1000 | #define MX51_PAD_NANDF_WP_B__NANDF_WP_B (_MX51_PAD_NANDF_WP_B__NANDF_WP_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1001 | #define MX51_PAD_NANDF_WP_B__PATA_DMACK (_MX51_PAD_NANDF_WP_B__PATA_DMACK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1002 | #define MX51_PAD_NANDF_WP_B__SD3_DATA2 (_MX51_PAD_NANDF_WP_B__SD3_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1003 | #define MX51_PAD_NANDF_RB0__ECSPI2_SS1 (_MX51_PAD_NANDF_RB0__ECSPI2_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1004 | #define MX51_PAD_NANDF_RB0__GPIO3_8 (_MX51_PAD_NANDF_RB0__GPIO3_8 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1005 | #define MX51_PAD_NANDF_RB0__NANDF_RB0 (_MX51_PAD_NANDF_RB0__NANDF_RB0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1006 | #define MX51_PAD_NANDF_RB0__PATA_DMARQ (_MX51_PAD_NANDF_RB0__PATA_DMARQ | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1007 | #define MX51_PAD_NANDF_RB0__SD3_DATA3 (_MX51_PAD_NANDF_RB0__SD3_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1008 | #define MX51_PAD_NANDF_RB1__CSPI_MOSI (_MX51_PAD_NANDF_RB1__CSPI_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1009 | #define MX51_PAD_NANDF_RB1__ECSPI2_RDY (_MX51_PAD_NANDF_RB1__ECSPI2_RDY | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1010 | #define MX51_PAD_NANDF_RB1__GPIO3_9 (_MX51_PAD_NANDF_RB1__GPIO3_9 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1011 | #define MX51_PAD_NANDF_RB1__NANDF_RB1 (_MX51_PAD_NANDF_RB1__NANDF_RB1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1012 | #define MX51_PAD_NANDF_RB1__PATA_IORDY (_MX51_PAD_NANDF_RB1__PATA_IORDY | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1013 | #define MX51_PAD_NANDF_RB1__SD4_CMD (_MX51_PAD_NANDF_RB1__SD4_CMD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1014 | #define MX51_PAD_NANDF_RB2__DISP2_WAIT (_MX51_PAD_NANDF_RB2__DISP2_WAIT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1015 | #define MX51_PAD_NANDF_RB2__ECSPI2_SCLK (_MX51_PAD_NANDF_RB2__ECSPI2_SCLK | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1016 | #define MX51_PAD_NANDF_RB2__FEC_COL (_MX51_PAD_NANDF_RB2__FEC_COL | MUX_PAD_CTRL(MX51_PAD_CTRL_2)) | ||
1017 | #define MX51_PAD_NANDF_RB2__GPIO3_10 (_MX51_PAD_NANDF_RB2__GPIO3_10 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1018 | #define MX51_PAD_NANDF_RB2__NANDF_RB2 (_MX51_PAD_NANDF_RB2__NANDF_RB2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1019 | #define MX51_PAD_NANDF_RB2__USBH3_H3_DP (_MX51_PAD_NANDF_RB2__USBH3_H3_DP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1020 | #define MX51_PAD_NANDF_RB2__USBH3_NXT (_MX51_PAD_NANDF_RB2__USBH3_NXT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1021 | #define MX51_PAD_NANDF_RB3__DISP1_WAIT (_MX51_PAD_NANDF_RB3__DISP1_WAIT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1022 | #define MX51_PAD_NANDF_RB3__ECSPI2_MISO (_MX51_PAD_NANDF_RB3__ECSPI2_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1023 | #define MX51_PAD_NANDF_RB3__FEC_RX_CLK (_MX51_PAD_NANDF_RB3__FEC_RX_CLK | MUX_PAD_CTRL(MX51_PAD_CTRL_2)) | ||
1024 | #define MX51_PAD_NANDF_RB3__GPIO3_11 (_MX51_PAD_NANDF_RB3__GPIO3_11 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1025 | #define MX51_PAD_NANDF_RB3__NANDF_RB3 (_MX51_PAD_NANDF_RB3__NANDF_RB3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1026 | #define MX51_PAD_NANDF_RB3__USBH3_CLK (_MX51_PAD_NANDF_RB3__USBH3_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1027 | #define MX51_PAD_NANDF_RB3__USBH3_H3_DM (_MX51_PAD_NANDF_RB3__USBH3_H3_DM | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1028 | #define MX51_PAD_GPIO_NAND__GPIO_NAND (_MX51_PAD_GPIO_NAND__GPIO_NAND | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1029 | #define MX51_PAD_GPIO_NAND__PATA_INTRQ (_MX51_PAD_GPIO_NAND__PATA_INTRQ | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1030 | #define MX51_PAD_NANDF_CS0__GPIO3_16 (_MX51_PAD_NANDF_CS0__GPIO3_16 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1031 | #define MX51_PAD_NANDF_CS0__NANDF_CS0 (_MX51_PAD_NANDF_CS0__NANDF_CS0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1032 | #define MX51_PAD_NANDF_CS1__GPIO3_17 (_MX51_PAD_NANDF_CS1__GPIO3_17 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1033 | #define MX51_PAD_NANDF_CS1__NANDF_CS1 (_MX51_PAD_NANDF_CS1__NANDF_CS1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1034 | #define MX51_PAD_NANDF_CS2__CSPI_SCLK (_MX51_PAD_NANDF_CS2__CSPI_SCLK | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1035 | #define MX51_PAD_NANDF_CS2__FEC_TX_ER (_MX51_PAD_NANDF_CS2__FEC_TX_ER | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1036 | #define MX51_PAD_NANDF_CS2__GPIO3_18 (_MX51_PAD_NANDF_CS2__GPIO3_18 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1037 | #define MX51_PAD_NANDF_CS2__NANDF_CS2 (_MX51_PAD_NANDF_CS2__NANDF_CS2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1038 | #define MX51_PAD_NANDF_CS2__PATA_CS_0 (_MX51_PAD_NANDF_CS2__PATA_CS_0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1039 | #define MX51_PAD_NANDF_CS2__SD4_CLK (_MX51_PAD_NANDF_CS2__SD4_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1040 | #define MX51_PAD_NANDF_CS2__USBH3_H1_DP (_MX51_PAD_NANDF_CS2__USBH3_H1_DP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1041 | #define MX51_PAD_NANDF_CS3__FEC_MDC (_MX51_PAD_NANDF_CS3__FEC_MDC | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1042 | #define MX51_PAD_NANDF_CS3__GPIO3_19 (_MX51_PAD_NANDF_CS3__GPIO3_19 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1043 | #define MX51_PAD_NANDF_CS3__NANDF_CS3 (_MX51_PAD_NANDF_CS3__NANDF_CS3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1044 | #define MX51_PAD_NANDF_CS3__PATA_CS_1 (_MX51_PAD_NANDF_CS3__PATA_CS_1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1045 | #define MX51_PAD_NANDF_CS3__SD4_DAT0 (_MX51_PAD_NANDF_CS3__SD4_DAT0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1046 | #define MX51_PAD_NANDF_CS3__USBH3_H1_DM (_MX51_PAD_NANDF_CS3__USBH3_H1_DM | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1047 | #define MX51_PAD_NANDF_CS4__FEC_TDATA1 (_MX51_PAD_NANDF_CS4__FEC_TDATA1 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1048 | #define MX51_PAD_NANDF_CS4__GPIO3_20 (_MX51_PAD_NANDF_CS4__GPIO3_20 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1049 | #define MX51_PAD_NANDF_CS4__NANDF_CS4 (_MX51_PAD_NANDF_CS4__NANDF_CS4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1050 | #define MX51_PAD_NANDF_CS4__PATA_DA_0 (_MX51_PAD_NANDF_CS4__PATA_DA_0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1051 | #define MX51_PAD_NANDF_CS4__SD4_DAT1 (_MX51_PAD_NANDF_CS4__SD4_DAT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1052 | #define MX51_PAD_NANDF_CS4__USBH3_STP (_MX51_PAD_NANDF_CS4__USBH3_STP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1053 | #define MX51_PAD_NANDF_CS5__FEC_TDATA2 (_MX51_PAD_NANDF_CS5__FEC_TDATA2 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1054 | #define MX51_PAD_NANDF_CS5__GPIO3_21 (_MX51_PAD_NANDF_CS5__GPIO3_21 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1055 | #define MX51_PAD_NANDF_CS5__NANDF_CS5 (_MX51_PAD_NANDF_CS5__NANDF_CS5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1056 | #define MX51_PAD_NANDF_CS5__PATA_DA_1 (_MX51_PAD_NANDF_CS5__PATA_DA_1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1057 | #define MX51_PAD_NANDF_CS5__SD4_DAT2 (_MX51_PAD_NANDF_CS5__SD4_DAT2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1058 | #define MX51_PAD_NANDF_CS5__USBH3_DIR (_MX51_PAD_NANDF_CS5__USBH3_DIR | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1059 | #define MX51_PAD_NANDF_CS6__CSPI_SS3 (_MX51_PAD_NANDF_CS6__CSPI_SS3 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1060 | #define MX51_PAD_NANDF_CS6__FEC_TDATA3 (_MX51_PAD_NANDF_CS6__FEC_TDATA3 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1061 | #define MX51_PAD_NANDF_CS6__GPIO3_22 (_MX51_PAD_NANDF_CS6__GPIO3_22 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1062 | #define MX51_PAD_NANDF_CS6__NANDF_CS6 (_MX51_PAD_NANDF_CS6__NANDF_CS6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1063 | #define MX51_PAD_NANDF_CS6__PATA_DA_2 (_MX51_PAD_NANDF_CS6__PATA_DA_2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1064 | #define MX51_PAD_NANDF_CS6__SD4_DAT3 (_MX51_PAD_NANDF_CS6__SD4_DAT3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1065 | #define MX51_PAD_NANDF_CS7__FEC_TX_EN (_MX51_PAD_NANDF_CS7__FEC_TX_EN | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1066 | #define MX51_PAD_NANDF_CS7__GPIO3_23 (_MX51_PAD_NANDF_CS7__GPIO3_23 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1067 | #define MX51_PAD_NANDF_CS7__NANDF_CS7 (_MX51_PAD_NANDF_CS7__NANDF_CS7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1068 | #define MX51_PAD_NANDF_CS7__SD3_CLK (_MX51_PAD_NANDF_CS7__SD3_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1069 | #define MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 (_MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1070 | #define MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK (_MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK | MUX_PAD_CTRL(MX51_PAD_CTRL_4)) | ||
1071 | #define MX51_PAD_NANDF_RDY_INT__GPIO3_24 (_MX51_PAD_NANDF_RDY_INT__GPIO3_24 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1072 | #define MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT (_MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1073 | #define MX51_PAD_NANDF_RDY_INT__SD3_CMD (_MX51_PAD_NANDF_RDY_INT__SD3_CMD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1074 | #define MX51_PAD_NANDF_D15__ECSPI2_MOSI (_MX51_PAD_NANDF_D15__ECSPI2_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1075 | #define MX51_PAD_NANDF_D15__GPIO3_25 (_MX51_PAD_NANDF_D15__GPIO3_25 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1076 | #define MX51_PAD_NANDF_D15__NANDF_D15 (_MX51_PAD_NANDF_D15__NANDF_D15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1077 | #define MX51_PAD_NANDF_D15__PATA_DATA15 (_MX51_PAD_NANDF_D15__PATA_DATA15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1078 | #define MX51_PAD_NANDF_D15__SD3_DAT7 (_MX51_PAD_NANDF_D15__SD3_DAT7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1079 | #define MX51_PAD_NANDF_D14__ECSPI2_SS3 (_MX51_PAD_NANDF_D14__ECSPI2_SS3 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1080 | #define MX51_PAD_NANDF_D14__GPIO3_26 (_MX51_PAD_NANDF_D14__GPIO3_26 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1081 | #define MX51_PAD_NANDF_D14__NANDF_D14 (_MX51_PAD_NANDF_D14__NANDF_D14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1082 | #define MX51_PAD_NANDF_D14__PATA_DATA14 (_MX51_PAD_NANDF_D14__PATA_DATA14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1083 | #define MX51_PAD_NANDF_D14__SD3_DAT6 (_MX51_PAD_NANDF_D14__SD3_DAT6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1084 | #define MX51_PAD_NANDF_D13__ECSPI2_SS2 (_MX51_PAD_NANDF_D13__ECSPI2_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1085 | #define MX51_PAD_NANDF_D13__GPIO3_27 (_MX51_PAD_NANDF_D13__GPIO3_27 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1086 | #define MX51_PAD_NANDF_D13__NANDF_D13 (_MX51_PAD_NANDF_D13__NANDF_D13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1087 | #define MX51_PAD_NANDF_D13__PATA_DATA13 (_MX51_PAD_NANDF_D13__PATA_DATA13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1088 | #define MX51_PAD_NANDF_D13__SD3_DAT5 (_MX51_PAD_NANDF_D13__SD3_DAT5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1089 | #define MX51_PAD_NANDF_D12__ECSPI2_SS1 (_MX51_PAD_NANDF_D12__ECSPI2_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1090 | #define MX51_PAD_NANDF_D12__GPIO3_28 (_MX51_PAD_NANDF_D12__GPIO3_28 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1091 | #define MX51_PAD_NANDF_D12__NANDF_D12 (_MX51_PAD_NANDF_D12__NANDF_D12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1092 | #define MX51_PAD_NANDF_D12__PATA_DATA12 (_MX51_PAD_NANDF_D12__PATA_DATA12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1093 | #define MX51_PAD_NANDF_D12__SD3_DAT4 (_MX51_PAD_NANDF_D12__SD3_DAT4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1094 | #define MX51_PAD_NANDF_D11__FEC_RX_DV (_MX51_PAD_NANDF_D11__FEC_RX_DV | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1095 | #define MX51_PAD_NANDF_D11__GPIO3_29 (_MX51_PAD_NANDF_D11__GPIO3_29 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1096 | #define MX51_PAD_NANDF_D11__NANDF_D11 (_MX51_PAD_NANDF_D11__NANDF_D11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1097 | #define MX51_PAD_NANDF_D11__PATA_DATA11 (_MX51_PAD_NANDF_D11__PATA_DATA11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1098 | #define MX51_PAD_NANDF_D11__SD3_DATA3 (_MX51_PAD_NANDF_D11__SD3_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1099 | #define MX51_PAD_NANDF_D10__GPIO3_30 (_MX51_PAD_NANDF_D10__GPIO3_30 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1100 | #define MX51_PAD_NANDF_D10__NANDF_D10 (_MX51_PAD_NANDF_D10__NANDF_D10 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1101 | #define MX51_PAD_NANDF_D10__PATA_DATA10 (_MX51_PAD_NANDF_D10__PATA_DATA10 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1102 | #define MX51_PAD_NANDF_D10__SD3_DATA2 (_MX51_PAD_NANDF_D10__SD3_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1103 | #define MX51_PAD_NANDF_D9__FEC_RDATA0 (_MX51_PAD_NANDF_D9__FEC_RDATA0 | MUX_PAD_CTRL(MX51_PAD_CTRL_4)) | ||
1104 | #define MX51_PAD_NANDF_D9__GPIO3_31 (_MX51_PAD_NANDF_D9__GPIO3_31 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1105 | #define MX51_PAD_NANDF_D9__NANDF_D9 (_MX51_PAD_NANDF_D9__NANDF_D9 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1106 | #define MX51_PAD_NANDF_D9__PATA_DATA9 (_MX51_PAD_NANDF_D9__PATA_DATA9 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1107 | #define MX51_PAD_NANDF_D9__SD3_DATA1 (_MX51_PAD_NANDF_D9__SD3_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1108 | #define MX51_PAD_NANDF_D8__FEC_TDATA0 (_MX51_PAD_NANDF_D8__FEC_TDATA0 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1109 | #define MX51_PAD_NANDF_D8__GPIO4_0 (_MX51_PAD_NANDF_D8__GPIO4_0 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1110 | #define MX51_PAD_NANDF_D8__NANDF_D8 (_MX51_PAD_NANDF_D8__NANDF_D8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1111 | #define MX51_PAD_NANDF_D8__PATA_DATA8 (_MX51_PAD_NANDF_D8__PATA_DATA8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1112 | #define MX51_PAD_NANDF_D8__SD3_DATA0 (_MX51_PAD_NANDF_D8__SD3_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1113 | #define MX51_PAD_NANDF_D7__GPIO4_1 (_MX51_PAD_NANDF_D7__GPIO4_1 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1114 | #define MX51_PAD_NANDF_D7__NANDF_D7 (_MX51_PAD_NANDF_D7__NANDF_D7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1115 | #define MX51_PAD_NANDF_D7__PATA_DATA7 (_MX51_PAD_NANDF_D7__PATA_DATA7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1116 | #define MX51_PAD_NANDF_D7__USBH3_DATA0 (_MX51_PAD_NANDF_D7__USBH3_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1117 | #define MX51_PAD_NANDF_D6__GPIO4_2 (_MX51_PAD_NANDF_D6__GPIO4_2 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1118 | #define MX51_PAD_NANDF_D6__NANDF_D6 (_MX51_PAD_NANDF_D6__NANDF_D6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1119 | #define MX51_PAD_NANDF_D6__PATA_DATA6 (_MX51_PAD_NANDF_D6__PATA_DATA6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1120 | #define MX51_PAD_NANDF_D6__SD4_LCTL (_MX51_PAD_NANDF_D6__SD4_LCTL | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1121 | #define MX51_PAD_NANDF_D6__USBH3_DATA1 (_MX51_PAD_NANDF_D6__USBH3_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1122 | #define MX51_PAD_NANDF_D5__GPIO4_3 (_MX51_PAD_NANDF_D5__GPIO4_3 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1123 | #define MX51_PAD_NANDF_D5__NANDF_D5 (_MX51_PAD_NANDF_D5__NANDF_D5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1124 | #define MX51_PAD_NANDF_D5__PATA_DATA5 (_MX51_PAD_NANDF_D5__PATA_DATA5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1125 | #define MX51_PAD_NANDF_D5__SD4_WP (_MX51_PAD_NANDF_D5__SD4_WP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1126 | #define MX51_PAD_NANDF_D5__USBH3_DATA2 (_MX51_PAD_NANDF_D5__USBH3_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1127 | #define MX51_PAD_NANDF_D4__GPIO4_4 (_MX51_PAD_NANDF_D4__GPIO4_4 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1128 | #define MX51_PAD_NANDF_D4__NANDF_D4 (_MX51_PAD_NANDF_D4__NANDF_D4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1129 | #define MX51_PAD_NANDF_D4__PATA_DATA4 (_MX51_PAD_NANDF_D4__PATA_DATA4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1130 | #define MX51_PAD_NANDF_D4__SD4_CD (_MX51_PAD_NANDF_D4__SD4_CD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1131 | #define MX51_PAD_NANDF_D4__USBH3_DATA3 (_MX51_PAD_NANDF_D4__USBH3_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1132 | #define MX51_PAD_NANDF_D3__GPIO4_5 (_MX51_PAD_NANDF_D3__GPIO4_5 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1133 | #define MX51_PAD_NANDF_D3__NANDF_D3 (_MX51_PAD_NANDF_D3__NANDF_D3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1134 | #define MX51_PAD_NANDF_D3__PATA_DATA3 (_MX51_PAD_NANDF_D3__PATA_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1135 | #define MX51_PAD_NANDF_D3__SD4_DAT4 (_MX51_PAD_NANDF_D3__SD4_DAT4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1136 | #define MX51_PAD_NANDF_D3__USBH3_DATA4 (_MX51_PAD_NANDF_D3__USBH3_DATA4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1137 | #define MX51_PAD_NANDF_D2__GPIO4_6 (_MX51_PAD_NANDF_D2__GPIO4_6 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1138 | #define MX51_PAD_NANDF_D2__NANDF_D2 (_MX51_PAD_NANDF_D2__NANDF_D2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1139 | #define MX51_PAD_NANDF_D2__PATA_DATA2 (_MX51_PAD_NANDF_D2__PATA_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1140 | #define MX51_PAD_NANDF_D2__SD4_DAT5 (_MX51_PAD_NANDF_D2__SD4_DAT5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1141 | #define MX51_PAD_NANDF_D2__USBH3_DATA5 (_MX51_PAD_NANDF_D2__USBH3_DATA5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1142 | #define MX51_PAD_NANDF_D1__GPIO4_7 (_MX51_PAD_NANDF_D1__GPIO4_7 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1143 | #define MX51_PAD_NANDF_D1__NANDF_D1 (_MX51_PAD_NANDF_D1__NANDF_D1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1144 | #define MX51_PAD_NANDF_D1__PATA_DATA1 (_MX51_PAD_NANDF_D1__PATA_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1145 | #define MX51_PAD_NANDF_D1__SD4_DAT6 (_MX51_PAD_NANDF_D1__SD4_DAT6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1146 | #define MX51_PAD_NANDF_D1__USBH3_DATA6 (_MX51_PAD_NANDF_D1__USBH3_DATA6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1147 | #define MX51_PAD_NANDF_D0__GPIO4_8 (_MX51_PAD_NANDF_D0__GPIO4_8 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1148 | #define MX51_PAD_NANDF_D0__NANDF_D0 (_MX51_PAD_NANDF_D0__NANDF_D0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1149 | #define MX51_PAD_NANDF_D0__PATA_DATA0 (_MX51_PAD_NANDF_D0__PATA_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1150 | #define MX51_PAD_NANDF_D0__SD4_DAT7 (_MX51_PAD_NANDF_D0__SD4_DAT7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1151 | #define MX51_PAD_NANDF_D0__USBH3_DATA7 (_MX51_PAD_NANDF_D0__USBH3_DATA7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1152 | #define MX51_PAD_CSI1_D8__CSI1_D8 (_MX51_PAD_CSI1_D8__CSI1_D8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1153 | #define MX51_PAD_CSI1_D8__GPIO3_12 (_MX51_PAD_CSI1_D8__GPIO3_12 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1154 | #define MX51_PAD_CSI1_D9__CSI1_D9 (_MX51_PAD_CSI1_D9__CSI1_D9 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1155 | #define MX51_PAD_CSI1_D9__GPIO3_13 (_MX51_PAD_CSI1_D9__GPIO3_13 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1156 | #define MX51_PAD_CSI1_D10__CSI1_D10 (_MX51_PAD_CSI1_D10__CSI1_D10 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1157 | #define MX51_PAD_CSI1_D11__CSI1_D11 (_MX51_PAD_CSI1_D11__CSI1_D11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1158 | #define MX51_PAD_CSI1_D12__CSI1_D12 (_MX51_PAD_CSI1_D12__CSI1_D12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1159 | #define MX51_PAD_CSI1_D13__CSI1_D13 (_MX51_PAD_CSI1_D13__CSI1_D13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1160 | #define MX51_PAD_CSI1_D14__CSI1_D14 (_MX51_PAD_CSI1_D14__CSI1_D14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1161 | #define MX51_PAD_CSI1_D15__CSI1_D15 (_MX51_PAD_CSI1_D15__CSI1_D15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1162 | #define MX51_PAD_CSI1_D16__CSI1_D16 (_MX51_PAD_CSI1_D16__CSI1_D16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1163 | #define MX51_PAD_CSI1_D17__CSI1_D17 (_MX51_PAD_CSI1_D17__CSI1_D17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1164 | #define MX51_PAD_CSI1_D18__CSI1_D18 (_MX51_PAD_CSI1_D18__CSI1_D18 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1165 | #define MX51_PAD_CSI1_D19__CSI1_D19 (_MX51_PAD_CSI1_D19__CSI1_D19 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1166 | #define MX51_PAD_CSI1_VSYNC__CSI1_VSYNC (_MX51_PAD_CSI1_VSYNC__CSI1_VSYNC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1167 | #define MX51_PAD_CSI1_VSYNC__GPIO3_14 (_MX51_PAD_CSI1_VSYNC__GPIO3_14 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1168 | #define MX51_PAD_CSI1_HSYNC__CSI1_HSYNC (_MX51_PAD_CSI1_HSYNC__CSI1_HSYNC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1169 | #define MX51_PAD_CSI1_HSYNC__GPIO3_15 (_MX51_PAD_CSI1_HSYNC__GPIO3_15 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1170 | #define MX51_PAD_CSI1_PIXCLK__CSI1_PIXCLK (_MX51_PAD_CSI1_PIXCLK__CSI1_PIXCLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1171 | #define MX51_PAD_CSI1_MCLK__CSI1_MCLK (_MX51_PAD_CSI1_MCLK__CSI1_MCLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1172 | #define MX51_PAD_CSI2_D12__CSI2_D12 (_MX51_PAD_CSI2_D12__CSI2_D12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1173 | #define MX51_PAD_CSI2_D12__GPIO4_9 (_MX51_PAD_CSI2_D12__GPIO4_9 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1174 | #define MX51_PAD_CSI2_D13__CSI2_D13 (_MX51_PAD_CSI2_D13__CSI2_D13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1175 | #define MX51_PAD_CSI2_D13__GPIO4_10 (_MX51_PAD_CSI2_D13__GPIO4_10 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1176 | #define MX51_PAD_CSI2_D14__CSI2_D14 (_MX51_PAD_CSI2_D14__CSI2_D14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1177 | #define MX51_PAD_CSI2_D15__CSI2_D15 (_MX51_PAD_CSI2_D15__CSI2_D15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1178 | #define MX51_PAD_CSI2_D16__CSI2_D16 (_MX51_PAD_CSI2_D16__CSI2_D16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1179 | #define MX51_PAD_CSI2_D17__CSI2_D17 (_MX51_PAD_CSI2_D17__CSI2_D17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1180 | #define MX51_PAD_CSI2_D18__CSI2_D18 (_MX51_PAD_CSI2_D18__CSI2_D18 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1181 | #define MX51_PAD_CSI2_D18__GPIO4_11 (_MX51_PAD_CSI2_D18__GPIO4_11 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1182 | #define MX51_PAD_CSI2_D19__CSI2_D19 (_MX51_PAD_CSI2_D19__CSI2_D19 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1183 | #define MX51_PAD_CSI2_D19__GPIO4_12 (_MX51_PAD_CSI2_D19__GPIO4_12 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1184 | #define MX51_PAD_CSI2_VSYNC__CSI2_VSYNC (_MX51_PAD_CSI2_VSYNC__CSI2_VSYNC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1185 | #define MX51_PAD_CSI2_VSYNC__GPIO4_13 (_MX51_PAD_CSI2_VSYNC__GPIO4_13 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1186 | #define MX51_PAD_CSI2_HSYNC__CSI2_HSYNC (_MX51_PAD_CSI2_HSYNC__CSI2_HSYNC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1187 | #define MX51_PAD_CSI2_HSYNC__GPIO4_14 (_MX51_PAD_CSI2_HSYNC__GPIO4_14 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1188 | #define MX51_PAD_CSI2_PIXCLK__CSI2_PIXCLK (_MX51_PAD_CSI2_PIXCLK__CSI2_PIXCLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1189 | #define MX51_PAD_CSI2_PIXCLK__GPIO4_15 (_MX51_PAD_CSI2_PIXCLK__GPIO4_15 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1190 | #define MX51_PAD_I2C1_CLK__GPIO4_16 (_MX51_PAD_I2C1_CLK__GPIO4_16 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1191 | #define MX51_PAD_I2C1_CLK__I2C1_CLK (_MX51_PAD_I2C1_CLK__I2C1_CLK | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1192 | #define MX51_PAD_I2C1_DAT__GPIO4_17 (_MX51_PAD_I2C1_DAT__GPIO4_17 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1193 | #define MX51_PAD_I2C1_DAT__I2C1_DAT (_MX51_PAD_I2C1_DAT__I2C1_DAT | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1194 | #define MX51_PAD_AUD3_BB_TXD__AUD3_TXD (_MX51_PAD_AUD3_BB_TXD__AUD3_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1195 | #define MX51_PAD_AUD3_BB_TXD__GPIO4_18 (_MX51_PAD_AUD3_BB_TXD__GPIO4_18 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1196 | #define MX51_PAD_AUD3_BB_RXD__AUD3_RXD (_MX51_PAD_AUD3_BB_RXD__AUD3_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1197 | #define MX51_PAD_AUD3_BB_RXD__GPIO4_19 (_MX51_PAD_AUD3_BB_RXD__GPIO4_19 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1198 | #define MX51_PAD_AUD3_BB_RXD__UART3_RXD (_MX51_PAD_AUD3_BB_RXD__UART3_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1199 | #define MX51_PAD_AUD3_BB_CK__AUD3_TXC (_MX51_PAD_AUD3_BB_CK__AUD3_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1200 | #define MX51_PAD_AUD3_BB_CK__GPIO4_20 (_MX51_PAD_AUD3_BB_CK__GPIO4_20 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1201 | #define MX51_PAD_AUD3_BB_FS__AUD3_TXFS (_MX51_PAD_AUD3_BB_FS__AUD3_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1202 | #define MX51_PAD_AUD3_BB_FS__GPIO4_21 (_MX51_PAD_AUD3_BB_FS__GPIO4_21 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1203 | #define MX51_PAD_AUD3_BB_FS__UART3_TXD (_MX51_PAD_AUD3_BB_FS__UART3_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1204 | #define MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI (_MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1205 | #define MX51_PAD_CSPI1_MOSI__GPIO4_22 (_MX51_PAD_CSPI1_MOSI__GPIO4_22 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1206 | #define MX51_PAD_CSPI1_MOSI__I2C1_SDA (_MX51_PAD_CSPI1_MOSI__I2C1_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1207 | #define MX51_PAD_CSPI1_MISO__AUD4_RXD (_MX51_PAD_CSPI1_MISO__AUD4_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1208 | #define MX51_PAD_CSPI1_MISO__ECSPI1_MISO (_MX51_PAD_CSPI1_MISO__ECSPI1_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1209 | #define MX51_PAD_CSPI1_MISO__GPIO4_23 (_MX51_PAD_CSPI1_MISO__GPIO4_23 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1210 | #define MX51_PAD_CSPI1_SS0__AUD4_TXC (_MX51_PAD_CSPI1_SS0__AUD4_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1211 | #define MX51_PAD_CSPI1_SS0__ECSPI1_SS0 (_MX51_PAD_CSPI1_SS0__ECSPI1_SS0 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1212 | #define MX51_PAD_CSPI1_SS0__GPIO4_24 (_MX51_PAD_CSPI1_SS0__GPIO4_24 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1213 | #define MX51_PAD_CSPI1_SS1__AUD4_TXD (_MX51_PAD_CSPI1_SS1__AUD4_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1214 | #define MX51_PAD_CSPI1_SS1__ECSPI1_SS1 (_MX51_PAD_CSPI1_SS1__ECSPI1_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1215 | #define MX51_PAD_CSPI1_SS1__GPIO4_25 (_MX51_PAD_CSPI1_SS1__GPIO4_25 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1216 | #define MX51_PAD_CSPI1_RDY__AUD4_TXFS (_MX51_PAD_CSPI1_RDY__AUD4_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1217 | #define MX51_PAD_CSPI1_RDY__ECSPI1_RDY (_MX51_PAD_CSPI1_RDY__ECSPI1_RDY | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1218 | #define MX51_PAD_CSPI1_RDY__GPIO4_26 (_MX51_PAD_CSPI1_RDY__GPIO4_26 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1219 | #define MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK (_MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1220 | #define MX51_PAD_CSPI1_SCLK__GPIO4_27 (_MX51_PAD_CSPI1_SCLK__GPIO4_27 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1221 | #define MX51_PAD_CSPI1_SCLK__I2C1_SCL (_MX51_PAD_CSPI1_SCLK__I2C1_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1222 | #define MX51_PAD_UART1_RXD__GPIO4_28 (_MX51_PAD_UART1_RXD__GPIO4_28 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1223 | #define MX51_PAD_UART1_RXD__UART1_RXD (_MX51_PAD_UART1_RXD__UART1_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1224 | #define MX51_PAD_UART1_TXD__GPIO4_29 (_MX51_PAD_UART1_TXD__GPIO4_29 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1225 | #define MX51_PAD_UART1_TXD__PWM2_PWMO (_MX51_PAD_UART1_TXD__PWM2_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1226 | #define MX51_PAD_UART1_TXD__UART1_TXD (_MX51_PAD_UART1_TXD__UART1_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1227 | #define MX51_PAD_UART1_RTS__GPIO4_30 (_MX51_PAD_UART1_RTS__GPIO4_30 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1228 | #define MX51_PAD_UART1_RTS__UART1_RTS (_MX51_PAD_UART1_RTS__UART1_RTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1229 | #define MX51_PAD_UART1_CTS__GPIO4_31 (_MX51_PAD_UART1_CTS__GPIO4_31 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1230 | #define MX51_PAD_UART1_CTS__UART1_CTS (_MX51_PAD_UART1_CTS__UART1_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1231 | #define MX51_PAD_UART2_RXD__FIRI_TXD (_MX51_PAD_UART2_RXD__FIRI_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1232 | #define MX51_PAD_UART2_RXD__GPIO1_20 (_MX51_PAD_UART2_RXD__GPIO1_20 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1233 | #define MX51_PAD_UART2_RXD__UART2_RXD (_MX51_PAD_UART2_RXD__UART2_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1234 | #define MX51_PAD_UART2_TXD__FIRI_RXD (_MX51_PAD_UART2_TXD__FIRI_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1235 | #define MX51_PAD_UART2_TXD__GPIO1_21 (_MX51_PAD_UART2_TXD__GPIO1_21 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1236 | #define MX51_PAD_UART2_TXD__UART2_TXD (_MX51_PAD_UART2_TXD__UART2_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1237 | #define MX51_PAD_UART3_RXD__CSI1_D0 (_MX51_PAD_UART3_RXD__CSI1_D0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1238 | #define MX51_PAD_UART3_RXD__GPIO1_22 (_MX51_PAD_UART3_RXD__GPIO1_22 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1239 | #define MX51_PAD_UART3_RXD__UART1_DTR (_MX51_PAD_UART3_RXD__UART1_DTR | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1240 | #define MX51_PAD_UART3_RXD__UART3_RXD (_MX51_PAD_UART3_RXD__UART3_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1241 | #define MX51_PAD_UART3_TXD__CSI1_D1 (_MX51_PAD_UART3_TXD__CSI1_D1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1242 | #define MX51_PAD_UART3_TXD__GPIO1_23 (_MX51_PAD_UART3_TXD__GPIO1_23 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1243 | #define MX51_PAD_UART3_TXD__UART1_DSR (_MX51_PAD_UART3_TXD__UART1_DSR | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1244 | #define MX51_PAD_UART3_TXD__UART3_TXD (_MX51_PAD_UART3_TXD__UART3_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1245 | #define MX51_PAD_OWIRE_LINE__GPIO1_24 (_MX51_PAD_OWIRE_LINE__GPIO1_24 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1246 | #define MX51_PAD_OWIRE_LINE__OWIRE_LINE (_MX51_PAD_OWIRE_LINE__OWIRE_LINE | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1247 | #define MX51_PAD_OWIRE_LINE__SPDIF_OUT (_MX51_PAD_OWIRE_LINE__SPDIF_OUT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1248 | #define MX51_PAD_KEY_ROW0__KEY_ROW0 (_MX51_PAD_KEY_ROW0__KEY_ROW0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1249 | #define MX51_PAD_KEY_ROW1__KEY_ROW1 (_MX51_PAD_KEY_ROW1__KEY_ROW1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1250 | #define MX51_PAD_KEY_ROW2__KEY_ROW2 (_MX51_PAD_KEY_ROW2__KEY_ROW2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1251 | #define MX51_PAD_KEY_ROW3__KEY_ROW3 (_MX51_PAD_KEY_ROW3__KEY_ROW3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1252 | #define MX51_PAD_KEY_COL0__KEY_COL0 (_MX51_PAD_KEY_COL0__KEY_COL0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1253 | #define MX51_PAD_KEY_COL0__PLL1_BYP (_MX51_PAD_KEY_COL0__PLL1_BYP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1254 | #define MX51_PAD_KEY_COL1__KEY_COL1 (_MX51_PAD_KEY_COL1__KEY_COL1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1255 | #define MX51_PAD_KEY_COL1__PLL2_BYP (_MX51_PAD_KEY_COL1__PLL2_BYP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1256 | #define MX51_PAD_KEY_COL2__KEY_COL2 (_MX51_PAD_KEY_COL2__KEY_COL2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1257 | #define MX51_PAD_KEY_COL2__PLL3_BYP (_MX51_PAD_KEY_COL2__PLL3_BYP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1258 | #define MX51_PAD_KEY_COL3__KEY_COL3 (_MX51_PAD_KEY_COL3__KEY_COL3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1259 | #define MX51_PAD_KEY_COL4__I2C2_SCL (_MX51_PAD_KEY_COL4__I2C2_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1260 | #define MX51_PAD_KEY_COL4__KEY_COL4 (_MX51_PAD_KEY_COL4__KEY_COL4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1261 | #define MX51_PAD_KEY_COL4__SPDIF_OUT1 (_MX51_PAD_KEY_COL4__SPDIF_OUT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1262 | #define MX51_PAD_KEY_COL4__UART1_RI (_MX51_PAD_KEY_COL4__UART1_RI | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1263 | #define MX51_PAD_KEY_COL4__UART3_RTS (_MX51_PAD_KEY_COL4__UART3_RTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1264 | #define MX51_PAD_KEY_COL5__I2C2_SDA (_MX51_PAD_KEY_COL5__I2C2_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1265 | #define MX51_PAD_KEY_COL5__KEY_COL5 (_MX51_PAD_KEY_COL5__KEY_COL5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1266 | #define MX51_PAD_KEY_COL5__UART1_DCD (_MX51_PAD_KEY_COL5__UART1_DCD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1267 | #define MX51_PAD_KEY_COL5__UART3_CTS (_MX51_PAD_KEY_COL5__UART3_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1268 | #define MX51_PAD_USBH1_CLK__CSPI_SCLK (_MX51_PAD_USBH1_CLK__CSPI_SCLK | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1269 | #define MX51_PAD_USBH1_CLK__GPIO1_25 (_MX51_PAD_USBH1_CLK__GPIO1_25 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1270 | #define MX51_PAD_USBH1_CLK__I2C2_SCL (_MX51_PAD_USBH1_CLK__I2C2_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1271 | #define MX51_PAD_USBH1_CLK__USBH1_CLK (_MX51_PAD_USBH1_CLK__USBH1_CLK | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1272 | #define MX51_PAD_USBH1_DIR__CSPI_MOSI (_MX51_PAD_USBH1_DIR__CSPI_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1273 | #define MX51_PAD_USBH1_DIR__GPIO1_26 (_MX51_PAD_USBH1_DIR__GPIO1_26 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1274 | #define MX51_PAD_USBH1_DIR__I2C2_SDA (_MX51_PAD_USBH1_DIR__I2C2_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1275 | #define MX51_PAD_USBH1_DIR__USBH1_DIR (_MX51_PAD_USBH1_DIR__USBH1_DIR | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1276 | #define MX51_PAD_USBH1_STP__CSPI_RDY (_MX51_PAD_USBH1_STP__CSPI_RDY | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1277 | #define MX51_PAD_USBH1_STP__GPIO1_27 (_MX51_PAD_USBH1_STP__GPIO1_27 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1278 | #define MX51_PAD_USBH1_STP__UART3_RXD (_MX51_PAD_USBH1_STP__UART3_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1279 | #define MX51_PAD_USBH1_STP__USBH1_STP (_MX51_PAD_USBH1_STP__USBH1_STP | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1280 | #define MX51_PAD_USBH1_NXT__CSPI_MISO (_MX51_PAD_USBH1_NXT__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1281 | #define MX51_PAD_USBH1_NXT__GPIO1_28 (_MX51_PAD_USBH1_NXT__GPIO1_28 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1282 | #define MX51_PAD_USBH1_NXT__UART3_TXD (_MX51_PAD_USBH1_NXT__UART3_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1283 | #define MX51_PAD_USBH1_NXT__USBH1_NXT (_MX51_PAD_USBH1_NXT__USBH1_NXT | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1284 | #define MX51_PAD_USBH1_DATA0__GPIO1_11 (_MX51_PAD_USBH1_DATA0__GPIO1_11 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1285 | #define MX51_PAD_USBH1_DATA0__UART2_CTS (_MX51_PAD_USBH1_DATA0__UART2_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1286 | #define MX51_PAD_USBH1_DATA0__USBH1_DATA0 (_MX51_PAD_USBH1_DATA0__USBH1_DATA0 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1287 | #define MX51_PAD_USBH1_DATA1__GPIO1_12 (_MX51_PAD_USBH1_DATA1__GPIO1_12 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1288 | #define MX51_PAD_USBH1_DATA1__UART2_RXD (_MX51_PAD_USBH1_DATA1__UART2_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1289 | #define MX51_PAD_USBH1_DATA1__USBH1_DATA1 (_MX51_PAD_USBH1_DATA1__USBH1_DATA1 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1290 | #define MX51_PAD_USBH1_DATA2__GPIO1_13 (_MX51_PAD_USBH1_DATA2__GPIO1_13 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1291 | #define MX51_PAD_USBH1_DATA2__UART2_TXD (_MX51_PAD_USBH1_DATA2__UART2_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1292 | #define MX51_PAD_USBH1_DATA2__USBH1_DATA2 (_MX51_PAD_USBH1_DATA2__USBH1_DATA2 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1293 | #define MX51_PAD_USBH1_DATA3__GPIO1_14 (_MX51_PAD_USBH1_DATA3__GPIO1_14 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1294 | #define MX51_PAD_USBH1_DATA3__UART2_RTS (_MX51_PAD_USBH1_DATA3__UART2_RTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1295 | #define MX51_PAD_USBH1_DATA3__USBH1_DATA3 (_MX51_PAD_USBH1_DATA3__USBH1_DATA3 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1296 | #define MX51_PAD_USBH1_DATA4__CSPI_SS0 (_MX51_PAD_USBH1_DATA4__CSPI_SS0 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1297 | #define MX51_PAD_USBH1_DATA4__GPIO1_15 (_MX51_PAD_USBH1_DATA4__GPIO1_15 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1298 | #define MX51_PAD_USBH1_DATA4__USBH1_DATA4 (_MX51_PAD_USBH1_DATA4__USBH1_DATA4 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1299 | #define MX51_PAD_USBH1_DATA5__CSPI_SS1 (_MX51_PAD_USBH1_DATA5__CSPI_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1300 | #define MX51_PAD_USBH1_DATA5__GPIO1_16 (_MX51_PAD_USBH1_DATA5__GPIO1_16 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1301 | #define MX51_PAD_USBH1_DATA5__USBH1_DATA5 (_MX51_PAD_USBH1_DATA5__USBH1_DATA5 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1302 | #define MX51_PAD_USBH1_DATA6__CSPI_SS3 (_MX51_PAD_USBH1_DATA6__CSPI_SS3 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1303 | #define MX51_PAD_USBH1_DATA6__GPIO1_17 (_MX51_PAD_USBH1_DATA6__GPIO1_17 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1304 | #define MX51_PAD_USBH1_DATA6__USBH1_DATA6 (_MX51_PAD_USBH1_DATA6__USBH1_DATA6 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1305 | #define MX51_PAD_USBH1_DATA7__ECSPI1_SS3 (_MX51_PAD_USBH1_DATA7__ECSPI1_SS3 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1306 | #define MX51_PAD_USBH1_DATA7__ECSPI2_SS3 (_MX51_PAD_USBH1_DATA7__ECSPI2_SS3 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1307 | #define MX51_PAD_USBH1_DATA7__GPIO1_18 (_MX51_PAD_USBH1_DATA7__GPIO1_18 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1308 | #define MX51_PAD_USBH1_DATA7__USBH1_DATA7 (_MX51_PAD_USBH1_DATA7__USBH1_DATA7 | MUX_PAD_CTRL(MX51_USBH1_PAD_CTRL)) | ||
1309 | #define MX51_PAD_DI1_PIN11__DI1_PIN11 (_MX51_PAD_DI1_PIN11__DI1_PIN11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1310 | #define MX51_PAD_DI1_PIN11__ECSPI1_SS2 (_MX51_PAD_DI1_PIN11__ECSPI1_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1311 | #define MX51_PAD_DI1_PIN11__GPIO3_0 (_MX51_PAD_DI1_PIN11__GPIO3_0 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1312 | #define MX51_PAD_DI1_PIN12__DI1_PIN12 (_MX51_PAD_DI1_PIN12__DI1_PIN12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1313 | #define MX51_PAD_DI1_PIN12__GPIO3_1 (_MX51_PAD_DI1_PIN12__GPIO3_1 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1314 | #define MX51_PAD_DI1_PIN13__DI1_PIN13 (_MX51_PAD_DI1_PIN13__DI1_PIN13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1315 | #define MX51_PAD_DI1_PIN13__GPIO3_2 (_MX51_PAD_DI1_PIN13__GPIO3_2 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1316 | #define MX51_PAD_DI1_D0_CS__DI1_D0_CS (_MX51_PAD_DI1_D0_CS__DI1_D0_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1317 | #define MX51_PAD_DI1_D0_CS__GPIO3_3 (_MX51_PAD_DI1_D0_CS__GPIO3_3 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1318 | #define MX51_PAD_DI1_D1_CS__DI1_D1_CS (_MX51_PAD_DI1_D1_CS__DI1_D1_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1319 | #define MX51_PAD_DI1_D1_CS__DISP1_PIN14 (_MX51_PAD_DI1_D1_CS__DISP1_PIN14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1320 | #define MX51_PAD_DI1_D1_CS__DISP1_PIN5 (_MX51_PAD_DI1_D1_CS__DISP1_PIN5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1321 | #define MX51_PAD_DI1_D1_CS__GPIO3_4 (_MX51_PAD_DI1_D1_CS__GPIO3_4 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1322 | #define MX51_PAD_DISPB2_SER_DIN__DISP1_PIN1 (_MX51_PAD_DISPB2_SER_DIN__DISP1_PIN1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1323 | #define MX51_PAD_DISPB2_SER_DIN__DISPB2_SER_DIN (_MX51_PAD_DISPB2_SER_DIN__DISPB2_SER_DIN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1324 | #define MX51_PAD_DISPB2_SER_DIN__GPIO3_5 (_MX51_PAD_DISPB2_SER_DIN__GPIO3_5 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1325 | #define MX51_PAD_DISPB2_SER_DIO__DISP1_PIN6 (_MX51_PAD_DISPB2_SER_DIO__DISP1_PIN6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1326 | #define MX51_PAD_DISPB2_SER_DIO__DISPB2_SER_DIO (_MX51_PAD_DISPB2_SER_DIO__DISPB2_SER_DIO | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1327 | #define MX51_PAD_DISPB2_SER_DIO__GPIO3_6 (_MX51_PAD_DISPB2_SER_DIO__GPIO3_6 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1328 | #define MX51_PAD_DISPB2_SER_CLK__DISP1_PIN17 (_MX51_PAD_DISPB2_SER_CLK__DISP1_PIN17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1329 | #define MX51_PAD_DISPB2_SER_CLK__DISP1_PIN7 (_MX51_PAD_DISPB2_SER_CLK__DISP1_PIN7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1330 | #define MX51_PAD_DISPB2_SER_CLK__DISPB2_SER_CLK (_MX51_PAD_DISPB2_SER_CLK__DISPB2_SER_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1331 | #define MX51_PAD_DISPB2_SER_CLK__GPIO3_7 (_MX51_PAD_DISPB2_SER_CLK__GPIO3_7 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1332 | #define MX51_PAD_DISPB2_SER_RS__DISP1_EXT_CLK (_MX51_PAD_DISPB2_SER_RS__DISP1_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1333 | #define MX51_PAD_DISPB2_SER_RS__DISP1_PIN16 (_MX51_PAD_DISPB2_SER_RS__DISP1_PIN16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1334 | #define MX51_PAD_DISPB2_SER_RS__DISP1_PIN8 (_MX51_PAD_DISPB2_SER_RS__DISP1_PIN8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1335 | #define MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS (_MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1336 | #define MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS (_MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1337 | #define MX51_PAD_DISPB2_SER_RS__GPIO3_8 (_MX51_PAD_DISPB2_SER_RS__GPIO3_8 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) | ||
1338 | #define MX51_PAD_DISP1_DAT0__DISP1_DAT0 (_MX51_PAD_DISP1_DAT0__DISP1_DAT0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1339 | #define MX51_PAD_DISP1_DAT1__DISP1_DAT1 (_MX51_PAD_DISP1_DAT1__DISP1_DAT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1340 | #define MX51_PAD_DISP1_DAT2__DISP1_DAT2 (_MX51_PAD_DISP1_DAT2__DISP1_DAT2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1341 | #define MX51_PAD_DISP1_DAT3__DISP1_DAT3 (_MX51_PAD_DISP1_DAT3__DISP1_DAT3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1342 | #define MX51_PAD_DISP1_DAT4__DISP1_DAT4 (_MX51_PAD_DISP1_DAT4__DISP1_DAT4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1343 | #define MX51_PAD_DISP1_DAT5__DISP1_DAT5 (_MX51_PAD_DISP1_DAT5__DISP1_DAT5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1344 | #define MX51_PAD_DISP1_DAT6__BOOT_USB_SRC (_MX51_PAD_DISP1_DAT6__BOOT_USB_SRC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1345 | #define MX51_PAD_DISP1_DAT6__DISP1_DAT6 (_MX51_PAD_DISP1_DAT6__DISP1_DAT6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1346 | #define MX51_PAD_DISP1_DAT7__BOOT_EEPROM_CFG (_MX51_PAD_DISP1_DAT7__BOOT_EEPROM_CFG | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1347 | #define MX51_PAD_DISP1_DAT7__DISP1_DAT7 (_MX51_PAD_DISP1_DAT7__DISP1_DAT7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1348 | #define MX51_PAD_DISP1_DAT8__BOOT_SRC0 (_MX51_PAD_DISP1_DAT8__BOOT_SRC0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1349 | #define MX51_PAD_DISP1_DAT8__DISP1_DAT8 (_MX51_PAD_DISP1_DAT8__DISP1_DAT8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1350 | #define MX51_PAD_DISP1_DAT9__BOOT_SRC1 (_MX51_PAD_DISP1_DAT9__BOOT_SRC1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1351 | #define MX51_PAD_DISP1_DAT9__DISP1_DAT9 (_MX51_PAD_DISP1_DAT9__DISP1_DAT9 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1352 | #define MX51_PAD_DISP1_DAT10__BOOT_SPARE_SIZE (_MX51_PAD_DISP1_DAT10__BOOT_SPARE_SIZE | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1353 | #define MX51_PAD_DISP1_DAT10__DISP1_DAT10 (_MX51_PAD_DISP1_DAT10__DISP1_DAT10 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1354 | #define MX51_PAD_DISP1_DAT11__BOOT_LPB_FREQ2 (_MX51_PAD_DISP1_DAT11__BOOT_LPB_FREQ2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1355 | #define MX51_PAD_DISP1_DAT11__DISP1_DAT11 (_MX51_PAD_DISP1_DAT11__DISP1_DAT11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1356 | #define MX51_PAD_DISP1_DAT12__BOOT_MLC_SEL (_MX51_PAD_DISP1_DAT12__BOOT_MLC_SEL | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1357 | #define MX51_PAD_DISP1_DAT12__DISP1_DAT12 (_MX51_PAD_DISP1_DAT12__DISP1_DAT12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1358 | #define MX51_PAD_DISP1_DAT13__BOOT_MEM_CTL0 (_MX51_PAD_DISP1_DAT13__BOOT_MEM_CTL0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1359 | #define MX51_PAD_DISP1_DAT13__DISP1_DAT13 (_MX51_PAD_DISP1_DAT13__DISP1_DAT13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1360 | #define MX51_PAD_DISP1_DAT14__BOOT_MEM_CTL1 (_MX51_PAD_DISP1_DAT14__BOOT_MEM_CTL1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1361 | #define MX51_PAD_DISP1_DAT14__DISP1_DAT14 (_MX51_PAD_DISP1_DAT14__DISP1_DAT14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1362 | #define MX51_PAD_DISP1_DAT15__BOOT_BUS_WIDTH (_MX51_PAD_DISP1_DAT15__BOOT_BUS_WIDTH | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1363 | #define MX51_PAD_DISP1_DAT15__DISP1_DAT15 (_MX51_PAD_DISP1_DAT15__DISP1_DAT15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1364 | #define MX51_PAD_DISP1_DAT16__BOOT_PAGE_SIZE0 (_MX51_PAD_DISP1_DAT16__BOOT_PAGE_SIZE0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1365 | #define MX51_PAD_DISP1_DAT16__DISP1_DAT16 (_MX51_PAD_DISP1_DAT16__DISP1_DAT16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1366 | #define MX51_PAD_DISP1_DAT17__BOOT_PAGE_SIZE1 (_MX51_PAD_DISP1_DAT17__BOOT_PAGE_SIZE1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1367 | #define MX51_PAD_DISP1_DAT17__DISP1_DAT17 (_MX51_PAD_DISP1_DAT17__DISP1_DAT17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1368 | #define MX51_PAD_DISP1_DAT18__BOOT_WEIM_MUXED0 (_MX51_PAD_DISP1_DAT18__BOOT_WEIM_MUXED0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1369 | #define MX51_PAD_DISP1_DAT18__DISP1_DAT18 (_MX51_PAD_DISP1_DAT18__DISP1_DAT18 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1370 | #define MX51_PAD_DISP1_DAT18__DISP2_PIN11 (_MX51_PAD_DISP1_DAT18__DISP2_PIN11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1371 | #define MX51_PAD_DISP1_DAT18__DISP2_PIN5 (_MX51_PAD_DISP1_DAT18__DISP2_PIN5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1372 | #define MX51_PAD_DISP1_DAT19__BOOT_WEIM_MUXED1 (_MX51_PAD_DISP1_DAT19__BOOT_WEIM_MUXED1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1373 | #define MX51_PAD_DISP1_DAT19__DISP1_DAT19 (_MX51_PAD_DISP1_DAT19__DISP1_DAT19 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1374 | #define MX51_PAD_DISP1_DAT19__DISP2_PIN12 (_MX51_PAD_DISP1_DAT19__DISP2_PIN12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1375 | #define MX51_PAD_DISP1_DAT19__DISP2_PIN6 (_MX51_PAD_DISP1_DAT19__DISP2_PIN6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1376 | #define MX51_PAD_DISP1_DAT20__BOOT_MEM_TYPE0 (_MX51_PAD_DISP1_DAT20__BOOT_MEM_TYPE0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1377 | #define MX51_PAD_DISP1_DAT20__DISP1_DAT20 (_MX51_PAD_DISP1_DAT20__DISP1_DAT20 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1378 | #define MX51_PAD_DISP1_DAT20__DISP2_PIN13 (_MX51_PAD_DISP1_DAT20__DISP2_PIN13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1379 | #define MX51_PAD_DISP1_DAT20__DISP2_PIN7 (_MX51_PAD_DISP1_DAT20__DISP2_PIN7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1380 | #define MX51_PAD_DISP1_DAT21__BOOT_MEM_TYPE1 (_MX51_PAD_DISP1_DAT21__BOOT_MEM_TYPE1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1381 | #define MX51_PAD_DISP1_DAT21__DISP1_DAT21 (_MX51_PAD_DISP1_DAT21__DISP1_DAT21 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1382 | #define MX51_PAD_DISP1_DAT21__DISP2_PIN14 (_MX51_PAD_DISP1_DAT21__DISP2_PIN14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1383 | #define MX51_PAD_DISP1_DAT21__DISP2_PIN8 (_MX51_PAD_DISP1_DAT21__DISP2_PIN8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1384 | #define MX51_PAD_DISP1_DAT22__BOOT_LPB_FREQ0 (_MX51_PAD_DISP1_DAT22__BOOT_LPB_FREQ0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1385 | #define MX51_PAD_DISP1_DAT22__DISP1_DAT22 (_MX51_PAD_DISP1_DAT22__DISP1_DAT22 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1386 | #define MX51_PAD_DISP1_DAT22__DISP2_D0_CS (_MX51_PAD_DISP1_DAT22__DISP2_D0_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1387 | #define MX51_PAD_DISP1_DAT22__DISP2_DAT16 (_MX51_PAD_DISP1_DAT22__DISP2_DAT16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1388 | #define MX51_PAD_DISP1_DAT23__BOOT_LPB_FREQ1 (_MX51_PAD_DISP1_DAT23__BOOT_LPB_FREQ1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1389 | #define MX51_PAD_DISP1_DAT23__DISP1_DAT23 (_MX51_PAD_DISP1_DAT23__DISP1_DAT23 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1390 | #define MX51_PAD_DISP1_DAT23__DISP2_D1_CS (_MX51_PAD_DISP1_DAT23__DISP2_D1_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1391 | #define MX51_PAD_DISP1_DAT23__DISP2_DAT17 (_MX51_PAD_DISP1_DAT23__DISP2_DAT17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1392 | #define MX51_PAD_DISP1_DAT23__DISP2_SER_CS (_MX51_PAD_DISP1_DAT23__DISP2_SER_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1393 | #define MX51_PAD_DI1_PIN3__DI1_PIN3 (_MX51_PAD_DI1_PIN3__DI1_PIN3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1394 | #define MX51_PAD_DI1_PIN2__DI1_PIN2 (_MX51_PAD_DI1_PIN2__DI1_PIN2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1395 | #define MX51_PAD_DI_GP2__DISP1_SER_CLK (_MX51_PAD_DI_GP2__DISP1_SER_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1396 | #define MX51_PAD_DI_GP2__DISP2_WAIT (_MX51_PAD_DI_GP2__DISP2_WAIT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1397 | #define MX51_PAD_DI_GP3__CSI1_DATA_EN (_MX51_PAD_DI_GP3__CSI1_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1398 | #define MX51_PAD_DI_GP3__DISP1_SER_DIO (_MX51_PAD_DI_GP3__DISP1_SER_DIO | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1399 | #define MX51_PAD_DI_GP3__FEC_TX_ER (_MX51_PAD_DI_GP3__FEC_TX_ER | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1400 | #define MX51_PAD_DI2_PIN4__CSI2_DATA_EN (_MX51_PAD_DI2_PIN4__CSI2_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1401 | #define MX51_PAD_DI2_PIN4__DI2_PIN4 (_MX51_PAD_DI2_PIN4__DI2_PIN4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1402 | #define MX51_PAD_DI2_PIN4__FEC_CRS (_MX51_PAD_DI2_PIN4__FEC_CRS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1403 | #define MX51_PAD_DI2_PIN2__DI2_PIN2 (_MX51_PAD_DI2_PIN2__DI2_PIN2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1404 | #define MX51_PAD_DI2_PIN2__FEC_MDC (_MX51_PAD_DI2_PIN2__FEC_MDC | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1405 | #define MX51_PAD_DI2_PIN3__DI2_PIN3 (_MX51_PAD_DI2_PIN3__DI2_PIN3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1406 | #define MX51_PAD_DI2_PIN3__FEC_MDIO (_MX51_PAD_DI2_PIN3__FEC_MDIO | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1407 | #define MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK (_MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1408 | #define MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 (_MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1409 | #define MX51_PAD_DI_GP4__DI2_PIN15 (_MX51_PAD_DI_GP4__DI2_PIN15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1410 | #define MX51_PAD_DI_GP4__DISP1_SER_DIN (_MX51_PAD_DI_GP4__DISP1_SER_DIN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1411 | #define MX51_PAD_DI_GP4__DISP2_PIN1 (_MX51_PAD_DI_GP4__DISP2_PIN1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1412 | #define MX51_PAD_DI_GP4__FEC_RDATA2 (_MX51_PAD_DI_GP4__FEC_RDATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1413 | #define MX51_PAD_DISP2_DAT0__DISP2_DAT0 (_MX51_PAD_DISP2_DAT0__DISP2_DAT0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1414 | #define MX51_PAD_DISP2_DAT0__FEC_RDATA3 (_MX51_PAD_DISP2_DAT0__FEC_RDATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1415 | #define MX51_PAD_DISP2_DAT0__KEY_COL6 (_MX51_PAD_DISP2_DAT0__KEY_COL6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1416 | #define MX51_PAD_DISP2_DAT0__UART3_RXD (_MX51_PAD_DISP2_DAT0__UART3_RXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1417 | #define MX51_PAD_DISP2_DAT0__USBH3_CLK (_MX51_PAD_DISP2_DAT0__USBH3_CLK | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1418 | #define MX51_PAD_DISP2_DAT1__DISP2_DAT1 (_MX51_PAD_DISP2_DAT1__DISP2_DAT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1419 | #define MX51_PAD_DISP2_DAT1__FEC_RX_ER (_MX51_PAD_DISP2_DAT1__FEC_RX_ER | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1420 | #define MX51_PAD_DISP2_DAT1__KEY_COL7 (_MX51_PAD_DISP2_DAT1__KEY_COL7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1421 | #define MX51_PAD_DISP2_DAT1__UART3_TXD (_MX51_PAD_DISP2_DAT1__UART3_TXD | MUX_PAD_CTRL(MX51_UART_PAD_CTRL)) | ||
1422 | #define MX51_PAD_DISP2_DAT1__USBH3_DIR (_MX51_PAD_DISP2_DAT1__USBH3_DIR | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1423 | #define MX51_PAD_DISP2_DAT2__DISP2_DAT2 (_MX51_PAD_DISP2_DAT2__DISP2_DAT2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1424 | #define MX51_PAD_DISP2_DAT3__DISP2_DAT3 (_MX51_PAD_DISP2_DAT3__DISP2_DAT3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1425 | #define MX51_PAD_DISP2_DAT4__DISP2_DAT4 (_MX51_PAD_DISP2_DAT4__DISP2_DAT4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1426 | #define MX51_PAD_DISP2_DAT5__DISP2_DAT5 (_MX51_PAD_DISP2_DAT5__DISP2_DAT5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1427 | #define MX51_PAD_DISP2_DAT6__DISP2_DAT6 (_MX51_PAD_DISP2_DAT6__DISP2_DAT6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1428 | #define MX51_PAD_DISP2_DAT6__FEC_TDATA1 (_MX51_PAD_DISP2_DAT6__FEC_TDATA1 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1429 | #define MX51_PAD_DISP2_DAT6__GPIO1_19 (_MX51_PAD_DISP2_DAT6__GPIO1_19 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1430 | #define MX51_PAD_DISP2_DAT6__KEY_ROW4 (_MX51_PAD_DISP2_DAT6__KEY_ROW4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1431 | #define MX51_PAD_DISP2_DAT6__USBH3_STP (_MX51_PAD_DISP2_DAT6__USBH3_STP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1432 | #define MX51_PAD_DISP2_DAT7__DISP2_DAT7 (_MX51_PAD_DISP2_DAT7__DISP2_DAT7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1433 | #define MX51_PAD_DISP2_DAT7__FEC_TDATA2 (_MX51_PAD_DISP2_DAT7__FEC_TDATA2 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1434 | #define MX51_PAD_DISP2_DAT7__GPIO1_29 (_MX51_PAD_DISP2_DAT7__GPIO1_29 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1435 | #define MX51_PAD_DISP2_DAT7__KEY_ROW5 (_MX51_PAD_DISP2_DAT7__KEY_ROW5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1436 | #define MX51_PAD_DISP2_DAT7__USBH3_NXT (_MX51_PAD_DISP2_DAT7__USBH3_NXT | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1437 | #define MX51_PAD_DISP2_DAT8__DISP2_DAT8 (_MX51_PAD_DISP2_DAT8__DISP2_DAT8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1438 | #define MX51_PAD_DISP2_DAT8__FEC_TDATA3 (_MX51_PAD_DISP2_DAT8__FEC_TDATA3 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1439 | #define MX51_PAD_DISP2_DAT8__GPIO1_30 (_MX51_PAD_DISP2_DAT8__GPIO1_30 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1440 | #define MX51_PAD_DISP2_DAT8__KEY_ROW6 (_MX51_PAD_DISP2_DAT8__KEY_ROW6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1441 | #define MX51_PAD_DISP2_DAT8__USBH3_DATA0 (_MX51_PAD_DISP2_DAT8__USBH3_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1442 | #define MX51_PAD_DISP2_DAT9__AUD6_RXC (_MX51_PAD_DISP2_DAT9__AUD6_RXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1443 | #define MX51_PAD_DISP2_DAT9__DISP2_DAT9 (_MX51_PAD_DISP2_DAT9__DISP2_DAT9 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1444 | #define MX51_PAD_DISP2_DAT9__FEC_TX_EN (_MX51_PAD_DISP2_DAT9__FEC_TX_EN | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1445 | #define MX51_PAD_DISP2_DAT9__GPIO1_31 (_MX51_PAD_DISP2_DAT9__GPIO1_31 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1446 | #define MX51_PAD_DISP2_DAT9__USBH3_DATA1 (_MX51_PAD_DISP2_DAT9__USBH3_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1447 | #define MX51_PAD_DISP2_DAT10__DISP2_DAT10 (_MX51_PAD_DISP2_DAT10__DISP2_DAT10 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1448 | #define MX51_PAD_DISP2_DAT10__DISP2_SER_CS (_MX51_PAD_DISP2_DAT10__DISP2_SER_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1449 | #define MX51_PAD_DISP2_DAT10__FEC_COL (_MX51_PAD_DISP2_DAT10__FEC_COL | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1450 | #define MX51_PAD_DISP2_DAT10__KEY_ROW7 (_MX51_PAD_DISP2_DAT10__KEY_ROW7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1451 | #define MX51_PAD_DISP2_DAT10__USBH3_DATA2 (_MX51_PAD_DISP2_DAT10__USBH3_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1452 | #define MX51_PAD_DISP2_DAT11__AUD6_TXD (_MX51_PAD_DISP2_DAT11__AUD6_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1453 | #define MX51_PAD_DISP2_DAT11__DISP2_DAT11 (_MX51_PAD_DISP2_DAT11__DISP2_DAT11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1454 | #define MX51_PAD_DISP2_DAT11__FEC_RX_CLK (_MX51_PAD_DISP2_DAT11__FEC_RX_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1455 | #define MX51_PAD_DISP2_DAT11__GPIO1_10 (_MX51_PAD_DISP2_DAT11__GPIO1_10 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1456 | #define MX51_PAD_DISP2_DAT11__USBH3_DATA3 (_MX51_PAD_DISP2_DAT11__USBH3_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1457 | #define MX51_PAD_DISP2_DAT12__AUD6_RXD (_MX51_PAD_DISP2_DAT12__AUD6_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1458 | #define MX51_PAD_DISP2_DAT12__DISP2_DAT12 (_MX51_PAD_DISP2_DAT12__DISP2_DAT12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1459 | #define MX51_PAD_DISP2_DAT12__FEC_RX_DV (_MX51_PAD_DISP2_DAT12__FEC_RX_DV | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1460 | #define MX51_PAD_DISP2_DAT12__USBH3_DATA4 (_MX51_PAD_DISP2_DAT12__USBH3_DATA4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1461 | #define MX51_PAD_DISP2_DAT13__AUD6_TXC (_MX51_PAD_DISP2_DAT13__AUD6_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1462 | #define MX51_PAD_DISP2_DAT13__DISP2_DAT13 (_MX51_PAD_DISP2_DAT13__DISP2_DAT13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1463 | #define MX51_PAD_DISP2_DAT13__FEC_TX_CLK (_MX51_PAD_DISP2_DAT13__FEC_TX_CLK | MUX_PAD_CTRL(MX51_PAD_CTRL_4)) | ||
1464 | #define MX51_PAD_DISP2_DAT13__USBH3_DATA5 (_MX51_PAD_DISP2_DAT13__USBH3_DATA5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1465 | #define MX51_PAD_DISP2_DAT14__AUD6_TXFS (_MX51_PAD_DISP2_DAT14__AUD6_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1466 | #define MX51_PAD_DISP2_DAT14__DISP2_DAT14 (_MX51_PAD_DISP2_DAT14__DISP2_DAT14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1467 | #define MX51_PAD_DISP2_DAT14__FEC_RDATA0 (_MX51_PAD_DISP2_DAT14__FEC_RDATA0 | MUX_PAD_CTRL(MX51_PAD_CTRL_4)) | ||
1468 | #define MX51_PAD_DISP2_DAT14__USBH3_DATA6 (_MX51_PAD_DISP2_DAT14__USBH3_DATA6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1469 | #define MX51_PAD_DISP2_DAT15__AUD6_RXFS (_MX51_PAD_DISP2_DAT15__AUD6_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1470 | #define MX51_PAD_DISP2_DAT15__DISP1_SER_CS (_MX51_PAD_DISP2_DAT15__DISP1_SER_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1471 | #define MX51_PAD_DISP2_DAT15__DISP2_DAT15 (_MX51_PAD_DISP2_DAT15__DISP2_DAT15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1472 | #define MX51_PAD_DISP2_DAT15__FEC_TDATA0 (_MX51_PAD_DISP2_DAT15__FEC_TDATA0 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) | ||
1473 | #define MX51_PAD_DISP2_DAT15__USBH3_DATA7 (_MX51_PAD_DISP2_DAT15__USBH3_DATA7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1474 | #define MX51_PAD_SD1_CMD__AUD5_RXFS (_MX51_PAD_SD1_CMD__AUD5_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1475 | #define MX51_PAD_SD1_CMD__CSPI_MOSI (_MX51_PAD_SD1_CMD__CSPI_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1476 | #define MX51_PAD_SD1_CMD__SD1_CMD (_MX51_PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL)) | ||
1477 | #define MX51_PAD_SD1_CLK__AUD5_RXC (_MX51_PAD_SD1_CLK__AUD5_RXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1478 | #define MX51_PAD_SD1_CLK__CSPI_SCLK (_MX51_PAD_SD1_CLK__CSPI_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1479 | #define MX51_PAD_SD1_CLK__SD1_CLK (_MX51_PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS)) | ||
1480 | #define MX51_PAD_SD1_DATA0__AUD5_TXD (_MX51_PAD_SD1_DATA0__AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1481 | #define MX51_PAD_SD1_DATA0__CSPI_MISO (_MX51_PAD_SD1_DATA0__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1482 | #define MX51_PAD_SD1_DATA0__SD1_DATA0 (_MX51_PAD_SD1_DATA0__SD1_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1483 | #define MX51_PAD_EIM_DA0__EIM_DA0 (_MX51_PAD_EIM_DA0__EIM_DA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1484 | #define MX51_PAD_EIM_DA1__EIM_DA1 (_MX51_PAD_EIM_DA1__EIM_DA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1485 | #define MX51_PAD_EIM_DA2__EIM_DA2 (_MX51_PAD_EIM_DA2__EIM_DA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1486 | #define MX51_PAD_EIM_DA3__EIM_DA3 (_MX51_PAD_EIM_DA3__EIM_DA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1487 | #define MX51_PAD_SD1_DATA1__AUD5_RXD (_MX51_PAD_SD1_DATA1__AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1488 | #define MX51_PAD_SD1_DATA1__SD1_DATA1 (_MX51_PAD_SD1_DATA1__SD1_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1489 | #define MX51_PAD_EIM_DA4__EIM_DA4 (_MX51_PAD_EIM_DA4__EIM_DA4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1490 | #define MX51_PAD_EIM_DA5__EIM_DA5 (_MX51_PAD_EIM_DA5__EIM_DA5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1491 | #define MX51_PAD_EIM_DA6__EIM_DA6 (_MX51_PAD_EIM_DA6__EIM_DA6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1492 | #define MX51_PAD_EIM_DA7__EIM_DA7 (_MX51_PAD_EIM_DA7__EIM_DA7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1493 | #define MX51_PAD_SD1_DATA2__AUD5_TXC (_MX51_PAD_SD1_DATA2__AUD5_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1494 | #define MX51_PAD_SD1_DATA2__SD1_DATA2 (_MX51_PAD_SD1_DATA2__SD1_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1495 | #define MX51_PAD_EIM_DA10__EIM_DA10 (_MX51_PAD_EIM_DA10__EIM_DA10 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1496 | #define MX51_PAD_EIM_DA11__EIM_DA11 (_MX51_PAD_EIM_DA11__EIM_DA11 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1497 | #define MX51_PAD_EIM_DA8__EIM_DA8 (_MX51_PAD_EIM_DA8__EIM_DA8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1498 | #define MX51_PAD_EIM_DA9__EIM_DA9 (_MX51_PAD_EIM_DA9__EIM_DA9 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1499 | #define MX51_PAD_SD1_DATA3__AUD5_TXFS (_MX51_PAD_SD1_DATA3__AUD5_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1500 | #define MX51_PAD_SD1_DATA3__CSPI_SS1 (_MX51_PAD_SD1_DATA3__CSPI_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1501 | #define MX51_PAD_SD1_DATA3__SD1_DATA3 (_MX51_PAD_SD1_DATA3__SD1_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1502 | #define MX51_PAD_GPIO1_0__CSPI_SS2 (_MX51_PAD_GPIO1_0__CSPI_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1503 | #define MX51_PAD_GPIO1_0__GPIO1_0 (_MX51_PAD_GPIO1_0__GPIO1_0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1504 | #define MX51_PAD_GPIO1_0__SD1_CD (_MX51_PAD_GPIO1_0__SD1_CD | MUX_PAD_CTRL(MX51_ESDHC_PAD_CTRL)) | ||
1505 | #define MX51_PAD_GPIO1_1__CSPI_MISO (_MX51_PAD_GPIO1_1__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1506 | #define MX51_PAD_GPIO1_1__GPIO1_1 (_MX51_PAD_GPIO1_1__GPIO1_1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1507 | #define MX51_PAD_GPIO1_1__SD1_WP (_MX51_PAD_GPIO1_1__SD1_WP | MUX_PAD_CTRL(MX51_ESDHC_PAD_CTRL)) | ||
1508 | #define MX51_PAD_EIM_DA12__EIM_DA12 (_MX51_PAD_EIM_DA12__EIM_DA12 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1509 | #define MX51_PAD_EIM_DA13__EIM_DA13 (_MX51_PAD_EIM_DA13__EIM_DA13 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1510 | #define MX51_PAD_EIM_DA14__EIM_DA14 (_MX51_PAD_EIM_DA14__EIM_DA14 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1511 | #define MX51_PAD_EIM_DA15__EIM_DA15 (_MX51_PAD_EIM_DA15__EIM_DA15 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1512 | #define MX51_PAD_SD2_CMD__CSPI_MOSI (_MX51_PAD_SD2_CMD__CSPI_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1513 | #define MX51_PAD_SD2_CMD__I2C1_SCL (_MX51_PAD_SD2_CMD__I2C1_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1514 | #define MX51_PAD_SD2_CMD__SD2_CMD (_MX51_PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL)) | ||
1515 | #define MX51_PAD_SD2_CLK__CSPI_SCLK (_MX51_PAD_SD2_CLK__CSPI_SCLK | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1516 | #define MX51_PAD_SD2_CLK__I2C1_SDA (_MX51_PAD_SD2_CLK__I2C1_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1517 | #define MX51_PAD_SD2_CLK__SD2_CLK (_MX51_PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS)) | ||
1518 | #define MX51_PAD_SD2_DATA0__CSPI_MISO (_MX51_PAD_SD2_DATA0__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1519 | #define MX51_PAD_SD2_DATA0__SD1_DAT4 (_MX51_PAD_SD2_DATA0__SD1_DAT4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1520 | #define MX51_PAD_SD2_DATA0__SD2_DATA0 (_MX51_PAD_SD2_DATA0__SD2_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1521 | #define MX51_PAD_SD2_DATA1__SD1_DAT5 (_MX51_PAD_SD2_DATA1__SD1_DAT5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1522 | #define MX51_PAD_SD2_DATA1__SD2_DATA1 (_MX51_PAD_SD2_DATA1__SD2_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1523 | #define MX51_PAD_SD2_DATA1__USBH3_H2_DP (_MX51_PAD_SD2_DATA1__USBH3_H2_DP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1524 | #define MX51_PAD_SD2_DATA2__SD1_DAT6 (_MX51_PAD_SD2_DATA2__SD1_DAT6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1525 | #define MX51_PAD_SD2_DATA2__SD2_DATA2 (_MX51_PAD_SD2_DATA2__SD2_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1526 | #define MX51_PAD_SD2_DATA2__USBH3_H2_DM (_MX51_PAD_SD2_DATA2__USBH3_H2_DM | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1527 | #define MX51_PAD_SD2_DATA3__CSPI_SS2 (_MX51_PAD_SD2_DATA3__CSPI_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) | ||
1528 | #define MX51_PAD_SD2_DATA3__SD1_DAT7 (_MX51_PAD_SD2_DATA3__SD1_DAT7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1529 | #define MX51_PAD_SD2_DATA3__SD2_DATA3 (_MX51_PAD_SD2_DATA3__SD2_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1530 | #define MX51_PAD_GPIO1_2__CCM_OUT_2 (_MX51_PAD_GPIO1_2__CCM_OUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1531 | #define MX51_PAD_GPIO1_2__GPIO1_2 (_MX51_PAD_GPIO1_2__GPIO1_2 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1532 | #define MX51_PAD_GPIO1_2__I2C2_SCL (_MX51_PAD_GPIO1_2__I2C2_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1533 | #define MX51_PAD_GPIO1_2__PLL1_BYP (_MX51_PAD_GPIO1_2__PLL1_BYP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1534 | #define MX51_PAD_GPIO1_2__PWM1_PWMO (_MX51_PAD_GPIO1_2__PWM1_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1535 | #define MX51_PAD_GPIO1_3__GPIO1_3 (_MX51_PAD_GPIO1_3__GPIO1_3 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1536 | #define MX51_PAD_GPIO1_3__I2C2_SDA (_MX51_PAD_GPIO1_3__I2C2_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) | ||
1537 | #define MX51_PAD_GPIO1_3__PLL2_BYP (_MX51_PAD_GPIO1_3__PLL2_BYP | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1538 | #define MX51_PAD_GPIO1_3__PWM2_PWMO (_MX51_PAD_GPIO1_3__PWM2_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1539 | #define MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ (_MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1540 | #define MX51_PAD_PMIC_INT_REQ__PMIC_PMU_IRQ_B (_MX51_PAD_PMIC_INT_REQ__PMIC_PMU_IRQ_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1541 | #define MX51_PAD_GPIO1_4__DISP2_EXT_CLK (_MX51_PAD_GPIO1_4__DISP2_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1542 | #define MX51_PAD_GPIO1_4__EIM_RDY (_MX51_PAD_GPIO1_4__EIM_RDY | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1543 | #define MX51_PAD_GPIO1_4__GPIO1_4 (_MX51_PAD_GPIO1_4__GPIO1_4 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1544 | #define MX51_PAD_GPIO1_4__WDOG1_WDOG_B (_MX51_PAD_GPIO1_4__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1545 | #define MX51_PAD_GPIO1_5__CSI2_MCLK (_MX51_PAD_GPIO1_5__CSI2_MCLK | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1546 | #define MX51_PAD_GPIO1_5__DISP2_PIN16 (_MX51_PAD_GPIO1_5__DISP2_PIN16 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1547 | #define MX51_PAD_GPIO1_5__GPIO1_5 (_MX51_PAD_GPIO1_5__GPIO1_5 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1548 | #define MX51_PAD_GPIO1_5__WDOG2_WDOG_B (_MX51_PAD_GPIO1_5__WDOG2_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1549 | #define MX51_PAD_GPIO1_6__DISP2_PIN17 (_MX51_PAD_GPIO1_6__DISP2_PIN17 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1550 | #define MX51_PAD_GPIO1_6__GPIO1_6 (_MX51_PAD_GPIO1_6__GPIO1_6 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1551 | #define MX51_PAD_GPIO1_6__REF_EN_B (_MX51_PAD_GPIO1_6__REF_EN_B | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1552 | #define MX51_PAD_GPIO1_7__CCM_OUT_0 (_MX51_PAD_GPIO1_7__CCM_OUT_0 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1553 | #define MX51_PAD_GPIO1_7__GPIO1_7 (_MX51_PAD_GPIO1_7__GPIO1_7 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1554 | #define MX51_PAD_GPIO1_7__SD2_WP (_MX51_PAD_GPIO1_7__SD2_WP | MUX_PAD_CTRL(MX51_ESDHC_PAD_CTRL)) | ||
1555 | #define MX51_PAD_GPIO1_7__SPDIF_OUT1 (_MX51_PAD_GPIO1_7__SPDIF_OUT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1556 | #define MX51_PAD_GPIO1_8__CSI2_DATA_EN (_MX51_PAD_GPIO1_8__CSI2_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1557 | #define MX51_PAD_GPIO1_8__GPIO1_8 (_MX51_PAD_GPIO1_8__GPIO1_8 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1558 | #define MX51_PAD_GPIO1_8__SD2_CD (_MX51_PAD_GPIO1_8__SD2_CD | MUX_PAD_CTRL(MX51_ESDHC_PAD_CTRL)) | ||
1559 | #define MX51_PAD_GPIO1_8__USBH3_PWR (_MX51_PAD_GPIO1_8__USBH3_PWR | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1560 | #define MX51_PAD_GPIO1_9__CCM_OUT_1 (_MX51_PAD_GPIO1_9__CCM_OUT_1 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1561 | #define MX51_PAD_GPIO1_9__DISP2_D1_CS (_MX51_PAD_GPIO1_9__DISP2_D1_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1562 | #define MX51_PAD_GPIO1_9__DISP2_SER_CS (_MX51_PAD_GPIO1_9__DISP2_SER_CS | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1563 | #define MX51_PAD_GPIO1_9__GPIO1_9 (_MX51_PAD_GPIO1_9__GPIO1_9 | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1564 | #define MX51_PAD_GPIO1_9__SD2_LCTL (_MX51_PAD_GPIO1_9__SD2_LCTL | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
1565 | #define MX51_PAD_GPIO1_9__USBH3_OC (_MX51_PAD_GPIO1_9__USBH3_OC | MUX_PAD_CTRL(NO_PAD_CTRL)) | ||
386 | 1566 | ||
387 | #endif /* __MACH_IOMUX_MX51_H__ */ | 1567 | #endif /* __MACH_IOMUX_MX51_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx53.h b/arch/arm/plat-mxc/include/mach/iomux-mx53.h new file mode 100644 index 000000000000..5deee019c29e --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/iomux-mx53.h | |||
@@ -0,0 +1,323 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc.. | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_IOMUX_MX53_H__ | ||
20 | #define __MACH_IOMUX_MX53_H__ | ||
21 | |||
22 | #include <mach/iomux-v3.h> | ||
23 | |||
24 | /* | ||
25 | * various IOMUX alternate output functions (1-7) | ||
26 | */ | ||
27 | typedef enum iomux_config { | ||
28 | IOMUX_CONFIG_ALT0, | ||
29 | IOMUX_CONFIG_ALT1, | ||
30 | IOMUX_CONFIG_ALT2, | ||
31 | IOMUX_CONFIG_ALT3, | ||
32 | IOMUX_CONFIG_ALT4, | ||
33 | IOMUX_CONFIG_ALT5, | ||
34 | IOMUX_CONFIG_ALT6, | ||
35 | IOMUX_CONFIG_ALT7, | ||
36 | IOMUX_CONFIG_GPIO, /* added to help user use GPIO mode */ | ||
37 | IOMUX_CONFIG_SION = 0x1 << 4, /* LOOPBACK:MUX SION bit */ | ||
38 | } iomux_pin_cfg_t; | ||
39 | |||
40 | /* These 2 defines are for pins that may not have a mux register, but could | ||
41 | * have a pad setting register, and vice-versa. */ | ||
42 | #define NON_MUX_I 0x00 | ||
43 | #define NON_PAD_I 0x00 | ||
44 | |||
45 | #define MX53_UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
46 | PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_HYS) | ||
47 | /* UART1 */ | ||
48 | #define MX53_PAD_CSI0_D10__UART1_TXD IOMUX_PAD(0x414, 0xE8, 2, 0x0, 0, MX53_UART_PAD_CTRL) | ||
49 | #define MX53_PAD_CSI0_D11__UART1_RXD IOMUX_PAD(0x418, 0xEC, 2, 0x878, 1, MX53_UART_PAD_CTRL) | ||
50 | #define MX53_PAD_ATA_DIOW__UART1_TXD IOMUX_PAD(0x5F0, 0x270, 3, 0x0, 0, MX53_UART_PAD_CTRL) | ||
51 | #define MX53_PAD_ATA_DMACK__UART1_RXD IOMUX_PAD(0x5F4, 0x274, 3, 0x880, 3, MX53_UART_PAD_CTRL) | ||
52 | |||
53 | /* UART2 */ | ||
54 | #define MX53_PAD_ATA_BUFFER_EN__UART2_RXD IOMUX_PAD(0x5FC, 0x27C, 3, 0x880, 3, MX53_UART_PAD_CTRL) | ||
55 | #define MX53_PAD_ATA_DMARQ__UART2_TXD IOMUX_PAD(0x5F8, 0x278, 3, 0x0, 0, MX53_UART_PAD_CTRL) | ||
56 | #define MX53_PAD_ATA_DIOR__UART2_RTS IOMUX_PAD(0x604, 0x284, 3, 0x87C, 3, MX53_UART_PAD_CTRL) | ||
57 | #define MX53_PAD_ATA_INTRQ__UART2_CTS IOMUX_PAD(0x600, 0x280, 3, 0x0, 0, MX53_UART_PAD_CTRL) | ||
58 | |||
59 | /* UART3 */ | ||
60 | #define MX53_PAD_ATA_CS_0__UART3_TXD IOMUX_PAD(0x61C, 0x29C, 4, 0x0, 0, MX53_UART_PAD_CTRL) | ||
61 | #define MX53_PAD_ATA_CS_1__UART3_RXD IOMUX_PAD(0x620, 0x2A0, 4, 0x888, 3, MX53_UART_PAD_CTRL) | ||
62 | #define MX53_PAD_ATA_DA_1__UART3_CTS IOMUX_PAD(0x614, 0x294, 4, 0x0, 0, MX53_UART_PAD_CTRL) | ||
63 | #define MX53_PAD_ATA_DA_2__UART3_RTS IOMUX_PAD(0x618, 0x298, 4, 0x884, 5, MX53_UART_PAD_CTRL) | ||
64 | |||
65 | #define MX53_PAD_GPIO_19__GPIO_4_5 IOMUX_PAD(0x348, 0x20,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
66 | #define MX53_PAD_KEY_COL0__GPIO_4_6 IOMUX_PAD(0x34C, 0x24,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
67 | #define MX53_PAD_KEY_ROW0__GPIO_4_7 IOMUX_PAD(0x350, 0x28,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
68 | #define MX53_PAD_KEY_COL1__GPIO_4_8 IOMUX_PAD(0x354, 0x2C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
69 | #define MX53_PAD_KEY_ROW1__GPIO_4_9 IOMUX_PAD(0x358, 0x30,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
70 | #define MX53_PAD_KEY_COL2__GPIO_4_10 IOMUX_PAD(0x35C, 0x34,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
71 | #define MX53_PAD_KEY_ROW2__GPIO_4_11 IOMUX_PAD(0x360, 0x38,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
72 | #define MX53_PAD_KEY_COL3__GPIO_4_12 IOMUX_PAD(0x364, 0x3C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
73 | #define MX53_PAD_KEY_ROW3__GPIO_4_13 IOMUX_PAD(0x368, 0x40,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
74 | #define MX53_PAD_KEY_COL4__GPIO_4_14 IOMUX_PAD(0x36C, 0x44,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
75 | #define MX53_PAD_KEY_ROW4__GPIO_4_15 IOMUX_PAD(0x370, 0x48,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
76 | #define MX53_PAD_NVCC_KEYPAD__NVCC_KEYPAD IOMUX_PAD(0x374, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
77 | #define MX53_PAD_DI0_DISP_CLK__GPIO_4_16 IOMUX_PAD(0x378, 0x4C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
78 | #define MX53_PAD_DI0_PIN15__GPIO_4_17 IOMUX_PAD(0x37C, 0x50,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
79 | #define MX53_PAD_DI0_PIN2__GPIO_4_18 IOMUX_PAD(0x380, 0x54,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
80 | #define MX53_PAD_DI0_PIN3__GPIO_4_19 IOMUX_PAD(0x384, 0x58,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
81 | #define MX53_PAD_DI0_PIN4__GPIO_4_20 IOMUX_PAD(0x388, 0x5C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
82 | #define MX53_PAD_DISP0_DAT0__GPIO_4_21 IOMUX_PAD(0x38C, 0x60,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
83 | #define MX53_PAD_DISP0_DAT1__GPIO_4_22 IOMUX_PAD(0x390, 0x64,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
84 | #define MX53_PAD_DISP0_DAT2__GPIO_4_23 IOMUX_PAD(0x394, 0x68,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
85 | #define MX53_PAD_DISP0_DAT3__GPIO_4_24 IOMUX_PAD(0x398, 0x6C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
86 | #define MX53_PAD_DISP0_DAT4__GPIO_4_25 IOMUX_PAD(0x39C, 0x70,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
87 | #define MX53_PAD_DISP0_DAT5__GPIO_4_26 IOMUX_PAD(0x3A0, 0x74,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
88 | #define MX53_PAD_DISP0_DAT6__GPIO_4_27 IOMUX_PAD(0x3A4, 0x78,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
89 | #define MX53_PAD_DISP0_DAT7__GPIO_4_28 IOMUX_PAD(0x3A8, 0x7C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
90 | #define MX53_PAD_DISP0_DAT8__GPIO_4_29 IOMUX_PAD(0x3AC, 0x80,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
91 | #define MX53_PAD_DISP0_DAT9__GPIO_4_30 IOMUX_PAD(0x3B0, 0x84,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
92 | #define MX53_PAD_DISP0_DAT10__GPIO_4_31 IOMUX_PAD(0x3B4, 0x88,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
93 | #define MX53_PAD_DISP0_DAT11__GPIO_5_5 IOMUX_PAD(0x3B8, 0x8C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
94 | #define MX53_PAD_DISP0_DAT12__GPIO_5_6 IOMUX_PAD(0x3BC, 0x90,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
95 | #define MX53_PAD_DISP0_DAT13__GPIO_5_7 IOMUX_PAD(0x3C0, 0x94,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
96 | #define MX53_PAD_DISP0_DAT14__GPIO_5_8 IOMUX_PAD(0x3C4, 0x98,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
97 | #define MX53_PAD_DISP0_DAT15__GPIO_5_9 IOMUX_PAD(0x3C8, 0x9C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
98 | #define MX53_PAD_DISP0_DAT16__GPIO_5_10 IOMUX_PAD(0x3CC, 0xA0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
99 | #define MX53_PAD_DISP0_DAT17__GPIO_5_11 IOMUX_PAD(0x3D0, 0xA4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
100 | #define MX53_PAD_DISP0_DAT18__GPIO_5_12 IOMUX_PAD(0x3D4, 0xA8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
101 | #define MX53_PAD_DISP0_DAT19__GPIO_5_13 IOMUX_PAD(0x3D8, 0xAC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
102 | #define MX53_PAD_DISP0_DAT20__GPIO_5_14 IOMUX_PAD(0x3DC, 0xB0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
103 | #define MX53_PAD_DISP0_DAT21__GPIO_5_15 IOMUX_PAD(0x3E0, 0xB4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
104 | #define MX53_PAD_DISP0_DAT22__GPIO_5_16 IOMUX_PAD(0x3E4, 0xB8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
105 | #define MX53_PAD_DISP0_DAT23__GPIO_5_17 IOMUX_PAD(0x3E8, 0xBC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
106 | #define MX53_PAD_CSI0_PIXCLK__GPIO_5_18 IOMUX_PAD(0x3EC, 0xC0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
107 | #define MX53_PAD_CSI0_MCLK__GPIO_5_19 IOMUX_PAD(0x3F0, 0xC4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
108 | #define MX53_PAD_CSI0_DATA_EN__GPIO_5_20 IOMUX_PAD(0x3F4, 0xC8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
109 | #define MX53_PAD_CSI0_VSYNC__GPIO_5_21 IOMUX_PAD(0x3F8, 0xCC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
110 | #define MX53_PAD_CSI0_D4__GPIO_5_22 IOMUX_PAD(0x3FC, 0xD0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
111 | #define MX53_PAD_CSI0_D5__GPIO_5_23 IOMUX_PAD(0x400, 0xD4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
112 | #define MX53_PAD_CSI0_D6__GPIO_5_24 IOMUX_PAD(0x404, 0xD8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
113 | #define MX53_PAD_CSI0_D7__GPIO_5_25 IOMUX_PAD(0x408, 0xDC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
114 | #define MX53_PAD_CSI0_D8__GPIO_5_26 IOMUX_PAD(0x40C, 0xE0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
115 | #define MX53_PAD_CSI0_D9__GPIO_5_27 IOMUX_PAD(0x410, 0xE4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
116 | #define MX53_PAD_CSI0_D10__GPIO_5_28 IOMUX_PAD(0x414, 0xE8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
117 | #define MX53_PAD_CSI0_D11__GPIO_5_29 IOMUX_PAD(0x418, 0xEC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
118 | #define MX53_PAD_CSI0_D12__GPIO_5_30 IOMUX_PAD(0x41C, 0xF0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
119 | #define MX53_PAD_CSI0_D13__GPIO_5_31 IOMUX_PAD(0x420, 0xF4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
120 | #define MX53_PAD_CSI0_D14__GPIO_6_0 IOMUX_PAD(0x424, 0xF8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
121 | #define MX53_PAD_CSI0_D15__GPIO_6_1 IOMUX_PAD(0x428, 0xFC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
122 | #define MX53_PAD_CSI0_D16__GPIO_6_2 IOMUX_PAD(0x42C, 0x100,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
123 | #define MX53_PAD_CSI0_D17__GPIO_6_3 IOMUX_PAD(0x430, 0x104,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
124 | #define MX53_PAD_CSI0_D18__GPIO_6_4 IOMUX_PAD(0x434, 0x108,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
125 | #define MX53_PAD_CSI0_D19__GPIO_6_5 IOMUX_PAD(0x438, 0x10C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
126 | #define MX53_PAD_NVCC_CSI0__NVCC_CSI0 IOMUX_PAD(0x43C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
127 | #define MX53_PAD_JTAG_TMS__JTAG_TMS IOMUX_PAD(0x440, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
128 | #define MX53_PAD_JTAG_MOD__JTAG_MOD IOMUX_PAD(0x444, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
129 | #define MX53_PAD_JTAG_TRSTB__JTAG_TRSTB IOMUX_PAD(0x448, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
130 | #define MX53_PAD_JTAG_TDI__JTAG_TDI IOMUX_PAD(0x44C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
131 | #define MX53_PAD_JTAG_TCK__JTAG_TCK IOMUX_PAD(0x450, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
132 | #define MX53_PAD_JTAG_TDO__JTAG_TDO IOMUX_PAD(0x454, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
133 | #define MX53_PAD_EIM_A25__GPIO_5_2 IOMUX_PAD(0x458, 0x110,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
134 | #define MX53_PAD_EIM_EB2__GPIO_2_30 IOMUX_PAD(0x45C, 0x114,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
135 | #define MX53_PAD_EIM_D16__GPIO_3_16 IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
136 | #define MX53_PAD_EIM_D17__GPIO_3_17 IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
137 | #define MX53_PAD_EIM_D18__GPIO_3_18 IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
138 | #define MX53_PAD_EIM_D19__GPIO_3_19 IOMUX_PAD(0x46C, 0x124,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
139 | #define MX53_PAD_EIM_D20__GPIO_3_20 IOMUX_PAD(0x470, 0x128,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
140 | #define MX53_PAD_EIM_D21__GPIO_3_21 IOMUX_PAD(0x474, 0x12C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
141 | #define MX53_PAD_EIM_D22__GPIO_3_22 IOMUX_PAD(0x478, 0x130,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
142 | #define MX53_PAD_EIM_D23__GPIO_3_23 IOMUX_PAD(0x47C, 0x134,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
143 | #define MX53_PAD_EIM_EB3__GPIO_2_31 IOMUX_PAD(0x480, 0x138,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
144 | #define MX53_PAD_EIM_D24__GPIO_3_24 IOMUX_PAD(0x484, 0x13C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
145 | #define MX53_PAD_EIM_D25__GPIO_3_25 IOMUX_PAD(0x488, 0x140,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
146 | #define MX53_PAD_EIM_D26__GPIO_3_26 IOMUX_PAD(0x48C, 0x144,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
147 | #define MX53_PAD_EIM_D27__GPIO_3_27 IOMUX_PAD(0x490, 0x148,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
148 | #define MX53_PAD_EIM_D28__GPIO_3_28 IOMUX_PAD(0x494, 0x14C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
149 | #define MX53_PAD_EIM_D29__GPIO_3_29 IOMUX_PAD(0x498, 0x150,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
150 | #define MX53_PAD_EIM_D30__GPIO_3_30 IOMUX_PAD(0x49C, 0x154,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
151 | #define MX53_PAD_EIM_D31__GPIO_3_31 IOMUX_PAD(0x4A0, 0x158,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
152 | #define MX53_PAD_NVCC_EIM1__NVCC_EIM1 IOMUX_PAD(0x4A4, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
153 | #define MX53_PAD_EIM_A24__GPIO_5_4 IOMUX_PAD(0x4A8, 0x15C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
154 | #define MX53_PAD_EIM_A23__GPIO_6_6 IOMUX_PAD(0x4AC, 0x160,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
155 | #define MX53_PAD_EIM_A22__GPIO_2_16 IOMUX_PAD(0x4B0, 0x164,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
156 | #define MX53_PAD_EIM_A21__GPIO_2_17 IOMUX_PAD(0x4B4, 0x168,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
157 | #define MX53_PAD_EIM_A20__GPIO_2_18 IOMUX_PAD(0x4B8, 0x16C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
158 | #define MX53_PAD_EIM_A19__GPIO_2_19 IOMUX_PAD(0x4BC, 0x170,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
159 | #define MX53_PAD_EIM_A18__GPIO_2_20 IOMUX_PAD(0x4C0, 0x174,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
160 | #define MX53_PAD_EIM_A17__GPIO_2_21 IOMUX_PAD(0x4C4, 0x178,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
161 | #define MX53_PAD_EIM_A16__GPIO_2_22 IOMUX_PAD(0x4C8, 0x17C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
162 | #define MX53_PAD_EIM_CS0__GPIO_2_23 IOMUX_PAD(0x4CC, 0x180,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
163 | #define MX53_PAD_EIM_CS1__GPIO_2_24 IOMUX_PAD(0x4D0, 0x184,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
164 | #define MX53_PAD_EIM_OE__GPIO_2_25 IOMUX_PAD(0x4D4, 0x188,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
165 | #define MX53_PAD_EIM_RW__GPIO_2_26 IOMUX_PAD(0x4D8, 0x18C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
166 | #define MX53_PAD_EIM_LBA__GPIO_2_27 IOMUX_PAD(0x4DC, 0x190,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
167 | #define MX53_PAD_NVCC_EIM4__NVCC_EIM4 IOMUX_PAD(0x4E0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
168 | #define MX53_PAD_EIM_EB0__GPIO_2_28 IOMUX_PAD(0x4E4, 0x194,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
169 | #define MX53_PAD_EIM_EB1__GPIO_2_29 IOMUX_PAD(0x4E8, 0x198,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
170 | #define MX53_PAD_EIM_DA0__GPIO_3_0 IOMUX_PAD(0x4EC, 0x19C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
171 | #define MX53_PAD_EIM_DA1__GPIO_3_1 IOMUX_PAD(0x4F0, 0x1A0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
172 | #define MX53_PAD_EIM_DA2__GPIO_3_2 IOMUX_PAD(0x4F4, 0x1A4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
173 | #define MX53_PAD_EIM_DA3__GPIO_3_3 IOMUX_PAD(0x4F8, 0x1A8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
174 | #define MX53_PAD_EIM_DA4__GPIO_3_4 IOMUX_PAD(0x4FC, 0x1AC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
175 | #define MX53_PAD_EIM_DA5__GPIO_3_5 IOMUX_PAD(0x500, 0x1B0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
176 | #define MX53_PAD_EIM_DA6__GPIO_3_6 IOMUX_PAD(0x504, 0x1B4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
177 | #define MX53_PAD_EIM_DA7__GPIO_3_7 IOMUX_PAD(0x508, 0x1B8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
178 | #define MX53_PAD_EIM_DA8__GPIO_3_8 IOMUX_PAD(0x50C, 0x1BC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
179 | #define MX53_PAD_EIM_DA9__GPIO_3_9 IOMUX_PAD(0x510, 0x1C0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
180 | #define MX53_PAD_EIM_DA10__GPIO_3_10 IOMUX_PAD(0x514, 0x1C4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
181 | #define MX53_PAD_EIM_DA11__GPIO_3_11 IOMUX_PAD(0x518, 0x1C8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
182 | #define MX53_PAD_EIM_DA12__GPIO_3_12 IOMUX_PAD(0x51C, 0x1CC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
183 | #define MX53_PAD_EIM_DA13__GPIO_3_13 IOMUX_PAD(0x520, 0x1D0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
184 | #define MX53_PAD_EIM_DA14__GPIO_3_14 IOMUX_PAD(0x524, 0x1D4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
185 | #define MX53_PAD_EIM_DA15__GPIO_3_15 IOMUX_PAD(0x528, 0x1D8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
186 | #define MX53_PAD_NANDF_WE_B__GPIO_6_12 IOMUX_PAD(0x52C, 0x1DC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
187 | #define MX53_PAD_NANDF_RE_B__GPIO_6_13 IOMUX_PAD(0x530, 0x1E0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
188 | #define MX53_PAD_EIM_WAIT__GPIO_5_0 IOMUX_PAD(0x534, 0x1E4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
189 | #define MX53_PAD_EIM_BCLK__EIM_BCLK IOMUX_PAD(0x538, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
190 | #define MX53_PAD_NVCC_EIM7__NVCC_EIM7 IOMUX_PAD(0x53C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
191 | #define MX53_PAD_LVDS1_TX3_P__GPIO_6_22 IOMUX_PAD(NON_PAD_I, 0x1EC, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
192 | #define MX53_PAD_LVDS1_TX2_P__GPIO_6_24 IOMUX_PAD(NON_PAD_I, 0x1F0, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
193 | #define MX53_PAD_LVDS1_CLK_P__GPIO_6_26 IOMUX_PAD(NON_PAD_I, 0x1F4, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
194 | #define MX53_PAD_LVDS1_TX1_P__GPIO_6_28 IOMUX_PAD(NON_PAD_I, 0x1F8, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
195 | #define MX53_PAD_LVDS1_TX0_P__GPIO_6_30 IOMUX_PAD(NON_PAD_I, 0x1FC, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
196 | #define MX53_PAD_LVDS0_TX3_P__GPIO_7_22 IOMUX_PAD(NON_PAD_I, 0x200, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
197 | #define MX53_PAD_LVDS0_CLK_P__GPIO_7_24 IOMUX_PAD(NON_PAD_I, 0x204, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
198 | #define MX53_PAD_LVDS0_TX2_P__GPIO_7_26 IOMUX_PAD(NON_PAD_I, 0x208, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
199 | #define MX53_PAD_LVDS0_TX1_P__GPIO_7_28 IOMUX_PAD(NON_PAD_I, 0x20C, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
200 | #define MX53_PAD_LVDS0_TX0_P__GPIO_7_30 IOMUX_PAD(NON_PAD_I, 0x210, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
201 | #define MX53_PAD_GPIO_10__GPIO_4_0 IOMUX_PAD(0x540, 0x214, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
202 | #define MX53_PAD_GPIO_11__GPIO_4_1 IOMUX_PAD(0x544, 0x218, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
203 | #define MX53_PAD_GPIO_12__GPIO_4_2 IOMUX_PAD(0x548, 0x21C, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
204 | #define MX53_PAD_GPIO_13__GPIO_4_3 IOMUX_PAD(0x54C, 0x220, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
205 | #define MX53_PAD_GPIO_14__GPIO_4_4 IOMUX_PAD(0x550, 0x224, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
206 | #define MX53_PAD_DRAM_DQM3__DRAM_DQM3 IOMUX_PAD(0x554, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
207 | #define MX53_PAD_DRAM_SDQS3__DRAM_SDQS3 IOMUX_PAD(0x558, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
208 | #define MX53_PAD_DRAM_SDCKE1__DRAM_SDCKE1 IOMUX_PAD(0x55C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
209 | #define MX53_PAD_DRAM_DQM2__DRAM_DQM2 IOMUX_PAD(0x560, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
210 | #define MX53_PAD_DRAM_SDODT1__DRAM_SDODT1 IOMUX_PAD(0x564, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
211 | #define MX53_PAD_DRAM_SDQS2__DRAM_SDQS2 IOMUX_PAD(0x568, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
212 | #define MX53_PAD_DRAM_RESET__DRAM_RESET IOMUX_PAD(0x56C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
213 | #define MX53_PAD_DRAM_SDCLK1__DRAM_SDCLK1 IOMUX_PAD(0x570, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
214 | #define MX53_PAD_DRAM_CAS__DRAM_CAS IOMUX_PAD(0x574, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
215 | #define MX53_PAD_DRAM_SDCLK0__DRAM_SDCLK0 IOMUX_PAD(0x578, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
216 | #define MX53_PAD_DRAM_SDQS0__DRAM_SDQS0 IOMUX_PAD(0x57C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
217 | #define MX53_PAD_DRAM_SDODT0__DRAM_SDODT0 IOMUX_PAD(0x580, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
218 | #define MX53_PAD_DRAM_DQM0__DRAM_DQM0 IOMUX_PAD(0x584, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
219 | #define MX53_PAD_DRAM_RAS__DRAM_RAS IOMUX_PAD(0x588, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
220 | #define MX53_PAD_DRAM_SDCKE0__DRAM_SDCKE0 IOMUX_PAD(0x58C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
221 | #define MX53_PAD_DRAM_SDQS1__DRAM_SDQS1 IOMUX_PAD(0x590, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
222 | #define MX53_PAD_DRAM_DQM1__DRAM_DQM1 IOMUX_PAD(0x594, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
223 | #define MX53_PAD_PMIC_ON_REQ__PMIC_ON_REQ IOMUX_PAD(0x598, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
224 | #define MX53_PAD_PMIC_STBY_REQ__PMIC_STBY_REQ IOMUX_PAD(0x59C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
225 | #define MX53_PAD_NANDF_CLE__GPIO_6_7 IOMUX_PAD(0x5A0, 0x228,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
226 | #define MX53_PAD_NANDF_ALE__GPIO_6_8 IOMUX_PAD(0x5A4, 0x22C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
227 | #define MX53_PAD_NANDF_WP_B__GPIO_6_9 IOMUX_PAD(0x5A8, 0x230,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
228 | #define MX53_PAD_NANDF_RB0__GPIO_6_10 IOMUX_PAD(0x5AC, 0x234,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
229 | #define MX53_PAD_NANDF_CS0__GPIO_6_11 IOMUX_PAD(0x5B0, 0x238,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
230 | #define MX53_PAD_NANDF_CS1__GPIO_6_14 IOMUX_PAD(0x5B4, 0x23C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
231 | #define MX53_PAD_NANDF_CS2__GPIO_6_15 IOMUX_PAD(0x5B8, 0x240,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
232 | #define MX53_PAD_NANDF_CS3__GPIO_6_16 IOMUX_PAD(0x5BC, 0x244,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
233 | #define MX53_PAD_NVCC_NANDF__NVCC_NANDF IOMUX_PAD(0x5C0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
234 | #define MX53_PAD_FEC_MDIO__GPIO_1_22 IOMUX_PAD(0x5C4, 0x248,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
235 | #define MX53_PAD_FEC_REF_CLK__GPIO_1_23 IOMUX_PAD(0x5C8, 0x24C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
236 | #define MX53_PAD_FEC_RX_ER__GPIO_1_24 IOMUX_PAD(0x5CC, 0x250,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
237 | #define MX53_PAD_FEC_CRS_DV__GPIO_1_25 IOMUX_PAD(0x5D0, 0x254,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
238 | #define MX53_PAD_FEC_RXD1__GPIO_1_26 IOMUX_PAD(0x5D4, 0x258,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
239 | #define MX53_PAD_FEC_RXD0__GPIO_1_27 IOMUX_PAD(0x5D8, 0x25C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
240 | #define MX53_PAD_FEC_TX_EN__GPIO_1_28 IOMUX_PAD(0x5DC, 0x260,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
241 | #define MX53_PAD_FEC_TXD1__GPIO_1_29 IOMUX_PAD(0x5E0, 0x264,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
242 | #define MX53_PAD_FEC_TXD0__GPIO_1_30 IOMUX_PAD(0x5E4, 0x268,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
243 | #define MX53_PAD_FEC_MDC__GPIO_1_31 IOMUX_PAD(0x5E8, 0x26C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
244 | #define MX53_PAD_NVCC_FEC__NVCC_FEC IOMUX_PAD(0x5EC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
245 | #define MX53_PAD_ATA_DIOW__GPIO_6_17 IOMUX_PAD(0x5F0, 0x270,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
246 | #define MX53_PAD_ATA_DMACK__GPIO_6_18 IOMUX_PAD(0x5F4, 0x274,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
247 | #define MX53_PAD_ATA_DMARQ__GPIO_7_0 IOMUX_PAD(0x5F8, 0x278,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
248 | #define MX53_PAD_ATA_BUFFER_EN__GPIO_7_1 IOMUX_PAD(0x5FC, 0x27C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
249 | #define MX53_PAD_ATA_INTRQ__GPIO_7_2 IOMUX_PAD(0x600, 0x280,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
250 | #define MX53_PAD_ATA_DIOR__GPIO_7_3 IOMUX_PAD(0x604, 0x284,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
251 | #define MX53_PAD_ATA_RESET_B__GPIO_7_4 IOMUX_PAD(0x608, 0x288,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
252 | #define MX53_PAD_ATA_IORDY__GPIO_7_5 IOMUX_PAD(0x60C, 0x28C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
253 | #define MX53_PAD_ATA_DA_0__GPIO_7_6 IOMUX_PAD(0x610, 0x290,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
254 | #define MX53_PAD_ATA_DA_1__GPIO_7_7 IOMUX_PAD(0x614, 0x294,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
255 | #define MX53_PAD_ATA_DA_2__GPIO_7_8 IOMUX_PAD(0x618, 0x298,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
256 | #define MX53_PAD_ATA_CS_0__GPIO_7_9 IOMUX_PAD(0x61C, 0x29C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
257 | #define MX53_PAD_ATA_CS_1__GPIO_7_10 IOMUX_PAD(0x620, 0x2A0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
258 | #define MX53_PAD_NVCC_ATA2__NVCC_ATA2 IOMUX_PAD(0x624, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
259 | #define MX53_PAD_ATA_DATA0__GPIO_2_0 IOMUX_PAD(0x628, 0x2A4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
260 | #define MX53_PAD_ATA_DATA1__GPIO_2_1 IOMUX_PAD(0x62C, 0x2A8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
261 | #define MX53_PAD_ATA_DATA2__GPIO_2_2 IOMUX_PAD(0x630, 0x2AC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
262 | #define MX53_PAD_ATA_DATA3__GPIO_2_3 IOMUX_PAD(0x634, 0x2B0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
263 | #define MX53_PAD_ATA_DATA4__GPIO_2_4 IOMUX_PAD(0x638, 0x2B4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
264 | #define MX53_PAD_ATA_DATA5__GPIO_2_5 IOMUX_PAD(0x63C, 0x2B8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
265 | #define MX53_PAD_ATA_DATA6__GPIO_2_6 IOMUX_PAD(0x640, 0x2BC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
266 | #define MX53_PAD_ATA_DATA7__GPIO_2_7 IOMUX_PAD(0x644, 0x2C0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
267 | #define MX53_PAD_ATA_DATA8__GPIO_2_8 IOMUX_PAD(0x648, 0x2C4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
268 | #define MX53_PAD_ATA_DATA9__GPIO_2_9 IOMUX_PAD(0x64C, 0x2C8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
269 | #define MX53_PAD_ATA_DATA10__GPIO_2_10 IOMUX_PAD(0x650, 0x2CC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
270 | #define MX53_PAD_ATA_DATA11__GPIO_2_11 IOMUX_PAD(0x654, 0x2D0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
271 | #define MX53_PAD_ATA_DATA12__GPIO_2_12 IOMUX_PAD(0x658, 0x2D4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
272 | #define MX53_PAD_ATA_DATA13__GPIO_2_13 IOMUX_PAD(0x65C, 0x2D8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
273 | #define MX53_PAD_ATA_DATA14__GPIO_2_14 IOMUX_PAD(0x660, 0x2DC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
274 | #define MX53_PAD_ATA_DATA15__GPIO_2_15 IOMUX_PAD(0x664, 0x2E0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
275 | #define MX53_PAD_NVCC_ATA0__NVCC_ATA0 IOMUX_PAD(0x668, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
276 | #define MX53_PAD_SD1_DATA0__GPIO_1_16 IOMUX_PAD(0x66C, 0x2E4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
277 | #define MX53_PAD_SD1_DATA1__GPIO_1_17 IOMUX_PAD(0x670, 0x2E8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
278 | #define MX53_PAD_SD1_CMD__GPIO_1_18 IOMUX_PAD(0x674, 0x2EC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
279 | #define MX53_PAD_SD1_DATA2__GPIO_1_19 IOMUX_PAD(0x678, 0x2F0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
280 | #define MX53_PAD_SD1_CLK__GPIO_1_20 IOMUX_PAD(0x67C, 0x2F4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
281 | #define MX53_PAD_SD1_DATA3__GPIO_1_21 IOMUX_PAD(0x680, 0x2F8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
282 | #define MX53_PAD_NVCC_SD1__NVCC_SD1 IOMUX_PAD(0x684, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
283 | #define MX53_PAD_SD2_CLK__GPIO_1_10 IOMUX_PAD(0x688, 0x2FC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
284 | #define MX53_PAD_SD2_CMD__GPIO_1_11 IOMUX_PAD(0x68C, 0x300,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
285 | #define MX53_PAD_SD2_DATA3__GPIO_1_12 IOMUX_PAD(0x690, 0x304,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
286 | #define MX53_PAD_SD2_DATA2__GPIO_1_13 IOMUX_PAD(0x694, 0x308,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
287 | #define MX53_PAD_SD2_DATA1__GPIO_1_14 IOMUX_PAD(0x698, 0x30C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
288 | #define MX53_PAD_SD2_DATA0__GPIO_1_15 IOMUX_PAD(0x69C, 0x310,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
289 | #define MX53_PAD_NVCC_SD2__NVCC_SD2 IOMUX_PAD(0x6A0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
290 | #define MX53_PAD_GPIO_0__GPIO_1_0 IOMUX_PAD(0x6A4, 0x314,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
291 | #define MX53_PAD_GPIO_1__GPIO_1_1 IOMUX_PAD(0x6A8, 0x318,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
292 | #define MX53_PAD_GPIO_9__GPIO_1_9 IOMUX_PAD(0x6AC, 0x31C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
293 | #define MX53_PAD_GPIO_3__GPIO_1_3 IOMUX_PAD(0x6B0, 0x320,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
294 | #define MX53_PAD_GPIO_6__GPIO_1_6 IOMUX_PAD(0x6B4, 0x324,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
295 | #define MX53_PAD_GPIO_2__GPIO_1_2 IOMUX_PAD(0x6B8, 0x328,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
296 | #define MX53_PAD_GPIO_4__GPIO_1_4 IOMUX_PAD(0x6BC, 0x32C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
297 | #define MX53_PAD_GPIO_5__GPIO_1_5 IOMUX_PAD(0x6C0, 0x330,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
298 | #define MX53_PAD_GPIO_7__GPIO_1_7 IOMUX_PAD(0x6C4, 0x334,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
299 | #define MX53_PAD_GPIO_8__GPIO_1_8 IOMUX_PAD(0x6C8, 0x338,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
300 | #define MX53_PAD_GPIO_16__GPIO_7_11 IOMUX_PAD(0x6CC, 0x33C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
301 | #define MX53_PAD_GPIO_17__GPIO_7_12 IOMUX_PAD(0x6D0, 0x340,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
302 | #define MX53_PAD_GPIO_18__GPIO_7_13 IOMUX_PAD(0x6D4, 0x344,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) | ||
303 | #define MX53_PAD_NVCC_GPIO__NVCC_GPIO IOMUX_PAD(0x6D8, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
304 | #define MX53_PAD_POR_B__POR_B IOMUX_PAD(0x6DC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
305 | #define MX53_PAD_BOOT_MODE1__BOOT_MODE1 IOMUX_PAD(0x6E0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
306 | #define MX53_PAD_RESET_IN_B__RESET_IN_B IOMUX_PAD(0x6E4, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
307 | #define MX53_PAD_BOOT_MODE0__BOOT_MODE0 IOMUX_PAD(0x6E8, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
308 | #define MX53_PAD_TEST_MODE__TEST_MODE IOMUX_PAD(0x6EC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
309 | #define MX53_PAD_GRP_ADDDS__GRP_ADDDS IOMUX_PAD(0x6F0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
310 | #define MX53_PAD_GRP_DDRMODE_CTL__GRP_DDRMODE_CTL IOMUX_PAD(0x6F4, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
311 | #define MX53_PAD_GRP_DDRPKE__GRP_DDRPKE IOMUX_PAD(0x6FC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
312 | #define MX53_PAD_GRP_DDRPK__GRP_DDRPK IOMUX_PAD(0x708, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
313 | #define MX53_PAD_GRP_TERM_CTL3__GRP_TERM_CTL3 IOMUX_PAD(0x70C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
314 | #define MX53_PAD_GRP_DDRHYS__GRP_DDRHYS IOMUX_PAD(0x710, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
315 | #define MX53_PAD_GRP_DDRMODE__GRP_DDRMODE IOMUX_PAD(0x714, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
316 | #define MX53_PAD_GRP_B0DS__GRP_B0DS IOMUX_PAD(0x718, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
317 | #define MX53_PAD_GRP_B1DS__GRP_B1DS IOMUX_PAD(0x71C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
318 | #define MX53_PAD_GRP_CTLDS__GRP_CTLDS IOMUX_PAD(0x720, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
319 | #define MX53_PAD_GRP_DDR_TYPE__GRP_DDR_TYPE IOMUX_PAD(0x724, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
320 | #define MX53_PAD_GRP_B2DS__GRP_B2DS IOMUX_PAD(0x728, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
321 | #define MX53_PAD_GRP_B3DS__GRP_B3DS IOMUX_PAD(0x72C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) | ||
322 | |||
323 | #endif /* __MACH_IOMUX_MX53_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h index 0880a4a1aed1..2277b01c855d 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-v3.h +++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h | |||
@@ -42,28 +42,44 @@ | |||
42 | * If <padname> or <padmode> refers to a GPIO, it is named | 42 | * If <padname> or <padmode> refers to a GPIO, it is named |
43 | * GPIO_<unit>_<num> | 43 | * GPIO_<unit>_<num> |
44 | * | 44 | * |
45 | */ | 45 | * IOMUX/PAD Bit field definitions |
46 | 46 | * | |
47 | struct pad_desc { | 47 | * MUX_CTRL_OFS: 0..11 (12) |
48 | unsigned mux_ctrl_ofs:12; /* IOMUXC_SW_MUX_CTL_PAD offset */ | 48 | * PAD_CTRL_OFS: 12..23 (12) |
49 | unsigned mux_mode:8; | 49 | * SEL_INPUT_OFS: 24..35 (12) |
50 | unsigned pad_ctrl_ofs:12; /* IOMUXC_SW_PAD_CTRL offset */ | 50 | * MUX_MODE + SION: 36..40 (5) |
51 | #define NO_PAD_CTRL (1 << 16) | 51 | * PAD_CTRL + NO_PAD_CTRL: 41..57 (17) |
52 | unsigned pad_ctrl:17; | 52 | * SEL_INP: 58..61 (4) |
53 | unsigned select_input_ofs:12; /* IOMUXC_SELECT_INPUT offset */ | 53 | * reserved: 63 (1) |
54 | unsigned select_input:3; | 54 | */ |
55 | }; | 55 | |
56 | 56 | typedef u64 iomux_v3_cfg_t; | |
57 | #define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \ | 57 | |
58 | _select_input, _pad_ctrl) \ | 58 | #define MUX_CTRL_OFS_SHIFT 0 |
59 | { \ | 59 | #define MUX_CTRL_OFS_MASK ((iomux_v3_cfg_t)0xfff << MUX_CTRL_OFS_SHIFT) |
60 | .mux_ctrl_ofs = _mux_ctrl_ofs, \ | 60 | #define MUX_PAD_CTRL_OFS_SHIFT 12 |
61 | .mux_mode = _mux_mode, \ | 61 | #define MUX_PAD_CTRL_OFS_MASK ((iomux_v3_cfg_t)0xfff << MUX_PAD_CTRL_OFS_SHIFT) |
62 | .pad_ctrl_ofs = _pad_ctrl_ofs, \ | 62 | #define MUX_SEL_INPUT_OFS_SHIFT 24 |
63 | .pad_ctrl = _pad_ctrl, \ | 63 | #define MUX_SEL_INPUT_OFS_MASK ((iomux_v3_cfg_t)0xfff << MUX_SEL_INPUT_OFS_SHIFT) |
64 | .select_input_ofs = _select_input_ofs, \ | 64 | |
65 | .select_input = _select_input, \ | 65 | #define MUX_MODE_SHIFT 36 |
66 | } | 66 | #define MUX_MODE_MASK ((iomux_v3_cfg_t)0x1f << MUX_MODE_SHIFT) |
67 | #define MUX_PAD_CTRL_SHIFT 41 | ||
68 | #define MUX_PAD_CTRL_MASK ((iomux_v3_cfg_t)0x1ffff << MUX_PAD_CTRL_SHIFT) | ||
69 | #define NO_PAD_CTRL ((iomux_v3_cfg_t)1 << (MUX_PAD_CTRL_SHIFT + 16)) | ||
70 | #define MUX_SEL_INPUT_SHIFT 58 | ||
71 | #define MUX_SEL_INPUT_MASK ((iomux_v3_cfg_t)0xf << MUX_SEL_INPUT_SHIFT) | ||
72 | |||
73 | #define MUX_PAD_CTRL(x) ((iomux_v3_cfg_t)(x) << MUX_PAD_CTRL_SHIFT) | ||
74 | |||
75 | #define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _sel_input_ofs, \ | ||
76 | _sel_input, _pad_ctrl) \ | ||
77 | (((iomux_v3_cfg_t)(_mux_ctrl_ofs) << MUX_CTRL_OFS_SHIFT) | \ | ||
78 | ((iomux_v3_cfg_t)(_mux_mode) << MUX_MODE_SHIFT) | \ | ||
79 | ((iomux_v3_cfg_t)(_pad_ctrl_ofs) << MUX_PAD_CTRL_OFS_SHIFT) | \ | ||
80 | ((iomux_v3_cfg_t)(_pad_ctrl) << MUX_PAD_CTRL_SHIFT) | \ | ||
81 | ((iomux_v3_cfg_t)(_sel_input_ofs) << MUX_SEL_INPUT_OFS_SHIFT) | \ | ||
82 | ((iomux_v3_cfg_t)(_sel_input) << MUX_SEL_INPUT_SHIFT)) | ||
67 | 83 | ||
68 | /* | 84 | /* |
69 | * Use to set PAD control | 85 | * Use to set PAD control |
@@ -107,13 +123,13 @@ struct pad_desc { | |||
107 | /* | 123 | /* |
108 | * setups a single pad in the iomuxer | 124 | * setups a single pad in the iomuxer |
109 | */ | 125 | */ |
110 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad); | 126 | int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad); |
111 | 127 | ||
112 | /* | 128 | /* |
113 | * setups mutliple pads | 129 | * setups mutliple pads |
114 | * convenient way to call the above function with tables | 130 | * convenient way to call the above function with tables |
115 | */ | 131 | */ |
116 | int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count); | 132 | int mxc_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count); |
117 | 133 | ||
118 | /* | 134 | /* |
119 | * Initialise the iomux controller | 135 | * Initialise the iomux controller |
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h index 86781f7b0c0c..58a49cc83797 100644 --- a/arch/arm/plat-mxc/include/mach/irqs.h +++ b/arch/arm/plat-mxc/include/mach/irqs.h | |||
@@ -23,13 +23,17 @@ | |||
23 | #define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS | 23 | #define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS |
24 | 24 | ||
25 | /* these are ordered by size to support multi-SoC kernels */ | 25 | /* these are ordered by size to support multi-SoC kernels */ |
26 | #if defined CONFIG_ARCH_MX2 | 26 | #if defined CONFIG_ARCH_MX53 |
27 | #define MXC_GPIO_IRQS (32 * 7) | ||
28 | #elif defined CONFIG_ARCH_MX2 | ||
29 | #define MXC_GPIO_IRQS (32 * 6) | ||
30 | #elif defined CONFIG_ARCH_MX50 | ||
27 | #define MXC_GPIO_IRQS (32 * 6) | 31 | #define MXC_GPIO_IRQS (32 * 6) |
28 | #elif defined CONFIG_ARCH_MX1 | 32 | #elif defined CONFIG_ARCH_MX1 |
29 | #define MXC_GPIO_IRQS (32 * 4) | 33 | #define MXC_GPIO_IRQS (32 * 4) |
30 | #elif defined CONFIG_ARCH_MX25 | 34 | #elif defined CONFIG_ARCH_MX25 |
31 | #define MXC_GPIO_IRQS (32 * 4) | 35 | #define MXC_GPIO_IRQS (32 * 4) |
32 | #elif defined CONFIG_ARCH_MX5 | 36 | #elif defined CONFIG_ARCH_MX51 |
33 | #define MXC_GPIO_IRQS (32 * 4) | 37 | #define MXC_GPIO_IRQS (32 * 4) |
34 | #elif defined CONFIG_ARCH_MXC91231 | 38 | #elif defined CONFIG_ARCH_MXC91231 |
35 | #define MXC_GPIO_IRQS (32 * 4) | 39 | #define MXC_GPIO_IRQS (32 * 4) |
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h index 564ec9dbc93d..83861408133f 100644 --- a/arch/arm/plat-mxc/include/mach/memory.h +++ b/arch/arm/plat-mxc/include/mach/memory.h | |||
@@ -16,7 +16,9 @@ | |||
16 | #define MX25_PHYS_OFFSET UL(0x80000000) | 16 | #define MX25_PHYS_OFFSET UL(0x80000000) |
17 | #define MX27_PHYS_OFFSET UL(0xa0000000) | 17 | #define MX27_PHYS_OFFSET UL(0xa0000000) |
18 | #define MX3x_PHYS_OFFSET UL(0x80000000) | 18 | #define MX3x_PHYS_OFFSET UL(0x80000000) |
19 | #define MX50_PHYS_OFFSET UL(0x70000000) | ||
19 | #define MX51_PHYS_OFFSET UL(0x90000000) | 20 | #define MX51_PHYS_OFFSET UL(0x90000000) |
21 | #define MX53_PHYS_OFFSET UL(0x70000000) | ||
20 | #define MXC91231_PHYS_OFFSET UL(0x90000000) | 22 | #define MXC91231_PHYS_OFFSET UL(0x90000000) |
21 | 23 | ||
22 | #if !defined(CONFIG_RUNTIME_PHYS_OFFSET) | 24 | #if !defined(CONFIG_RUNTIME_PHYS_OFFSET) |
@@ -32,8 +34,12 @@ | |||
32 | # define PHYS_OFFSET MX3x_PHYS_OFFSET | 34 | # define PHYS_OFFSET MX3x_PHYS_OFFSET |
33 | # elif defined CONFIG_ARCH_MXC91231 | 35 | # elif defined CONFIG_ARCH_MXC91231 |
34 | # define PHYS_OFFSET MXC91231_PHYS_OFFSET | 36 | # define PHYS_OFFSET MXC91231_PHYS_OFFSET |
35 | # elif defined CONFIG_ARCH_MX5 | 37 | # elif defined CONFIG_ARCH_MX50 |
38 | # define PHYS_OFFSET MX50_PHYS_OFFSET | ||
39 | # elif defined CONFIG_ARCH_MX51 | ||
36 | # define PHYS_OFFSET MX51_PHYS_OFFSET | 40 | # define PHYS_OFFSET MX51_PHYS_OFFSET |
41 | # elif defined CONFIG_ARCH_MX53 | ||
42 | # define PHYS_OFFSET MX53_PHYS_OFFSET | ||
37 | # endif | 43 | # endif |
38 | #endif | 44 | #endif |
39 | 45 | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h index 641b24618239..75d96214b831 100644 --- a/arch/arm/plat-mxc/include/mach/mx1.h +++ b/arch/arm/plat-mxc/include/mach/mx1.h | |||
@@ -19,7 +19,6 @@ | |||
19 | */ | 19 | */ |
20 | #define MX1_IO_BASE_ADDR 0x00200000 | 20 | #define MX1_IO_BASE_ADDR 0x00200000 |
21 | #define MX1_IO_SIZE SZ_1M | 21 | #define MX1_IO_SIZE SZ_1M |
22 | #define MX1_IO_BASE_ADDR_VIRT VMALLOC_END | ||
23 | 22 | ||
24 | #define MX1_CS0_PHYS 0x10000000 | 23 | #define MX1_CS0_PHYS 0x10000000 |
25 | #define MX1_CS0_SIZE 0x02000000 | 24 | #define MX1_CS0_SIZE 0x02000000 |
@@ -66,6 +65,10 @@ | |||
66 | #define MX1_CCM_BASE_ADDR (0x1B000 + MX1_IO_BASE_ADDR) | 65 | #define MX1_CCM_BASE_ADDR (0x1B000 + MX1_IO_BASE_ADDR) |
67 | #define MX1_SCM_BASE_ADDR (0x1B804 + MX1_IO_BASE_ADDR) | 66 | #define MX1_SCM_BASE_ADDR (0x1B804 + MX1_IO_BASE_ADDR) |
68 | #define MX1_GPIO_BASE_ADDR (0x1C000 + MX1_IO_BASE_ADDR) | 67 | #define MX1_GPIO_BASE_ADDR (0x1C000 + MX1_IO_BASE_ADDR) |
68 | #define MX1_GPIO1_BASE_ADDR (0x1C000 + MX1_IO_BASE_ADDR) | ||
69 | #define MX1_GPIO2_BASE_ADDR (0x1C100 + MX1_IO_BASE_ADDR) | ||
70 | #define MX1_GPIO3_BASE_ADDR (0x1C200 + MX1_IO_BASE_ADDR) | ||
71 | #define MX1_GPIO4_BASE_ADDR (0x1C300 + MX1_IO_BASE_ADDR) | ||
69 | #define MX1_EIM_BASE_ADDR (0x20000 + MX1_IO_BASE_ADDR) | 72 | #define MX1_EIM_BASE_ADDR (0x20000 + MX1_IO_BASE_ADDR) |
70 | #define MX1_SDRAMC_BASE_ADDR (0x21000 + MX1_IO_BASE_ADDR) | 73 | #define MX1_SDRAMC_BASE_ADDR (0x21000 + MX1_IO_BASE_ADDR) |
71 | #define MX1_MMA_BASE_ADDR (0x22000 + MX1_IO_BASE_ADDR) | 74 | #define MX1_MMA_BASE_ADDR (0x22000 + MX1_IO_BASE_ADDR) |
@@ -73,12 +76,12 @@ | |||
73 | #define MX1_CSI_BASE_ADDR (0x24000 + MX1_IO_BASE_ADDR) | 76 | #define MX1_CSI_BASE_ADDR (0x24000 + MX1_IO_BASE_ADDR) |
74 | 77 | ||
75 | /* macro to get at IO space when running virtually */ | 78 | /* macro to get at IO space when running virtually */ |
76 | #define MX1_IO_ADDRESS(x) ( \ | 79 | #define MX1_IO_P2V(x) IMX_IO_P2V(x) |
77 | IMX_IO_ADDRESS(x, MX1_IO)) | 80 | #define MX1_IO_ADDRESS(x) IOMEM(MX1_IO_P2V(x)) |
78 | 81 | ||
79 | /* fixed interrput numbers */ | 82 | /* fixed interrput numbers */ |
80 | #define MX1_INT_SOFTINT 0 | 83 | #define MX1_INT_SOFTINT 0 |
81 | #define MX1_CSI_INT 6 | 84 | #define MX1_INT_CSI 6 |
82 | #define MX1_DSPA_MAC_INT 7 | 85 | #define MX1_DSPA_MAC_INT 7 |
83 | #define MX1_DSPA_INT 8 | 86 | #define MX1_DSPA_INT 8 |
84 | #define MX1_COMP_INT 9 | 87 | #define MX1_COMP_INT 9 |
@@ -115,13 +118,13 @@ | |||
115 | #define MX1_SSI_RX_INT 44 | 118 | #define MX1_SSI_RX_INT 44 |
116 | #define MX1_SSI_RX_ERR_INT 45 | 119 | #define MX1_SSI_RX_ERR_INT 45 |
117 | #define MX1_TOUCH_INT 46 | 120 | #define MX1_TOUCH_INT 46 |
118 | #define MX1_USBD_INT0 47 | 121 | #define MX1_INT_USBD0 47 |
119 | #define MX1_USBD_INT1 48 | 122 | #define MX1_INT_USBD1 48 |
120 | #define MX1_USBD_INT2 49 | 123 | #define MX1_INT_USBD2 49 |
121 | #define MX1_USBD_INT3 50 | 124 | #define MX1_INT_USBD3 50 |
122 | #define MX1_USBD_INT4 51 | 125 | #define MX1_INT_USBD4 51 |
123 | #define MX1_USBD_INT5 52 | 126 | #define MX1_INT_USBD5 52 |
124 | #define MX1_USBD_INT6 53 | 127 | #define MX1_INT_USBD6 53 |
125 | #define MX1_BTSYS_INT 55 | 128 | #define MX1_BTSYS_INT 55 |
126 | #define MX1_BTTIM_INT 56 | 129 | #define MX1_BTTIM_INT 56 |
127 | #define MX1_BTWUI_INT 57 | 130 | #define MX1_BTWUI_INT 57 |
@@ -164,134 +167,6 @@ | |||
164 | * to not break drivers/usb/gadget/imx_udc. Should go | 167 | * to not break drivers/usb/gadget/imx_udc. Should go |
165 | * away after this driver uses the new name. | 168 | * away after this driver uses the new name. |
166 | */ | 169 | */ |
167 | #define USBD_INT0 MX1_USBD_INT0 | 170 | #define USBD_INT0 MX1_INT_USBD0 |
168 | |||
169 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | ||
170 | /* these should go away */ | ||
171 | #define IMX_IO_PHYS MX1_IO_BASE_ADDR | ||
172 | #define IMX_IO_SIZE MX1_IO_SIZE | ||
173 | #define IMX_IO_BASE MX1_IO_BASE_ADDR_VIRT | ||
174 | #define IMX_CS0_PHYS MX1_CS0_PHYS | ||
175 | #define IMX_CS0_SIZE MX1_CS0_SIZE | ||
176 | #define IMX_CS1_PHYS MX1_CS1_PHYS | ||
177 | #define IMX_CS1_SIZE MX1_CS1_SIZE | ||
178 | #define IMX_CS2_PHYS MX1_CS2_PHYS | ||
179 | #define IMX_CS2_SIZE MX1_CS2_SIZE | ||
180 | #define IMX_CS3_PHYS MX1_CS3_PHYS | ||
181 | #define IMX_CS3_SIZE MX1_CS3_SIZE | ||
182 | #define IMX_CS4_PHYS MX1_CS4_PHYS | ||
183 | #define IMX_CS4_SIZE MX1_CS4_SIZE | ||
184 | #define IMX_CS5_PHYS MX1_CS5_PHYS | ||
185 | #define IMX_CS5_SIZE MX1_CS5_SIZE | ||
186 | #define AIPI1_BASE_ADDR MX1_AIPI1_BASE_ADDR | ||
187 | #define WDT_BASE_ADDR MX1_WDT_BASE_ADDR | ||
188 | #define TIM1_BASE_ADDR MX1_TIM1_BASE_ADDR | ||
189 | #define TIM2_BASE_ADDR MX1_TIM2_BASE_ADDR | ||
190 | #define RTC_BASE_ADDR MX1_RTC_BASE_ADDR | ||
191 | #define LCDC_BASE_ADDR MX1_LCDC_BASE_ADDR | ||
192 | #define UART1_BASE_ADDR MX1_UART1_BASE_ADDR | ||
193 | #define UART2_BASE_ADDR MX1_UART2_BASE_ADDR | ||
194 | #define PWM_BASE_ADDR MX1_PWM_BASE_ADDR | ||
195 | #define DMA_BASE_ADDR MX1_DMA_BASE_ADDR | ||
196 | #define AIPI2_BASE_ADDR MX1_AIPI2_BASE_ADDR | ||
197 | #define SIM_BASE_ADDR MX1_SIM_BASE_ADDR | ||
198 | #define USBD_BASE_ADDR MX1_USBD_BASE_ADDR | ||
199 | #define SPI1_BASE_ADDR MX1_SPI1_BASE_ADDR | ||
200 | #define MMC_BASE_ADDR MX1_MMC_BASE_ADDR | ||
201 | #define ASP_BASE_ADDR MX1_ASP_BASE_ADDR | ||
202 | #define BTA_BASE_ADDR MX1_BTA_BASE_ADDR | ||
203 | #define I2C_BASE_ADDR MX1_I2C_BASE_ADDR | ||
204 | #define SSI_BASE_ADDR MX1_SSI_BASE_ADDR | ||
205 | #define SPI2_BASE_ADDR MX1_SPI2_BASE_ADDR | ||
206 | #define MSHC_BASE_ADDR MX1_MSHC_BASE_ADDR | ||
207 | #define CCM_BASE_ADDR MX1_CCM_BASE_ADDR | ||
208 | #define SCM_BASE_ADDR MX1_SCM_BASE_ADDR | ||
209 | #define GPIO_BASE_ADDR MX1_GPIO_BASE_ADDR | ||
210 | #define EIM_BASE_ADDR MX1_EIM_BASE_ADDR | ||
211 | #define SDRAMC_BASE_ADDR MX1_SDRAMC_BASE_ADDR | ||
212 | #define MMA_BASE_ADDR MX1_MMA_BASE_ADDR | ||
213 | #define AVIC_BASE_ADDR MX1_AVIC_BASE_ADDR | ||
214 | #define CSI_BASE_ADDR MX1_CSI_BASE_ADDR | ||
215 | #define IO_ADDRESS(x) MX1_IO_ADDRESS(x) | ||
216 | #define AVIC_IO_ADDRESS(x) IO_ADDRESS(x) | ||
217 | #define INT_SOFTINT MX1_INT_SOFTINT | ||
218 | #define CSI_INT MX1_CSI_INT | ||
219 | #define DSPA_MAC_INT MX1_DSPA_MAC_INT | ||
220 | #define DSPA_INT MX1_DSPA_INT | ||
221 | #define COMP_INT MX1_COMP_INT | ||
222 | #define MSHC_XINT MX1_MSHC_XINT | ||
223 | #define GPIO_INT_PORTA MX1_GPIO_INT_PORTA | ||
224 | #define GPIO_INT_PORTB MX1_GPIO_INT_PORTB | ||
225 | #define GPIO_INT_PORTC MX1_GPIO_INT_PORTC | ||
226 | #define LCDC_INT MX1_LCDC_INT | ||
227 | #define SIM_INT MX1_SIM_INT | ||
228 | #define SIM_DATA_INT MX1_SIM_DATA_INT | ||
229 | #define RTC_INT MX1_RTC_INT | ||
230 | #define RTC_SAMINT MX1_RTC_SAMINT | ||
231 | #define UART2_MINT_PFERR MX1_UART2_MINT_PFERR | ||
232 | #define UART2_MINT_RTS MX1_UART2_MINT_RTS | ||
233 | #define UART2_MINT_DTR MX1_UART2_MINT_DTR | ||
234 | #define UART2_MINT_UARTC MX1_UART2_MINT_UARTC | ||
235 | #define UART2_MINT_TX MX1_UART2_MINT_TX | ||
236 | #define UART2_MINT_RX MX1_UART2_MINT_RX | ||
237 | #define UART1_MINT_PFERR MX1_UART1_MINT_PFERR | ||
238 | #define UART1_MINT_RTS MX1_UART1_MINT_RTS | ||
239 | #define UART1_MINT_DTR MX1_UART1_MINT_DTR | ||
240 | #define UART1_MINT_UARTC MX1_UART1_MINT_UARTC | ||
241 | #define UART1_MINT_TX MX1_UART1_MINT_TX | ||
242 | #define UART1_MINT_RX MX1_UART1_MINT_RX | ||
243 | #define VOICE_DAC_INT MX1_VOICE_DAC_INT | ||
244 | #define VOICE_ADC_INT MX1_VOICE_ADC_INT | ||
245 | #define PEN_DATA_INT MX1_PEN_DATA_INT | ||
246 | #define PWM_INT MX1_PWM_INT | ||
247 | #define SDHC_INT MX1_SDHC_INT | ||
248 | #define I2C_INT MX1_INT_I2C | ||
249 | #define CSPI_INT MX1_CSPI_INT | ||
250 | #define SSI_TX_INT MX1_SSI_TX_INT | ||
251 | #define SSI_TX_ERR_INT MX1_SSI_TX_ERR_INT | ||
252 | #define SSI_RX_INT MX1_SSI_RX_INT | ||
253 | #define SSI_RX_ERR_INT MX1_SSI_RX_ERR_INT | ||
254 | #define TOUCH_INT MX1_TOUCH_INT | ||
255 | #define USBD_INT1 MX1_USBD_INT1 | ||
256 | #define USBD_INT2 MX1_USBD_INT2 | ||
257 | #define USBD_INT3 MX1_USBD_INT3 | ||
258 | #define USBD_INT4 MX1_USBD_INT4 | ||
259 | #define USBD_INT5 MX1_USBD_INT5 | ||
260 | #define USBD_INT6 MX1_USBD_INT6 | ||
261 | #define BTSYS_INT MX1_BTSYS_INT | ||
262 | #define BTTIM_INT MX1_BTTIM_INT | ||
263 | #define BTWUI_INT MX1_BTWUI_INT | ||
264 | #define TIM2_INT MX1_TIM2_INT | ||
265 | #define TIM1_INT MX1_TIM1_INT | ||
266 | #define DMA_ERR MX1_DMA_ERR | ||
267 | #define DMA_INT MX1_DMA_INT | ||
268 | #define GPIO_INT_PORTD MX1_GPIO_INT_PORTD | ||
269 | #define WDT_INT MX1_WDT_INT | ||
270 | #define DMA_REQ_UART3_T MX1_DMA_REQ_UART3_T | ||
271 | #define DMA_REQ_UART3_R MX1_DMA_REQ_UART3_R | ||
272 | #define DMA_REQ_SSI2_T MX1_DMA_REQ_SSI2_T | ||
273 | #define DMA_REQ_SSI2_R MX1_DMA_REQ_SSI2_R | ||
274 | #define DMA_REQ_CSI_STAT MX1_DMA_REQ_CSI_STAT | ||
275 | #define DMA_REQ_CSI_R MX1_DMA_REQ_CSI_R | ||
276 | #define DMA_REQ_MSHC MX1_DMA_REQ_MSHC | ||
277 | #define DMA_REQ_DSPA_DCT_DOUT MX1_DMA_REQ_DSPA_DCT_DOUT | ||
278 | #define DMA_REQ_DSPA_DCT_DIN MX1_DMA_REQ_DSPA_DCT_DIN | ||
279 | #define DMA_REQ_DSPA_MAC MX1_DMA_REQ_DSPA_MAC | ||
280 | #define DMA_REQ_EXT MX1_DMA_REQ_EXT | ||
281 | #define DMA_REQ_SDHC MX1_DMA_REQ_SDHC | ||
282 | #define DMA_REQ_SPI1_R MX1_DMA_REQ_SPI1_R | ||
283 | #define DMA_REQ_SPI1_T MX1_DMA_REQ_SPI1_T | ||
284 | #define DMA_REQ_SSI_T MX1_DMA_REQ_SSI_T | ||
285 | #define DMA_REQ_SSI_R MX1_DMA_REQ_SSI_R | ||
286 | #define DMA_REQ_ASP_DAC MX1_DMA_REQ_ASP_DAC | ||
287 | #define DMA_REQ_ASP_ADC MX1_DMA_REQ_ASP_ADC | ||
288 | #define DMA_REQ_USP_EP(x) MX1_DMA_REQ_USP_EP(x) | ||
289 | #define DMA_REQ_SPI2_R MX1_DMA_REQ_SPI2_R | ||
290 | #define DMA_REQ_SPI2_T MX1_DMA_REQ_SPI2_T | ||
291 | #define DMA_REQ_UART2_T MX1_DMA_REQ_UART2_T | ||
292 | #define DMA_REQ_UART2_R MX1_DMA_REQ_UART2_R | ||
293 | #define DMA_REQ_UART1_T MX1_DMA_REQ_UART1_T | ||
294 | #define DMA_REQ_UART1_R MX1_DMA_REQ_UART1_R | ||
295 | #endif /* ifdef IMX_NEEDS_DEPRECATED_SYMBOLS */ | ||
296 | 171 | ||
297 | #endif /* ifndef __MACH_MX1_H__ */ | 172 | #endif /* ifndef __MACH_MX1_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h index 8bc59720b6e4..6cd049ebbd8d 100644 --- a/arch/arm/plat-mxc/include/mach/mx21.h +++ b/arch/arm/plat-mxc/include/mach/mx21.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #define __MACH_MX21_H__ | 26 | #define __MACH_MX21_H__ |
27 | 27 | ||
28 | #define MX21_AIPI_BASE_ADDR 0x10000000 | 28 | #define MX21_AIPI_BASE_ADDR 0x10000000 |
29 | #define MX21_AIPI_BASE_ADDR_VIRT 0xf4000000 | ||
30 | #define MX21_AIPI_SIZE SZ_1M | 29 | #define MX21_AIPI_SIZE SZ_1M |
31 | #define MX21_DMA_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x01000) | 30 | #define MX21_DMA_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x01000) |
32 | #define MX21_WDOG_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x02000) | 31 | #define MX21_WDOG_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x02000) |
@@ -49,6 +48,12 @@ | |||
49 | #define MX21_SDHC1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x13000) | 48 | #define MX21_SDHC1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x13000) |
50 | #define MX21_SDHC2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x14000) | 49 | #define MX21_SDHC2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x14000) |
51 | #define MX21_GPIO_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x15000) | 50 | #define MX21_GPIO_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x15000) |
51 | #define MX21_GPIO1_BASE_ADDR (MX21_GPIO_BASE_ADDR + 0x000) | ||
52 | #define MX21_GPIO2_BASE_ADDR (MX21_GPIO_BASE_ADDR + 0x100) | ||
53 | #define MX21_GPIO3_BASE_ADDR (MX21_GPIO_BASE_ADDR + 0x200) | ||
54 | #define MX21_GPIO4_BASE_ADDR (MX21_GPIO_BASE_ADDR + 0x300) | ||
55 | #define MX21_GPIO5_BASE_ADDR (MX21_GPIO_BASE_ADDR + 0x400) | ||
56 | #define MX21_GPIO6_BASE_ADDR (MX21_GPIO_BASE_ADDR + 0x500) | ||
52 | #define MX21_AUDMUX_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x16000) | 57 | #define MX21_AUDMUX_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x16000) |
53 | #define MX21_CSPI3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x17000) | 58 | #define MX21_CSPI3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x17000) |
54 | #define MX21_LCDC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x21000) | 59 | #define MX21_LCDC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x21000) |
@@ -64,7 +69,6 @@ | |||
64 | #define MX21_AVIC_BASE_ADDR 0x10040000 | 69 | #define MX21_AVIC_BASE_ADDR 0x10040000 |
65 | 70 | ||
66 | #define MX21_SAHB1_BASE_ADDR 0x80000000 | 71 | #define MX21_SAHB1_BASE_ADDR 0x80000000 |
67 | #define MX21_SAHB1_BASE_ADDR_VIRT 0xf4100000 | ||
68 | #define MX21_SAHB1_SIZE SZ_1M | 72 | #define MX21_SAHB1_SIZE SZ_1M |
69 | #define MX21_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000) | 73 | #define MX21_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000) |
70 | 74 | ||
@@ -82,7 +86,6 @@ | |||
82 | 86 | ||
83 | /* NAND, SDRAM, WEIM etc controllers */ | 87 | /* NAND, SDRAM, WEIM etc controllers */ |
84 | #define MX21_X_MEMC_BASE_ADDR 0xdf000000 | 88 | #define MX21_X_MEMC_BASE_ADDR 0xdf000000 |
85 | #define MX21_X_MEMC_BASE_ADDR_VIRT 0xf4200000 | ||
86 | #define MX21_X_MEMC_SIZE SZ_256K | 89 | #define MX21_X_MEMC_SIZE SZ_256K |
87 | 90 | ||
88 | #define MX21_SDRAMC_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x0000) | 91 | #define MX21_SDRAMC_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x0000) |
@@ -92,10 +95,8 @@ | |||
92 | 95 | ||
93 | #define MX21_IRAM_BASE_ADDR 0xffffe800 /* internal ram */ | 96 | #define MX21_IRAM_BASE_ADDR 0xffffe800 /* internal ram */ |
94 | 97 | ||
95 | #define MX21_IO_ADDRESS(x) ( \ | 98 | #define MX21_IO_P2V(x) IMX_IO_P2V(x) |
96 | IMX_IO_ADDRESS(x, MX21_AIPI) ?: \ | 99 | #define MX21_IO_ADDRESS(x) IOMEM(MX21_IO_P2V(x)) |
97 | IMX_IO_ADDRESS(x, MX21_SAHB1) ?: \ | ||
98 | IMX_IO_ADDRESS(x, MX21_X_MEMC)) | ||
99 | 100 | ||
100 | /* fixed interrupt numbers */ | 101 | /* fixed interrupt numbers */ |
101 | #define MX21_INT_CSPI3 6 | 102 | #define MX21_INT_CSPI3 6 |
@@ -184,39 +185,4 @@ | |||
184 | #define MX21_DMA_REQ_CSI_STAT 30 | 185 | #define MX21_DMA_REQ_CSI_STAT 30 |
185 | #define MX21_DMA_REQ_CSI_RX 31 | 186 | #define MX21_DMA_REQ_CSI_RX 31 |
186 | 187 | ||
187 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | ||
188 | /* these should go away */ | ||
189 | #define SDRAM_BASE_ADDR MX21_SDRAM_BASE_ADDR | ||
190 | #define CSD1_BASE_ADDR MX21_CSD1_BASE_ADDR | ||
191 | #define CS0_BASE_ADDR MX21_CS0_BASE_ADDR | ||
192 | #define CS1_BASE_ADDR MX21_CS1_BASE_ADDR | ||
193 | #define CS2_BASE_ADDR MX21_CS2_BASE_ADDR | ||
194 | #define CS3_BASE_ADDR MX21_CS3_BASE_ADDR | ||
195 | #define CS4_BASE_ADDR MX21_CS4_BASE_ADDR | ||
196 | #define PCMCIA_MEM_BASE_ADDR MX21_PCMCIA_MEM_BASE_ADDR | ||
197 | #define CS5_BASE_ADDR MX21_CS5_BASE_ADDR | ||
198 | #define X_MEMC_BASE_ADDR MX21_X_MEMC_BASE_ADDR | ||
199 | #define X_MEMC_BASE_ADDR_VIRT MX21_X_MEMC_BASE_ADDR_VIRT | ||
200 | #define X_MEMC_SIZE MX21_X_MEMC_SIZE | ||
201 | #define SDRAMC_BASE_ADDR MX21_SDRAMC_BASE_ADDR | ||
202 | #define EIM_BASE_ADDR MX21_EIM_BASE_ADDR | ||
203 | #define PCMCIA_CTL_BASE_ADDR MX21_PCMCIA_CTL_BASE_ADDR | ||
204 | #define NFC_BASE_ADDR MX21_NFC_BASE_ADDR | ||
205 | #define IRAM_BASE_ADDR MX21_IRAM_BASE_ADDR | ||
206 | #define MXC_INT_FIRI MX21_INT_FIRI | ||
207 | #define MXC_INT_BMI MX21_INT_BMI | ||
208 | #define MXC_INT_EMMAENC MX21_INT_EMMAENC | ||
209 | #define MXC_INT_EMMADEC MX21_INT_EMMADEC | ||
210 | #define MXC_INT_USBWKUP MX21_INT_USBWKUP | ||
211 | #define MXC_INT_USBDMA MX21_INT_USBDMA | ||
212 | #define MXC_INT_USBHOST MX21_INT_USBHOST | ||
213 | #define MXC_INT_USBFUNC MX21_INT_USBFUNC | ||
214 | #define MXC_INT_USBMNP MX21_INT_USBMNP | ||
215 | #define MXC_INT_USBCTRL MX21_INT_USBCTRL | ||
216 | #define MXC_INT_USBCTRL MX21_INT_USBCTRL | ||
217 | #define DMA_REQ_FIRI_RX MX21_DMA_REQ_FIRI_RX | ||
218 | #define DMA_REQ_BMI_TX MX21_DMA_REQ_BMI_TX | ||
219 | #define DMA_REQ_BMI_RX MX21_DMA_REQ_BMI_RX | ||
220 | #endif | ||
221 | |||
222 | #endif /* ifndef __MACH_MX21_H__ */ | 188 | #endif /* ifndef __MACH_MX21_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h index cf46a45b0d4e..087cd7ac8d52 100644 --- a/arch/arm/plat-mxc/include/mach/mx25.h +++ b/arch/arm/plat-mxc/include/mach/mx25.h | |||
@@ -2,13 +2,10 @@ | |||
2 | #define __MACH_MX25_H__ | 2 | #define __MACH_MX25_H__ |
3 | 3 | ||
4 | #define MX25_AIPS1_BASE_ADDR 0x43f00000 | 4 | #define MX25_AIPS1_BASE_ADDR 0x43f00000 |
5 | #define MX25_AIPS1_BASE_ADDR_VIRT 0xfc000000 | ||
6 | #define MX25_AIPS1_SIZE SZ_1M | 5 | #define MX25_AIPS1_SIZE SZ_1M |
7 | #define MX25_AIPS2_BASE_ADDR 0x53f00000 | 6 | #define MX25_AIPS2_BASE_ADDR 0x53f00000 |
8 | #define MX25_AIPS2_BASE_ADDR_VIRT 0xfc200000 | ||
9 | #define MX25_AIPS2_SIZE SZ_1M | 7 | #define MX25_AIPS2_SIZE SZ_1M |
10 | #define MX25_AVIC_BASE_ADDR 0x68000000 | 8 | #define MX25_AVIC_BASE_ADDR 0x68000000 |
11 | #define MX25_AVIC_BASE_ADDR_VIRT 0xfc400000 | ||
12 | #define MX25_AVIC_SIZE SZ_1M | 9 | #define MX25_AVIC_SIZE SZ_1M |
13 | 10 | ||
14 | #define MX25_I2C1_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0x80000) | 11 | #define MX25_I2C1_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0x80000) |
@@ -21,20 +18,15 @@ | |||
21 | 18 | ||
22 | #define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000) | 19 | #define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000) |
23 | #define MX25_GPT1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x90000) | 20 | #define MX25_GPT1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x90000) |
21 | #define MX25_GPIO4_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x9c000) | ||
22 | #define MX25_PWM2_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xa0000) | ||
23 | #define MX25_GPIO3_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xa4000) | ||
24 | #define MX25_PWM3_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xa8000) | ||
25 | #define MX25_PWM4_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xc8000) | ||
26 | #define MX25_GPIO1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xcc000) | ||
27 | #define MX25_GPIO2_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xd0000) | ||
24 | #define MX25_WDOG_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xdc000) | 28 | #define MX25_WDOG_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xdc000) |
25 | 29 | #define MX25_PWM1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xe0000) | |
26 | #define MX25_GPIO1_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xcc000) | ||
27 | #define MX25_GPIO2_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xd0000) | ||
28 | #define MX25_GPIO3_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xa4000) | ||
29 | #define MX25_GPIO4_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0x9c000) | ||
30 | |||
31 | #define MX25_IO_ADDRESS(x) ( \ | ||
32 | IMX_IO_ADDRESS(x, MX25_AIPS1) ?: \ | ||
33 | IMX_IO_ADDRESS(x, MX25_AIPS2) ?: \ | ||
34 | IMX_IO_ADDRESS(x, MX25_AVIC)) | ||
35 | |||
36 | #define MX25_AIPS1_IO_ADDRESS(x) \ | ||
37 | (((x) - MX25_AIPS1_BASE_ADDR) + MX25_AIPS1_BASE_ADDR_VIRT) | ||
38 | 30 | ||
39 | #define MX25_UART1_BASE_ADDR 0x43f90000 | 31 | #define MX25_UART1_BASE_ADDR 0x43f90000 |
40 | #define MX25_UART2_BASE_ADDR 0x43f94000 | 32 | #define MX25_UART2_BASE_ADDR 0x43f94000 |
@@ -55,9 +47,19 @@ | |||
55 | #define MX25_LCDC_BASE_ADDR 0x53fbc000 | 47 | #define MX25_LCDC_BASE_ADDR 0x53fbc000 |
56 | #define MX25_KPP_BASE_ADDR 0x43fa8000 | 48 | #define MX25_KPP_BASE_ADDR 0x43fa8000 |
57 | #define MX25_SDMA_BASE_ADDR 0x53fd4000 | 49 | #define MX25_SDMA_BASE_ADDR 0x53fd4000 |
58 | #define MX25_OTG_BASE_ADDR 0x53ff4000 | 50 | #define MX25_USB_BASE_ADDR 0x53ff4000 |
51 | #define MX25_USB_OTG_BASE_ADDR (MX25_USB_BASE_ADDR + 0x0000) | ||
52 | /* | ||
53 | * The reference manual (IMX25RM, Rev. 1, 06/2009) specifies an offset of 0x200 | ||
54 | * for the host controller. Early documentation drafts specified 0x400 and | ||
55 | * Freescale internal sources confirm only the latter value to work. | ||
56 | */ | ||
57 | #define MX25_USB_HS_BASE_ADDR (MX25_USB_BASE_ADDR + 0x0400) | ||
59 | #define MX25_CSI_BASE_ADDR 0x53ff8000 | 58 | #define MX25_CSI_BASE_ADDR 0x53ff8000 |
60 | 59 | ||
60 | #define MX25_IO_P2V(x) IMX_IO_P2V(x) | ||
61 | #define MX25_IO_ADDRESS(x) IOMEM(MX25_IO_P2V(x)) | ||
62 | |||
61 | #define MX25_INT_CSPI3 0 | 63 | #define MX25_INT_CSPI3 0 |
62 | #define MX25_INT_I2C1 3 | 64 | #define MX25_INT_I2C1 3 |
63 | #define MX25_INT_I2C2 4 | 65 | #define MX25_INT_I2C2 4 |
@@ -69,18 +71,28 @@ | |||
69 | #define MX25_INT_SSI1 12 | 71 | #define MX25_INT_SSI1 12 |
70 | #define MX25_INT_CSPI2 13 | 72 | #define MX25_INT_CSPI2 13 |
71 | #define MX25_INT_CSPI1 14 | 73 | #define MX25_INT_CSPI1 14 |
74 | #define MX25_INT_GPIO3 16 | ||
72 | #define MX25_INT_CSI 17 | 75 | #define MX25_INT_CSI 17 |
73 | #define MX25_INT_UART3 18 | 76 | #define MX25_INT_UART3 18 |
77 | #define MX25_INT_GPIO4 23 | ||
74 | #define MX25_INT_KPP 24 | 78 | #define MX25_INT_KPP 24 |
75 | #define MX25_INT_DRYICE 25 | 79 | #define MX25_INT_DRYICE 25 |
80 | #define MX25_INT_PWM1 26 | ||
76 | #define MX25_INT_UART2 32 | 81 | #define MX25_INT_UART2 32 |
77 | #define MX25_INT_NFC 33 | 82 | #define MX25_INT_NFC 33 |
78 | #define MX25_INT_SDMA 34 | 83 | #define MX25_INT_SDMA 34 |
84 | #define MX25_INT_USB_HS 35 | ||
85 | #define MX25_INT_PWM2 36 | ||
86 | #define MX25_INT_USB_OTG 37 | ||
79 | #define MX25_INT_LCDC 39 | 87 | #define MX25_INT_LCDC 39 |
80 | #define MX25_INT_UART5 40 | 88 | #define MX25_INT_UART5 40 |
89 | #define MX25_INT_PWM3 41 | ||
90 | #define MX25_INT_PWM4 42 | ||
81 | #define MX25_INT_CAN1 43 | 91 | #define MX25_INT_CAN1 43 |
82 | #define MX25_INT_CAN2 44 | 92 | #define MX25_INT_CAN2 44 |
83 | #define MX25_INT_UART1 45 | 93 | #define MX25_INT_UART1 45 |
94 | #define MX25_INT_GPIO2 51 | ||
95 | #define MX25_INT_GPIO1 52 | ||
84 | #define MX25_INT_FEC 57 | 96 | #define MX25_INT_FEC 57 |
85 | 97 | ||
86 | #define MX25_DMA_REQ_SSI2_RX1 22 | 98 | #define MX25_DMA_REQ_SSI2_RX1 22 |
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h index 2237ba2e5351..cbc43ad5ef48 100644 --- a/arch/arm/plat-mxc/include/mach/mx27.h +++ b/arch/arm/plat-mxc/include/mach/mx27.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #define MX27_AIPI_BASE_ADDR 0x10000000 | 31 | #define MX27_AIPI_BASE_ADDR 0x10000000 |
32 | #define MX27_AIPI_BASE_ADDR_VIRT 0xf4000000 | ||
33 | #define MX27_AIPI_SIZE SZ_1M | 32 | #define MX27_AIPI_SIZE SZ_1M |
34 | #define MX27_DMA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x01000) | 33 | #define MX27_DMA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x01000) |
35 | #define MX27_WDOG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x02000) | 34 | #define MX27_WDOG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x02000) |
@@ -52,6 +51,12 @@ | |||
52 | #define MX27_SDHC1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x13000) | 51 | #define MX27_SDHC1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x13000) |
53 | #define MX27_SDHC2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x14000) | 52 | #define MX27_SDHC2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x14000) |
54 | #define MX27_GPIO_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x15000) | 53 | #define MX27_GPIO_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x15000) |
54 | #define MX27_GPIO1_BASE_ADDR (MX27_GPIO_BASE_ADDR + 0x000) | ||
55 | #define MX27_GPIO2_BASE_ADDR (MX27_GPIO_BASE_ADDR + 0x100) | ||
56 | #define MX27_GPIO3_BASE_ADDR (MX27_GPIO_BASE_ADDR + 0x200) | ||
57 | #define MX27_GPIO4_BASE_ADDR (MX27_GPIO_BASE_ADDR + 0x300) | ||
58 | #define MX27_GPIO5_BASE_ADDR (MX27_GPIO_BASE_ADDR + 0x400) | ||
59 | #define MX27_GPIO6_BASE_ADDR (MX27_GPIO_BASE_ADDR + 0x500) | ||
55 | #define MX27_AUDMUX_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x16000) | 60 | #define MX27_AUDMUX_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x16000) |
56 | #define MX27_CSPI3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x17000) | 61 | #define MX27_CSPI3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x17000) |
57 | #define MX27_MSHC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x18000) | 62 | #define MX27_MSHC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x18000) |
@@ -65,11 +70,13 @@ | |||
65 | #define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000) | 70 | #define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000) |
66 | #define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000) | 71 | #define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000) |
67 | #define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000) | 72 | #define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000) |
68 | #define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000) | 73 | #define MX27_USB_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000) |
69 | #define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR | 74 | #define MX27_USB_OTG_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0000) |
75 | #define MX27_USB_HS1_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0200) | ||
76 | #define MX27_USB_HS2_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0400) | ||
70 | #define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000) | 77 | #define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000) |
71 | #define MX27_EMMA_PP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000) | 78 | #define MX27_EMMAPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000) |
72 | #define MX27_EMMA_PRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400) | 79 | #define MX27_EMMAPRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400) |
73 | #define MX27_CCM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27000) | 80 | #define MX27_CCM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27000) |
74 | #define MX27_SYSCTRL_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27800) | 81 | #define MX27_SYSCTRL_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27800) |
75 | #define MX27_IIM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x28000) | 82 | #define MX27_IIM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x28000) |
@@ -87,7 +94,6 @@ | |||
87 | #define MX27_ROMP_BASE_ADDR 0x10041000 | 94 | #define MX27_ROMP_BASE_ADDR 0x10041000 |
88 | 95 | ||
89 | #define MX27_SAHB1_BASE_ADDR 0x80000000 | 96 | #define MX27_SAHB1_BASE_ADDR 0x80000000 |
90 | #define MX27_SAHB1_BASE_ADDR_VIRT 0xf4100000 | ||
91 | #define MX27_SAHB1_SIZE SZ_1M | 97 | #define MX27_SAHB1_SIZE SZ_1M |
92 | #define MX27_CSI_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x0000) | 98 | #define MX27_CSI_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x0000) |
93 | #define MX27_ATA_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x1000) | 99 | #define MX27_ATA_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x1000) |
@@ -105,7 +111,6 @@ | |||
105 | 111 | ||
106 | /* NAND, SDRAM, WEIM, M3IF, EMI controllers */ | 112 | /* NAND, SDRAM, WEIM, M3IF, EMI controllers */ |
107 | #define MX27_X_MEMC_BASE_ADDR 0xd8000000 | 113 | #define MX27_X_MEMC_BASE_ADDR 0xd8000000 |
108 | #define MX27_X_MEMC_BASE_ADDR_VIRT 0xf4200000 | ||
109 | #define MX27_X_MEMC_SIZE SZ_1M | 114 | #define MX27_X_MEMC_SIZE SZ_1M |
110 | #define MX27_NFC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR) | 115 | #define MX27_NFC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR) |
111 | #define MX27_SDRAMC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x1000) | 116 | #define MX27_SDRAMC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x1000) |
@@ -123,10 +128,8 @@ | |||
123 | /* IRAM */ | 128 | /* IRAM */ |
124 | #define MX27_IRAM_BASE_ADDR 0xffff4c00 /* internal ram */ | 129 | #define MX27_IRAM_BASE_ADDR 0xffff4c00 /* internal ram */ |
125 | 130 | ||
126 | #define MX27_IO_ADDRESS(x) ( \ | 131 | #define MX27_IO_P2V(x) IMX_IO_P2V(x) |
127 | IMX_IO_ADDRESS(x, MX27_AIPI) ?: \ | 132 | #define MX27_IO_ADDRESS(x) IOMEM(MX27_IO_P2V(x)) |
128 | IMX_IO_ADDRESS(x, MX27_SAHB1) ?: \ | ||
129 | IMX_IO_ADDRESS(x, MX27_X_MEMC)) | ||
130 | 133 | ||
131 | #ifndef __ASSEMBLER__ | 134 | #ifndef __ASSEMBLER__ |
132 | static inline void mx27_setup_weimcs(size_t cs, | 135 | static inline void mx27_setup_weimcs(size_t cs, |
@@ -192,9 +195,9 @@ static inline void mx27_setup_weimcs(size_t cs, | |||
192 | #define MX27_INT_EMMAPRP 51 | 195 | #define MX27_INT_EMMAPRP 51 |
193 | #define MX27_INT_EMMAPP 52 | 196 | #define MX27_INT_EMMAPP 52 |
194 | #define MX27_INT_VPU 53 | 197 | #define MX27_INT_VPU 53 |
195 | #define MX27_INT_USB1 54 | 198 | #define MX27_INT_USB_HS1 54 |
196 | #define MX27_INT_USB2 55 | 199 | #define MX27_INT_USB_HS2 55 |
197 | #define MX27_INT_USB3 56 | 200 | #define MX27_INT_USB_OTG 56 |
198 | #define MX27_INT_SCC_SMN 57 | 201 | #define MX27_INT_SCC_SMN 57 |
199 | #define MX27_INT_SCC_SCM 58 | 202 | #define MX27_INT_SCC_SCM 58 |
200 | #define MX27_INT_SAHARA 59 | 203 | #define MX27_INT_SAHARA 59 |
@@ -241,82 +244,8 @@ static inline void mx27_setup_weimcs(size_t cs, | |||
241 | #define MX27_DMA_REQ_SDHC3 36 | 244 | #define MX27_DMA_REQ_SDHC3 36 |
242 | #define MX27_DMA_REQ_NFC 37 | 245 | #define MX27_DMA_REQ_NFC 37 |
243 | 246 | ||
244 | /* silicon revisions specific to i.MX27 */ | ||
245 | #define CHIP_REV_1_0 0x00 | ||
246 | #define CHIP_REV_2_0 0x01 | ||
247 | |||
248 | #ifndef __ASSEMBLY__ | 247 | #ifndef __ASSEMBLY__ |
249 | extern int mx27_revision(void); | 248 | extern int mx27_revision(void); |
250 | #endif | 249 | #endif |
251 | 250 | ||
252 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | ||
253 | /* these should go away */ | ||
254 | #define MSHC_BASE_ADDR MX27_MSHC_BASE_ADDR | ||
255 | #define GPT5_BASE_ADDR MX27_GPT5_BASE_ADDR | ||
256 | #define GPT4_BASE_ADDR MX27_GPT4_BASE_ADDR | ||
257 | #define UART5_BASE_ADDR MX27_UART5_BASE_ADDR | ||
258 | #define UART6_BASE_ADDR MX27_UART6_BASE_ADDR | ||
259 | #define I2C2_BASE_ADDR MX27_I2C2_BASE_ADDR | ||
260 | #define SDHC3_BASE_ADDR MX27_SDHC3_BASE_ADDR | ||
261 | #define GPT6_BASE_ADDR MX27_GPT6_BASE_ADDR | ||
262 | #define VPU_BASE_ADDR MX27_VPU_BASE_ADDR | ||
263 | #define OTG_BASE_ADDR MX27_OTG_BASE_ADDR | ||
264 | #define SAHARA_BASE_ADDR MX27_SAHARA_BASE_ADDR | ||
265 | #define IIM_BASE_ADDR MX27_IIM_BASE_ADDR | ||
266 | #define RTIC_BASE_ADDR MX27_RTIC_BASE_ADDR | ||
267 | #define FEC_BASE_ADDR MX27_FEC_BASE_ADDR | ||
268 | #define SCC_BASE_ADDR MX27_SCC_BASE_ADDR | ||
269 | #define ETB_BASE_ADDR MX27_ETB_BASE_ADDR | ||
270 | #define ETB_RAM_BASE_ADDR MX27_ETB_RAM_BASE_ADDR | ||
271 | #define ROMP_BASE_ADDR MX27_ROMP_BASE_ADDR | ||
272 | #define ATA_BASE_ADDR MX27_ATA_BASE_ADDR | ||
273 | #define SDRAM_BASE_ADDR MX27_SDRAM_BASE_ADDR | ||
274 | #define CSD1_BASE_ADDR MX27_CSD1_BASE_ADDR | ||
275 | #define CS0_BASE_ADDR MX27_CS0_BASE_ADDR | ||
276 | #define CS1_BASE_ADDR MX27_CS1_BASE_ADDR | ||
277 | #define CS2_BASE_ADDR MX27_CS2_BASE_ADDR | ||
278 | #define CS3_BASE_ADDR MX27_CS3_BASE_ADDR | ||
279 | #define CS4_BASE_ADDR MX27_CS4_BASE_ADDR | ||
280 | #define CS5_BASE_ADDR MX27_CS5_BASE_ADDR | ||
281 | #define X_MEMC_BASE_ADDR MX27_X_MEMC_BASE_ADDR | ||
282 | #define X_MEMC_BASE_ADDR_VIRT MX27_X_MEMC_BASE_ADDR_VIRT | ||
283 | #define X_MEMC_SIZE MX27_X_MEMC_SIZE | ||
284 | #define NFC_BASE_ADDR MX27_NFC_BASE_ADDR | ||
285 | #define SDRAMC_BASE_ADDR MX27_SDRAMC_BASE_ADDR | ||
286 | #define WEIM_BASE_ADDR MX27_WEIM_BASE_ADDR | ||
287 | #define M3IF_BASE_ADDR MX27_M3IF_BASE_ADDR | ||
288 | #define PCMCIA_CTL_BASE_ADDR MX27_PCMCIA_CTL_BASE_ADDR | ||
289 | #define PCMCIA_MEM_BASE_ADDR MX27_PCMCIA_MEM_BASE_ADDR | ||
290 | #define IRAM_BASE_ADDR MX27_IRAM_BASE_ADDR | ||
291 | #define MXC_INT_I2C2 MX27_INT_I2C2 | ||
292 | #define MXC_INT_GPT6 MX27_INT_GPT6 | ||
293 | #define MXC_INT_GPT5 MX27_INT_GPT5 | ||
294 | #define MXC_INT_GPT4 MX27_INT_GPT4 | ||
295 | #define MXC_INT_RTIC MX27_INT_RTIC | ||
296 | #define MXC_INT_SDHC MX27_INT_SDHC | ||
297 | #define MXC_INT_SDHC3 MX27_INT_SDHC3 | ||
298 | #define MXC_INT_ATA MX27_INT_ATA | ||
299 | #define MXC_INT_UART6 MX27_INT_UART6 | ||
300 | #define MXC_INT_UART5 MX27_INT_UART5 | ||
301 | #define MXC_INT_FEC MX27_INT_FEC | ||
302 | #define MXC_INT_VPU MX27_INT_VPU | ||
303 | #define MXC_INT_USB1 MX27_INT_USB1 | ||
304 | #define MXC_INT_USB2 MX27_INT_USB2 | ||
305 | #define MXC_INT_USB3 MX27_INT_USB3 | ||
306 | #define MXC_INT_SCC_SMN MX27_INT_SCC_SMN | ||
307 | #define MXC_INT_SCC_SCM MX27_INT_SCC_SCM | ||
308 | #define MXC_INT_SAHARA MX27_INT_SAHARA | ||
309 | #define MXC_INT_IIM MX27_INT_IIM | ||
310 | #define MXC_INT_CCM MX27_INT_CCM | ||
311 | #define DMA_REQ_MSHC MX27_DMA_REQ_MSHC | ||
312 | #define DMA_REQ_ATA_TX MX27_DMA_REQ_ATA_TX | ||
313 | #define DMA_REQ_ATA_RCV MX27_DMA_REQ_ATA_RCV | ||
314 | #define DMA_REQ_UART5_TX MX27_DMA_REQ_UART5_TX | ||
315 | #define DMA_REQ_UART5_RX MX27_DMA_REQ_UART5_RX | ||
316 | #define DMA_REQ_UART6_TX MX27_DMA_REQ_UART6_TX | ||
317 | #define DMA_REQ_UART6_RX MX27_DMA_REQ_UART6_RX | ||
318 | #define DMA_REQ_SDHC3 MX27_DMA_REQ_SDHC3 | ||
319 | #define DMA_REQ_NFC MX27_DMA_REQ_NFC | ||
320 | #endif | ||
321 | |||
322 | #endif /* ifndef __MACH_MX27_H__ */ | 251 | #endif /* ifndef __MACH_MX27_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h index afb895a0b5b8..6d07839fdec2 100644 --- a/arch/arm/plat-mxc/include/mach/mx2x.h +++ b/arch/arm/plat-mxc/include/mach/mx2x.h | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | /* Register offsets */ | 28 | /* Register offsets */ |
29 | #define MX2x_AIPI_BASE_ADDR 0x10000000 | 29 | #define MX2x_AIPI_BASE_ADDR 0x10000000 |
30 | #define MX2x_AIPI_BASE_ADDR_VIRT 0xf4000000 | ||
31 | #define MX2x_AIPI_SIZE SZ_1M | 30 | #define MX2x_AIPI_SIZE SZ_1M |
32 | #define MX2x_DMA_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x01000) | 31 | #define MX2x_DMA_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x01000) |
33 | #define MX2x_WDOG_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x02000) | 32 | #define MX2x_WDOG_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x02000) |
@@ -65,43 +64,9 @@ | |||
65 | #define MX2x_AVIC_BASE_ADDR 0x10040000 | 64 | #define MX2x_AVIC_BASE_ADDR 0x10040000 |
66 | 65 | ||
67 | #define MX2x_SAHB1_BASE_ADDR 0x80000000 | 66 | #define MX2x_SAHB1_BASE_ADDR 0x80000000 |
68 | #define MX2x_SAHB1_BASE_ADDR_VIRT 0xf4100000 | ||
69 | #define MX2x_SAHB1_SIZE SZ_1M | 67 | #define MX2x_SAHB1_SIZE SZ_1M |
70 | #define MX2x_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000) | 68 | #define MX2x_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000) |
71 | 69 | ||
72 | /* | ||
73 | * This macro defines the physical to virtual address mapping for all the | ||
74 | * peripheral modules. It is used by passing in the physical address as x | ||
75 | * and returning the virtual address. If the physical address is not mapped, | ||
76 | * it returns 0xDEADBEEF | ||
77 | */ | ||
78 | #define IO_ADDRESS(x) \ | ||
79 | (void __force __iomem *) \ | ||
80 | (((x >= AIPI_BASE_ADDR) && (x < (AIPI_BASE_ADDR + AIPI_SIZE))) ? \ | ||
81 | AIPI_IO_ADDRESS(x) : \ | ||
82 | ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ | ||
83 | SAHB1_IO_ADDRESS(x) : \ | ||
84 | ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ | ||
85 | X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) | ||
86 | |||
87 | /* define the address mapping macros: in physical address order */ | ||
88 | #define AIPI_IO_ADDRESS(x) \ | ||
89 | (((x) - AIPI_BASE_ADDR) + AIPI_BASE_ADDR_VIRT) | ||
90 | |||
91 | #define AVIC_IO_ADDRESS(x) AIPI_IO_ADDRESS(x) | ||
92 | |||
93 | #define SAHB1_IO_ADDRESS(x) \ | ||
94 | (((x) - SAHB1_BASE_ADDR) + SAHB1_BASE_ADDR_VIRT) | ||
95 | |||
96 | #define CS4_IO_ADDRESS(x) \ | ||
97 | (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT) | ||
98 | |||
99 | #define X_MEMC_IO_ADDRESS(x) \ | ||
100 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
101 | |||
102 | #define PCMCIA_IO_ADDRESS(x) \ | ||
103 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
104 | |||
105 | /* fixed interrupt numbers */ | 70 | /* fixed interrupt numbers */ |
106 | #define MX2x_INT_CSPI3 6 | 71 | #define MX2x_INT_CSPI3 6 |
107 | #define MX2x_INT_GPIO 8 | 72 | #define MX2x_INT_GPIO 8 |
@@ -176,118 +141,4 @@ | |||
176 | #define MX2x_DMA_REQ_CSI_STAT 30 | 141 | #define MX2x_DMA_REQ_CSI_STAT 30 |
177 | #define MX2x_DMA_REQ_CSI_RX 31 | 142 | #define MX2x_DMA_REQ_CSI_RX 31 |
178 | 143 | ||
179 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | ||
180 | /* these should go away */ | ||
181 | #define AIPI_BASE_ADDR MX2x_AIPI_BASE_ADDR | ||
182 | #define AIPI_BASE_ADDR_VIRT MX2x_AIPI_BASE_ADDR_VIRT | ||
183 | #define AIPI_SIZE MX2x_AIPI_SIZE | ||
184 | #define DMA_BASE_ADDR MX2x_DMA_BASE_ADDR | ||
185 | #define WDOG_BASE_ADDR MX2x_WDOG_BASE_ADDR | ||
186 | #define GPT1_BASE_ADDR MX2x_GPT1_BASE_ADDR | ||
187 | #define GPT2_BASE_ADDR MX2x_GPT2_BASE_ADDR | ||
188 | #define GPT3_BASE_ADDR MX2x_GPT3_BASE_ADDR | ||
189 | #define PWM_BASE_ADDR MX2x_PWM_BASE_ADDR | ||
190 | #define RTC_BASE_ADDR MX2x_RTC_BASE_ADDR | ||
191 | #define KPP_BASE_ADDR MX2x_KPP_BASE_ADDR | ||
192 | #define OWIRE_BASE_ADDR MX2x_OWIRE_BASE_ADDR | ||
193 | #define UART1_BASE_ADDR MX2x_UART1_BASE_ADDR | ||
194 | #define UART2_BASE_ADDR MX2x_UART2_BASE_ADDR | ||
195 | #define UART3_BASE_ADDR MX2x_UART3_BASE_ADDR | ||
196 | #define UART4_BASE_ADDR MX2x_UART4_BASE_ADDR | ||
197 | #define CSPI1_BASE_ADDR MX2x_CSPI1_BASE_ADDR | ||
198 | #define CSPI2_BASE_ADDR MX2x_CSPI2_BASE_ADDR | ||
199 | #define SSI1_BASE_ADDR MX2x_SSI1_BASE_ADDR | ||
200 | #define SSI2_BASE_ADDR MX2x_SSI2_BASE_ADDR | ||
201 | #define I2C_BASE_ADDR MX2x_I2C_BASE_ADDR | ||
202 | #define SDHC1_BASE_ADDR MX2x_SDHC1_BASE_ADDR | ||
203 | #define SDHC2_BASE_ADDR MX2x_SDHC2_BASE_ADDR | ||
204 | #define GPIO_BASE_ADDR MX2x_GPIO_BASE_ADDR | ||
205 | #define AUDMUX_BASE_ADDR MX2x_AUDMUX_BASE_ADDR | ||
206 | #define CSPI3_BASE_ADDR MX2x_CSPI3_BASE_ADDR | ||
207 | #define LCDC_BASE_ADDR MX2x_LCDC_BASE_ADDR | ||
208 | #define SLCDC_BASE_ADDR MX2x_SLCDC_BASE_ADDR | ||
209 | #define USBOTG_BASE_ADDR MX2x_USBOTG_BASE_ADDR | ||
210 | #define EMMA_PP_BASE_ADDR MX2x_EMMA_PP_BASE_ADDR | ||
211 | #define EMMA_PRP_BASE_ADDR MX2x_EMMA_PRP_BASE_ADDR | ||
212 | #define CCM_BASE_ADDR MX2x_CCM_BASE_ADDR | ||
213 | #define SYSCTRL_BASE_ADDR MX2x_SYSCTRL_BASE_ADDR | ||
214 | #define JAM_BASE_ADDR MX2x_JAM_BASE_ADDR | ||
215 | #define MAX_BASE_ADDR MX2x_MAX_BASE_ADDR | ||
216 | #define AVIC_BASE_ADDR MX2x_AVIC_BASE_ADDR | ||
217 | #define SAHB1_BASE_ADDR MX2x_SAHB1_BASE_ADDR | ||
218 | #define SAHB1_BASE_ADDR_VIRT MX2x_SAHB1_BASE_ADDR_VIRT | ||
219 | #define SAHB1_SIZE MX2x_SAHB1_SIZE | ||
220 | #define CSI_BASE_ADDR MX2x_CSI_BASE_ADDR | ||
221 | #define MXC_INT_CSPI3 MX2x_INT_CSPI3 | ||
222 | #define MXC_INT_GPIO MX2x_INT_GPIO | ||
223 | #define MXC_INT_SDHC2 MX2x_INT_SDHC2 | ||
224 | #define MXC_INT_SDHC1 MX2x_INT_SDHC1 | ||
225 | #define MXC_INT_I2C MX2x_INT_I2C | ||
226 | #define MXC_INT_SSI2 MX2x_INT_SSI2 | ||
227 | #define MXC_INT_SSI1 MX2x_INT_SSI1 | ||
228 | #define MXC_INT_CSPI2 MX2x_INT_CSPI2 | ||
229 | #define MXC_INT_CSPI1 MX2x_INT_CSPI1 | ||
230 | #define MXC_INT_UART4 MX2x_INT_UART4 | ||
231 | #define MXC_INT_UART3 MX2x_INT_UART3 | ||
232 | #define MXC_INT_UART2 MX2x_INT_UART2 | ||
233 | #define MXC_INT_UART1 MX2x_INT_UART1 | ||
234 | #define MXC_INT_KPP MX2x_INT_KPP | ||
235 | #define MXC_INT_RTC MX2x_INT_RTC | ||
236 | #define MXC_INT_PWM MX2x_INT_PWM | ||
237 | #define MXC_INT_GPT3 MX2x_INT_GPT3 | ||
238 | #define MXC_INT_GPT2 MX2x_INT_GPT2 | ||
239 | #define MXC_INT_GPT1 MX2x_INT_GPT1 | ||
240 | #define MXC_INT_WDOG MX2x_INT_WDOG | ||
241 | #define MXC_INT_PCMCIA MX2x_INT_PCMCIA | ||
242 | #define MXC_INT_NANDFC MX2x_INT_NANDFC | ||
243 | #define MXC_INT_CSI MX2x_INT_CSI | ||
244 | #define MXC_INT_DMACH0 MX2x_INT_DMACH0 | ||
245 | #define MXC_INT_DMACH1 MX2x_INT_DMACH1 | ||
246 | #define MXC_INT_DMACH2 MX2x_INT_DMACH2 | ||
247 | #define MXC_INT_DMACH3 MX2x_INT_DMACH3 | ||
248 | #define MXC_INT_DMACH4 MX2x_INT_DMACH4 | ||
249 | #define MXC_INT_DMACH5 MX2x_INT_DMACH5 | ||
250 | #define MXC_INT_DMACH6 MX2x_INT_DMACH6 | ||
251 | #define MXC_INT_DMACH7 MX2x_INT_DMACH7 | ||
252 | #define MXC_INT_DMACH8 MX2x_INT_DMACH8 | ||
253 | #define MXC_INT_DMACH9 MX2x_INT_DMACH9 | ||
254 | #define MXC_INT_DMACH10 MX2x_INT_DMACH10 | ||
255 | #define MXC_INT_DMACH11 MX2x_INT_DMACH11 | ||
256 | #define MXC_INT_DMACH12 MX2x_INT_DMACH12 | ||
257 | #define MXC_INT_DMACH13 MX2x_INT_DMACH13 | ||
258 | #define MXC_INT_DMACH14 MX2x_INT_DMACH14 | ||
259 | #define MXC_INT_DMACH15 MX2x_INT_DMACH15 | ||
260 | #define MXC_INT_EMMAPRP MX2x_INT_EMMAPRP | ||
261 | #define MXC_INT_EMMAPP MX2x_INT_EMMAPP | ||
262 | #define MXC_INT_SLCDC MX2x_INT_SLCDC | ||
263 | #define MXC_INT_LCDC MX2x_INT_LCDC | ||
264 | #define DMA_REQ_CSPI3_RX MX2x_DMA_REQ_CSPI3_RX | ||
265 | #define DMA_REQ_CSPI3_TX MX2x_DMA_REQ_CSPI3_TX | ||
266 | #define DMA_REQ_EXT MX2x_DMA_REQ_EXT | ||
267 | #define DMA_REQ_SDHC2 MX2x_DMA_REQ_SDHC2 | ||
268 | #define DMA_REQ_SDHC1 MX2x_DMA_REQ_SDHC1 | ||
269 | #define DMA_REQ_SSI2_RX0 MX2x_DMA_REQ_SSI2_RX0 | ||
270 | #define DMA_REQ_SSI2_TX0 MX2x_DMA_REQ_SSI2_TX0 | ||
271 | #define DMA_REQ_SSI2_RX1 MX2x_DMA_REQ_SSI2_RX1 | ||
272 | #define DMA_REQ_SSI2_TX1 MX2x_DMA_REQ_SSI2_TX1 | ||
273 | #define DMA_REQ_SSI1_RX0 MX2x_DMA_REQ_SSI1_RX0 | ||
274 | #define DMA_REQ_SSI1_TX0 MX2x_DMA_REQ_SSI1_TX0 | ||
275 | #define DMA_REQ_SSI1_RX1 MX2x_DMA_REQ_SSI1_RX1 | ||
276 | #define DMA_REQ_SSI1_TX1 MX2x_DMA_REQ_SSI1_TX1 | ||
277 | #define DMA_REQ_CSPI2_RX MX2x_DMA_REQ_CSPI2_RX | ||
278 | #define DMA_REQ_CSPI2_TX MX2x_DMA_REQ_CSPI2_TX | ||
279 | #define DMA_REQ_CSPI1_RX MX2x_DMA_REQ_CSPI1_RX | ||
280 | #define DMA_REQ_CSPI1_TX MX2x_DMA_REQ_CSPI1_TX | ||
281 | #define DMA_REQ_UART4_RX MX2x_DMA_REQ_UART4_RX | ||
282 | #define DMA_REQ_UART4_TX MX2x_DMA_REQ_UART4_TX | ||
283 | #define DMA_REQ_UART3_RX MX2x_DMA_REQ_UART3_RX | ||
284 | #define DMA_REQ_UART3_TX MX2x_DMA_REQ_UART3_TX | ||
285 | #define DMA_REQ_UART2_RX MX2x_DMA_REQ_UART2_RX | ||
286 | #define DMA_REQ_UART2_TX MX2x_DMA_REQ_UART2_TX | ||
287 | #define DMA_REQ_UART1_RX MX2x_DMA_REQ_UART1_RX | ||
288 | #define DMA_REQ_UART1_TX MX2x_DMA_REQ_UART1_TX | ||
289 | #define DMA_REQ_CSI_STAT MX2x_DMA_REQ_CSI_STAT | ||
290 | #define DMA_REQ_CSI_RX MX2x_DMA_REQ_CSI_RX | ||
291 | #endif | ||
292 | |||
293 | #endif /* ifndef __MACH_MX2x_H__ */ | 144 | #endif /* ifndef __MACH_MX2x_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h index 61cfe827498b..79e7fc01bb59 100644 --- a/arch/arm/plat-mxc/include/mach/mx31.h +++ b/arch/arm/plat-mxc/include/mach/mx31.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #define MX31_L2CC_SIZE SZ_1M | 15 | #define MX31_L2CC_SIZE SZ_1M |
16 | 16 | ||
17 | #define MX31_AIPS1_BASE_ADDR 0x43f00000 | 17 | #define MX31_AIPS1_BASE_ADDR 0x43f00000 |
18 | #define MX31_AIPS1_BASE_ADDR_VIRT 0xfc000000 | ||
19 | #define MX31_AIPS1_SIZE SZ_1M | 18 | #define MX31_AIPS1_SIZE SZ_1M |
20 | #define MX31_MAX_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x04000) | 19 | #define MX31_MAX_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x04000) |
21 | #define MX31_EVTMON_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x08000) | 20 | #define MX31_EVTMON_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x08000) |
@@ -25,7 +24,10 @@ | |||
25 | #define MX31_ECT_CTIO_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x18000) | 24 | #define MX31_ECT_CTIO_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x18000) |
26 | #define MX31_I2C1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x80000) | 25 | #define MX31_I2C1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x80000) |
27 | #define MX31_I2C3_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x84000) | 26 | #define MX31_I2C3_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x84000) |
28 | #define MX31_OTG_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x88000) | 27 | #define MX31_USB_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x88000) |
28 | #define MX31_USB_OTG_BASE_ADDR (MX31_USB_BASE_ADDR + 0x0000) | ||
29 | #define MX31_USB_HS1_BASE_ADDR (MX31_USB_BASE_ADDR + 0x0200) | ||
30 | #define MX31_USB_HS2_BASE_ADDR (MX31_USB_BASE_ADDR + 0x0400) | ||
29 | #define MX31_ATA_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x8c000) | 31 | #define MX31_ATA_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x8c000) |
30 | #define MX31_UART1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x90000) | 32 | #define MX31_UART1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x90000) |
31 | #define MX31_UART2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x94000) | 33 | #define MX31_UART2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x94000) |
@@ -41,10 +43,9 @@ | |||
41 | #define MX31_ECT_IP2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xbc000) | 43 | #define MX31_ECT_IP2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xbc000) |
42 | 44 | ||
43 | #define MX31_SPBA0_BASE_ADDR 0x50000000 | 45 | #define MX31_SPBA0_BASE_ADDR 0x50000000 |
44 | #define MX31_SPBA0_BASE_ADDR_VIRT 0xfc100000 | ||
45 | #define MX31_SPBA0_SIZE SZ_1M | 46 | #define MX31_SPBA0_SIZE SZ_1M |
46 | #define MX31_MMC_SDHC1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x04000) | 47 | #define MX31_SDHC1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x04000) |
47 | #define MX31_MMC_SDHC2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x08000) | 48 | #define MX31_SDHC2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x08000) |
48 | #define MX31_UART3_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x0c000) | 49 | #define MX31_UART3_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x0c000) |
49 | #define MX31_CSPI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x10000) | 50 | #define MX31_CSPI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x10000) |
50 | #define MX31_SSI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x14000) | 51 | #define MX31_SSI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x14000) |
@@ -55,7 +56,6 @@ | |||
55 | #define MX31_SPBA_CTRL_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x3c000) | 56 | #define MX31_SPBA_CTRL_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x3c000) |
56 | 57 | ||
57 | #define MX31_AIPS2_BASE_ADDR 0x53f00000 | 58 | #define MX31_AIPS2_BASE_ADDR 0x53f00000 |
58 | #define MX31_AIPS2_BASE_ADDR_VIRT 0xfc200000 | ||
59 | #define MX31_AIPS2_SIZE SZ_1M | 59 | #define MX31_AIPS2_SIZE SZ_1M |
60 | #define MX31_CCM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x80000) | 60 | #define MX31_CCM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x80000) |
61 | #define MX31_CSPI3_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x84000) | 61 | #define MX31_CSPI3_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x84000) |
@@ -84,7 +84,6 @@ | |||
84 | #define MX31_ROMP_SIZE SZ_1M | 84 | #define MX31_ROMP_SIZE SZ_1M |
85 | 85 | ||
86 | #define MX31_AVIC_BASE_ADDR 0x68000000 | 86 | #define MX31_AVIC_BASE_ADDR 0x68000000 |
87 | #define MX31_AVIC_BASE_ADDR_VIRT 0xfc400000 | ||
88 | #define MX31_AVIC_SIZE SZ_1M | 87 | #define MX31_AVIC_SIZE SZ_1M |
89 | 88 | ||
90 | #define MX31_IPU_MEM_BASE_ADDR 0x70000000 | 89 | #define MX31_IPU_MEM_BASE_ADDR 0x70000000 |
@@ -97,15 +96,14 @@ | |||
97 | #define MX31_CS3_BASE_ADDR 0xb2000000 | 96 | #define MX31_CS3_BASE_ADDR 0xb2000000 |
98 | 97 | ||
99 | #define MX31_CS4_BASE_ADDR 0xb4000000 | 98 | #define MX31_CS4_BASE_ADDR 0xb4000000 |
100 | #define MX31_CS4_BASE_ADDR_VIRT 0xf4000000 | 99 | #define MX31_CS4_BASE_ADDR_VIRT 0xf6000000 |
101 | #define MX31_CS4_SIZE SZ_32M | 100 | #define MX31_CS4_SIZE SZ_32M |
102 | 101 | ||
103 | #define MX31_CS5_BASE_ADDR 0xb6000000 | 102 | #define MX31_CS5_BASE_ADDR 0xb6000000 |
104 | #define MX31_CS5_BASE_ADDR_VIRT 0xf6000000 | 103 | #define MX31_CS5_BASE_ADDR_VIRT 0xf8000000 |
105 | #define MX31_CS5_SIZE SZ_32M | 104 | #define MX31_CS5_SIZE SZ_32M |
106 | 105 | ||
107 | #define MX31_X_MEMC_BASE_ADDR 0xb8000000 | 106 | #define MX31_X_MEMC_BASE_ADDR 0xb8000000 |
108 | #define MX31_X_MEMC_BASE_ADDR_VIRT 0xfc320000 | ||
109 | #define MX31_X_MEMC_SIZE SZ_64K | 107 | #define MX31_X_MEMC_SIZE SZ_64K |
110 | #define MX31_NFC_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x0000) | 108 | #define MX31_NFC_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x0000) |
111 | #define MX31_ESDCTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x1000) | 109 | #define MX31_ESDCTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x1000) |
@@ -121,12 +119,8 @@ | |||
121 | 119 | ||
122 | #define MX31_PCMCIA_MEM_BASE_ADDR 0xbc000000 | 120 | #define MX31_PCMCIA_MEM_BASE_ADDR 0xbc000000 |
123 | 121 | ||
124 | #define MX31_IO_ADDRESS(x) ( \ | 122 | #define MX31_IO_P2V(x) IMX_IO_P2V(x) |
125 | IMX_IO_ADDRESS(x, MX31_AIPS1) ?: \ | 123 | #define MX31_IO_ADDRESS(x) IOMEM(MX31_IO_P2V(x)) |
126 | IMX_IO_ADDRESS(x, MX31_AIPS2) ?: \ | ||
127 | IMX_IO_ADDRESS(x, MX31_AVIC) ?: \ | ||
128 | IMX_IO_ADDRESS(x, MX31_X_MEMC) ?: \ | ||
129 | IMX_IO_ADDRESS(x, MX31_SPBA0)) | ||
130 | 124 | ||
131 | #ifndef __ASSEMBLER__ | 125 | #ifndef __ASSEMBLER__ |
132 | static inline void mx31_setup_weimcs(size_t cs, | 126 | static inline void mx31_setup_weimcs(size_t cs, |
@@ -143,8 +137,8 @@ static inline void mx31_setup_weimcs(size_t cs, | |||
143 | #define MX31_INT_MPEG4_ENCODER 5 | 137 | #define MX31_INT_MPEG4_ENCODER 5 |
144 | #define MX31_INT_RTIC 6 | 138 | #define MX31_INT_RTIC 6 |
145 | #define MX31_INT_FIRI 7 | 139 | #define MX31_INT_FIRI 7 |
146 | #define MX31_INT_MMC_SDHC2 8 | 140 | #define MX31_INT_SDHC2 8 |
147 | #define MX31_INT_MMC_SDHC1 9 | 141 | #define MX31_INT_SDHC1 9 |
148 | #define MX31_INT_I2C1 10 | 142 | #define MX31_INT_I2C1 10 |
149 | #define MX31_INT_SSI2 11 | 143 | #define MX31_INT_SSI2 11 |
150 | #define MX31_INT_SSI1 12 | 144 | #define MX31_INT_SSI1 12 |
@@ -170,10 +164,9 @@ static inline void mx31_setup_weimcs(size_t cs, | |||
170 | #define MX31_INT_UART2 32 | 164 | #define MX31_INT_UART2 32 |
171 | #define MX31_INT_NFC 33 | 165 | #define MX31_INT_NFC 33 |
172 | #define MX31_INT_SDMA 34 | 166 | #define MX31_INT_SDMA 34 |
173 | #define MX31_INT_USB1 35 | 167 | #define MX31_INT_USB_HS1 35 |
174 | #define MX31_INT_USB2 36 | 168 | #define MX31_INT_USB_HS2 36 |
175 | #define MX31_INT_USB3 37 | 169 | #define MX31_INT_USB_OTG 37 |
176 | #define MX31_INT_USB4 38 | ||
177 | #define MX31_INT_MSHC1 39 | 170 | #define MX31_INT_MSHC1 39 |
178 | #define MX31_INT_MSHC2 40 | 171 | #define MX31_INT_MSHC2 40 |
179 | #define MX31_INT_IPU_ERR 41 | 172 | #define MX31_INT_IPU_ERR 41 |
@@ -197,6 +190,8 @@ static inline void mx31_setup_weimcs(size_t cs, | |||
197 | #define MX31_INT_EXT_WDOG 62 | 190 | #define MX31_INT_EXT_WDOG 62 |
198 | #define MX31_INT_EXT_TV 63 | 191 | #define MX31_INT_EXT_TV 63 |
199 | 192 | ||
193 | #define MX31_DMA_REQ_SDHC1 20 | ||
194 | #define MX31_DMA_REQ_SDHC2 21 | ||
200 | #define MX31_DMA_REQ_SSI2_RX1 22 | 195 | #define MX31_DMA_REQ_SSI2_RX1 22 |
201 | #define MX31_DMA_REQ_SSI2_TX1 23 | 196 | #define MX31_DMA_REQ_SSI2_TX1 23 |
202 | #define MX31_DMA_REQ_SSI2_RX0 24 | 197 | #define MX31_DMA_REQ_SSI2_RX0 24 |
@@ -208,52 +203,4 @@ static inline void mx31_setup_weimcs(size_t cs, | |||
208 | 203 | ||
209 | #define MX31_PROD_SIGNATURE 0x1 /* For MX31 */ | 204 | #define MX31_PROD_SIGNATURE 0x1 /* For MX31 */ |
210 | 205 | ||
211 | /* silicon revisions specific to i.MX31 */ | ||
212 | #define MX31_CHIP_REV_1_0 0x10 | ||
213 | #define MX31_CHIP_REV_1_1 0x11 | ||
214 | #define MX31_CHIP_REV_1_2 0x12 | ||
215 | #define MX31_CHIP_REV_1_3 0x13 | ||
216 | #define MX31_CHIP_REV_2_0 0x20 | ||
217 | #define MX31_CHIP_REV_2_1 0x21 | ||
218 | #define MX31_CHIP_REV_2_2 0x22 | ||
219 | #define MX31_CHIP_REV_2_3 0x23 | ||
220 | #define MX31_CHIP_REV_3_0 0x30 | ||
221 | #define MX31_CHIP_REV_3_1 0x31 | ||
222 | #define MX31_CHIP_REV_3_2 0x32 | ||
223 | |||
224 | #define MX31_SYSTEM_REV_MIN MX31_CHIP_REV_1_0 | ||
225 | #define MX31_SYSTEM_REV_NUM 3 | ||
226 | |||
227 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | ||
228 | /* these should go away */ | ||
229 | #define ATA_BASE_ADDR MX31_ATA_BASE_ADDR | ||
230 | #define UART4_BASE_ADDR MX31_UART4_BASE_ADDR | ||
231 | #define UART5_BASE_ADDR MX31_UART5_BASE_ADDR | ||
232 | #define MMC_SDHC1_BASE_ADDR MX31_MMC_SDHC1_BASE_ADDR | ||
233 | #define MMC_SDHC2_BASE_ADDR MX31_MMC_SDHC2_BASE_ADDR | ||
234 | #define SIM1_BASE_ADDR MX31_SIM1_BASE_ADDR | ||
235 | #define IIM_BASE_ADDR MX31_IIM_BASE_ADDR | ||
236 | #define CSPI3_BASE_ADDR MX31_CSPI3_BASE_ADDR | ||
237 | #define FIRI_BASE_ADDR MX31_FIRI_BASE_ADDR | ||
238 | #define SCM_BASE_ADDR MX31_SCM_BASE_ADDR | ||
239 | #define SMN_BASE_ADDR MX31_SMN_BASE_ADDR | ||
240 | #define MPEG4_ENC_BASE_ADDR MX31_MPEG4_ENC_BASE_ADDR | ||
241 | #define MXC_INT_MPEG4_ENCODER MX31_INT_MPEG4_ENCODER | ||
242 | #define MXC_INT_FIRI MX31_INT_FIRI | ||
243 | #define MXC_INT_MBX MX31_INT_MBX | ||
244 | #define MXC_INT_CSPI3 MX31_INT_CSPI3 | ||
245 | #define MXC_INT_SIM2 MX31_INT_SIM2 | ||
246 | #define MXC_INT_SIM1 MX31_INT_SIM1 | ||
247 | #define MXC_INT_CCM_DVFS MX31_INT_CCM_DVFS | ||
248 | #define MXC_INT_USB1 MX31_INT_USB1 | ||
249 | #define MXC_INT_USB2 MX31_INT_USB2 | ||
250 | #define MXC_INT_USB3 MX31_INT_USB3 | ||
251 | #define MXC_INT_USB4 MX31_INT_USB4 | ||
252 | #define MXC_INT_MSHC2 MX31_INT_MSHC2 | ||
253 | #define MXC_INT_UART4 MX31_INT_UART4 | ||
254 | #define MXC_INT_UART5 MX31_INT_UART5 | ||
255 | #define MXC_INT_CCM MX31_INT_CCM | ||
256 | #define MXC_INT_PCMCIA MX31_INT_PCMCIA | ||
257 | #endif | ||
258 | |||
259 | #endif /* ifndef __MACH_MX31_H__ */ | 206 | #endif /* ifndef __MACH_MX31_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h index 6267cff6035d..d13dbfeef08a 100644 --- a/arch/arm/plat-mxc/include/mach/mx35.h +++ b/arch/arm/plat-mxc/include/mach/mx35.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #define MX35_L2CC_SIZE SZ_1M | 11 | #define MX35_L2CC_SIZE SZ_1M |
12 | 12 | ||
13 | #define MX35_AIPS1_BASE_ADDR 0x43f00000 | 13 | #define MX35_AIPS1_BASE_ADDR 0x43f00000 |
14 | #define MX35_AIPS1_BASE_ADDR_VIRT 0xfc000000 | ||
15 | #define MX35_AIPS1_SIZE SZ_1M | 14 | #define MX35_AIPS1_SIZE SZ_1M |
16 | #define MX35_MAX_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x04000) | 15 | #define MX35_MAX_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x04000) |
17 | #define MX35_EVTMON_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x08000) | 16 | #define MX35_EVTMON_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x08000) |
@@ -33,7 +32,6 @@ | |||
33 | #define MX35_ECT_IP2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xbc000) | 32 | #define MX35_ECT_IP2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xbc000) |
34 | 33 | ||
35 | #define MX35_SPBA0_BASE_ADDR 0x50000000 | 34 | #define MX35_SPBA0_BASE_ADDR 0x50000000 |
36 | #define MX35_SPBA0_BASE_ADDR_VIRT 0xfc100000 | ||
37 | #define MX35_SPBA0_SIZE SZ_1M | 35 | #define MX35_SPBA0_SIZE SZ_1M |
38 | #define MX35_UART3_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x0c000) | 36 | #define MX35_UART3_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x0c000) |
39 | #define MX35_CSPI2_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x10000) | 37 | #define MX35_CSPI2_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x10000) |
@@ -44,7 +42,6 @@ | |||
44 | #define MX35_SPBA_CTRL_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x3c000) | 42 | #define MX35_SPBA_CTRL_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x3c000) |
45 | 43 | ||
46 | #define MX35_AIPS2_BASE_ADDR 0x53f00000 | 44 | #define MX35_AIPS2_BASE_ADDR 0x53f00000 |
47 | #define MX35_AIPS2_BASE_ADDR_VIRT 0xfc200000 | ||
48 | #define MX35_AIPS2_SIZE SZ_1M | 45 | #define MX35_AIPS2_SIZE SZ_1M |
49 | #define MX35_CCM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x80000) | 46 | #define MX35_CCM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x80000) |
50 | #define MX35_GPT1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x90000) | 47 | #define MX35_GPT1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x90000) |
@@ -68,15 +65,19 @@ | |||
68 | #define MX35_CAN2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe8000) | 65 | #define MX35_CAN2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe8000) |
69 | #define MX35_RTIC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xec000) | 66 | #define MX35_RTIC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xec000) |
70 | #define MX35_IIM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xf0000) | 67 | #define MX35_IIM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xf0000) |
71 | 68 | #define MX35_USB_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xf4000) | |
72 | #define MX35_OTG_BASE_ADDR 0x53ff4000 | 69 | #define MX35_USB_OTG_BASE_ADDR (MX35_USB_BASE_ADDR + 0x0000) |
70 | /* | ||
71 | * The Reference Manual (IMX35RM, Rev. 2, 3/2009) claims an offset of 0x200 for | ||
72 | * HS. When host support was implemented only a preliminary document was | ||
73 | * available, which told 0x400. This works fine. | ||
74 | */ | ||
75 | #define MX35_USB_HS_BASE_ADDR (MX35_USB_BASE_ADDR + 0x0400) | ||
73 | 76 | ||
74 | #define MX35_ROMP_BASE_ADDR 0x60000000 | 77 | #define MX35_ROMP_BASE_ADDR 0x60000000 |
75 | #define MX35_ROMP_BASE_ADDR_VIRT 0xfc500000 | ||
76 | #define MX35_ROMP_SIZE SZ_1M | 78 | #define MX35_ROMP_SIZE SZ_1M |
77 | 79 | ||
78 | #define MX35_AVIC_BASE_ADDR 0x68000000 | 80 | #define MX35_AVIC_BASE_ADDR 0x68000000 |
79 | #define MX35_AVIC_BASE_ADDR_VIRT 0xfc400000 | ||
80 | #define MX35_AVIC_SIZE SZ_1M | 81 | #define MX35_AVIC_SIZE SZ_1M |
81 | 82 | ||
82 | /* | 83 | /* |
@@ -92,18 +93,17 @@ | |||
92 | #define MX35_CS3_BASE_ADDR 0xb2000000 | 93 | #define MX35_CS3_BASE_ADDR 0xb2000000 |
93 | 94 | ||
94 | #define MX35_CS4_BASE_ADDR 0xb4000000 | 95 | #define MX35_CS4_BASE_ADDR 0xb4000000 |
95 | #define MX35_CS4_BASE_ADDR_VIRT 0xf4000000 | 96 | #define MX35_CS4_BASE_ADDR_VIRT 0xf6000000 |
96 | #define MX35_CS4_SIZE SZ_32M | 97 | #define MX35_CS4_SIZE SZ_32M |
97 | 98 | ||
98 | #define MX35_CS5_BASE_ADDR 0xb6000000 | 99 | #define MX35_CS5_BASE_ADDR 0xb6000000 |
99 | #define MX35_CS5_BASE_ADDR_VIRT 0xf6000000 | 100 | #define MX35_CS5_BASE_ADDR_VIRT 0xf8000000 |
100 | #define MX35_CS5_SIZE SZ_32M | 101 | #define MX35_CS5_SIZE SZ_32M |
101 | 102 | ||
102 | /* | 103 | /* |
103 | * NAND, SDRAM, WEIM, M3IF, EMI controllers | 104 | * NAND, SDRAM, WEIM, M3IF, EMI controllers |
104 | */ | 105 | */ |
105 | #define MX35_X_MEMC_BASE_ADDR 0xb8000000 | 106 | #define MX35_X_MEMC_BASE_ADDR 0xb8000000 |
106 | #define MX35_X_MEMC_BASE_ADDR_VIRT 0xfc320000 | ||
107 | #define MX35_X_MEMC_SIZE SZ_64K | 107 | #define MX35_X_MEMC_SIZE SZ_64K |
108 | #define MX35_ESDCTL_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x1000) | 108 | #define MX35_ESDCTL_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x1000) |
109 | #define MX35_WEIM_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x2000) | 109 | #define MX35_WEIM_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x2000) |
@@ -114,12 +114,8 @@ | |||
114 | #define MX35_NFC_BASE_ADDR 0xbb000000 | 114 | #define MX35_NFC_BASE_ADDR 0xbb000000 |
115 | #define MX35_PCMCIA_MEM_BASE_ADDR 0xbc000000 | 115 | #define MX35_PCMCIA_MEM_BASE_ADDR 0xbc000000 |
116 | 116 | ||
117 | #define MX35_IO_ADDRESS(x) ( \ | 117 | #define MX35_IO_P2V(x) IMX_IO_P2V(x) |
118 | IMX_IO_ADDRESS(x, MX35_AIPS1) ?: \ | 118 | #define MX35_IO_ADDRESS(x) IOMEM(MX35_IO_P2V(x)) |
119 | IMX_IO_ADDRESS(x, MX35_AIPS2) ?: \ | ||
120 | IMX_IO_ADDRESS(x, MX35_AVIC) ?: \ | ||
121 | IMX_IO_ADDRESS(x, MX35_X_MEMC) ?: \ | ||
122 | IMX_IO_ADDRESS(x, MX35_SPBA0)) | ||
123 | 119 | ||
124 | /* | 120 | /* |
125 | * Interrupt numbers | 121 | * Interrupt numbers |
@@ -153,8 +149,8 @@ | |||
153 | #define MX35_INT_UART2 32 | 149 | #define MX35_INT_UART2 32 |
154 | #define MX35_INT_NFC 33 | 150 | #define MX35_INT_NFC 33 |
155 | #define MX35_INT_SDMA 34 | 151 | #define MX35_INT_SDMA 34 |
156 | #define MX35_INT_USBHS 35 | 152 | #define MX35_INT_USB_HS 35 |
157 | #define MX35_INT_USBOTG 37 | 153 | #define MX35_INT_USB_OTG 37 |
158 | #define MX35_INT_MSHC1 39 | 154 | #define MX35_INT_MSHC1 39 |
159 | #define MX35_INT_ESAI 40 | 155 | #define MX35_INT_ESAI 40 |
160 | #define MX35_INT_IPU_ERR 41 | 156 | #define MX35_INT_IPU_ERR 41 |
@@ -190,23 +186,4 @@ | |||
190 | 186 | ||
191 | #define MX35_PROD_SIGNATURE 0x1 /* For MX31 */ | 187 | #define MX35_PROD_SIGNATURE 0x1 /* For MX31 */ |
192 | 188 | ||
193 | #define MX35_SYSTEM_REV_MIN MX3x_CHIP_REV_1_0 | ||
194 | #define MX35_SYSTEM_REV_NUM 3 | ||
195 | |||
196 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | ||
197 | /* these should go away */ | ||
198 | #define MXC_FEC_BASE_ADDR MX35_FEC_BASE_ADDR | ||
199 | #define MXC_INT_OWIRE MX35_INT_OWIRE | ||
200 | #define MXC_INT_GPU2D MX35_INT_GPU2D | ||
201 | #define MXC_INT_ASRC MX35_INT_ASRC | ||
202 | #define MXC_INT_USBHS MX35_INT_USBHS | ||
203 | #define MXC_INT_USBOTG MX35_INT_USBOTG | ||
204 | #define MXC_INT_ESAI MX35_INT_ESAI | ||
205 | #define MXC_INT_CAN1 MX35_INT_CAN1 | ||
206 | #define MXC_INT_CAN2 MX35_INT_CAN2 | ||
207 | #define MXC_INT_MLB MX35_INT_MLB | ||
208 | #define MXC_INT_SPDIF MX35_INT_SPDIF | ||
209 | #define MXC_INT_FEC MX35_INT_FEC | ||
210 | #endif | ||
211 | |||
212 | #endif /* ifndef __MACH_MX35_H__ */ | 189 | #endif /* ifndef __MACH_MX35_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h index d1bd26d7b8a6..388a407d72d6 100644 --- a/arch/arm/plat-mxc/include/mach/mx3x.h +++ b/arch/arm/plat-mxc/include/mach/mx3x.h | |||
@@ -44,7 +44,6 @@ | |||
44 | * AIPS 1 | 44 | * AIPS 1 |
45 | */ | 45 | */ |
46 | #define MX3x_AIPS1_BASE_ADDR 0x43f00000 | 46 | #define MX3x_AIPS1_BASE_ADDR 0x43f00000 |
47 | #define MX3x_AIPS1_BASE_ADDR_VIRT 0xfc000000 | ||
48 | #define MX3x_AIPS1_SIZE SZ_1M | 47 | #define MX3x_AIPS1_SIZE SZ_1M |
49 | #define MX3x_MAX_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x04000) | 48 | #define MX3x_MAX_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x04000) |
50 | #define MX3x_EVTMON_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x08000) | 49 | #define MX3x_EVTMON_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x08000) |
@@ -69,7 +68,6 @@ | |||
69 | * SPBA global module enabled #0 | 68 | * SPBA global module enabled #0 |
70 | */ | 69 | */ |
71 | #define MX3x_SPBA0_BASE_ADDR 0x50000000 | 70 | #define MX3x_SPBA0_BASE_ADDR 0x50000000 |
72 | #define MX3x_SPBA0_BASE_ADDR_VIRT 0xfc100000 | ||
73 | #define MX3x_SPBA0_SIZE SZ_1M | 71 | #define MX3x_SPBA0_SIZE SZ_1M |
74 | #define MX3x_UART3_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x0c000) | 72 | #define MX3x_UART3_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x0c000) |
75 | #define MX3x_CSPI2_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x10000) | 73 | #define MX3x_CSPI2_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x10000) |
@@ -82,7 +80,6 @@ | |||
82 | * AIPS 2 | 80 | * AIPS 2 |
83 | */ | 81 | */ |
84 | #define MX3x_AIPS2_BASE_ADDR 0x53f00000 | 82 | #define MX3x_AIPS2_BASE_ADDR 0x53f00000 |
85 | #define MX3x_AIPS2_BASE_ADDR_VIRT 0xfc200000 | ||
86 | #define MX3x_AIPS2_SIZE SZ_1M | 83 | #define MX3x_AIPS2_SIZE SZ_1M |
87 | #define MX3x_CCM_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x80000) | 84 | #define MX3x_CCM_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x80000) |
88 | #define MX3x_GPT1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x90000) | 85 | #define MX3x_GPT1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x90000) |
@@ -105,11 +102,9 @@ | |||
105 | * ROMP and AVIC | 102 | * ROMP and AVIC |
106 | */ | 103 | */ |
107 | #define MX3x_ROMP_BASE_ADDR 0x60000000 | 104 | #define MX3x_ROMP_BASE_ADDR 0x60000000 |
108 | #define MX3x_ROMP_BASE_ADDR_VIRT 0xfc500000 | ||
109 | #define MX3x_ROMP_SIZE SZ_1M | 105 | #define MX3x_ROMP_SIZE SZ_1M |
110 | 106 | ||
111 | #define MX3x_AVIC_BASE_ADDR 0x68000000 | 107 | #define MX3x_AVIC_BASE_ADDR 0x68000000 |
112 | #define MX3x_AVIC_BASE_ADDR_VIRT 0xfc400000 | ||
113 | #define MX3x_AVIC_SIZE SZ_1M | 108 | #define MX3x_AVIC_SIZE SZ_1M |
114 | 109 | ||
115 | /* | 110 | /* |
@@ -125,18 +120,17 @@ | |||
125 | #define MX3x_CS3_BASE_ADDR 0xb2000000 | 120 | #define MX3x_CS3_BASE_ADDR 0xb2000000 |
126 | 121 | ||
127 | #define MX3x_CS4_BASE_ADDR 0xb4000000 | 122 | #define MX3x_CS4_BASE_ADDR 0xb4000000 |
128 | #define MX3x_CS4_BASE_ADDR_VIRT 0xf4000000 | 123 | #define MX3x_CS4_BASE_ADDR_VIRT 0xf6000000 |
129 | #define MX3x_CS4_SIZE SZ_32M | 124 | #define MX3x_CS4_SIZE SZ_32M |
130 | 125 | ||
131 | #define MX3x_CS5_BASE_ADDR 0xb6000000 | 126 | #define MX3x_CS5_BASE_ADDR 0xb6000000 |
132 | #define MX3x_CS5_BASE_ADDR_VIRT 0xf6000000 | 127 | #define MX3x_CS5_BASE_ADDR_VIRT 0xf8000000 |
133 | #define MX3x_CS5_SIZE SZ_32M | 128 | #define MX3x_CS5_SIZE SZ_32M |
134 | 129 | ||
135 | /* | 130 | /* |
136 | * NAND, SDRAM, WEIM, M3IF, EMI controllers | 131 | * NAND, SDRAM, WEIM, M3IF, EMI controllers |
137 | */ | 132 | */ |
138 | #define MX3x_X_MEMC_BASE_ADDR 0xb8000000 | 133 | #define MX3x_X_MEMC_BASE_ADDR 0xb8000000 |
139 | #define MX3x_X_MEMC_BASE_ADDR_VIRT 0xfc320000 | ||
140 | #define MX3x_X_MEMC_SIZE SZ_64K | 134 | #define MX3x_X_MEMC_SIZE SZ_64K |
141 | #define MX3x_ESDCTL_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x1000) | 135 | #define MX3x_ESDCTL_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x1000) |
142 | #define MX3x_WEIM_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x2000) | 136 | #define MX3x_WEIM_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x2000) |
@@ -146,56 +140,6 @@ | |||
146 | 140 | ||
147 | #define MX3x_PCMCIA_MEM_BASE_ADDR 0xbc000000 | 141 | #define MX3x_PCMCIA_MEM_BASE_ADDR 0xbc000000 |
148 | 142 | ||
149 | /*! | ||
150 | * This macro defines the physical to virtual address mapping for all the | ||
151 | * peripheral modules. It is used by passing in the physical address as x | ||
152 | * and returning the virtual address. If the physical address is not mapped, | ||
153 | * it returns 0xDEADBEEF | ||
154 | */ | ||
155 | #define IO_ADDRESS(x) \ | ||
156 | (void __force __iomem *) \ | ||
157 | (((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\ | ||
158 | ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\ | ||
159 | ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\ | ||
160 | ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\ | ||
161 | ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\ | ||
162 | ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\ | ||
163 | ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\ | ||
164 | 0xDEADBEEF) | ||
165 | |||
166 | /* | ||
167 | * define the address mapping macros: in physical address order | ||
168 | */ | ||
169 | #define L2CC_IO_ADDRESS(x) \ | ||
170 | (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT) | ||
171 | |||
172 | #define AIPS1_IO_ADDRESS(x) \ | ||
173 | (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) | ||
174 | |||
175 | #define SPBA0_IO_ADDRESS(x) \ | ||
176 | (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) | ||
177 | |||
178 | #define AIPS2_IO_ADDRESS(x) \ | ||
179 | (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) | ||
180 | |||
181 | #define ROMP_IO_ADDRESS(x) \ | ||
182 | (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) | ||
183 | |||
184 | #define AVIC_IO_ADDRESS(x) \ | ||
185 | (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT) | ||
186 | |||
187 | #define CS4_IO_ADDRESS(x) \ | ||
188 | (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT) | ||
189 | |||
190 | #define CS5_IO_ADDRESS(x) \ | ||
191 | (((x) - CS5_BASE_ADDR) + CS5_BASE_ADDR_VIRT) | ||
192 | |||
193 | #define X_MEMC_IO_ADDRESS(x) \ | ||
194 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
195 | |||
196 | #define PCMCIA_IO_ADDRESS(x) \ | ||
197 | (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) | ||
198 | |||
199 | /* | 143 | /* |
200 | * Interrupt numbers | 144 | * Interrupt numbers |
201 | */ | 145 | */ |
@@ -240,22 +184,6 @@ | |||
240 | 184 | ||
241 | #define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */ | 185 | #define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */ |
242 | 186 | ||
243 | /* silicon revisions specific to i.MX31 and i.MX35 */ | ||
244 | #define MX3x_CHIP_REV_1_0 0x10 | ||
245 | #define MX3x_CHIP_REV_1_1 0x11 | ||
246 | #define MX3x_CHIP_REV_1_2 0x12 | ||
247 | #define MX3x_CHIP_REV_1_3 0x13 | ||
248 | #define MX3x_CHIP_REV_2_0 0x20 | ||
249 | #define MX3x_CHIP_REV_2_1 0x21 | ||
250 | #define MX3x_CHIP_REV_2_2 0x22 | ||
251 | #define MX3x_CHIP_REV_2_3 0x23 | ||
252 | #define MX3x_CHIP_REV_3_0 0x30 | ||
253 | #define MX3x_CHIP_REV_3_1 0x31 | ||
254 | #define MX3x_CHIP_REV_3_2 0x32 | ||
255 | |||
256 | #define MX3x_SYSTEM_REV_MIN MX3x_CHIP_REV_1_0 | ||
257 | #define MX3x_SYSTEM_REV_NUM 3 | ||
258 | |||
259 | /* Mandatory defines used globally */ | 187 | /* Mandatory defines used globally */ |
260 | 188 | ||
261 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) | 189 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) |
@@ -277,126 +205,4 @@ static inline int mx35_revision(void) | |||
277 | } | 205 | } |
278 | #endif | 206 | #endif |
279 | 207 | ||
280 | #ifdef IMX_NEEDS_DEPRECATED_SYMBOLS | ||
281 | /* these should go away */ | ||
282 | #define L2CC_BASE_ADDR MX3x_L2CC_BASE_ADDR | ||
283 | #define L2CC_SIZE MX3x_L2CC_SIZE | ||
284 | #define AIPS1_BASE_ADDR MX3x_AIPS1_BASE_ADDR | ||
285 | #define AIPS1_BASE_ADDR_VIRT MX3x_AIPS1_BASE_ADDR_VIRT | ||
286 | #define AIPS1_SIZE MX3x_AIPS1_SIZE | ||
287 | #define MAX_BASE_ADDR MX3x_MAX_BASE_ADDR | ||
288 | #define EVTMON_BASE_ADDR MX3x_EVTMON_BASE_ADDR | ||
289 | #define CLKCTL_BASE_ADDR MX3x_CLKCTL_BASE_ADDR | ||
290 | #define ETB_SLOT4_BASE_ADDR MX3x_ETB_SLOT4_BASE_ADDR | ||
291 | #define ETB_SLOT5_BASE_ADDR MX3x_ETB_SLOT5_BASE_ADDR | ||
292 | #define ECT_CTIO_BASE_ADDR MX3x_ECT_CTIO_BASE_ADDR | ||
293 | #define I2C_BASE_ADDR MX3x_I2C_BASE_ADDR | ||
294 | #define I2C3_BASE_ADDR MX3x_I2C3_BASE_ADDR | ||
295 | #define UART1_BASE_ADDR MX3x_UART1_BASE_ADDR | ||
296 | #define UART2_BASE_ADDR MX3x_UART2_BASE_ADDR | ||
297 | #define I2C2_BASE_ADDR MX3x_I2C2_BASE_ADDR | ||
298 | #define OWIRE_BASE_ADDR MX3x_OWIRE_BASE_ADDR | ||
299 | #define SSI1_BASE_ADDR MX3x_SSI1_BASE_ADDR | ||
300 | #define CSPI1_BASE_ADDR MX3x_CSPI1_BASE_ADDR | ||
301 | #define KPP_BASE_ADDR MX3x_KPP_BASE_ADDR | ||
302 | #define IOMUXC_BASE_ADDR MX3x_IOMUXC_BASE_ADDR | ||
303 | #define ECT_IP1_BASE_ADDR MX3x_ECT_IP1_BASE_ADDR | ||
304 | #define ECT_IP2_BASE_ADDR MX3x_ECT_IP2_BASE_ADDR | ||
305 | #define SPBA0_BASE_ADDR MX3x_SPBA0_BASE_ADDR | ||
306 | #define SPBA0_BASE_ADDR_VIRT MX3x_SPBA0_BASE_ADDR_VIRT | ||
307 | #define SPBA0_SIZE MX3x_SPBA0_SIZE | ||
308 | #define UART3_BASE_ADDR MX3x_UART3_BASE_ADDR | ||
309 | #define CSPI2_BASE_ADDR MX3x_CSPI2_BASE_ADDR | ||
310 | #define SSI2_BASE_ADDR MX3x_SSI2_BASE_ADDR | ||
311 | #define ATA_DMA_BASE_ADDR MX3x_ATA_DMA_BASE_ADDR | ||
312 | #define MSHC1_BASE_ADDR MX3x_MSHC1_BASE_ADDR | ||
313 | #define SPBA_CTRL_BASE_ADDR MX3x_SPBA_CTRL_BASE_ADDR | ||
314 | #define AIPS2_BASE_ADDR MX3x_AIPS2_BASE_ADDR | ||
315 | #define AIPS2_BASE_ADDR_VIRT MX3x_AIPS2_BASE_ADDR_VIRT | ||
316 | #define AIPS2_SIZE MX3x_AIPS2_SIZE | ||
317 | #define CCM_BASE_ADDR MX3x_CCM_BASE_ADDR | ||
318 | #define GPT1_BASE_ADDR MX3x_GPT1_BASE_ADDR | ||
319 | #define EPIT1_BASE_ADDR MX3x_EPIT1_BASE_ADDR | ||
320 | #define EPIT2_BASE_ADDR MX3x_EPIT2_BASE_ADDR | ||
321 | #define GPIO3_BASE_ADDR MX3x_GPIO3_BASE_ADDR | ||
322 | #define SCC_BASE_ADDR MX3x_SCC_BASE_ADDR | ||
323 | #define RNGA_BASE_ADDR MX3x_RNGA_BASE_ADDR | ||
324 | #define IPU_CTRL_BASE_ADDR MX3x_IPU_CTRL_BASE_ADDR | ||
325 | #define AUDMUX_BASE_ADDR MX3x_AUDMUX_BASE_ADDR | ||
326 | #define GPIO1_BASE_ADDR MX3x_GPIO1_BASE_ADDR | ||
327 | #define GPIO2_BASE_ADDR MX3x_GPIO2_BASE_ADDR | ||
328 | #define SDMA_BASE_ADDR MX3x_SDMA_BASE_ADDR | ||
329 | #define RTC_BASE_ADDR MX3x_RTC_BASE_ADDR | ||
330 | #define WDOG_BASE_ADDR MX3x_WDOG_BASE_ADDR | ||
331 | #define PWM_BASE_ADDR MX3x_PWM_BASE_ADDR | ||
332 | #define RTIC_BASE_ADDR MX3x_RTIC_BASE_ADDR | ||
333 | #define ROMP_BASE_ADDR MX3x_ROMP_BASE_ADDR | ||
334 | #define ROMP_BASE_ADDR_VIRT MX3x_ROMP_BASE_ADDR_VIRT | ||
335 | #define ROMP_SIZE MX3x_ROMP_SIZE | ||
336 | #define AVIC_BASE_ADDR MX3x_AVIC_BASE_ADDR | ||
337 | #define AVIC_BASE_ADDR_VIRT MX3x_AVIC_BASE_ADDR_VIRT | ||
338 | #define AVIC_SIZE MX3x_AVIC_SIZE | ||
339 | #define IPU_MEM_BASE_ADDR MX3x_IPU_MEM_BASE_ADDR | ||
340 | #define CSD0_BASE_ADDR MX3x_CSD0_BASE_ADDR | ||
341 | #define CSD1_BASE_ADDR MX3x_CSD1_BASE_ADDR | ||
342 | #define CS0_BASE_ADDR MX3x_CS0_BASE_ADDR | ||
343 | #define CS1_BASE_ADDR MX3x_CS1_BASE_ADDR | ||
344 | #define CS2_BASE_ADDR MX3x_CS2_BASE_ADDR | ||
345 | #define CS3_BASE_ADDR MX3x_CS3_BASE_ADDR | ||
346 | #define CS4_BASE_ADDR MX3x_CS4_BASE_ADDR | ||
347 | #define CS4_BASE_ADDR_VIRT MX3x_CS4_BASE_ADDR_VIRT | ||
348 | #define CS4_SIZE MX3x_CS4_SIZE | ||
349 | #define CS5_BASE_ADDR MX3x_CS5_BASE_ADDR | ||
350 | #define CS5_BASE_ADDR_VIRT MX3x_CS5_BASE_ADDR_VIRT | ||
351 | #define CS5_SIZE MX3x_CS5_SIZE | ||
352 | #define X_MEMC_BASE_ADDR MX3x_X_MEMC_BASE_ADDR | ||
353 | #define X_MEMC_BASE_ADDR_VIRT MX3x_X_MEMC_BASE_ADDR_VIRT | ||
354 | #define X_MEMC_SIZE MX3x_X_MEMC_SIZE | ||
355 | #define ESDCTL_BASE_ADDR MX3x_ESDCTL_BASE_ADDR | ||
356 | #define WEIM_BASE_ADDR MX3x_WEIM_BASE_ADDR | ||
357 | #define M3IF_BASE_ADDR MX3x_M3IF_BASE_ADDR | ||
358 | #define EMI_CTL_BASE_ADDR MX3x_EMI_CTL_BASE_ADDR | ||
359 | #define PCMCIA_CTL_BASE_ADDR MX3x_PCMCIA_CTL_BASE_ADDR | ||
360 | #define PCMCIA_MEM_BASE_ADDR MX3x_PCMCIA_MEM_BASE_ADDR | ||
361 | #define MXC_INT_I2C3 MX3x_INT_I2C3 | ||
362 | #define MXC_INT_I2C2 MX3x_INT_I2C2 | ||
363 | #define MXC_INT_RTIC MX3x_INT_RTIC | ||
364 | #define MXC_INT_I2C MX3x_INT_I2C | ||
365 | #define MXC_INT_CSPI2 MX3x_INT_CSPI2 | ||
366 | #define MXC_INT_CSPI1 MX3x_INT_CSPI1 | ||
367 | #define MXC_INT_ATA MX3x_INT_ATA | ||
368 | #define MXC_INT_UART3 MX3x_INT_UART3 | ||
369 | #define MXC_INT_IIM MX3x_INT_IIM | ||
370 | #define MXC_INT_RNGA MX3x_INT_RNGA | ||
371 | #define MXC_INT_EVTMON MX3x_INT_EVTMON | ||
372 | #define MXC_INT_KPP MX3x_INT_KPP | ||
373 | #define MXC_INT_RTC MX3x_INT_RTC | ||
374 | #define MXC_INT_PWM MX3x_INT_PWM | ||
375 | #define MXC_INT_EPIT2 MX3x_INT_EPIT2 | ||
376 | #define MXC_INT_EPIT1 MX3x_INT_EPIT1 | ||
377 | #define MXC_INT_GPT MX3x_INT_GPT | ||
378 | #define MXC_INT_POWER_FAIL MX3x_INT_POWER_FAIL | ||
379 | #define MXC_INT_UART2 MX3x_INT_UART2 | ||
380 | #define MXC_INT_NANDFC MX3x_INT_NANDFC | ||
381 | #define MXC_INT_SDMA MX3x_INT_SDMA | ||
382 | #define MXC_INT_MSHC1 MX3x_INT_MSHC1 | ||
383 | #define MXC_INT_IPU_ERR MX3x_INT_IPU_ERR | ||
384 | #define MXC_INT_IPU_SYN MX3x_INT_IPU_SYN | ||
385 | #define MXC_INT_UART1 MX3x_INT_UART1 | ||
386 | #define MXC_INT_ECT MX3x_INT_ECT | ||
387 | #define MXC_INT_SCC_SCM MX3x_INT_SCC_SCM | ||
388 | #define MXC_INT_SCC_SMN MX3x_INT_SCC_SMN | ||
389 | #define MXC_INT_GPIO2 MX3x_INT_GPIO2 | ||
390 | #define MXC_INT_GPIO1 MX3x_INT_GPIO1 | ||
391 | #define MXC_INT_WDOG MX3x_INT_WDOG | ||
392 | #define MXC_INT_GPIO3 MX3x_INT_GPIO3 | ||
393 | #define MXC_INT_EXT_POWER MX3x_INT_EXT_POWER | ||
394 | #define MXC_INT_EXT_TEMPER MX3x_INT_EXT_TEMPER | ||
395 | #define MXC_INT_EXT_SENSOR60 MX3x_INT_EXT_SENSOR60 | ||
396 | #define MXC_INT_EXT_SENSOR61 MX3x_INT_EXT_SENSOR61 | ||
397 | #define MXC_INT_EXT_WDOG MX3x_INT_EXT_WDOG | ||
398 | #define MXC_INT_EXT_TV MX3x_INT_EXT_TV | ||
399 | #define PROD_SIGNATURE MX3x_PROD_SIGNATURE | ||
400 | #endif | ||
401 | |||
402 | #endif /* ifndef __MACH_MX3x_H__ */ | 208 | #endif /* ifndef __MACH_MX3x_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/mx50.h b/arch/arm/plat-mxc/include/mach/mx50.h new file mode 100644 index 000000000000..aaec2a6e7b3a --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/mx50.h | |||
@@ -0,0 +1,285 @@ | |||
1 | #ifndef __MACH_MX50_H__ | ||
2 | #define __MACH_MX50_H__ | ||
3 | |||
4 | /* | ||
5 | * IROM | ||
6 | */ | ||
7 | #define MX50_IROM_BASE_ADDR 0x0 | ||
8 | #define MX50_IROM_SIZE SZ_64K | ||
9 | |||
10 | /* TZIC */ | ||
11 | #define MX50_TZIC_BASE_ADDR 0x0fffc000 | ||
12 | #define MX50_TZIC_SIZE SZ_16K | ||
13 | |||
14 | /* | ||
15 | * IRAM | ||
16 | */ | ||
17 | #define MX50_IRAM_BASE_ADDR 0xf8000000 /* internal ram */ | ||
18 | #define MX50_IRAM_PARTITIONS 16 | ||
19 | #define MX50_IRAM_SIZE (MX50_IRAM_PARTITIONS * SZ_8K) /* 128KB */ | ||
20 | |||
21 | /* | ||
22 | * Databahn | ||
23 | */ | ||
24 | #define MX50_DATABAHN_BASE_ADDR 0x14000000 | ||
25 | |||
26 | /* | ||
27 | * Graphics Memory of GPU | ||
28 | */ | ||
29 | #define MX50_GPU2D_BASE_ADDR 0x20000000 | ||
30 | |||
31 | #define MX50_DEBUG_BASE_ADDR 0x40000000 | ||
32 | #define MX50_DEBUG_SIZE SZ_1M | ||
33 | #define MX50_ETB_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00001000) | ||
34 | #define MX50_ETM_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00002000) | ||
35 | #define MX50_TPIU_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00003000) | ||
36 | #define MX50_CTI0_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00004000) | ||
37 | #define MX50_CTI1_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00005000) | ||
38 | #define MX50_CTI2_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00006000) | ||
39 | #define MX50_CTI3_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00007000) | ||
40 | #define MX50_CORTEX_DBG_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x00008000) | ||
41 | |||
42 | #define MX50_APBHDMA_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01000000) | ||
43 | #define MX50_OCOTP_CTRL_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01002000) | ||
44 | #define MX50_DIGCTL_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01004000) | ||
45 | #define MX50_GPMI_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01006000) | ||
46 | #define MX50_BCH_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01008000) | ||
47 | #define MX50_ELCDIF_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x0100a000) | ||
48 | #define MX50_EPXP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x0100c000) | ||
49 | #define MX50_DCP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x0100e000) | ||
50 | #define MX50_EPDC_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01010000) | ||
51 | #define MX50_QOSC_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01012000) | ||
52 | #define MX50_PERFMON_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01014000) | ||
53 | #define MX50_SSP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01016000) | ||
54 | #define MX50_ANATOP_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x01018000) | ||
55 | #define MX50_NIC_BASE_ADDR (MX50_DEBUG_BASE_ADDR + 0x08000000) | ||
56 | |||
57 | /* | ||
58 | * SPBA global module enabled #0 | ||
59 | */ | ||
60 | #define MX50_SPBA0_BASE_ADDR 0x50000000 | ||
61 | #define MX50_SPBA0_SIZE SZ_1M | ||
62 | |||
63 | #define MX50_MMC_SDHC1_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00004000) | ||
64 | #define MX50_MMC_SDHC2_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00008000) | ||
65 | #define MX50_UART3_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x0000c000) | ||
66 | #define MX50_CSPI1_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00010000) | ||
67 | #define MX50_SSI2_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00014000) | ||
68 | #define MX50_MMC_SDHC3_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00020000) | ||
69 | #define MX50_MMC_SDHC4_BASE_ADDR (MX50_SPBA0_BASE_ADDR + 0x00024000) | ||
70 | |||
71 | /* | ||
72 | * AIPS 1 | ||
73 | */ | ||
74 | #define MX50_AIPS1_BASE_ADDR 0x53f00000 | ||
75 | #define MX50_AIPS1_SIZE SZ_1M | ||
76 | |||
77 | #define MX50_OTG_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00080000) | ||
78 | #define MX50_GPIO1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00084000) | ||
79 | #define MX50_GPIO2_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00088000) | ||
80 | #define MX50_GPIO3_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x0008c000) | ||
81 | #define MX50_GPIO4_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00090000) | ||
82 | #define MX50_KPP_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00094000) | ||
83 | #define MX50_WDOG_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x00098000) | ||
84 | #define MX50_GPT1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000a0000) | ||
85 | #define MX50_SRTC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000a4000) | ||
86 | #define MX50_IOMUXC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000a8000) | ||
87 | #define MX50_EPIT1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000ac000) | ||
88 | #define MX50_PWM1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000b4000) | ||
89 | #define MX50_PWM2_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000b8000) | ||
90 | #define MX50_UART1_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000bc000) | ||
91 | #define MX50_UART2_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000c0000) | ||
92 | #define MX50_SRC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000d0000) | ||
93 | #define MX50_CCM_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000d4000) | ||
94 | #define MX50_GPC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000d8000) | ||
95 | #define MX50_GPIO5_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000dc000) | ||
96 | #define MX50_GPIO6_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000e0000) | ||
97 | #define MX50_I2C3_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000ec000) | ||
98 | #define MX50_UART4_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000f0000) | ||
99 | |||
100 | #define MX50_MSHC_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000f4000) | ||
101 | #define MX50_RNGB_BASE_ADDR (MX50_AIPS1_BASE_ADDR + 0x000f8000) | ||
102 | |||
103 | /* | ||
104 | * AIPS 2 | ||
105 | */ | ||
106 | #define MX50_AIPS2_BASE_ADDR 0x63f00000 | ||
107 | #define MX50_AIPS2_SIZE SZ_1M | ||
108 | |||
109 | #define MX50_PLL1_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00080000) | ||
110 | #define MX50_PLL2_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00084000) | ||
111 | #define MX50_PLL3_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00088000) | ||
112 | #define MX50_UART5_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00090000) | ||
113 | #define MX50_AHBMAX_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x00094000) | ||
114 | #define MX50_ARM_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000a0000) | ||
115 | #define MX50_OWIRE_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000a4000) | ||
116 | #define MX50_CSPI2_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000ac000) | ||
117 | #define MX50_SDMA_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000b0000) | ||
118 | #define MX50_ROMCP_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000b8000) | ||
119 | #define MX50_CSPI3_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000c0000) | ||
120 | #define MX50_I2C2_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000c4000) | ||
121 | #define MX50_I2C1_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000c8000) | ||
122 | #define MX50_SSI1_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000cc000) | ||
123 | #define MX50_AUDMUX_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000d0000) | ||
124 | #define MX50_WEIM_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000d8000) | ||
125 | #define MX50_FEC_BASE_ADDR (MX50_AIPS2_BASE_ADDR + 0x000ec000) | ||
126 | |||
127 | /* | ||
128 | * Memory regions and CS | ||
129 | */ | ||
130 | #define MX50_CSD0_BASE_ADDR 0x70000000 | ||
131 | #define MX50_CSD1_BASE_ADDR 0xb0000000 | ||
132 | #define MX50_CS0_BASE_ADDR 0xf0000000 | ||
133 | |||
134 | #define MX50_IO_P2V(x) IMX_IO_P2V(x) | ||
135 | #define MX50_IO_ADDRESS(x) IOMEM(MX50_IO_P2V(x)) | ||
136 | |||
137 | /* | ||
138 | * defines for SPBA modules | ||
139 | */ | ||
140 | #define MX50_SPBA_SDHC1 0x04 | ||
141 | #define MX50_SPBA_SDHC2 0x08 | ||
142 | #define MX50_SPBA_UART3 0x0c | ||
143 | #define MX50_SPBA_CSPI1 0x10 | ||
144 | #define MX50_SPBA_SSI2 0x14 | ||
145 | #define MX50_SPBA_SDHC3 0x20 | ||
146 | #define MX50_SPBA_SDHC4 0x24 | ||
147 | #define MX50_SPBA_SPDIF 0x28 | ||
148 | #define MX50_SPBA_ATA 0x30 | ||
149 | #define MX50_SPBA_SLIM 0x34 | ||
150 | #define MX50_SPBA_HSI2C 0x38 | ||
151 | #define MX50_SPBA_CTRL 0x3c | ||
152 | |||
153 | /* | ||
154 | * DMA request assignments | ||
155 | */ | ||
156 | #define MX50_DMA_REQ_GPC 1 | ||
157 | #define MX50_DMA_REQ_ATA_UART4_RX 2 | ||
158 | #define MX50_DMA_REQ_ATA_UART4_TX 3 | ||
159 | #define MX50_DMA_REQ_CSPI1_RX 6 | ||
160 | #define MX50_DMA_REQ_CSPI1_TX 7 | ||
161 | #define MX50_DMA_REQ_CSPI2_RX 8 | ||
162 | #define MX50_DMA_REQ_CSPI2_TX 9 | ||
163 | #define MX50_DMA_REQ_I2C3_SDHC3 10 | ||
164 | #define MX50_DMA_REQ_SDHC4 11 | ||
165 | #define MX50_DMA_REQ_UART2_FIRI_RX 12 | ||
166 | #define MX50_DMA_REQ_UART2_FIRI_TX 13 | ||
167 | #define MX50_DMA_REQ_EXT0 14 | ||
168 | #define MX50_DMA_REQ_EXT1 15 | ||
169 | #define MX50_DMA_REQ_UART5_RX 16 | ||
170 | #define MX50_DMA_REQ_UART5_TX 17 | ||
171 | #define MX50_DMA_REQ_UART1_RX 18 | ||
172 | #define MX50_DMA_REQ_UART1_TX 19 | ||
173 | #define MX50_DMA_REQ_I2C1_SDHC1 20 | ||
174 | #define MX50_DMA_REQ_I2C2_SDHC2 21 | ||
175 | #define MX50_DMA_REQ_SSI2_RX2 22 | ||
176 | #define MX50_DMA_REQ_SSI2_TX2 23 | ||
177 | #define MX50_DMA_REQ_SSI2_RX1 24 | ||
178 | #define MX50_DMA_REQ_SSI2_TX1 25 | ||
179 | #define MX50_DMA_REQ_SSI1_RX2 26 | ||
180 | #define MX50_DMA_REQ_SSI1_TX2 27 | ||
181 | #define MX50_DMA_REQ_SSI1_RX1 28 | ||
182 | #define MX50_DMA_REQ_SSI1_TX1 29 | ||
183 | #define MX50_DMA_REQ_CSPI_RX 38 | ||
184 | #define MX50_DMA_REQ_CSPI_TX 39 | ||
185 | #define MX50_DMA_REQ_UART3_RX 42 | ||
186 | #define MX50_DMA_REQ_UART3_TX 43 | ||
187 | |||
188 | /* | ||
189 | * Interrupt numbers | ||
190 | */ | ||
191 | #define MX50_INT_MMC_SDHC1 1 | ||
192 | #define MX50_INT_MMC_SDHC2 2 | ||
193 | #define MX50_INT_MMC_SDHC3 3 | ||
194 | #define MX50_INT_MMC_SDHC4 4 | ||
195 | #define MX50_INT_DAP 5 | ||
196 | #define MX50_INT_SDMA 6 | ||
197 | #define MX50_INT_IOMUX 7 | ||
198 | #define MX50_INT_UART4 13 | ||
199 | #define MX50_INT_USB_H1 14 | ||
200 | #define MX50_INT_USB_OTG 18 | ||
201 | #define MX50_INT_DATABAHN 19 | ||
202 | #define MX50_INT_ELCDIF 20 | ||
203 | #define MX50_INT_EPXP 21 | ||
204 | #define MX50_INT_SRTC_NTZ 24 | ||
205 | #define MX50_INT_SRTC_TZ 25 | ||
206 | #define MX50_INT_EPDC 27 | ||
207 | #define MX50_INT_NIC 28 | ||
208 | #define MX50_INT_SSI1 29 | ||
209 | #define MX50_INT_SSI2 30 | ||
210 | #define MX50_INT_UART1 31 | ||
211 | #define MX50_INT_UART2 32 | ||
212 | #define MX50_INT_UART3 33 | ||
213 | #define MX50_INT_RESV34 34 | ||
214 | #define MX50_INT_RESV35 35 | ||
215 | #define MX50_INT_CSPI1 36 | ||
216 | #define MX50_INT_CSPI2 37 | ||
217 | #define MX50_INT_CSPI 38 | ||
218 | #define MX50_INT_GPT 39 | ||
219 | #define MX50_INT_EPIT1 40 | ||
220 | #define MX50_INT_GPIO1_INT7 42 | ||
221 | #define MX50_INT_GPIO1_INT6 43 | ||
222 | #define MX50_INT_GPIO1_INT5 44 | ||
223 | #define MX50_INT_GPIO1_INT4 45 | ||
224 | #define MX50_INT_GPIO1_INT3 46 | ||
225 | #define MX50_INT_GPIO1_INT2 47 | ||
226 | #define MX50_INT_GPIO1_INT1 48 | ||
227 | #define MX50_INT_GPIO1_INT0 49 | ||
228 | #define MX50_INT_GPIO1_LOW 50 | ||
229 | #define MX50_INT_GPIO1_HIGH 51 | ||
230 | #define MX50_INT_GPIO2_LOW 52 | ||
231 | #define MX50_INT_GPIO2_HIGH 53 | ||
232 | #define MX50_INT_GPIO3_LOW 54 | ||
233 | #define MX50_INT_GPIO3_HIGH 55 | ||
234 | #define MX50_INT_GPIO4_LOW 56 | ||
235 | #define MX50_INT_GPIO4_HIGH 57 | ||
236 | #define MX50_INT_WDOG1 58 | ||
237 | #define MX50_INT_KPP 60 | ||
238 | #define MX50_INT_PWM1 61 | ||
239 | #define MX50_INT_I2C1 62 | ||
240 | #define MX50_INT_I2C2 63 | ||
241 | #define MX50_INT_I2C3 64 | ||
242 | #define MX50_INT_RESV65 65 | ||
243 | #define MX50_INT_DCDC 66 | ||
244 | #define MX50_INT_THERMAL_ALARM 67 | ||
245 | #define MX50_INT_ANA3 68 | ||
246 | #define MX50_INT_ANA4 69 | ||
247 | #define MX50_INT_CCM1 71 | ||
248 | #define MX50_INT_CCM2 72 | ||
249 | #define MX50_INT_GPC1 73 | ||
250 | #define MX50_INT_GPC2 74 | ||
251 | #define MX50_INT_SRC 75 | ||
252 | #define MX50_INT_NM 76 | ||
253 | #define MX50_INT_PMU 77 | ||
254 | #define MX50_INT_CTI_IRQ 78 | ||
255 | #define MX50_INT_CTI1_TG0 79 | ||
256 | #define MX50_INT_CTI1_TG1 80 | ||
257 | #define MX50_INT_GPU2_IRQ 84 | ||
258 | #define MX50_INT_GPU2_BUSY 85 | ||
259 | #define MX50_INT_UART5 86 | ||
260 | #define MX50_INT_FEC 87 | ||
261 | #define MX50_INT_OWIRE 88 | ||
262 | #define MX50_INT_CTI1_TG2 89 | ||
263 | #define MX50_INT_SJC 90 | ||
264 | #define MX50_INT_DCP_CHAN1_3 91 | ||
265 | #define MX50_INT_DCP_CHAN0 92 | ||
266 | #define MX50_INT_PWM2 94 | ||
267 | #define MX50_INT_RNGB 97 | ||
268 | #define MX50_INT_CTI1_TG3 98 | ||
269 | #define MX50_INT_RAWNAND_BCH 100 | ||
270 | #define MX50_INT_RAWNAND_GPMI 102 | ||
271 | #define MX50_INT_GPIO5_LOW 103 | ||
272 | #define MX50_INT_GPIO5_HIGH 104 | ||
273 | #define MX50_INT_GPIO6_LOW 105 | ||
274 | #define MX50_INT_GPIO6_HIGH 106 | ||
275 | #define MX50_INT_MSHC 109 | ||
276 | #define MX50_INT_APBHDMA_CHAN0 110 | ||
277 | #define MX50_INT_APBHDMA_CHAN1 111 | ||
278 | #define MX50_INT_APBHDMA_CHAN2 112 | ||
279 | #define MX50_INT_APBHDMA_CHAN3 113 | ||
280 | #define MX50_INT_APBHDMA_CHAN4 114 | ||
281 | #define MX50_INT_APBHDMA_CHAN5 115 | ||
282 | #define MX50_INT_APBHDMA_CHAN6 116 | ||
283 | #define MX50_INT_APBHDMA_CHAN7 117 | ||
284 | |||
285 | #endif /* ifndef __MACH_MX50_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h index 2af7a1056fc1..873807f96d70 100644 --- a/arch/arm/plat-mxc/include/mach/mx51.h +++ b/arch/arm/plat-mxc/include/mach/mx51.h | |||
@@ -2,31 +2,6 @@ | |||
2 | #define __MACH_MX51_H__ | 2 | #define __MACH_MX51_H__ |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * MX51 memory map: | ||
6 | * | ||
7 | * | ||
8 | * Virt Phys Size What | ||
9 | * --------------------------------------------------------------------------- | ||
10 | * fa3e0000 1ffe0000 128K IRAM (SCCv2 RAM) | ||
11 | * 30000000 256M GPU | ||
12 | * 40000000 512M IPU | ||
13 | * fa200000 60000000 1M DEBUG | ||
14 | * fb100000 70000000 1M SPBA 0 | ||
15 | * fb000000 73f00000 1M AIPS 1 | ||
16 | * fb200000 83f00000 1M AIPS 2 | ||
17 | * 8fffc000 16K TZIC (interrupt controller) | ||
18 | * 90000000 256M CSD0 SDRAM/DDR | ||
19 | * a0000000 256M CSD1 SDRAM/DDR | ||
20 | * b0000000 128M CS0 Flash | ||
21 | * b8000000 128M CS1 Flash | ||
22 | * c0000000 128M CS2 Flash | ||
23 | * c8000000 64M CS3 Flash | ||
24 | * cc000000 32M CS4 SRAM | ||
25 | * ce000000 32M CS5 SRAM | ||
26 | * cfff0000 64K NFC (NAND Flash AXI) | ||
27 | */ | ||
28 | |||
29 | /* | ||
30 | * IROM | 5 | * IROM |
31 | */ | 6 | */ |
32 | #define MX51_IROM_BASE_ADDR 0x0 | 7 | #define MX51_IROM_BASE_ADDR 0x0 |
@@ -36,7 +11,6 @@ | |||
36 | * IRAM | 11 | * IRAM |
37 | */ | 12 | */ |
38 | #define MX51_IRAM_BASE_ADDR 0x1ffe0000 /* internal ram */ | 13 | #define MX51_IRAM_BASE_ADDR 0x1ffe0000 /* internal ram */ |
39 | #define MX51_IRAM_BASE_ADDR_VIRT 0xfa3e0000 | ||
40 | #define MX51_IRAM_PARTITIONS 16 | 14 | #define MX51_IRAM_PARTITIONS 16 |
41 | #define MX51_IRAM_SIZE (MX51_IRAM_PARTITIONS * SZ_8K) /* 128KB */ | 15 | #define MX51_IRAM_SIZE (MX51_IRAM_PARTITIONS * SZ_8K) /* 128KB */ |
42 | 16 | ||
@@ -45,7 +19,6 @@ | |||
45 | #define MX51_IPU_CTRL_BASE_ADDR 0x40000000 | 19 | #define MX51_IPU_CTRL_BASE_ADDR 0x40000000 |
46 | 20 | ||
47 | #define MX51_DEBUG_BASE_ADDR 0x60000000 | 21 | #define MX51_DEBUG_BASE_ADDR 0x60000000 |
48 | #define MX51_DEBUG_BASE_ADDR_VIRT 0xfa200000 | ||
49 | #define MX51_DEBUG_SIZE SZ_1M | 22 | #define MX51_DEBUG_SIZE SZ_1M |
50 | 23 | ||
51 | #define MX51_ETB_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x01000) | 24 | #define MX51_ETB_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x01000) |
@@ -61,7 +34,6 @@ | |||
61 | * SPBA global module enabled #0 | 34 | * SPBA global module enabled #0 |
62 | */ | 35 | */ |
63 | #define MX51_SPBA0_BASE_ADDR 0x70000000 | 36 | #define MX51_SPBA0_BASE_ADDR 0x70000000 |
64 | #define MX51_SPBA0_BASE_ADDR_VIRT 0xfb100000 | ||
65 | #define MX51_SPBA0_SIZE SZ_1M | 37 | #define MX51_SPBA0_SIZE SZ_1M |
66 | 38 | ||
67 | #define MX51_ESDHC1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x04000) | 39 | #define MX51_ESDHC1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x04000) |
@@ -81,7 +53,6 @@ | |||
81 | * AIPS 1 | 53 | * AIPS 1 |
82 | */ | 54 | */ |
83 | #define MX51_AIPS1_BASE_ADDR 0x73f00000 | 55 | #define MX51_AIPS1_BASE_ADDR 0x73f00000 |
84 | #define MX51_AIPS1_BASE_ADDR_VIRT 0xfb000000 | ||
85 | #define MX51_AIPS1_SIZE SZ_1M | 56 | #define MX51_AIPS1_SIZE SZ_1M |
86 | 57 | ||
87 | #define MX51_OTG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x80000) | 58 | #define MX51_OTG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x80000) |
@@ -90,7 +61,7 @@ | |||
90 | #define MX51_GPIO3_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x8c000) | 61 | #define MX51_GPIO3_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x8c000) |
91 | #define MX51_GPIO4_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x90000) | 62 | #define MX51_GPIO4_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x90000) |
92 | #define MX51_KPP_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x94000) | 63 | #define MX51_KPP_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x94000) |
93 | #define MX51_WDOG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x98000) | 64 | #define MX51_WDOG1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x98000) |
94 | #define MX51_WDOG2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x9c000) | 65 | #define MX51_WDOG2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x9c000) |
95 | #define MX51_GPT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xa0000) | 66 | #define MX51_GPT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xa0000) |
96 | #define MX51_SRTC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xa4000) | 67 | #define MX51_SRTC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0xa4000) |
@@ -109,7 +80,6 @@ | |||
109 | * AIPS 2 | 80 | * AIPS 2 |
110 | */ | 81 | */ |
111 | #define MX51_AIPS2_BASE_ADDR 0x83f00000 | 82 | #define MX51_AIPS2_BASE_ADDR 0x83f00000 |
112 | #define MX51_AIPS2_BASE_ADDR_VIRT 0xfb200000 | ||
113 | #define MX51_AIPS2_SIZE SZ_1M | 83 | #define MX51_AIPS2_SIZE SZ_1M |
114 | 84 | ||
115 | #define MX51_PLL1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x80000) | 85 | #define MX51_PLL1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x80000) |
@@ -139,7 +109,7 @@ | |||
139 | #define MX51_MIPI_HSC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xdc000) | 109 | #define MX51_MIPI_HSC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xdc000) |
140 | #define MX51_ATA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe0000) | 110 | #define MX51_ATA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe0000) |
141 | #define MX51_SIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe4000) | 111 | #define MX51_SIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe4000) |
142 | #define MX51_SSI3BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe8000) | 112 | #define MX51_SSI3_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xe8000) |
143 | #define MX51_FEC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xec000) | 113 | #define MX51_FEC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xec000) |
144 | #define MX51_TVE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xf0000) | 114 | #define MX51_TVE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xf0000) |
145 | #define MX51_VPU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xf4000) | 115 | #define MX51_VPU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0xf4000) |
@@ -163,16 +133,8 @@ | |||
163 | #define MX51_GPU2D_BASE_ADDR 0xd0000000 | 133 | #define MX51_GPU2D_BASE_ADDR 0xd0000000 |
164 | #define MX51_TZIC_BASE_ADDR 0xe0000000 | 134 | #define MX51_TZIC_BASE_ADDR 0xe0000000 |
165 | 135 | ||
166 | #define MX51_IO_ADDRESS(x) ( \ | 136 | #define MX51_IO_P2V(x) IMX_IO_P2V(x) |
167 | IMX_IO_ADDRESS(x, MX51_IRAM) ?: \ | 137 | #define MX51_IO_ADDRESS(x) IOMEM(MX51_IO_P2V(x)) |
168 | IMX_IO_ADDRESS(x, MX51_DEBUG) ?: \ | ||
169 | IMX_IO_ADDRESS(x, MX51_SPBA0) ?: \ | ||
170 | IMX_IO_ADDRESS(x, MX51_AIPS1) ?: \ | ||
171 | IMX_IO_ADDRESS(x, MX51_AIPS2)) | ||
172 | |||
173 | /* This is currently used in <mach/debug-macro.S>, but should go away */ | ||
174 | #define MX51_AIPS1_IO_ADDRESS(x) \ | ||
175 | (((x) - MX51_AIPS1_BASE_ADDR) + MX51_AIPS1_BASE_ADDR_VIRT) | ||
176 | 138 | ||
177 | /* | 139 | /* |
178 | * defines for SPBA modules | 140 | * defines for SPBA modules |
@@ -261,9 +223,9 @@ | |||
261 | #define MX51_DMA_REQ_EMI_WR 32 | 223 | #define MX51_DMA_REQ_EMI_WR 32 |
262 | #define MX51_DMA_REQ_CTI2_1 33 | 224 | #define MX51_DMA_REQ_CTI2_1 33 |
263 | #define MX51_DMA_REQ_EPIT2 34 | 225 | #define MX51_DMA_REQ_EPIT2 34 |
264 | #define MX51_DMA_REQ_SSI3_RX2 35 | 226 | #define MX51_DMA_REQ_SSI3_RX1 35 |
265 | #define MX51_DMA_REQ_IPU 36 | 227 | #define MX51_DMA_REQ_IPU 36 |
266 | #define MX51_DMA_REQ_SSI3_TX2 37 | 228 | #define MX51_DMA_REQ_SSI3_TX1 37 |
267 | #define MX51_DMA_REQ_CSPI_RX 38 | 229 | #define MX51_DMA_REQ_CSPI_RX 38 |
268 | #define MX51_DMA_REQ_CSPI_TX 39 | 230 | #define MX51_DMA_REQ_CSPI_TX 39 |
269 | #define MX51_DMA_REQ_SDHC3 40 | 231 | #define MX51_DMA_REQ_SDHC3 40 |
@@ -272,8 +234,8 @@ | |||
272 | #define MX51_DMA_REQ_UART3_RX 43 | 234 | #define MX51_DMA_REQ_UART3_RX 43 |
273 | #define MX51_DMA_REQ_UART3_TX 44 | 235 | #define MX51_DMA_REQ_UART3_TX 44 |
274 | #define MX51_DMA_REQ_SPDIF 45 | 236 | #define MX51_DMA_REQ_SPDIF 45 |
275 | #define MX51_DMA_REQ_SSI3_RX1 46 | 237 | #define MX51_DMA_REQ_SSI3_RX0 46 |
276 | #define MX51_DMA_REQ_SSI3_TX1 47 | 238 | #define MX51_DMA_REQ_SSI3_TX0 47 |
277 | 239 | ||
278 | /* | 240 | /* |
279 | * Interrupt numbers | 241 | * Interrupt numbers |
@@ -289,8 +251,8 @@ | |||
289 | #define MX51_MXC_INT_IOMUX 7 | 251 | #define MX51_MXC_INT_IOMUX 7 |
290 | #define MX51_INT_NFC 8 | 252 | #define MX51_INT_NFC 8 |
291 | #define MX51_MXC_INT_VPU 9 | 253 | #define MX51_MXC_INT_VPU 9 |
292 | #define MX51_MXC_INT_IPU_ERR 10 | 254 | #define MX51_INT_IPU_ERR 10 |
293 | #define MX51_MXC_INT_IPU_SYN 11 | 255 | #define MX51_INT_IPU_SYN 11 |
294 | #define MX51_MXC_INT_GPU 12 | 256 | #define MX51_MXC_INT_GPU 12 |
295 | #define MX51_MXC_INT_RESV13 13 | 257 | #define MX51_MXC_INT_RESV13 13 |
296 | #define MX51_MXC_INT_USB_H1 14 | 258 | #define MX51_MXC_INT_USB_H1 14 |
@@ -375,7 +337,7 @@ | |||
375 | #define MX51_MXC_INT_FIRI 93 | 337 | #define MX51_MXC_INT_FIRI 93 |
376 | #define MX51_MXC_INT_PWM2 94 | 338 | #define MX51_MXC_INT_PWM2 94 |
377 | #define MX51_MXC_INT_SLIM_EXP 95 | 339 | #define MX51_MXC_INT_SLIM_EXP 95 |
378 | #define MX51_MXC_INT_SSI3 96 | 340 | #define MX51_INT_SSI3 96 |
379 | #define MX51_MXC_INT_EMI_BOOT 97 | 341 | #define MX51_MXC_INT_EMI_BOOT 97 |
380 | #define MX51_MXC_INT_CTI1_TG3 98 | 342 | #define MX51_MXC_INT_CTI1_TG3 98 |
381 | #define MX51_MXC_INT_SMC_RX 99 | 343 | #define MX51_MXC_INT_SMC_RX 99 |
@@ -383,19 +345,6 @@ | |||
383 | #define MX51_MXC_INT_EMI_NFC 101 | 345 | #define MX51_MXC_INT_EMI_NFC 101 |
384 | #define MX51_MXC_INT_GPU_IDLE 102 | 346 | #define MX51_MXC_INT_GPU_IDLE 102 |
385 | 347 | ||
386 | /* silicon revisions specific to i.MX51 */ | ||
387 | #define MX51_CHIP_REV_1_0 0x10 | ||
388 | #define MX51_CHIP_REV_1_1 0x11 | ||
389 | #define MX51_CHIP_REV_1_2 0x12 | ||
390 | #define MX51_CHIP_REV_1_3 0x13 | ||
391 | #define MX51_CHIP_REV_2_0 0x20 | ||
392 | #define MX51_CHIP_REV_2_1 0x21 | ||
393 | #define MX51_CHIP_REV_2_2 0x22 | ||
394 | #define MX51_CHIP_REV_2_3 0x23 | ||
395 | #define MX51_CHIP_REV_3_0 0x30 | ||
396 | #define MX51_CHIP_REV_3_1 0x31 | ||
397 | #define MX51_CHIP_REV_3_2 0x32 | ||
398 | |||
399 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) | 348 | #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) |
400 | extern int mx51_revision(void); | 349 | extern int mx51_revision(void); |
401 | #endif | 350 | #endif |
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h new file mode 100644 index 000000000000..9577cdbf7fad --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/mx53.h | |||
@@ -0,0 +1,353 @@ | |||
1 | #ifndef __MACH_MX53_H__ | ||
2 | #define __MACH_MX53_H__ | ||
3 | |||
4 | /* | ||
5 | * IROM | ||
6 | */ | ||
7 | #define MX53_IROM_BASE_ADDR 0x0 | ||
8 | #define MX53_IROM_SIZE SZ_64K | ||
9 | |||
10 | /* TZIC */ | ||
11 | #define MX53_TZIC_BASE_ADDR 0x0FFFC000 | ||
12 | |||
13 | /* | ||
14 | * AHCI SATA | ||
15 | */ | ||
16 | #define MX53_SATA_BASE_ADDR 0x10000000 | ||
17 | |||
18 | /* | ||
19 | * NFC | ||
20 | */ | ||
21 | #define MX53_NFC_AXI_BASE_ADDR 0xF7FF0000 /* NAND flash AXI */ | ||
22 | #define MX53_NFC_AXI_SIZE SZ_64K | ||
23 | |||
24 | /* | ||
25 | * IRAM | ||
26 | */ | ||
27 | #define MX53_IRAM_BASE_ADDR 0xF8000000 /* internal ram */ | ||
28 | #define MX53_IRAM_PARTITIONS 16 | ||
29 | #define MX53_IRAM_SIZE (MX53_IRAM_PARTITIONS * SZ_8K) /* 128KB */ | ||
30 | |||
31 | /* | ||
32 | * Graphics Memory of GPU | ||
33 | */ | ||
34 | #define MX53_IPU_CTRL_BASE_ADDR 0x18000000 | ||
35 | #define MX53_GPU2D_BASE_ADDR 0x20000000 | ||
36 | #define MX53_GPU_BASE_ADDR 0x30000000 | ||
37 | #define MX53_GPU_GMEM_BASE_ADDR 0xF8020000 | ||
38 | |||
39 | #define MX53_DEBUG_BASE_ADDR 0x40000000 | ||
40 | #define MX53_DEBUG_SIZE SZ_1M | ||
41 | #define MX53_ETB_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00001000) | ||
42 | #define MX53_ETM_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00002000) | ||
43 | #define MX53_TPIU_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00003000) | ||
44 | #define MX53_CTI0_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00004000) | ||
45 | #define MX53_CTI1_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00005000) | ||
46 | #define MX53_CTI2_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00006000) | ||
47 | #define MX53_CTI3_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00007000) | ||
48 | #define MX53_CORTEX_DBG_BASE_ADDR (MX53_DEBUG_BASE_ADDR + 0x00008000) | ||
49 | |||
50 | /* | ||
51 | * SPBA global module enabled #0 | ||
52 | */ | ||
53 | #define MX53_SPBA0_BASE_ADDR 0x50000000 | ||
54 | #define MX53_SPBA0_SIZE SZ_1M | ||
55 | |||
56 | #define MX53_MMC_SDHC1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00004000) | ||
57 | #define MX53_MMC_SDHC2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00008000) | ||
58 | #define MX53_UART3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0000C000) | ||
59 | #define MX53_CSPI1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00010000) | ||
60 | #define MX53_SSI2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00014000) | ||
61 | #define MX53_MMC_SDHC3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00020000) | ||
62 | #define MX53_MMC_SDHC4_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00024000) | ||
63 | #define MX53_SPDIF_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00028000) | ||
64 | #define MX53_ASRC_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0002C000) | ||
65 | #define MX53_ATA_DMA_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00030000) | ||
66 | #define MX53_SLIM_DMA_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00034000) | ||
67 | #define MX53_HSI2C_DMA_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00038000) | ||
68 | #define MX53_SPBA_CTRL_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0003C000) | ||
69 | |||
70 | /* | ||
71 | * AIPS 1 | ||
72 | */ | ||
73 | #define MX53_AIPS1_BASE_ADDR 0x53F00000 | ||
74 | #define MX53_AIPS1_SIZE SZ_1M | ||
75 | |||
76 | #define MX53_OTG_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00080000) | ||
77 | #define MX53_GPIO1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00084000) | ||
78 | #define MX53_GPIO2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00088000) | ||
79 | #define MX53_GPIO3_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0008C000) | ||
80 | #define MX53_GPIO4_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00090000) | ||
81 | #define MX53_KPP_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00094000) | ||
82 | #define MX53_WDOG_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00098000) | ||
83 | #define MX53_WDOG2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0009C000) | ||
84 | #define MX53_GPT1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A0000) | ||
85 | #define MX53_SRTC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A4000) | ||
86 | #define MX53_IOMUXC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A8000) | ||
87 | #define MX53_EPIT1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000AC000) | ||
88 | #define MX53_EPIT2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000B0000) | ||
89 | #define MX53_PWM1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000B4000) | ||
90 | #define MX53_PWM2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000B8000) | ||
91 | #define MX53_UART1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000BC000) | ||
92 | #define MX53_UART2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000C0000) | ||
93 | #define MX53_SRC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000D0000) | ||
94 | #define MX53_CCM_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000D4000) | ||
95 | #define MX53_GPC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000D8000) | ||
96 | #define MX53_GPIO5_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000DC000) | ||
97 | #define MX53_GPIO6_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000E0000) | ||
98 | #define MX53_GPIO7_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000E4000) | ||
99 | #define MX53_ATA_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000E8000) | ||
100 | #define MX53_I2C3_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000EC000) | ||
101 | #define MX53_UART4_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000F0000) | ||
102 | |||
103 | /* | ||
104 | * AIPS 2 | ||
105 | */ | ||
106 | #define MX53_AIPS2_BASE_ADDR 0x63F00000 | ||
107 | #define MX53_AIPS2_SIZE SZ_1M | ||
108 | |||
109 | #define MX53_PLL1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x00080000) | ||
110 | #define MX53_PLL2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x00084000) | ||
111 | #define MX53_PLL3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x00088000) | ||
112 | #define MX53_PLL4_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x0008C000) | ||
113 | #define MX53_UART5_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x00090000) | ||
114 | #define MX53_AHBMAX_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x00094000) | ||
115 | #define MX53_IIM_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x00098000) | ||
116 | #define MX53_CSU_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x0009C000) | ||
117 | #define MX53_ARM_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A0000) | ||
118 | #define MX53_OWIRE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A4000) | ||
119 | #define MX53_FIRI_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A8000) | ||
120 | #define MX53_CSPI2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000AC000) | ||
121 | #define MX53_SDMA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B0000) | ||
122 | #define MX53_SCC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B4000) | ||
123 | #define MX53_ROMCP_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B8000) | ||
124 | #define MX53_RTIC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000BC000) | ||
125 | #define MX53_CSPI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C0000) | ||
126 | #define MX53_I2C2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C4000) | ||
127 | #define MX53_I2C1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C8000) | ||
128 | #define MX53_SSI1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000CC000) | ||
129 | #define MX53_AUDMUX_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000D0000) | ||
130 | #define MX53_RTC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000D4000) | ||
131 | #define MX53_M4IF_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000D8000) | ||
132 | #define MX53_ESDCTL_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000D9000) | ||
133 | #define MX53_WEIM_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DA000) | ||
134 | #define MX53_NFC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DB000) | ||
135 | #define MX53_EMI_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DBF00) | ||
136 | #define MX53_MIPI_HSC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DC000) | ||
137 | #define MX53_MLB_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E4000) | ||
138 | #define MX53_SSI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E8000) | ||
139 | #define MX53_MXC_FEC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000EC000) | ||
140 | #define MX53_TVE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F0000) | ||
141 | #define MX53_VPU_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F4000) | ||
142 | #define MX53_SAHARA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F8000) | ||
143 | #define MX53_PTP_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000FC000) | ||
144 | |||
145 | /* | ||
146 | * Memory regions and CS | ||
147 | */ | ||
148 | #define MX53_CSD0_BASE_ADDR 0x90000000 | ||
149 | #define MX53_CSD1_BASE_ADDR 0xA0000000 | ||
150 | #define MX53_CS0_BASE_ADDR 0xB0000000 | ||
151 | #define MX53_CS1_BASE_ADDR 0xB8000000 | ||
152 | #define MX53_CS2_BASE_ADDR 0xC0000000 | ||
153 | #define MX53_CS3_BASE_ADDR 0xC8000000 | ||
154 | #define MX53_CS4_BASE_ADDR 0xCC000000 | ||
155 | #define MX53_CS5_BASE_ADDR 0xCE000000 | ||
156 | |||
157 | #define MX53_IO_P2V(x) IMX_IO_P2V(x) | ||
158 | #define MX53_IO_ADDRESS(x) IOMEM(MX53_IO_P2V(x)) | ||
159 | |||
160 | /* | ||
161 | * defines for SPBA modules | ||
162 | */ | ||
163 | #define MX53_SPBA_SDHC1 0x04 | ||
164 | #define MX53_SPBA_SDHC2 0x08 | ||
165 | #define MX53_SPBA_UART3 0x0C | ||
166 | #define MX53_SPBA_CSPI1 0x10 | ||
167 | #define MX53_SPBA_SSI2 0x14 | ||
168 | #define MX53_SPBA_SDHC3 0x20 | ||
169 | #define MX53_SPBA_SDHC4 0x24 | ||
170 | #define MX53_SPBA_SPDIF 0x28 | ||
171 | #define MX53_SPBA_ATA 0x30 | ||
172 | #define MX53_SPBA_SLIM 0x34 | ||
173 | #define MX53_SPBA_HSI2C 0x38 | ||
174 | #define MX53_SPBA_CTRL 0x3C | ||
175 | |||
176 | /* | ||
177 | * DMA request assignments | ||
178 | */ | ||
179 | #define MX53_DMA_REQ_SSI3_TX1 47 | ||
180 | #define MX53_DMA_REQ_SSI3_RX1 46 | ||
181 | #define MX53_DMA_REQ_SSI3_TX2 45 | ||
182 | #define MX53_DMA_REQ_SSI3_RX2 44 | ||
183 | #define MX53_DMA_REQ_UART3_TX 43 | ||
184 | #define MX53_DMA_REQ_UART3_RX 42 | ||
185 | #define MX53_DMA_REQ_ESAI_TX 41 | ||
186 | #define MX53_DMA_REQ_ESAI_RX 40 | ||
187 | #define MX53_DMA_REQ_CSPI_TX 39 | ||
188 | #define MX53_DMA_REQ_CSPI_RX 38 | ||
189 | #define MX53_DMA_REQ_ASRC_DMA6 37 | ||
190 | #define MX53_DMA_REQ_ASRC_DMA5 36 | ||
191 | #define MX53_DMA_REQ_ASRC_DMA4 35 | ||
192 | #define MX53_DMA_REQ_ASRC_DMA3 34 | ||
193 | #define MX53_DMA_REQ_ASRC_DMA2 33 | ||
194 | #define MX53_DMA_REQ_ASRC_DMA1 32 | ||
195 | #define MX53_DMA_REQ_EMI_WR 31 | ||
196 | #define MX53_DMA_REQ_EMI_RD 30 | ||
197 | #define MX53_DMA_REQ_SSI1_TX1 29 | ||
198 | #define MX53_DMA_REQ_SSI1_RX1 28 | ||
199 | #define MX53_DMA_REQ_SSI1_TX2 27 | ||
200 | #define MX53_DMA_REQ_SSI1_RX2 26 | ||
201 | #define MX53_DMA_REQ_SSI2_TX1 25 | ||
202 | #define MX53_DMA_REQ_SSI2_RX1 24 | ||
203 | #define MX53_DMA_REQ_SSI2_TX2 23 | ||
204 | #define MX53_DMA_REQ_SSI2_RX2 22 | ||
205 | #define MX53_DMA_REQ_I2C2_SDHC2 21 | ||
206 | #define MX53_DMA_REQ_I2C1_SDHC1 20 | ||
207 | #define MX53_DMA_REQ_UART1_TX 19 | ||
208 | #define MX53_DMA_REQ_UART1_RX 18 | ||
209 | #define MX53_DMA_REQ_UART5_TX 17 | ||
210 | #define MX53_DMA_REQ_UART5_RX 16 | ||
211 | #define MX53_DMA_REQ_SPDIF_TX 15 | ||
212 | #define MX53_DMA_REQ_SPDIF_RX 14 | ||
213 | #define MX53_DMA_REQ_UART2_FIRI_TX 13 | ||
214 | #define MX53_DMA_REQ_UART2_FIRI_RX 12 | ||
215 | #define MX53_DMA_REQ_SDHC4 11 | ||
216 | #define MX53_DMA_REQ_I2C3_SDHC3 10 | ||
217 | #define MX53_DMA_REQ_CSPI2_TX 9 | ||
218 | #define MX53_DMA_REQ_CSPI2_RX 8 | ||
219 | #define MX53_DMA_REQ_CSPI1_TX 7 | ||
220 | #define MX53_DMA_REQ_CSPI1_RX 6 | ||
221 | #define MX53_DMA_REQ_IPU 5 | ||
222 | #define MX53_DMA_REQ_ATA_TX_END 4 | ||
223 | #define MX53_DMA_REQ_ATA_UART4_TX 3 | ||
224 | #define MX53_DMA_REQ_ATA_UART4_RX 2 | ||
225 | #define MX53_DMA_REQ_GPC 1 | ||
226 | #define MX53_DMA_REQ_VPU 0 | ||
227 | |||
228 | /* | ||
229 | * Interrupt numbers | ||
230 | */ | ||
231 | #define MX53_INT_RESV0 0 | ||
232 | #define MX53_INT_MMC_SDHC1 1 | ||
233 | #define MX53_INT_MMC_SDHC2 2 | ||
234 | #define MX53_INT_MMC_SDHC3 3 | ||
235 | #define MX53_INT_MMC_SDHC4 4 | ||
236 | #define MX53_INT_RESV5 5 | ||
237 | #define MX53_INT_SDMA 6 | ||
238 | #define MX53_INT_IOMUX 7 | ||
239 | #define MX53_INT_NFC 8 | ||
240 | #define MX53_INT_VPU 9 | ||
241 | #define MX53_INT_IPU_ERR 10 | ||
242 | #define MX53_INT_IPU_SYN 11 | ||
243 | #define MX53_INT_GPU 12 | ||
244 | #define MX53_INT_RESV13 13 | ||
245 | #define MX53_INT_USB_H1 14 | ||
246 | #define MX53_INT_EMI 15 | ||
247 | #define MX53_INT_USB_H2 16 | ||
248 | #define MX53_INT_USB_H3 17 | ||
249 | #define MX53_INT_USB_OTG 18 | ||
250 | #define MX53_INT_SAHARA_H0 19 | ||
251 | #define MX53_INT_SAHARA_H1 20 | ||
252 | #define MX53_INT_SCC_SMN 21 | ||
253 | #define MX53_INT_SCC_STZ 22 | ||
254 | #define MX53_INT_SCC_SCM 23 | ||
255 | #define MX53_INT_SRTC_NTZ 24 | ||
256 | #define MX53_INT_SRTC_TZ 25 | ||
257 | #define MX53_INT_RTIC 26 | ||
258 | #define MX53_INT_CSU 27 | ||
259 | #define MX53_INT_SATA 28 | ||
260 | #define MX53_INT_SSI1 29 | ||
261 | #define MX53_INT_SSI2 30 | ||
262 | #define MX53_INT_UART1 31 | ||
263 | #define MX53_INT_UART2 32 | ||
264 | #define MX53_INT_UART3 33 | ||
265 | #define MX53_INT_RESV34 34 | ||
266 | #define MX53_INT_RESV35 35 | ||
267 | #define MX53_INT_CSPI1 36 | ||
268 | #define MX53_INT_CSPI2 37 | ||
269 | #define MX53_INT_CSPI 38 | ||
270 | #define MX53_INT_GPT 39 | ||
271 | #define MX53_INT_EPIT1 40 | ||
272 | #define MX53_INT_EPIT2 41 | ||
273 | #define MX53_INT_GPIO1_INT7 42 | ||
274 | #define MX53_INT_GPIO1_INT6 43 | ||
275 | #define MX53_INT_GPIO1_INT5 44 | ||
276 | #define MX53_INT_GPIO1_INT4 45 | ||
277 | #define MX53_INT_GPIO1_INT3 46 | ||
278 | #define MX53_INT_GPIO1_INT2 47 | ||
279 | #define MX53_INT_GPIO1_INT1 48 | ||
280 | #define MX53_INT_GPIO1_INT0 49 | ||
281 | #define MX53_INT_GPIO1_LOW 50 | ||
282 | #define MX53_INT_GPIO1_HIGH 51 | ||
283 | #define MX53_INT_GPIO2_LOW 52 | ||
284 | #define MX53_INT_GPIO2_HIGH 53 | ||
285 | #define MX53_INT_GPIO3_LOW 54 | ||
286 | #define MX53_INT_GPIO3_HIGH 55 | ||
287 | #define MX53_INT_GPIO4_LOW 56 | ||
288 | #define MX53_INT_GPIO4_HIGH 57 | ||
289 | #define MX53_INT_WDOG1 58 | ||
290 | #define MX53_INT_WDOG2 59 | ||
291 | #define MX53_INT_KPP 60 | ||
292 | #define MX53_INT_PWM1 61 | ||
293 | #define MX53_INT_I2C1 62 | ||
294 | #define MX53_INT_I2C2 63 | ||
295 | #define MX53_INT_I2C3 64 | ||
296 | #define MX53_INT_RESV65 65 | ||
297 | #define MX53_INT_RESV66 66 | ||
298 | #define MX53_INT_SPDIF 67 | ||
299 | #define MX53_INT_SIM_DAT 68 | ||
300 | #define MX53_INT_IIM 69 | ||
301 | #define MX53_INT_ATA 70 | ||
302 | #define MX53_INT_CCM1 71 | ||
303 | #define MX53_INT_CCM2 72 | ||
304 | #define MX53_INT_GPC1 73 | ||
305 | #define MX53_INT_GPC2 74 | ||
306 | #define MX53_INT_SRC 75 | ||
307 | #define MX53_INT_NM 76 | ||
308 | #define MX53_INT_PMU 77 | ||
309 | #define MX53_INT_CTI_IRQ 78 | ||
310 | #define MX53_INT_CTI1_TG0 79 | ||
311 | #define MX53_INT_CTI1_TG1 80 | ||
312 | #define MX53_INT_ESAI 81 | ||
313 | #define MX53_INT_CAN1 82 | ||
314 | #define MX53_INT_CAN2 83 | ||
315 | #define MX53_INT_GPU2_IRQ 84 | ||
316 | #define MX53_INT_GPU2_BUSY 85 | ||
317 | #define MX53_INT_RESV86 86 | ||
318 | #define MX53_INT_FEC 87 | ||
319 | #define MX53_INT_OWIRE 88 | ||
320 | #define MX53_INT_CTI1_TG2 89 | ||
321 | #define MX53_INT_SJC 90 | ||
322 | #define MX53_INT_TVE 92 | ||
323 | #define MX53_INT_FIRI 93 | ||
324 | #define MX53_INT_PWM2 94 | ||
325 | #define MX53_INT_SLIM_EXP 95 | ||
326 | #define MX53_INT_SSI3 96 | ||
327 | #define MX53_INT_EMI_BOOT 97 | ||
328 | #define MX53_INT_CTI1_TG3 98 | ||
329 | #define MX53_INT_SMC_RX 99 | ||
330 | #define MX53_INT_VPU_IDLE 100 | ||
331 | #define MX53_INT_EMI_NFC 101 | ||
332 | #define MX53_INT_GPU_IDLE 102 | ||
333 | #define MX53_INT_GPIO5_LOW 103 | ||
334 | #define MX53_INT_GPIO5_HIGH 104 | ||
335 | #define MX53_INT_GPIO6_LOW 105 | ||
336 | #define MX53_INT_GPIO6_HIGH 106 | ||
337 | #define MX53_INT_GPIO7_LOW 107 | ||
338 | #define MX53_INT_GPIO7_HIGH 108 | ||
339 | |||
340 | /* silicon revisions specific to i.MX53 */ | ||
341 | #define MX53_CHIP_REV_1_0 0x10 | ||
342 | #define MX53_CHIP_REV_1_1 0x11 | ||
343 | #define MX53_CHIP_REV_1_2 0x12 | ||
344 | #define MX53_CHIP_REV_1_3 0x13 | ||
345 | #define MX53_CHIP_REV_2_0 0x20 | ||
346 | #define MX53_CHIP_REV_2_1 0x21 | ||
347 | #define MX53_CHIP_REV_2_2 0x22 | ||
348 | #define MX53_CHIP_REV_2_3 0x23 | ||
349 | #define MX53_CHIP_REV_3_0 0x30 | ||
350 | #define MX53_CHIP_REV_3_1 0x31 | ||
351 | #define MX53_CHIP_REV_3_2 0x32 | ||
352 | |||
353 | #endif /* ifndef __MACH_MX53_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h index a42c7207082d..04c7a26b1f26 100644 --- a/arch/arm/plat-mxc/include/mach/mxc.h +++ b/arch/arm/plat-mxc/include/mach/mxc.h | |||
@@ -32,9 +32,25 @@ | |||
32 | #define MXC_CPU_MX27 27 | 32 | #define MXC_CPU_MX27 27 |
33 | #define MXC_CPU_MX31 31 | 33 | #define MXC_CPU_MX31 31 |
34 | #define MXC_CPU_MX35 35 | 34 | #define MXC_CPU_MX35 35 |
35 | #define MXC_CPU_MX50 50 | ||
35 | #define MXC_CPU_MX51 51 | 36 | #define MXC_CPU_MX51 51 |
37 | #define MXC_CPU_MX53 53 | ||
36 | #define MXC_CPU_MXC91231 91231 | 38 | #define MXC_CPU_MXC91231 91231 |
37 | 39 | ||
40 | #define IMX_CHIP_REVISION_1_0 0x10 | ||
41 | #define IMX_CHIP_REVISION_1_1 0x11 | ||
42 | #define IMX_CHIP_REVISION_1_2 0x12 | ||
43 | #define IMX_CHIP_REVISION_1_3 0x13 | ||
44 | #define IMX_CHIP_REVISION_2_0 0x20 | ||
45 | #define IMX_CHIP_REVISION_2_1 0x21 | ||
46 | #define IMX_CHIP_REVISION_2_2 0x22 | ||
47 | #define IMX_CHIP_REVISION_2_3 0x23 | ||
48 | #define IMX_CHIP_REVISION_3_0 0x30 | ||
49 | #define IMX_CHIP_REVISION_3_1 0x31 | ||
50 | #define IMX_CHIP_REVISION_3_2 0x32 | ||
51 | #define IMX_CHIP_REVISION_3_3 0x33 | ||
52 | #define IMX_CHIP_REVISION_UNKNOWN 0xff | ||
53 | |||
38 | #ifndef __ASSEMBLY__ | 54 | #ifndef __ASSEMBLY__ |
39 | extern unsigned int __mxc_cpu_type; | 55 | extern unsigned int __mxc_cpu_type; |
40 | #endif | 56 | #endif |
@@ -111,7 +127,19 @@ extern unsigned int __mxc_cpu_type; | |||
111 | # define cpu_is_mx35() (0) | 127 | # define cpu_is_mx35() (0) |
112 | #endif | 128 | #endif |
113 | 129 | ||
114 | #ifdef CONFIG_ARCH_MX5 | 130 | #ifdef CONFIG_ARCH_MX50 |
131 | # ifdef mxc_cpu_type | ||
132 | # undef mxc_cpu_type | ||
133 | # define mxc_cpu_type __mxc_cpu_type | ||
134 | # else | ||
135 | # define mxc_cpu_type MXC_CPU_MX50 | ||
136 | # endif | ||
137 | # define cpu_is_mx50() (mxc_cpu_type == MXC_CPU_MX50) | ||
138 | #else | ||
139 | # define cpu_is_mx50() (0) | ||
140 | #endif | ||
141 | |||
142 | #ifdef CONFIG_ARCH_MX51 | ||
115 | # ifdef mxc_cpu_type | 143 | # ifdef mxc_cpu_type |
116 | # undef mxc_cpu_type | 144 | # undef mxc_cpu_type |
117 | # define mxc_cpu_type __mxc_cpu_type | 145 | # define mxc_cpu_type __mxc_cpu_type |
@@ -123,6 +151,18 @@ extern unsigned int __mxc_cpu_type; | |||
123 | # define cpu_is_mx51() (0) | 151 | # define cpu_is_mx51() (0) |
124 | #endif | 152 | #endif |
125 | 153 | ||
154 | #ifdef CONFIG_ARCH_MX53 | ||
155 | # ifdef mxc_cpu_type | ||
156 | # undef mxc_cpu_type | ||
157 | # define mxc_cpu_type __mxc_cpu_type | ||
158 | # else | ||
159 | # define mxc_cpu_type MXC_CPU_MX53 | ||
160 | # endif | ||
161 | # define cpu_is_mx53() (mxc_cpu_type == MXC_CPU_MX53) | ||
162 | #else | ||
163 | # define cpu_is_mx53() (0) | ||
164 | #endif | ||
165 | |||
126 | #ifdef CONFIG_ARCH_MXC91231 | 166 | #ifdef CONFIG_ARCH_MXC91231 |
127 | # ifdef mxc_cpu_type | 167 | # ifdef mxc_cpu_type |
128 | # undef mxc_cpu_type | 168 | # undef mxc_cpu_type |
diff --git a/arch/arm/plat-mxc/include/mach/mxc91231.h b/arch/arm/plat-mxc/include/mach/mxc91231.h index 0ca3101ebf36..765190fe6332 100644 --- a/arch/arm/plat-mxc/include/mach/mxc91231.h +++ b/arch/arm/plat-mxc/include/mach/mxc91231.h | |||
@@ -21,14 +21,12 @@ | |||
21 | * L2CC | 21 | * L2CC |
22 | */ | 22 | */ |
23 | #define MXC91231_L2CC_BASE_ADDR 0x30000000 | 23 | #define MXC91231_L2CC_BASE_ADDR 0x30000000 |
24 | #define MXC91231_L2CC_BASE_ADDR_VIRT 0xF9000000 | ||
25 | #define MXC91231_L2CC_SIZE SZ_64K | 24 | #define MXC91231_L2CC_SIZE SZ_64K |
26 | 25 | ||
27 | /* | 26 | /* |
28 | * AIPS 1 | 27 | * AIPS 1 |
29 | */ | 28 | */ |
30 | #define MXC91231_AIPS1_BASE_ADDR 0x43F00000 | 29 | #define MXC91231_AIPS1_BASE_ADDR 0x43F00000 |
31 | #define MXC91231_AIPS1_BASE_ADDR_VIRT 0xFC000000 | ||
32 | #define MXC91231_AIPS1_SIZE SZ_1M | 30 | #define MXC91231_AIPS1_SIZE SZ_1M |
33 | 31 | ||
34 | #define MXC91231_AIPS1_CTRL_BASE_ADDR MXC91231_AIPS1_BASE_ADDR | 32 | #define MXC91231_AIPS1_CTRL_BASE_ADDR MXC91231_AIPS1_BASE_ADDR |
@@ -53,7 +51,6 @@ | |||
53 | * AIPS 2 | 51 | * AIPS 2 |
54 | */ | 52 | */ |
55 | #define MXC91231_AIPS2_BASE_ADDR 0x53F00000 | 53 | #define MXC91231_AIPS2_BASE_ADDR 0x53F00000 |
56 | #define MXC91231_AIPS2_BASE_ADDR_VIRT 0xFC100000 | ||
57 | #define MXC91231_AIPS2_SIZE SZ_1M | 54 | #define MXC91231_AIPS2_SIZE SZ_1M |
58 | 55 | ||
59 | #define MXC91231_GEMK_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x8C000) | 56 | #define MXC91231_GEMK_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x8C000) |
@@ -79,7 +76,6 @@ | |||
79 | * SPBA global module 0 | 76 | * SPBA global module 0 |
80 | */ | 77 | */ |
81 | #define MXC91231_SPBA0_BASE_ADDR 0x50000000 | 78 | #define MXC91231_SPBA0_BASE_ADDR 0x50000000 |
82 | #define MXC91231_SPBA0_BASE_ADDR_VIRT 0xFC200000 | ||
83 | #define MXC91231_SPBA0_SIZE SZ_1M | 79 | #define MXC91231_SPBA0_SIZE SZ_1M |
84 | 80 | ||
85 | #define MXC91231_MMC_SDHC1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x04000) | 81 | #define MXC91231_MMC_SDHC1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x04000) |
@@ -109,7 +105,6 @@ | |||
109 | * SPBA global module 1 | 105 | * SPBA global module 1 |
110 | */ | 106 | */ |
111 | #define MXC91231_SPBA1_BASE_ADDR 0x52000000 | 107 | #define MXC91231_SPBA1_BASE_ADDR 0x52000000 |
112 | #define MXC91231_SPBA1_BASE_ADDR_VIRT 0xFC300000 | ||
113 | #define MXC91231_SPBA1_SIZE SZ_1M | 108 | #define MXC91231_SPBA1_SIZE SZ_1M |
114 | 109 | ||
115 | #define MXC91231_MQSPI_BASE_ADDR (MXC91231_SPBA1_BASE_ADDR + 0x34000) | 110 | #define MXC91231_MQSPI_BASE_ADDR (MXC91231_SPBA1_BASE_ADDR + 0x34000) |
@@ -144,18 +139,15 @@ | |||
144 | * ROMP and AVIC | 139 | * ROMP and AVIC |
145 | */ | 140 | */ |
146 | #define MXC91231_ROMP_BASE_ADDR 0x60000000 | 141 | #define MXC91231_ROMP_BASE_ADDR 0x60000000 |
147 | #define MXC91231_ROMP_BASE_ADDR_VIRT 0xFC400000 | ||
148 | #define MXC91231_ROMP_SIZE SZ_64K | 142 | #define MXC91231_ROMP_SIZE SZ_64K |
149 | 143 | ||
150 | #define MXC91231_AVIC_BASE_ADDR 0x68000000 | 144 | #define MXC91231_AVIC_BASE_ADDR 0x68000000 |
151 | #define MXC91231_AVIC_BASE_ADDR_VIRT 0xFC410000 | ||
152 | #define MXC91231_AVIC_SIZE SZ_64K | 145 | #define MXC91231_AVIC_SIZE SZ_64K |
153 | 146 | ||
154 | /* | 147 | /* |
155 | * NAND, SDRAM, WEIM, M3IF, EMI controllers | 148 | * NAND, SDRAM, WEIM, M3IF, EMI controllers |
156 | */ | 149 | */ |
157 | #define MXC91231_X_MEMC_BASE_ADDR 0xB8000000 | 150 | #define MXC91231_X_MEMC_BASE_ADDR 0xB8000000 |
158 | #define MXC91231_X_MEMC_BASE_ADDR_VIRT 0xFC420000 | ||
159 | #define MXC91231_X_MEMC_SIZE SZ_64K | 151 | #define MXC91231_X_MEMC_SIZE SZ_64K |
160 | 152 | ||
161 | #define MXC91231_NFC_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x0000) | 153 | #define MXC91231_NFC_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x0000) |
@@ -183,19 +175,10 @@ | |||
183 | /* | 175 | /* |
184 | * This macro defines the physical to virtual address mapping for all the | 176 | * This macro defines the physical to virtual address mapping for all the |
185 | * peripheral modules. It is used by passing in the physical address as x | 177 | * peripheral modules. It is used by passing in the physical address as x |
186 | * and returning the virtual address. If the physical address is not mapped, | 178 | * and returning the virtual address. |
187 | * it returns 0. | ||
188 | */ | 179 | */ |
189 | 180 | #define MXC91231_IO_P2V(x) IMX_IO_P2V(x) | |
190 | #define MXC91231_IO_ADDRESS(x) ( \ | 181 | #define MXC91231_IO_ADDRESS(x) IOMEM(MXC91231_IO_P2V(x)) |
191 | IMX_IO_ADDRESS(x, MXC91231_L2CC) ?: \ | ||
192 | IMX_IO_ADDRESS(x, MXC91231_X_MEMC) ?: \ | ||
193 | IMX_IO_ADDRESS(x, MXC91231_ROMP) ?: \ | ||
194 | IMX_IO_ADDRESS(x, MXC91231_AVIC) ?: \ | ||
195 | IMX_IO_ADDRESS(x, MXC91231_AIPS1) ?: \ | ||
196 | IMX_IO_ADDRESS(x, MXC91231_SPBA0) ?: \ | ||
197 | IMX_IO_ADDRESS(x, MXC91231_SPBA1) ?: \ | ||
198 | IMX_IO_ADDRESS(x, MXC91231_AIPS2)) | ||
199 | 182 | ||
200 | /* | 183 | /* |
201 | * Interrupt numbers | 184 | * Interrupt numbers |
diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/arch/arm/plat-mxc/include/mach/mxc_ehci.h index 7fc5f9946199..a523a4079299 100644 --- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h +++ b/arch/arm/plat-mxc/include/mach/mxc_ehci.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define MXC_USBCTRL_OFFSET 0 | 31 | #define MXC_USBCTRL_OFFSET 0 |
32 | #define MXC_USB_PHY_CTR_FUNC_OFFSET 0x8 | 32 | #define MXC_USB_PHY_CTR_FUNC_OFFSET 0x8 |
33 | #define MXC_USB_PHY_CTR_FUNC2_OFFSET 0xc | 33 | #define MXC_USB_PHY_CTR_FUNC2_OFFSET 0xc |
34 | #define MXC_USBH2CTRL_OFFSET 0x14 | ||
34 | 35 | ||
35 | #define MX5_USBOTHER_REGS_OFFSET 0x800 | 36 | #define MX5_USBOTHER_REGS_OFFSET 0x800 |
36 | 37 | ||
diff --git a/arch/arm/plat-mxc/include/mach/sdma.h b/arch/arm/plat-mxc/include/mach/sdma.h index 9be112227ac4..913e0432e40e 100644 --- a/arch/arm/plat-mxc/include/mach/sdma.h +++ b/arch/arm/plat-mxc/include/mach/sdma.h | |||
@@ -2,16 +2,62 @@ | |||
2 | #define __MACH_MXC_SDMA_H__ | 2 | #define __MACH_MXC_SDMA_H__ |
3 | 3 | ||
4 | /** | 4 | /** |
5 | * struct sdma_script_start_addrs - SDMA script start pointers | ||
6 | * | ||
7 | * start addresses of the different functions in the physical | ||
8 | * address space of the SDMA engine. | ||
9 | */ | ||
10 | struct sdma_script_start_addrs { | ||
11 | s32 ap_2_ap_addr; | ||
12 | s32 ap_2_bp_addr; | ||
13 | s32 ap_2_ap_fixed_addr; | ||
14 | s32 bp_2_ap_addr; | ||
15 | s32 loopback_on_dsp_side_addr; | ||
16 | s32 mcu_interrupt_only_addr; | ||
17 | s32 firi_2_per_addr; | ||
18 | s32 firi_2_mcu_addr; | ||
19 | s32 per_2_firi_addr; | ||
20 | s32 mcu_2_firi_addr; | ||
21 | s32 uart_2_per_addr; | ||
22 | s32 uart_2_mcu_addr; | ||
23 | s32 per_2_app_addr; | ||
24 | s32 mcu_2_app_addr; | ||
25 | s32 per_2_per_addr; | ||
26 | s32 uartsh_2_per_addr; | ||
27 | s32 uartsh_2_mcu_addr; | ||
28 | s32 per_2_shp_addr; | ||
29 | s32 mcu_2_shp_addr; | ||
30 | s32 ata_2_mcu_addr; | ||
31 | s32 mcu_2_ata_addr; | ||
32 | s32 app_2_per_addr; | ||
33 | s32 app_2_mcu_addr; | ||
34 | s32 shp_2_per_addr; | ||
35 | s32 shp_2_mcu_addr; | ||
36 | s32 mshc_2_mcu_addr; | ||
37 | s32 mcu_2_mshc_addr; | ||
38 | s32 spdif_2_mcu_addr; | ||
39 | s32 mcu_2_spdif_addr; | ||
40 | s32 asrc_2_mcu_addr; | ||
41 | s32 ext_mem_2_ipu_addr; | ||
42 | s32 descrambler_addr; | ||
43 | s32 dptc_dvfs_addr; | ||
44 | s32 utra_addr; | ||
45 | s32 ram_code_start_addr; | ||
46 | }; | ||
47 | |||
48 | /** | ||
5 | * struct sdma_platform_data - platform specific data for SDMA engine | 49 | * struct sdma_platform_data - platform specific data for SDMA engine |
6 | * | 50 | * |
7 | * @sdma_version The version of this SDMA engine | 51 | * @sdma_version The version of this SDMA engine |
8 | * @cpu_name used to generate the firmware name | 52 | * @cpu_name used to generate the firmware name |
9 | * @to_version CPU Tape out version | 53 | * @to_version CPU Tape out version |
54 | * @script_addrs SDMA scripts addresses in SDMA ROM | ||
10 | */ | 55 | */ |
11 | struct sdma_platform_data { | 56 | struct sdma_platform_data { |
12 | int sdma_version; | 57 | int sdma_version; |
13 | char *cpu_name; | 58 | char *cpu_name; |
14 | int to_version; | 59 | int to_version; |
60 | struct sdma_script_start_addrs *script_addrs; | ||
15 | }; | 61 | }; |
16 | 62 | ||
17 | #endif /* __MACH_MXC_SDMA_H__ */ | 63 | #endif /* __MACH_MXC_SDMA_H__ */ |
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h index 9dd9c2085aad..3a70ebf0477f 100644 --- a/arch/arm/plat-mxc/include/mach/uncompress.h +++ b/arch/arm/plat-mxc/include/mach/uncompress.h | |||
@@ -63,6 +63,8 @@ static inline void flush(void) | |||
63 | #define MX3X_UART1_BASE_ADDR 0x43F90000 | 63 | #define MX3X_UART1_BASE_ADDR 0x43F90000 |
64 | #define MX3X_UART2_BASE_ADDR 0x43F94000 | 64 | #define MX3X_UART2_BASE_ADDR 0x43F94000 |
65 | #define MX51_UART1_BASE_ADDR 0x73fbc000 | 65 | #define MX51_UART1_BASE_ADDR 0x73fbc000 |
66 | #define MX50_UART1_BASE_ADDR 0x53fbc000 | ||
67 | #define MX53_UART1_BASE_ADDR 0x53fbc000 | ||
66 | 68 | ||
67 | static __inline__ void __arch_decomp_setup(unsigned long arch_id) | 69 | static __inline__ void __arch_decomp_setup(unsigned long arch_id) |
68 | { | 70 | { |
@@ -102,6 +104,12 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id) | |||
102 | case MACH_TYPE_EUKREA_CPUIMX51SD: | 104 | case MACH_TYPE_EUKREA_CPUIMX51SD: |
103 | uart_base = MX51_UART1_BASE_ADDR; | 105 | uart_base = MX51_UART1_BASE_ADDR; |
104 | break; | 106 | break; |
107 | case MACH_TYPE_MX50_RDP: | ||
108 | uart_base = MX50_UART1_BASE_ADDR; | ||
109 | break; | ||
110 | case MACH_TYPE_MX53_EVK: | ||
111 | uart_base = MX53_UART1_BASE_ADDR; | ||
112 | break; | ||
105 | default: | 113 | default: |
106 | break; | 114 | break; |
107 | } | 115 | } |
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c index b318c6a222d5..99a9cdb9d6be 100644 --- a/arch/arm/plat-mxc/iomux-v3.c +++ b/arch/arm/plat-mxc/iomux-v3.c | |||
@@ -32,31 +32,38 @@ | |||
32 | static void __iomem *base; | 32 | static void __iomem *base; |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * setups a single pad in the iomuxer | 35 | * configures a single pad in the iomuxer |
36 | */ | 36 | */ |
37 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad) | 37 | int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad) |
38 | { | 38 | { |
39 | if (pad->mux_ctrl_ofs) | 39 | u32 mux_ctrl_ofs = (pad & MUX_CTRL_OFS_MASK) >> MUX_CTRL_OFS_SHIFT; |
40 | __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); | 40 | u32 mux_mode = (pad & MUX_MODE_MASK) >> MUX_MODE_SHIFT; |
41 | u32 sel_input_ofs = (pad & MUX_SEL_INPUT_OFS_MASK) >> MUX_SEL_INPUT_OFS_SHIFT; | ||
42 | u32 sel_input = (pad & MUX_SEL_INPUT_MASK) >> MUX_SEL_INPUT_SHIFT; | ||
43 | u32 pad_ctrl_ofs = (pad & MUX_PAD_CTRL_OFS_MASK) >> MUX_PAD_CTRL_OFS_SHIFT; | ||
44 | u32 pad_ctrl = (pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT; | ||
41 | 45 | ||
42 | if (pad->select_input_ofs) | 46 | if (mux_ctrl_ofs) |
43 | __raw_writel(pad->select_input, | 47 | __raw_writel(mux_mode, base + mux_ctrl_ofs); |
44 | base + pad->select_input_ofs); | 48 | |
49 | if (sel_input_ofs) | ||
50 | __raw_writel(sel_input, base + sel_input_ofs); | ||
51 | |||
52 | if (!(pad_ctrl & NO_PAD_CTRL) && pad_ctrl_ofs) | ||
53 | __raw_writel(pad_ctrl, base + pad_ctrl_ofs); | ||
45 | 54 | ||
46 | if (!(pad->pad_ctrl & NO_PAD_CTRL) && pad->pad_ctrl_ofs) | ||
47 | __raw_writel(pad->pad_ctrl, base + pad->pad_ctrl_ofs); | ||
48 | return 0; | 55 | return 0; |
49 | } | 56 | } |
50 | EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); | 57 | EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); |
51 | 58 | ||
52 | int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count) | 59 | int mxc_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count) |
53 | { | 60 | { |
54 | struct pad_desc *p = pad_list; | 61 | iomux_v3_cfg_t *p = pad_list; |
55 | int i; | 62 | int i; |
56 | int ret; | 63 | int ret; |
57 | 64 | ||
58 | for (i = 0; i < count; i++) { | 65 | for (i = 0; i < count; i++) { |
59 | ret = mxc_iomux_v3_setup_pad(p); | 66 | ret = mxc_iomux_v3_setup_pad(*p); |
60 | if (ret) | 67 | if (ret) |
61 | return ret; | 68 | return ret; |
62 | p++; | 69 | p++; |
diff --git a/arch/arm/plat-mxc/irq-common.c b/arch/arm/plat-mxc/irq-common.c new file mode 100644 index 000000000000..0c799ac27730 --- /dev/null +++ b/arch/arm/plat-mxc/irq-common.c | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright (C) BitBox Ltd 2010 | ||
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/module.h> | ||
20 | #include <linux/irq.h> | ||
21 | |||
22 | #include "irq-common.h" | ||
23 | |||
24 | int imx_irq_set_priority(unsigned char irq, unsigned char prio) | ||
25 | { | ||
26 | struct mxc_irq_chip *chip; | ||
27 | struct irq_chip *base; | ||
28 | int ret; | ||
29 | |||
30 | ret = -ENOSYS; | ||
31 | |||
32 | base = get_irq_chip(irq); | ||
33 | if (base) { | ||
34 | chip = container_of(base, struct mxc_irq_chip, base); | ||
35 | if (chip->set_priority) | ||
36 | ret = chip->set_priority(irq, prio); | ||
37 | } | ||
38 | |||
39 | return ret; | ||
40 | } | ||
41 | EXPORT_SYMBOL(imx_irq_set_priority); | ||
42 | |||
43 | int mxc_set_irq_fiq(unsigned int irq, unsigned int type) | ||
44 | { | ||
45 | struct mxc_irq_chip *chip; | ||
46 | struct irq_chip *base; | ||
47 | int ret; | ||
48 | |||
49 | ret = -ENOSYS; | ||
50 | |||
51 | base = get_irq_chip(irq); | ||
52 | if (base) { | ||
53 | chip = container_of(base, struct mxc_irq_chip, base); | ||
54 | if (chip->set_irq_fiq) | ||
55 | ret = chip->set_irq_fiq(irq, type); | ||
56 | } | ||
57 | |||
58 | return ret; | ||
59 | } | ||
60 | EXPORT_SYMBOL(mxc_set_irq_fiq); | ||
diff --git a/arch/arm/plat-mxc/irq-common.h b/arch/arm/plat-mxc/irq-common.h new file mode 100644 index 000000000000..7203543fb1b3 --- /dev/null +++ b/arch/arm/plat-mxc/irq-common.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) BitBox Ltd 2010 | ||
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 __PLAT_MXC_IRQ_COMMON_H__ | ||
20 | #define __PLAT_MXC_IRQ_COMMON_H__ | ||
21 | |||
22 | struct mxc_irq_chip | ||
23 | { | ||
24 | struct irq_chip base; | ||
25 | int (*set_priority)(unsigned char irq, unsigned char prio); | ||
26 | int (*set_irq_fiq)(unsigned int irq, unsigned int type); | ||
27 | }; | ||
28 | |||
29 | #endif | ||
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c index 925bce4607e7..3455fc0575a6 100644 --- a/arch/arm/plat-mxc/system.c +++ b/arch/arm/plat-mxc/system.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <mach/common.h> | 26 | #include <mach/common.h> |
27 | #include <asm/proc-fns.h> | 27 | #include <asm/proc-fns.h> |
28 | #include <asm/system.h> | 28 | #include <asm/system.h> |
29 | #include <asm/mach-types.h> | ||
29 | 30 | ||
30 | static void __iomem *wdog_base; | 31 | static void __iomem *wdog_base; |
31 | 32 | ||
@@ -42,12 +43,19 @@ void arch_reset(char mode, const char *cmd) | |||
42 | return; | 43 | return; |
43 | } | 44 | } |
44 | #endif | 45 | #endif |
46 | #ifdef CONFIG_MACH_MX51_EFIKAMX | ||
47 | if (machine_is_mx51_efikamx()) { | ||
48 | mx51_efikamx_reset(); | ||
49 | return; | ||
50 | } | ||
51 | #endif | ||
52 | |||
45 | if (cpu_is_mx1()) { | 53 | if (cpu_is_mx1()) { |
46 | wcr_enable = (1 << 0); | 54 | wcr_enable = (1 << 0); |
47 | } else { | 55 | } else { |
48 | struct clk *clk; | 56 | struct clk *clk; |
49 | 57 | ||
50 | clk = clk_get_sys("imx-wdt.0", NULL); | 58 | clk = clk_get_sys("imx2-wdt.0", NULL); |
51 | if (!IS_ERR(clk)) | 59 | if (!IS_ERR(clk)) |
52 | clk_enable(clk); | 60 | clk_enable(clk); |
53 | wcr_enable = (1 << 2); | 61 | wcr_enable = (1 << 2); |
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c index f9a1b059a76c..9f0c2610595e 100644 --- a/arch/arm/plat-mxc/time.c +++ b/arch/arm/plat-mxc/time.c | |||
@@ -120,7 +120,6 @@ static struct clocksource clocksource_mxc = { | |||
120 | .rating = 200, | 120 | .rating = 200, |
121 | .read = mx1_2_get_cycles, | 121 | .read = mx1_2_get_cycles, |
122 | .mask = CLOCKSOURCE_MASK(32), | 122 | .mask = CLOCKSOURCE_MASK(32), |
123 | .shift = 20, | ||
124 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 123 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
125 | }; | 124 | }; |
126 | 125 | ||
@@ -131,9 +130,7 @@ static int __init mxc_clocksource_init(struct clk *timer_clk) | |||
131 | if (timer_is_v2()) | 130 | if (timer_is_v2()) |
132 | clocksource_mxc.read = v2_get_cycles; | 131 | clocksource_mxc.read = v2_get_cycles; |
133 | 132 | ||
134 | clocksource_mxc.mult = clocksource_hz2mult(c, | 133 | clocksource_register_hz(&clocksource_mxc, c); |
135 | clocksource_mxc.shift); | ||
136 | clocksource_register(&clocksource_mxc); | ||
137 | 134 | ||
138 | return 0; | 135 | return 0; |
139 | } | 136 | } |
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/plat-mxc/tzic.c index 3703ab28257f..e69ed8a8c203 100644 --- a/arch/arm/plat-mxc/tzic.c +++ b/arch/arm/plat-mxc/tzic.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
22 | #include <mach/common.h> | 22 | #include <mach/common.h> |
23 | 23 | ||
24 | #include "irq-common.h" | ||
25 | |||
24 | /* | 26 | /* |
25 | ***************************************** | 27 | ***************************************** |
26 | * TZIC Registers * | 28 | * TZIC Registers * |
@@ -47,6 +49,25 @@ | |||
47 | 49 | ||
48 | void __iomem *tzic_base; /* Used as irq controller base in entry-macro.S */ | 50 | void __iomem *tzic_base; /* Used as irq controller base in entry-macro.S */ |
49 | 51 | ||
52 | #ifdef CONFIG_FIQ | ||
53 | static int tzic_set_irq_fiq(unsigned int irq, unsigned int type) | ||
54 | { | ||
55 | unsigned int index, mask, value; | ||
56 | |||
57 | index = irq >> 5; | ||
58 | if (unlikely(index >= 4)) | ||
59 | return -EINVAL; | ||
60 | mask = 1U << (irq & 0x1F); | ||
61 | |||
62 | value = __raw_readl(tzic_base + TZIC_INTSEC0(index)) | mask; | ||
63 | if (type) | ||
64 | value &= ~mask; | ||
65 | __raw_writel(value, tzic_base + TZIC_INTSEC0(index)); | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | #endif | ||
70 | |||
50 | /** | 71 | /** |
51 | * tzic_mask_irq() - Disable interrupt number "irq" in the TZIC | 72 | * tzic_mask_irq() - Disable interrupt number "irq" in the TZIC |
52 | * | 73 | * |
@@ -104,12 +125,17 @@ static int tzic_set_wake_irq(unsigned int irq, unsigned int enable) | |||
104 | return 0; | 125 | return 0; |
105 | } | 126 | } |
106 | 127 | ||
107 | static struct irq_chip mxc_tzic_chip = { | 128 | static struct mxc_irq_chip mxc_tzic_chip = { |
108 | .name = "MXC_TZIC", | 129 | .base = { |
109 | .ack = tzic_mask_irq, | 130 | .name = "MXC_TZIC", |
110 | .mask = tzic_mask_irq, | 131 | .ack = tzic_mask_irq, |
111 | .unmask = tzic_unmask_irq, | 132 | .mask = tzic_mask_irq, |
112 | .set_wake = tzic_set_wake_irq, | 133 | .unmask = tzic_unmask_irq, |
134 | .set_wake = tzic_set_wake_irq, | ||
135 | }, | ||
136 | #ifdef CONFIG_FIQ | ||
137 | .set_irq_fiq = tzic_set_irq_fiq, | ||
138 | #endif | ||
113 | }; | 139 | }; |
114 | 140 | ||
115 | /* | 141 | /* |
@@ -141,10 +167,16 @@ void __init tzic_init_irq(void __iomem *irqbase) | |||
141 | /* all IRQ no FIQ Warning :: No selection */ | 167 | /* all IRQ no FIQ Warning :: No selection */ |
142 | 168 | ||
143 | for (i = 0; i < MXC_INTERNAL_IRQS; i++) { | 169 | for (i = 0; i < MXC_INTERNAL_IRQS; i++) { |
144 | set_irq_chip(i, &mxc_tzic_chip); | 170 | set_irq_chip(i, &mxc_tzic_chip.base); |
145 | set_irq_handler(i, handle_level_irq); | 171 | set_irq_handler(i, handle_level_irq); |
146 | set_irq_flags(i, IRQF_VALID); | 172 | set_irq_flags(i, IRQF_VALID); |
147 | } | 173 | } |
174 | |||
175 | #ifdef CONFIG_FIQ | ||
176 | /* Initialize FIQ */ | ||
177 | init_FIQ(); | ||
178 | #endif | ||
179 | |||
148 | pr_info("TrustZone Interrupt Controller (TZIC) initialized\n"); | 180 | pr_info("TrustZone Interrupt Controller (TZIC) initialized\n"); |
149 | } | 181 | } |
150 | 182 | ||
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index 5da3f97c537b..187f4e84bb22 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig | |||
@@ -14,6 +14,7 @@ if PLAT_NOMADIK | |||
14 | 14 | ||
15 | config HAS_MTU | 15 | config HAS_MTU |
16 | bool | 16 | bool |
17 | select HAVE_SCHED_CLOCK | ||
17 | help | 18 | help |
18 | Support for Multi Timer Unit. MTU provides access | 19 | Support for Multi Timer Unit. MTU provides access |
19 | to multiple interrupt generating programmable | 20 | to multiple interrupt generating programmable |
diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c index 85e6fd212a41..eda4e3a11a3d 100644 --- a/arch/arm/plat-nomadik/gpio.c +++ b/arch/arm/plat-nomadik/gpio.c | |||
@@ -119,7 +119,7 @@ static void __nmk_gpio_make_output(struct nmk_gpio_chip *nmk_chip, | |||
119 | } | 119 | } |
120 | 120 | ||
121 | static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset, | 121 | static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset, |
122 | pin_cfg_t cfg) | 122 | pin_cfg_t cfg, bool sleep) |
123 | { | 123 | { |
124 | static const char *afnames[] = { | 124 | static const char *afnames[] = { |
125 | [NMK_GPIO_ALT_GPIO] = "GPIO", | 125 | [NMK_GPIO_ALT_GPIO] = "GPIO", |
@@ -145,11 +145,34 @@ static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset, | |||
145 | int output = PIN_DIR(cfg); | 145 | int output = PIN_DIR(cfg); |
146 | int val = PIN_VAL(cfg); | 146 | int val = PIN_VAL(cfg); |
147 | 147 | ||
148 | dev_dbg(nmk_chip->chip.dev, "pin %d: af %s, pull %s, slpm %s (%s%s)\n", | 148 | dev_dbg(nmk_chip->chip.dev, "pin %d [%#lx]: af %s, pull %s, slpm %s (%s%s)\n", |
149 | pin, afnames[af], pullnames[pull], slpmnames[slpm], | 149 | pin, cfg, afnames[af], pullnames[pull], slpmnames[slpm], |
150 | output ? "output " : "input", | 150 | output ? "output " : "input", |
151 | output ? (val ? "high" : "low") : ""); | 151 | output ? (val ? "high" : "low") : ""); |
152 | 152 | ||
153 | if (sleep) { | ||
154 | int slpm_pull = PIN_SLPM_PULL(cfg); | ||
155 | int slpm_output = PIN_SLPM_DIR(cfg); | ||
156 | int slpm_val = PIN_SLPM_VAL(cfg); | ||
157 | |||
158 | /* | ||
159 | * The SLPM_* values are normal values + 1 to allow zero to | ||
160 | * mean "same as normal". | ||
161 | */ | ||
162 | if (slpm_pull) | ||
163 | pull = slpm_pull - 1; | ||
164 | if (slpm_output) | ||
165 | output = slpm_output - 1; | ||
166 | if (slpm_val) | ||
167 | val = slpm_val - 1; | ||
168 | |||
169 | dev_dbg(nmk_chip->chip.dev, "pin %d: sleep pull %s, dir %s, val %s\n", | ||
170 | pin, | ||
171 | slpm_pull ? pullnames[pull] : "same", | ||
172 | slpm_output ? (output ? "output" : "input") : "same", | ||
173 | slpm_val ? (val ? "high" : "low") : "same"); | ||
174 | } | ||
175 | |||
153 | if (output) | 176 | if (output) |
154 | __nmk_gpio_make_output(nmk_chip, offset, val); | 177 | __nmk_gpio_make_output(nmk_chip, offset, val); |
155 | else { | 178 | else { |
@@ -175,7 +198,7 @@ static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset, | |||
175 | * side-effects. The gpio can be manipulated later using standard GPIO API | 198 | * side-effects. The gpio can be manipulated later using standard GPIO API |
176 | * calls. | 199 | * calls. |
177 | */ | 200 | */ |
178 | int nmk_config_pin(pin_cfg_t cfg) | 201 | int nmk_config_pin(pin_cfg_t cfg, bool sleep) |
179 | { | 202 | { |
180 | struct nmk_gpio_chip *nmk_chip; | 203 | struct nmk_gpio_chip *nmk_chip; |
181 | int gpio = PIN_NUM(cfg); | 204 | int gpio = PIN_NUM(cfg); |
@@ -186,7 +209,7 @@ int nmk_config_pin(pin_cfg_t cfg) | |||
186 | return -EINVAL; | 209 | return -EINVAL; |
187 | 210 | ||
188 | spin_lock_irqsave(&nmk_chip->lock, flags); | 211 | spin_lock_irqsave(&nmk_chip->lock, flags); |
189 | __nmk_config_pin(nmk_chip, gpio - nmk_chip->chip.base, cfg); | 212 | __nmk_config_pin(nmk_chip, gpio - nmk_chip->chip.base, cfg, sleep); |
190 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 213 | spin_unlock_irqrestore(&nmk_chip->lock, flags); |
191 | 214 | ||
192 | return 0; | 215 | return 0; |
@@ -207,7 +230,7 @@ int nmk_config_pins(pin_cfg_t *cfgs, int num) | |||
207 | int i; | 230 | int i; |
208 | 231 | ||
209 | for (i = 0; i < num; i++) { | 232 | for (i = 0; i < num; i++) { |
210 | int ret = nmk_config_pin(cfgs[i]); | 233 | ret = nmk_config_pin(cfgs[i], false); |
211 | if (ret) | 234 | if (ret) |
212 | break; | 235 | break; |
213 | } | 236 | } |
@@ -216,6 +239,21 @@ int nmk_config_pins(pin_cfg_t *cfgs, int num) | |||
216 | } | 239 | } |
217 | EXPORT_SYMBOL(nmk_config_pins); | 240 | EXPORT_SYMBOL(nmk_config_pins); |
218 | 241 | ||
242 | int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num) | ||
243 | { | ||
244 | int ret = 0; | ||
245 | int i; | ||
246 | |||
247 | for (i = 0; i < num; i++) { | ||
248 | ret = nmk_config_pin(cfgs[i], true); | ||
249 | if (ret) | ||
250 | break; | ||
251 | } | ||
252 | |||
253 | return ret; | ||
254 | } | ||
255 | EXPORT_SYMBOL(nmk_config_pins_sleep); | ||
256 | |||
219 | /** | 257 | /** |
220 | * nmk_gpio_set_slpm() - configure the sleep mode of a pin | 258 | * nmk_gpio_set_slpm() - configure the sleep mode of a pin |
221 | * @gpio: pin number | 259 | * @gpio: pin number |
@@ -634,7 +672,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) | |||
634 | 672 | ||
635 | chip = &nmk_chip->chip; | 673 | chip = &nmk_chip->chip; |
636 | chip->base = pdata->first_gpio; | 674 | chip->base = pdata->first_gpio; |
637 | chip->label = pdata->name; | 675 | chip->label = pdata->name ?: dev_name(&dev->dev); |
638 | chip->dev = &dev->dev; | 676 | chip->dev = &dev->dev; |
639 | chip->owner = THIS_MODULE; | 677 | chip->owner = THIS_MODULE; |
640 | 678 | ||
diff --git a/arch/arm/plat-nomadik/include/plat/pincfg.h b/arch/arm/plat-nomadik/include/plat/pincfg.h index 8c5ae3f2acf8..05a3936ae6d1 100644 --- a/arch/arm/plat-nomadik/include/plat/pincfg.h +++ b/arch/arm/plat-nomadik/include/plat/pincfg.h | |||
@@ -19,16 +19,22 @@ | |||
19 | * bit 9..10 - Alternate Function Selection | 19 | * bit 9..10 - Alternate Function Selection |
20 | * bit 11..12 - Pull up/down state | 20 | * bit 11..12 - Pull up/down state |
21 | * bit 13 - Sleep mode behaviour | 21 | * bit 13 - Sleep mode behaviour |
22 | * bit 14 - (sleep mode) Direction | 22 | * bit 14 - Direction |
23 | * bit 15 - (sleep mode) Value (if output) | 23 | * bit 15 - Value (if output) |
24 | * bit 16..18 - SLPM pull up/down state | ||
25 | * bit 19..20 - SLPM direction | ||
26 | * bit 21..22 - SLPM Value (if output) | ||
24 | * | 27 | * |
25 | * to facilitate the definition, the following macros are provided | 28 | * to facilitate the definition, the following macros are provided |
26 | * | 29 | * |
27 | * PIN_CFG_DEFAULT - default config (0): | 30 | * PIN_CFG_DEFAULT - default config (0): |
28 | * pull up/down = disabled | 31 | * pull up/down = disabled |
29 | * sleep mode = input/wakeup | 32 | * sleep mode = input/wakeup |
30 | * (sleep mode) direction = input | 33 | * direction = input |
31 | * (sleep mode) value = low | 34 | * value = low |
35 | * SLPM direction = same as normal | ||
36 | * SLPM pull = same as normal | ||
37 | * SLPM value = same as normal | ||
32 | * | 38 | * |
33 | * PIN_CFG - default config with alternate function | 39 | * PIN_CFG - default config with alternate function |
34 | * PIN_CFG_PULL - default config with alternate function and pull up/down | 40 | * PIN_CFG_PULL - default config with alternate function and pull up/down |
@@ -75,30 +81,64 @@ typedef unsigned long pin_cfg_t; | |||
75 | #define PIN_VAL_LOW (0 << PIN_VAL_SHIFT) | 81 | #define PIN_VAL_LOW (0 << PIN_VAL_SHIFT) |
76 | #define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT) | 82 | #define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT) |
77 | 83 | ||
78 | /* Shortcuts. Use these instead of separate DIR and VAL. */ | 84 | #define PIN_SLPM_PULL_SHIFT 16 |
79 | #define PIN_INPUT PIN_DIR_INPUT | 85 | #define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT) |
86 | #define PIN_SLPM_PULL(x) \ | ||
87 | (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT) | ||
88 | #define PIN_SLPM_PULL_NONE \ | ||
89 | ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT) | ||
90 | #define PIN_SLPM_PULL_UP \ | ||
91 | ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT) | ||
92 | #define PIN_SLPM_PULL_DOWN \ | ||
93 | ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT) | ||
94 | |||
95 | #define PIN_SLPM_DIR_SHIFT 19 | ||
96 | #define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT) | ||
97 | #define PIN_SLPM_DIR(x) \ | ||
98 | (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT) | ||
99 | #define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT) | ||
100 | #define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT) | ||
101 | |||
102 | #define PIN_SLPM_VAL_SHIFT 21 | ||
103 | #define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT) | ||
104 | #define PIN_SLPM_VAL(x) \ | ||
105 | (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT) | ||
106 | #define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT) | ||
107 | #define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT) | ||
108 | |||
109 | /* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */ | ||
110 | #define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN) | ||
111 | #define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP) | ||
112 | #define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE) | ||
80 | #define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW) | 113 | #define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW) |
81 | #define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH) | 114 | #define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH) |
82 | 115 | ||
83 | /* | 116 | #define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN) |
84 | * These are the same as the ones above, but should make more sense to the | 117 | #define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP) |
85 | * reader when seen along with a setting a pin to AF mode. | 118 | #define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE) |
86 | */ | 119 | #define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW) |
87 | #define PIN_SLPM_INPUT PIN_INPUT | 120 | #define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH) |
88 | #define PIN_SLPM_OUTPUT_LOW PIN_OUTPUT_LOW | ||
89 | #define PIN_SLPM_OUTPUT_HIGH PIN_OUTPUT_HIGH | ||
90 | 121 | ||
91 | #define PIN_CFG_DEFAULT (PIN_PULL_NONE | PIN_SLPM_INPUT) | 122 | #define PIN_CFG_DEFAULT (0) |
92 | 123 | ||
93 | #define PIN_CFG(num, alt) \ | 124 | #define PIN_CFG(num, alt) \ |
94 | (PIN_CFG_DEFAULT |\ | 125 | (PIN_CFG_DEFAULT |\ |
95 | (PIN_NUM(num) | PIN_##alt)) | 126 | (PIN_NUM(num) | PIN_##alt)) |
96 | 127 | ||
128 | #define PIN_CFG_INPUT(num, alt, pull) \ | ||
129 | (PIN_CFG_DEFAULT |\ | ||
130 | (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull)) | ||
131 | |||
132 | #define PIN_CFG_OUTPUT(num, alt, val) \ | ||
133 | (PIN_CFG_DEFAULT |\ | ||
134 | (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val)) | ||
135 | |||
97 | #define PIN_CFG_PULL(num, alt, pull) \ | 136 | #define PIN_CFG_PULL(num, alt, pull) \ |
98 | ((PIN_CFG_DEFAULT & ~PIN_PULL_MASK) |\ | 137 | ((PIN_CFG_DEFAULT & ~PIN_PULL_MASK) |\ |
99 | (PIN_NUM(num) | PIN_##alt | PIN_PULL_##pull)) | 138 | (PIN_NUM(num) | PIN_##alt | PIN_PULL_##pull)) |
100 | 139 | ||
101 | extern int nmk_config_pin(pin_cfg_t cfg); | 140 | extern int nmk_config_pin(pin_cfg_t cfg, bool sleep); |
102 | extern int nmk_config_pins(pin_cfg_t *cfgs, int num); | 141 | extern int nmk_config_pins(pin_cfg_t *cfgs, int num); |
142 | extern int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num); | ||
103 | 143 | ||
104 | #endif | 144 | #endif |
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index 63cdc6025bd7..41723402006b 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
@@ -17,9 +17,9 @@ | |||
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/jiffies.h> | 18 | #include <linux/jiffies.h> |
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/cnt32_to_63.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/timer.h> | ||
22 | #include <asm/mach/time.h> | 21 | #include <asm/mach/time.h> |
22 | #include <asm/sched_clock.h> | ||
23 | 23 | ||
24 | #include <plat/mtu.h> | 24 | #include <plat/mtu.h> |
25 | 25 | ||
@@ -52,81 +52,24 @@ static struct clocksource nmdk_clksrc = { | |||
52 | * Override the global weak sched_clock symbol with this | 52 | * Override the global weak sched_clock symbol with this |
53 | * local implementation which uses the clocksource to get some | 53 | * local implementation which uses the clocksource to get some |
54 | * better resolution when scheduling the kernel. | 54 | * better resolution when scheduling the kernel. |
55 | * | ||
56 | * Because the hardware timer period may be quite short | ||
57 | * (32.3 secs on the 133 MHz MTU timer selection on ux500) | ||
58 | * and because cnt32_to_63() needs to be called at least once per | ||
59 | * half period to work properly, a kernel keepwarm() timer is set up | ||
60 | * to ensure this requirement is always met. | ||
61 | * | ||
62 | * Also the sched_clock timer will wrap around at some point, | ||
63 | * here we set it to run continously for a year. | ||
64 | */ | 55 | */ |
65 | #define SCHED_CLOCK_MIN_WRAP 3600*24*365 | 56 | static DEFINE_CLOCK_DATA(cd); |
66 | static struct timer_list cnt32_to_63_keepwarm_timer; | ||
67 | static u32 sched_mult; | ||
68 | static u32 sched_shift; | ||
69 | 57 | ||
70 | unsigned long long notrace sched_clock(void) | 58 | unsigned long long notrace sched_clock(void) |
71 | { | 59 | { |
72 | u64 cycles; | 60 | u32 cyc; |
73 | 61 | ||
74 | if (unlikely(!mtu_base)) | 62 | if (unlikely(!mtu_base)) |
75 | return 0; | 63 | return 0; |
76 | 64 | ||
77 | cycles = cnt32_to_63(-readl(mtu_base + MTU_VAL(0))); | 65 | cyc = -readl(mtu_base + MTU_VAL(0)); |
78 | /* | 66 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
79 | * sched_mult is guaranteed to be even so will | ||
80 | * shift out bit 63 | ||
81 | */ | ||
82 | return (cycles * sched_mult) >> sched_shift; | ||
83 | } | 67 | } |
84 | 68 | ||
85 | /* Just kick sched_clock every so often */ | 69 | static void notrace nomadik_update_sched_clock(void) |
86 | static void cnt32_to_63_keepwarm(unsigned long data) | ||
87 | { | 70 | { |
88 | mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data)); | 71 | u32 cyc = -readl(mtu_base + MTU_VAL(0)); |
89 | (void) sched_clock(); | 72 | update_sched_clock(&cd, cyc, (u32)~0); |
90 | } | ||
91 | |||
92 | /* | ||
93 | * Set up a timer to keep sched_clock():s 32_to_63 algorithm warm | ||
94 | * once in half a 32bit timer wrap interval. | ||
95 | */ | ||
96 | static void __init nmdk_sched_clock_init(unsigned long rate) | ||
97 | { | ||
98 | u32 v; | ||
99 | unsigned long delta; | ||
100 | u64 days; | ||
101 | |||
102 | /* Find the apropriate mult and shift factors */ | ||
103 | clocks_calc_mult_shift(&sched_mult, &sched_shift, | ||
104 | rate, NSEC_PER_SEC, SCHED_CLOCK_MIN_WRAP); | ||
105 | /* We need to multiply by an even number to get rid of bit 63 */ | ||
106 | if (sched_mult & 1) | ||
107 | sched_mult++; | ||
108 | |||
109 | /* Let's see what we get, take max counter and scale it */ | ||
110 | days = (0xFFFFFFFFFFFFFFFFLLU * sched_mult) >> sched_shift; | ||
111 | do_div(days, NSEC_PER_SEC); | ||
112 | do_div(days, (3600*24)); | ||
113 | |||
114 | pr_info("sched_clock: using %d bits @ %lu Hz wrap in %lu days\n", | ||
115 | (64 - sched_shift), rate, (unsigned long) days); | ||
116 | |||
117 | /* | ||
118 | * Program a timer to kick us at half 32bit wraparound | ||
119 | * Formula: seconds per wrap = (2^32) / f | ||
120 | */ | ||
121 | v = 0xFFFFFFFFUL / rate; | ||
122 | /* We want half of the wrap time to keep cnt32_to_63 warm */ | ||
123 | v /= 2; | ||
124 | pr_debug("sched_clock: prescaled timer rate: %lu Hz, " | ||
125 | "initialize keepwarm timer every %d seconds\n", rate, v); | ||
126 | /* Convert seconds to jiffies */ | ||
127 | delta = msecs_to_jiffies(v*1000); | ||
128 | setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, delta); | ||
129 | mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + delta)); | ||
130 | } | 73 | } |
131 | 74 | ||
132 | /* Clockevent device: use one-shot mode */ | 75 | /* Clockevent device: use one-shot mode */ |
@@ -222,7 +165,6 @@ void __init nmdk_timer_init(void) | |||
222 | } else { | 165 | } else { |
223 | cr |= MTU_CRn_PRESCALE_1; | 166 | cr |= MTU_CRn_PRESCALE_1; |
224 | } | 167 | } |
225 | clocksource_calc_mult_shift(&nmdk_clksrc, rate, MTU_MIN_RANGE); | ||
226 | 168 | ||
227 | /* Timer 0 is the free running clocksource */ | 169 | /* Timer 0 is the free running clocksource */ |
228 | writel(cr, mtu_base + MTU_CR(0)); | 170 | writel(cr, mtu_base + MTU_CR(0)); |
@@ -233,11 +175,11 @@ void __init nmdk_timer_init(void) | |||
233 | /* Now the clock source is ready */ | 175 | /* Now the clock source is ready */ |
234 | nmdk_clksrc.read = nmdk_read_timer; | 176 | nmdk_clksrc.read = nmdk_read_timer; |
235 | 177 | ||
236 | if (clocksource_register(&nmdk_clksrc)) | 178 | if (clocksource_register_hz(&nmdk_clksrc, rate)) |
237 | pr_err("timer: failed to initialize clock source %s\n", | 179 | pr_err("timer: failed to initialize clock source %s\n", |
238 | nmdk_clksrc.name); | 180 | nmdk_clksrc.name); |
239 | 181 | ||
240 | nmdk_sched_clock_init(rate); | 182 | init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); |
241 | 183 | ||
242 | /* Timer 1 is used for events */ | 184 | /* Timer 1 is used for events */ |
243 | 185 | ||
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 92c5bb7909f5..c9408434a855 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -11,13 +11,13 @@ choice | |||
11 | 11 | ||
12 | config ARCH_OMAP1 | 12 | config ARCH_OMAP1 |
13 | bool "TI OMAP1" | 13 | bool "TI OMAP1" |
14 | select COMMON_CLKDEV | 14 | select CLKDEV_LOOKUP |
15 | help | 15 | help |
16 | "Systems based on omap7xx, omap15xx or omap16xx" | 16 | "Systems based on omap7xx, omap15xx or omap16xx" |
17 | 17 | ||
18 | config ARCH_OMAP2PLUS | 18 | config ARCH_OMAP2PLUS |
19 | bool "TI OMAP2/3/4" | 19 | bool "TI OMAP2/3/4" |
20 | select COMMON_CLKDEV | 20 | select CLKDEV_LOOKUP |
21 | help | 21 | help |
22 | "Systems based on OMAP2, OMAP3 or OMAP4" | 22 | "Systems based on OMAP2, OMAP3 or OMAP4" |
23 | 23 | ||
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c index 8722a136f3a5..ea4644021fb9 100644 --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c | |||
@@ -15,8 +15,11 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/io.h> | ||
19 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/io.h> | ||
20 | #include <linux/sched.h> | ||
21 | |||
22 | #include <asm/sched_clock.h> | ||
20 | 23 | ||
21 | #include <plat/common.h> | 24 | #include <plat/common.h> |
22 | #include <plat/board.h> | 25 | #include <plat/board.h> |
@@ -45,7 +48,7 @@ | |||
45 | static u32 offset_32k __read_mostly; | 48 | static u32 offset_32k __read_mostly; |
46 | 49 | ||
47 | #ifdef CONFIG_ARCH_OMAP16XX | 50 | #ifdef CONFIG_ARCH_OMAP16XX |
48 | static cycle_t omap16xx_32k_read(struct clocksource *cs) | 51 | static cycle_t notrace omap16xx_32k_read(struct clocksource *cs) |
49 | { | 52 | { |
50 | return omap_readl(OMAP16XX_TIMER_32K_SYNCHRONIZED) - offset_32k; | 53 | return omap_readl(OMAP16XX_TIMER_32K_SYNCHRONIZED) - offset_32k; |
51 | } | 54 | } |
@@ -54,7 +57,7 @@ static cycle_t omap16xx_32k_read(struct clocksource *cs) | |||
54 | #endif | 57 | #endif |
55 | 58 | ||
56 | #ifdef CONFIG_ARCH_OMAP2420 | 59 | #ifdef CONFIG_ARCH_OMAP2420 |
57 | static cycle_t omap2420_32k_read(struct clocksource *cs) | 60 | static cycle_t notrace omap2420_32k_read(struct clocksource *cs) |
58 | { | 61 | { |
59 | return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k; | 62 | return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k; |
60 | } | 63 | } |
@@ -63,7 +66,7 @@ static cycle_t omap2420_32k_read(struct clocksource *cs) | |||
63 | #endif | 66 | #endif |
64 | 67 | ||
65 | #ifdef CONFIG_ARCH_OMAP2430 | 68 | #ifdef CONFIG_ARCH_OMAP2430 |
66 | static cycle_t omap2430_32k_read(struct clocksource *cs) | 69 | static cycle_t notrace omap2430_32k_read(struct clocksource *cs) |
67 | { | 70 | { |
68 | return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k; | 71 | return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k; |
69 | } | 72 | } |
@@ -72,7 +75,7 @@ static cycle_t omap2430_32k_read(struct clocksource *cs) | |||
72 | #endif | 75 | #endif |
73 | 76 | ||
74 | #ifdef CONFIG_ARCH_OMAP3 | 77 | #ifdef CONFIG_ARCH_OMAP3 |
75 | static cycle_t omap34xx_32k_read(struct clocksource *cs) | 78 | static cycle_t notrace omap34xx_32k_read(struct clocksource *cs) |
76 | { | 79 | { |
77 | return omap_readl(OMAP3430_32KSYNCT_BASE + 0x10) - offset_32k; | 80 | return omap_readl(OMAP3430_32KSYNCT_BASE + 0x10) - offset_32k; |
78 | } | 81 | } |
@@ -81,7 +84,7 @@ static cycle_t omap34xx_32k_read(struct clocksource *cs) | |||
81 | #endif | 84 | #endif |
82 | 85 | ||
83 | #ifdef CONFIG_ARCH_OMAP4 | 86 | #ifdef CONFIG_ARCH_OMAP4 |
84 | static cycle_t omap44xx_32k_read(struct clocksource *cs) | 87 | static cycle_t notrace omap44xx_32k_read(struct clocksource *cs) |
85 | { | 88 | { |
86 | return omap_readl(OMAP4430_32KSYNCT_BASE + 0x10) - offset_32k; | 89 | return omap_readl(OMAP4430_32KSYNCT_BASE + 0x10) - offset_32k; |
87 | } | 90 | } |
@@ -93,7 +96,7 @@ static cycle_t omap44xx_32k_read(struct clocksource *cs) | |||
93 | * Kernel assumes that sched_clock can be called early but may not have | 96 | * Kernel assumes that sched_clock can be called early but may not have |
94 | * things ready yet. | 97 | * things ready yet. |
95 | */ | 98 | */ |
96 | static cycle_t omap_32k_read_dummy(struct clocksource *cs) | 99 | static cycle_t notrace omap_32k_read_dummy(struct clocksource *cs) |
97 | { | 100 | { |
98 | return 0; | 101 | return 0; |
99 | } | 102 | } |
@@ -103,7 +106,6 @@ static struct clocksource clocksource_32k = { | |||
103 | .rating = 250, | 106 | .rating = 250, |
104 | .read = omap_32k_read_dummy, | 107 | .read = omap_32k_read_dummy, |
105 | .mask = CLOCKSOURCE_MASK(32), | 108 | .mask = CLOCKSOURCE_MASK(32), |
106 | .shift = 10, | ||
107 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 109 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
108 | }; | 110 | }; |
109 | 111 | ||
@@ -111,10 +113,25 @@ static struct clocksource clocksource_32k = { | |||
111 | * Returns current time from boot in nsecs. It's OK for this to wrap | 113 | * Returns current time from boot in nsecs. It's OK for this to wrap |
112 | * around for now, as it's just a relative time stamp. | 114 | * around for now, as it's just a relative time stamp. |
113 | */ | 115 | */ |
114 | unsigned long long sched_clock(void) | 116 | static DEFINE_CLOCK_DATA(cd); |
117 | |||
118 | /* | ||
119 | * Constants generated by clocks_calc_mult_shift(m, s, 32768, NSEC_PER_SEC, 60). | ||
120 | * This gives a resolution of about 30us and a wrap period of about 36hrs. | ||
121 | */ | ||
122 | #define SC_MULT 4000000000u | ||
123 | #define SC_SHIFT 17 | ||
124 | |||
125 | unsigned long long notrace sched_clock(void) | ||
126 | { | ||
127 | u32 cyc = clocksource_32k.read(&clocksource_32k); | ||
128 | return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT); | ||
129 | } | ||
130 | |||
131 | static void notrace omap_update_sched_clock(void) | ||
115 | { | 132 | { |
116 | return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k), | 133 | u32 cyc = clocksource_32k.read(&clocksource_32k); |
117 | clocksource_32k.mult, clocksource_32k.shift); | 134 | update_sched_clock(&cd, cyc, (u32)~0); |
118 | } | 135 | } |
119 | 136 | ||
120 | /** | 137 | /** |
@@ -168,13 +185,13 @@ static int __init omap_init_clocksource_32k(void) | |||
168 | if (!IS_ERR(sync_32k_ick)) | 185 | if (!IS_ERR(sync_32k_ick)) |
169 | clk_enable(sync_32k_ick); | 186 | clk_enable(sync_32k_ick); |
170 | 187 | ||
171 | clocksource_32k.mult = clocksource_hz2mult(32768, | ||
172 | clocksource_32k.shift); | ||
173 | |||
174 | offset_32k = clocksource_32k.read(&clocksource_32k); | 188 | offset_32k = clocksource_32k.read(&clocksource_32k); |
175 | 189 | ||
176 | if (clocksource_register(&clocksource_32k)) | 190 | if (clocksource_register_hz(&clocksource_32k, 32768)) |
177 | printk(err, clocksource_32k.name); | 191 | printk(err, clocksource_32k.name); |
192 | |||
193 | init_fixed_sched_clock(&cd, omap_update_sched_clock, 32, | ||
194 | 32768, SC_MULT, SC_SHIFT); | ||
178 | } | 195 | } |
179 | return 0; | 196 | return 0; |
180 | } | 197 | } |
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h index bb937f3fabed..4b2028ab4d2b 100644 --- a/arch/arm/plat-omap/include/plat/clkdev_omap.h +++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H | 8 | #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H |
9 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H | 9 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H |
10 | 10 | ||
11 | #include <asm/clkdev.h> | 11 | #include <linux/clkdev.h> |
12 | 12 | ||
13 | struct omap_clk { | 13 | struct omap_clk { |
14 | u16 cpu; | 14 | u16 cpu; |
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h index 128b549c2796..204865f91d93 100644 --- a/arch/arm/plat-omap/include/plat/io.h +++ b/arch/arm/plat-omap/include/plat/io.h | |||
@@ -294,8 +294,8 @@ static inline void omap44xx_map_common_io(void) | |||
294 | extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | 294 | extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, |
295 | struct omap_sdrc_params *sdrc_cs1); | 295 | struct omap_sdrc_params *sdrc_cs1); |
296 | 296 | ||
297 | #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) | 297 | #define __arch_ioremap omap_ioremap |
298 | #define __arch_iounmap(v) omap_iounmap(v) | 298 | #define __arch_iounmap omap_iounmap |
299 | 299 | ||
300 | void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type); | 300 | void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type); |
301 | void omap_iounmap(volatile void __iomem *addr); | 301 | void omap_iounmap(volatile void __iomem *addr); |
diff --git a/arch/arm/plat-omap/include/plat/memory.h b/arch/arm/plat-omap/include/plat/memory.h index d5306bee44b2..f8d922fb5584 100644 --- a/arch/arm/plat-omap/include/plat/memory.h +++ b/arch/arm/plat-omap/include/plat/memory.h | |||
@@ -61,17 +61,17 @@ | |||
61 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) | 61 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) |
62 | #define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0)) | 62 | #define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0)) |
63 | 63 | ||
64 | #define __arch_page_to_dma(dev, page) \ | 64 | #define __arch_pfn_to_dma(dev, pfn) \ |
65 | ({ dma_addr_t __dma = page_to_phys(page); \ | 65 | ({ dma_addr_t __dma = __pfn_to_phys(pfn); \ |
66 | if (is_lbus_device(dev)) \ | 66 | if (is_lbus_device(dev)) \ |
67 | __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \ | 67 | __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \ |
68 | __dma; }) | 68 | __dma; }) |
69 | 69 | ||
70 | #define __arch_dma_to_page(dev, addr) \ | 70 | #define __arch_dma_to_pfn(dev, addr) \ |
71 | ({ dma_addr_t __dma = addr; \ | 71 | ({ dma_addr_t __dma = addr; \ |
72 | if (is_lbus_device(dev)) \ | 72 | if (is_lbus_device(dev)) \ |
73 | __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET; \ | 73 | __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET; \ |
74 | phys_to_page(__dma); \ | 74 | __phys_to_pfn(__dma); \ |
75 | }) | 75 | }) |
76 | 76 | ||
77 | #define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \ | 77 | #define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \ |
diff --git a/arch/arm/plat-omap/include/plat/smp.h b/arch/arm/plat-omap/include/plat/smp.h index ecd6a488c497..7a10257909ef 100644 --- a/arch/arm/plat-omap/include/plat/smp.h +++ b/arch/arm/plat-omap/include/plat/smp.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #define OMAP_ARCH_SMP_H | 18 | #define OMAP_ARCH_SMP_H |
19 | 19 | ||
20 | #include <asm/hardware/gic.h> | 20 | #include <asm/hardware/gic.h> |
21 | #include <asm/smp_mpidr.h> | ||
22 | 21 | ||
23 | /* Needed for secondary core boot */ | 22 | /* Needed for secondary core boot */ |
24 | extern void omap_secondary_startup(void); | 23 | extern void omap_secondary_startup(void); |
@@ -29,9 +28,9 @@ extern u32 omap_read_auxcoreboot0(void); | |||
29 | /* | 28 | /* |
30 | * We use Soft IRQ1 as the IPI | 29 | * We use Soft IRQ1 as the IPI |
31 | */ | 30 | */ |
32 | static inline void smp_cross_call(const struct cpumask *mask) | 31 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
33 | { | 32 | { |
34 | gic_raise_softirq(mask, 1); | 33 | gic_raise_softirq(mask, ipi); |
35 | } | 34 | } |
36 | 35 | ||
37 | #endif | 36 | #endif |
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c index 715a30177f28..c3da2478b2aa 100644 --- a/arch/arm/plat-orion/time.c +++ b/arch/arm/plat-orion/time.c | |||
@@ -13,11 +13,11 @@ | |||
13 | 13 | ||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/cnt32_to_63.h> | ||
17 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
18 | #include <linux/clockchips.h> | 17 | #include <linux/clockchips.h> |
19 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
20 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
20 | #include <asm/sched_clock.h> | ||
21 | #include <asm/mach/time.h> | 21 | #include <asm/mach/time.h> |
22 | #include <mach/bridge-regs.h> | 22 | #include <mach/bridge-regs.h> |
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
@@ -44,52 +44,26 @@ static u32 ticks_per_jiffy; | |||
44 | 44 | ||
45 | /* | 45 | /* |
46 | * Orion's sched_clock implementation. It has a resolution of | 46 | * Orion's sched_clock implementation. It has a resolution of |
47 | * at least 7.5ns (133MHz TCLK) and a maximum value of 834 days. | 47 | * at least 7.5ns (133MHz TCLK). |
48 | * | ||
49 | * Because the hardware timer period is quite short (21 secs if | ||
50 | * 200MHz TCLK) and because cnt32_to_63() needs to be called at | ||
51 | * least once per half period to work properly, a kernel timer is | ||
52 | * set up to ensure this requirement is always met. | ||
53 | */ | 48 | */ |
54 | #define TCLK2NS_SCALE_FACTOR 8 | 49 | static DEFINE_CLOCK_DATA(cd); |
55 | |||
56 | static unsigned long tclk2ns_scale; | ||
57 | 50 | ||
58 | unsigned long long sched_clock(void) | 51 | unsigned long long notrace sched_clock(void) |
59 | { | 52 | { |
60 | unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL)); | 53 | u32 cyc = 0xffffffff - readl(TIMER0_VAL); |
61 | return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR; | 54 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
62 | } | 55 | } |
63 | 56 | ||
64 | static struct timer_list cnt32_to_63_keepwarm_timer; | ||
65 | 57 | ||
66 | static void cnt32_to_63_keepwarm(unsigned long data) | 58 | static void notrace orion_update_sched_clock(void) |
67 | { | 59 | { |
68 | mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data)); | 60 | u32 cyc = 0xffffffff - readl(TIMER0_VAL); |
69 | (void) sched_clock(); | 61 | update_sched_clock(&cd, cyc, (u32)~0); |
70 | } | 62 | } |
71 | 63 | ||
72 | static void __init setup_sched_clock(unsigned long tclk) | 64 | static void __init setup_sched_clock(unsigned long tclk) |
73 | { | 65 | { |
74 | unsigned long long v; | 66 | init_sched_clock(&cd, orion_update_sched_clock, 32, tclk); |
75 | unsigned long data; | ||
76 | |||
77 | v = NSEC_PER_SEC; | ||
78 | v <<= TCLK2NS_SCALE_FACTOR; | ||
79 | v += tclk/2; | ||
80 | do_div(v, tclk); | ||
81 | /* | ||
82 | * We want an even value to automatically clear the top bit | ||
83 | * returned by cnt32_to_63() without an additional run time | ||
84 | * instruction. So if the LSB is 1 then round it up. | ||
85 | */ | ||
86 | if (v & 1) | ||
87 | v++; | ||
88 | tclk2ns_scale = v; | ||
89 | |||
90 | data = (0xffffffffUL / tclk / 2 - 2) * HZ; | ||
91 | setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, data); | ||
92 | mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data)); | ||
93 | } | 67 | } |
94 | 68 | ||
95 | /* | 69 | /* |
@@ -102,7 +76,6 @@ static cycle_t orion_clksrc_read(struct clocksource *cs) | |||
102 | 76 | ||
103 | static struct clocksource orion_clksrc = { | 77 | static struct clocksource orion_clksrc = { |
104 | .name = "orion_clocksource", | 78 | .name = "orion_clocksource", |
105 | .shift = 20, | ||
106 | .rating = 300, | 79 | .rating = 300, |
107 | .read = orion_clksrc_read, | 80 | .read = orion_clksrc_read, |
108 | .mask = CLOCKSOURCE_MASK(32), | 81 | .mask = CLOCKSOURCE_MASK(32), |
@@ -245,8 +218,7 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk) | |||
245 | writel(u & ~BRIDGE_INT_TIMER0, BRIDGE_MASK); | 218 | writel(u & ~BRIDGE_INT_TIMER0, BRIDGE_MASK); |
246 | u = readl(TIMER_CTRL); | 219 | u = readl(TIMER_CTRL); |
247 | writel(u | TIMER0_EN | TIMER0_RELOAD_EN, TIMER_CTRL); | 220 | writel(u | TIMER0_EN | TIMER0_RELOAD_EN, TIMER_CTRL); |
248 | orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift); | 221 | clocksource_register_hz(&orion_clksrc, tclk); |
249 | clocksource_register(&orion_clksrc); | ||
250 | 222 | ||
251 | /* | 223 | /* |
252 | * Setup clockevent timer (interrupt-driven.) | 224 | * Setup clockevent timer (interrupt-driven.) |
diff --git a/arch/arm/plat-pxa/Makefile b/arch/arm/plat-pxa/Makefile index 4aacdd12c9cc..3aca5ba0f876 100644 --- a/arch/arm/plat-pxa/Makefile +++ b/arch/arm/plat-pxa/Makefile | |||
@@ -6,6 +6,7 @@ obj-y := dma.o | |||
6 | 6 | ||
7 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o | 7 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o |
8 | obj-$(CONFIG_PXA3xx) += mfp.o | 8 | obj-$(CONFIG_PXA3xx) += mfp.o |
9 | obj-$(CONFIG_PXA95x) += mfp.o | ||
9 | obj-$(CONFIG_ARCH_MMP) += mfp.o | 10 | obj-$(CONFIG_ARCH_MMP) += mfp.o |
10 | 11 | ||
11 | obj-$(CONFIG_HAVE_PWM) += pwm.o | 12 | obj-$(CONFIG_HAVE_PWM) += pwm.o |
diff --git a/arch/arm/plat-pxa/include/plat/mfp.h b/arch/arm/plat-pxa/include/plat/mfp.h index 9e604c80618f..75f656471240 100644 --- a/arch/arm/plat-pxa/include/plat/mfp.h +++ b/arch/arm/plat-pxa/include/plat/mfp.h | |||
@@ -423,7 +423,7 @@ typedef unsigned long mfp_cfg_t; | |||
423 | ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\ | 423 | ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\ |
424 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm)) | 424 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm)) |
425 | 425 | ||
426 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_ARCH_MMP) | 426 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) || defined(CONFIG_ARCH_MMP) |
427 | /* | 427 | /* |
428 | * each MFP pin will have a MFPR register, since the offset of the | 428 | * each MFP pin will have a MFPR register, since the offset of the |
429 | * register varies between processors, the processor specific code | 429 | * register varies between processors, the processor specific code |
@@ -470,6 +470,6 @@ void mfp_write(int mfp, unsigned long mfpr_val); | |||
470 | void mfp_config(unsigned long *mfp_cfgs, int num); | 470 | void mfp_config(unsigned long *mfp_cfgs, int num); |
471 | void mfp_config_run(void); | 471 | void mfp_config_run(void); |
472 | void mfp_config_lpm(void); | 472 | void mfp_config_lpm(void); |
473 | #endif /* CONFIG_PXA3xx || CONFIG_ARCH_MMP */ | 473 | #endif /* CONFIG_PXA3xx || CONFIG_PXA95x || CONFIG_ARCH_MMP */ |
474 | 474 | ||
475 | #endif /* __ASM_PLAT_MFP_H */ | 475 | #endif /* __ASM_PLAT_MFP_H */ |
diff --git a/arch/arm/plat-spear/include/plat/clock.h b/arch/arm/plat-spear/include/plat/clock.h index 298bafc0a52f..2572260f990f 100644 --- a/arch/arm/plat-spear/include/plat/clock.h +++ b/arch/arm/plat-spear/include/plat/clock.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #define __PLAT_CLOCK_H | 15 | #define __PLAT_CLOCK_H |
16 | 16 | ||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <asm/clkdev.h> | 18 | #include <linux/clkdev.h> |
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | 20 | ||
21 | /* clk structure flags */ | 21 | /* clk structure flags */ |
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index ab211652e4ca..839c88df9994 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c | |||
@@ -81,8 +81,6 @@ static struct clocksource clksrc = { | |||
81 | .rating = 200, /* its a pretty decent clock */ | 81 | .rating = 200, /* its a pretty decent clock */ |
82 | .read = clocksource_read_cycles, | 82 | .read = clocksource_read_cycles, |
83 | .mask = 0xFFFF, /* 16 bits */ | 83 | .mask = 0xFFFF, /* 16 bits */ |
84 | .mult = 0, /* to be computed */ | ||
85 | .shift = 0, /* to be computed */ | ||
86 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 84 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
87 | }; | 85 | }; |
88 | 86 | ||
@@ -105,10 +103,8 @@ static void spear_clocksource_init(void) | |||
105 | val |= CTRL_ENABLE ; | 103 | val |= CTRL_ENABLE ; |
106 | writew(val, gpt_base + CR(CLKSRC)); | 104 | writew(val, gpt_base + CR(CLKSRC)); |
107 | 105 | ||
108 | clocksource_calc_mult_shift(&clksrc, tick_rate, SPEAR_MIN_RANGE); | ||
109 | |||
110 | /* register the clocksource */ | 106 | /* register the clocksource */ |
111 | clocksource_register(&clksrc); | 107 | clocksource_register_hz(&clksrc, tick_rate); |
112 | } | 108 | } |
113 | 109 | ||
114 | static struct clock_event_device clkevt = { | 110 | static struct clock_event_device clkevt = { |
diff --git a/arch/arm/plat-stmp3xxx/clock.c b/arch/arm/plat-stmp3xxx/clock.c index e593a2a801c6..2e712e17ce72 100644 --- a/arch/arm/plat-stmp3xxx/clock.c +++ b/arch/arm/plat-stmp3xxx/clock.c | |||
@@ -25,9 +25,9 @@ | |||
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
28 | #include <linux/clkdev.h> | ||
28 | 29 | ||
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
30 | #include <asm/clkdev.h> | ||
31 | #include <mach/platform.h> | 31 | #include <mach/platform.h> |
32 | #include <mach/regs-clkctrl.h> | 32 | #include <mach/regs-clkctrl.h> |
33 | 33 | ||
diff --git a/arch/arm/plat-stmp3xxx/timer.c b/arch/arm/plat-stmp3xxx/timer.c index 063c7bc0e740..c395630a6edc 100644 --- a/arch/arm/plat-stmp3xxx/timer.c +++ b/arch/arm/plat-stmp3xxx/timer.c | |||
@@ -89,7 +89,6 @@ static struct clocksource cksrc_stmp3xxx = { | |||
89 | .rating = 250, | 89 | .rating = 250, |
90 | .read = stmp3xxx_clock_read, | 90 | .read = stmp3xxx_clock_read, |
91 | .mask = CLOCKSOURCE_MASK(16), | 91 | .mask = CLOCKSOURCE_MASK(16), |
92 | .shift = 10, | ||
93 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 92 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
94 | }; | 93 | }; |
95 | 94 | ||
@@ -106,8 +105,6 @@ static struct irqaction stmp3xxx_timer_irq = { | |||
106 | */ | 105 | */ |
107 | static void __init stmp3xxx_init_timer(void) | 106 | static void __init stmp3xxx_init_timer(void) |
108 | { | 107 | { |
109 | cksrc_stmp3xxx.mult = clocksource_hz2mult(CLOCK_TICK_RATE, | ||
110 | cksrc_stmp3xxx.shift); | ||
111 | ckevt_timrot.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, | 108 | ckevt_timrot.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, |
112 | ckevt_timrot.shift); | 109 | ckevt_timrot.shift); |
113 | ckevt_timrot.min_delta_ns = clockevent_delta2ns(2, &ckevt_timrot); | 110 | ckevt_timrot.min_delta_ns = clockevent_delta2ns(2, &ckevt_timrot); |
@@ -140,7 +137,7 @@ static void __init stmp3xxx_init_timer(void) | |||
140 | 137 | ||
141 | setup_irq(IRQ_TIMER0, &stmp3xxx_timer_irq); | 138 | setup_irq(IRQ_TIMER0, &stmp3xxx_timer_irq); |
142 | 139 | ||
143 | clocksource_register(&cksrc_stmp3xxx); | 140 | clocksource_register_hz(&cksrc_stmp3xxx, CLOCK_TICK_RATE); |
144 | clockevents_register_device(&ckevt_timrot); | 141 | clockevents_register_device(&ckevt_timrot); |
145 | } | 142 | } |
146 | 143 | ||
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile index 5cf88e8427b1..16dde0819934 100644 --- a/arch/arm/plat-versatile/Makefile +++ b/arch/arm/plat-versatile/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | obj-y := clock.o | 1 | obj-y := clock.o |
2 | obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o | 2 | ifneq ($(CONFIG_ARCH_INTEGRATOR),y) |
3 | obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o | 3 | obj-y += sched-clock.o |
4 | obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o | 4 | endif |
5 | ifeq ($(CONFIG_LEDS_CLASS),y) | 5 | ifeq ($(CONFIG_LEDS_CLASS),y) |
6 | obj-$(CONFIG_ARCH_REALVIEW) += leds.o | 6 | obj-$(CONFIG_ARCH_REALVIEW) += leds.o |
7 | obj-$(CONFIG_ARCH_VERSATILE) += leds.o | 7 | obj-$(CONFIG_ARCH_VERSATILE) += leds.o |
diff --git a/arch/arm/plat-versatile/include/plat/sched_clock.h b/arch/arm/plat-versatile/include/plat/sched_clock.h new file mode 100644 index 000000000000..5c3e4fc9fa0c --- /dev/null +++ b/arch/arm/plat-versatile/include/plat/sched_clock.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef ARM_PLAT_SCHED_CLOCK_H | ||
2 | #define ARM_PLAT_SCHED_CLOCK_H | ||
3 | |||
4 | void versatile_sched_clock_init(void __iomem *, unsigned long); | ||
5 | |||
6 | #endif | ||
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c index 9768cf7e83d7..3d6a4c292cab 100644 --- a/arch/arm/plat-versatile/sched-clock.c +++ b/arch/arm/plat-versatile/sched-clock.c | |||
@@ -18,36 +18,41 @@ | |||
18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | #include <linux/cnt32_to_63.h> | ||
22 | #include <linux/io.h> | 21 | #include <linux/io.h> |
23 | #include <asm/div64.h> | 22 | #include <linux/sched.h> |
24 | 23 | ||
25 | #include <mach/hardware.h> | 24 | #include <asm/sched_clock.h> |
26 | #include <mach/platform.h> | 25 | #include <plat/sched_clock.h> |
27 | 26 | ||
28 | #ifdef VERSATILE_SYS_BASE | 27 | static DEFINE_CLOCK_DATA(cd); |
29 | #define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) | 28 | static void __iomem *ctr; |
30 | #endif | ||
31 | |||
32 | #ifdef REALVIEW_SYS_BASE | ||
33 | #define REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) | ||
34 | #endif | ||
35 | 29 | ||
36 | /* | 30 | /* |
37 | * This is the Realview and Versatile sched_clock implementation. This | 31 | * Constants generated by clocks_calc_mult_shift(m, s, 24MHz, NSEC_PER_SEC, 60). |
38 | * has a resolution of 41.7ns, and a maximum value of about 35583 days. | 32 | * This gives a resolution of about 41ns and a wrap period of about 178s. |
39 | * | ||
40 | * The return value is guaranteed to be monotonic in that range as | ||
41 | * long as there is always less than 89 seconds between successive | ||
42 | * calls to this function. | ||
43 | */ | 33 | */ |
44 | unsigned long long sched_clock(void) | 34 | #define SC_MULT 2796202667u |
35 | #define SC_SHIFT 26 | ||
36 | |||
37 | unsigned long long notrace sched_clock(void) | ||
45 | { | 38 | { |
46 | unsigned long long v = cnt32_to_63(readl(REFCOUNTER)); | 39 | if (ctr) { |
40 | u32 cyc = readl(ctr); | ||
41 | return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, | ||
42 | SC_MULT, SC_SHIFT); | ||
43 | } else | ||
44 | return 0; | ||
45 | } | ||
47 | 46 | ||
48 | /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */ | 47 | static void notrace versatile_update_sched_clock(void) |
49 | v *= 125<<1; | 48 | { |
50 | do_div(v, 3<<1); | 49 | u32 cyc = readl(ctr); |
50 | update_sched_clock(&cd, cyc, (u32)~0); | ||
51 | } | ||
51 | 52 | ||
52 | return v; | 53 | void __init versatile_sched_clock_init(void __iomem *reg, unsigned long rate) |
54 | { | ||
55 | ctr = reg; | ||
56 | init_fixed_sched_clock(&cd, versatile_update_sched_clock, | ||
57 | 32, rate, SC_MULT, SC_SHIFT); | ||
53 | } | 58 | } |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 8063a322c790..0797cb528b46 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -10,9 +10,12 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/cpu.h> | ||
13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/notifier.h> | ||
14 | #include <linux/signal.h> | 16 | #include <linux/signal.h> |
15 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
18 | #include <linux/smp.h> | ||
16 | #include <linux/init.h> | 19 | #include <linux/init.h> |
17 | 20 | ||
18 | #include <asm/cputype.h> | 21 | #include <asm/cputype.h> |
@@ -484,7 +487,24 @@ void vfp_flush_hwstate(struct thread_info *thread) | |||
484 | put_cpu(); | 487 | put_cpu(); |
485 | } | 488 | } |
486 | 489 | ||
487 | #include <linux/smp.h> | 490 | /* |
491 | * VFP hardware can lose all context when a CPU goes offline. | ||
492 | * Safely clear our held state when a CPU has been killed, and | ||
493 | * re-enable access to VFP when the CPU comes back online. | ||
494 | * | ||
495 | * Both CPU_DYING and CPU_STARTING are called on the CPU which | ||
496 | * is being offlined/onlined. | ||
497 | */ | ||
498 | static int vfp_hotplug(struct notifier_block *b, unsigned long action, | ||
499 | void *hcpu) | ||
500 | { | ||
501 | if (action == CPU_DYING || action == CPU_DYING_FROZEN) { | ||
502 | unsigned int cpu = (long)hcpu; | ||
503 | last_VFP_context[cpu] = NULL; | ||
504 | } else if (action == CPU_STARTING || action == CPU_STARTING_FROZEN) | ||
505 | vfp_enable(NULL); | ||
506 | return NOTIFY_OK; | ||
507 | } | ||
488 | 508 | ||
489 | /* | 509 | /* |
490 | * VFP support code initialisation. | 510 | * VFP support code initialisation. |
@@ -514,6 +534,8 @@ static int __init vfp_init(void) | |||
514 | else if (vfpsid & FPSID_NODOUBLE) { | 534 | else if (vfpsid & FPSID_NODOUBLE) { |
515 | printk("no double precision support\n"); | 535 | printk("no double precision support\n"); |
516 | } else { | 536 | } else { |
537 | hotcpu_notifier(vfp_hotplug, 0); | ||
538 | |||
517 | smp_call_function(vfp_enable, NULL, 1); | 539 | smp_call_function(vfp_enable, NULL, 1); |
518 | 540 | ||
519 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ | 541 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index ef514c42eb4a..e9e71120040c 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | config SUPERH | 1 | config SUPERH |
2 | def_bool y | 2 | def_bool y |
3 | select EMBEDDED | 3 | select EMBEDDED |
4 | select HAVE_CLK | 4 | select CLKDEV_LOOKUP |
5 | select HAVE_IDE if HAS_IOPORT | 5 | select HAVE_IDE if HAS_IOPORT |
6 | select HAVE_MEMBLOCK | 6 | select HAVE_MEMBLOCK |
7 | select HAVE_OPROFILE | 7 | select HAVE_OPROFILE |
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c index a5ecfbacaf36..87618c91d178 100644 --- a/arch/sh/boards/mach-highlander/setup.c +++ b/arch/sh/boards/mach-highlander/setup.c | |||
@@ -24,10 +24,10 @@ | |||
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/usb/r8a66597.h> | 25 | #include <linux/usb/r8a66597.h> |
26 | #include <linux/usb/m66592.h> | 26 | #include <linux/usb/m66592.h> |
27 | #include <linux/clkdev.h> | ||
27 | #include <net/ax88796.h> | 28 | #include <net/ax88796.h> |
28 | #include <asm/machvec.h> | 29 | #include <asm/machvec.h> |
29 | #include <mach/highlander.h> | 30 | #include <mach/highlander.h> |
30 | #include <asm/clkdev.h> | ||
31 | #include <asm/clock.h> | 31 | #include <asm/clock.h> |
32 | #include <asm/heartbeat.h> | 32 | #include <asm/heartbeat.h> |
33 | #include <asm/io.h> | 33 | #include <asm/io.h> |
diff --git a/arch/sh/include/asm/clkdev.h b/arch/sh/include/asm/clkdev.h index 5645f358128b..6ba91868201c 100644 --- a/arch/sh/include/asm/clkdev.h +++ b/arch/sh/include/asm/clkdev.h | |||
@@ -1,9 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh/include/asm/clkdev.h | 2 | * Copyright (C) 2010 Paul Mundt <lethal@linux-sh.org> |
3 | * | ||
4 | * Cloned from arch/arm/include/asm/clkdev.h: | ||
5 | * | ||
6 | * Copyright (C) 2008 Russell King. | ||
7 | * | 3 | * |
8 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
@@ -11,25 +7,25 @@ | |||
11 | * | 7 | * |
12 | * Helper for the clk API to assist looking up a struct clk. | 8 | * Helper for the clk API to assist looking up a struct clk. |
13 | */ | 9 | */ |
14 | #ifndef __ASM_CLKDEV_H | ||
15 | #define __ASM_CLKDEV_H | ||
16 | 10 | ||
17 | struct clk; | 11 | #ifndef __CLKDEV__H_ |
12 | #define __CLKDEV__H_ | ||
18 | 13 | ||
19 | struct clk_lookup { | 14 | #include <linux/bootmem.h> |
20 | struct list_head node; | 15 | #include <linux/mm.h> |
21 | const char *dev_id; | 16 | #include <linux/slab.h> |
22 | const char *con_id; | ||
23 | struct clk *clk; | ||
24 | }; | ||
25 | 17 | ||
26 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | 18 | #include <asm/clock.h> |
27 | const char *dev_fmt, ...); | ||
28 | 19 | ||
29 | void clkdev_add(struct clk_lookup *cl); | 20 | static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size) |
30 | void clkdev_drop(struct clk_lookup *cl); | 21 | { |
22 | if (!slab_is_available()) | ||
23 | return alloc_bootmem_low_pages(size); | ||
24 | else | ||
25 | return kzalloc(size, GFP_KERNEL); | ||
26 | } | ||
31 | 27 | ||
32 | void clkdev_add_table(struct clk_lookup *, size_t); | 28 | #define __clk_put(clk) |
33 | int clk_add_alias(const char *, const char *, char *, struct device *); | 29 | #define __clk_get(clk) ({ 1; }) |
34 | 30 | ||
35 | #endif | 31 | #endif /* __CLKDEV_H__ */ |
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index ff80227b02d8..77f7ae1d4647 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile | |||
@@ -11,7 +11,7 @@ endif | |||
11 | 11 | ||
12 | CFLAGS_REMOVE_return_address.o = -pg | 12 | CFLAGS_REMOVE_return_address.o = -pg |
13 | 13 | ||
14 | obj-y := clkdev.o debugtraps.o dma-nommu.o dumpstack.o \ | 14 | obj-y := debugtraps.o dma-nommu.o dumpstack.o \ |
15 | idle.o io.o irq.o irq_$(BITS).o kdebugfs.o \ | 15 | idle.o io.o irq.o irq_$(BITS).o kdebugfs.o \ |
16 | machvec.o nmi_debug.o process.o \ | 16 | machvec.o nmi_debug.o process.o \ |
17 | process_$(BITS).o ptrace.o ptrace_$(BITS).o \ | 17 | process_$(BITS).o ptrace.o ptrace_$(BITS).o \ |
diff --git a/arch/sh/kernel/clkdev.c b/arch/sh/kernel/clkdev.c deleted file mode 100644 index 1f800ef4a735..000000000000 --- a/arch/sh/kernel/clkdev.c +++ /dev/null | |||
@@ -1,171 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/clkdev.c | ||
3 | * | ||
4 | * Cloned from arch/arm/common/clkdev.c: | ||
5 | * | ||
6 | * Copyright (C) 2008 Russell King. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * Helper for the clk API to assist looking up a struct clk. | ||
13 | */ | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/errno.h> | ||
19 | #include <linux/err.h> | ||
20 | #include <linux/string.h> | ||
21 | #include <linux/mutex.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/slab.h> | ||
24 | #include <linux/bootmem.h> | ||
25 | #include <linux/mm.h> | ||
26 | #include <asm/clock.h> | ||
27 | #include <asm/clkdev.h> | ||
28 | |||
29 | static LIST_HEAD(clocks); | ||
30 | static DEFINE_MUTEX(clocks_mutex); | ||
31 | |||
32 | /* | ||
33 | * Find the correct struct clk for the device and connection ID. | ||
34 | * We do slightly fuzzy matching here: | ||
35 | * An entry with a NULL ID is assumed to be a wildcard. | ||
36 | * If an entry has a device ID, it must match | ||
37 | * If an entry has a connection ID, it must match | ||
38 | * Then we take the most specific entry - with the following | ||
39 | * order of precedence: dev+con > dev only > con only. | ||
40 | */ | ||
41 | static struct clk *clk_find(const char *dev_id, const char *con_id) | ||
42 | { | ||
43 | struct clk_lookup *p; | ||
44 | struct clk *clk = NULL; | ||
45 | int match, best = 0; | ||
46 | |||
47 | list_for_each_entry(p, &clocks, node) { | ||
48 | match = 0; | ||
49 | if (p->dev_id) { | ||
50 | if (!dev_id || strcmp(p->dev_id, dev_id)) | ||
51 | continue; | ||
52 | match += 2; | ||
53 | } | ||
54 | if (p->con_id) { | ||
55 | if (!con_id || strcmp(p->con_id, con_id)) | ||
56 | continue; | ||
57 | match += 1; | ||
58 | } | ||
59 | if (match == 0) | ||
60 | continue; | ||
61 | |||
62 | if (match > best) { | ||
63 | clk = p->clk; | ||
64 | best = match; | ||
65 | } | ||
66 | } | ||
67 | return clk; | ||
68 | } | ||
69 | |||
70 | struct clk *clk_get_sys(const char *dev_id, const char *con_id) | ||
71 | { | ||
72 | struct clk *clk; | ||
73 | |||
74 | mutex_lock(&clocks_mutex); | ||
75 | clk = clk_find(dev_id, con_id); | ||
76 | mutex_unlock(&clocks_mutex); | ||
77 | |||
78 | return clk ? clk : ERR_PTR(-ENOENT); | ||
79 | } | ||
80 | EXPORT_SYMBOL(clk_get_sys); | ||
81 | |||
82 | void clkdev_add(struct clk_lookup *cl) | ||
83 | { | ||
84 | mutex_lock(&clocks_mutex); | ||
85 | list_add_tail(&cl->node, &clocks); | ||
86 | mutex_unlock(&clocks_mutex); | ||
87 | } | ||
88 | EXPORT_SYMBOL(clkdev_add); | ||
89 | |||
90 | void __init clkdev_add_table(struct clk_lookup *cl, size_t num) | ||
91 | { | ||
92 | mutex_lock(&clocks_mutex); | ||
93 | while (num--) { | ||
94 | list_add_tail(&cl->node, &clocks); | ||
95 | cl++; | ||
96 | } | ||
97 | mutex_unlock(&clocks_mutex); | ||
98 | } | ||
99 | |||
100 | #define MAX_DEV_ID 20 | ||
101 | #define MAX_CON_ID 16 | ||
102 | |||
103 | struct clk_lookup_alloc { | ||
104 | struct clk_lookup cl; | ||
105 | char dev_id[MAX_DEV_ID]; | ||
106 | char con_id[MAX_CON_ID]; | ||
107 | }; | ||
108 | |||
109 | struct clk_lookup * __init_refok | ||
110 | clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...) | ||
111 | { | ||
112 | struct clk_lookup_alloc *cla; | ||
113 | |||
114 | if (!slab_is_available()) | ||
115 | cla = alloc_bootmem_low_pages(sizeof(*cla)); | ||
116 | else | ||
117 | cla = kzalloc(sizeof(*cla), GFP_KERNEL); | ||
118 | |||
119 | if (!cla) | ||
120 | return NULL; | ||
121 | |||
122 | cla->cl.clk = clk; | ||
123 | if (con_id) { | ||
124 | strlcpy(cla->con_id, con_id, sizeof(cla->con_id)); | ||
125 | cla->cl.con_id = cla->con_id; | ||
126 | } | ||
127 | |||
128 | if (dev_fmt) { | ||
129 | va_list ap; | ||
130 | |||
131 | va_start(ap, dev_fmt); | ||
132 | vscnprintf(cla->dev_id, sizeof(cla->dev_id), dev_fmt, ap); | ||
133 | cla->cl.dev_id = cla->dev_id; | ||
134 | va_end(ap); | ||
135 | } | ||
136 | |||
137 | return &cla->cl; | ||
138 | } | ||
139 | EXPORT_SYMBOL(clkdev_alloc); | ||
140 | |||
141 | int clk_add_alias(const char *alias, const char *alias_dev_name, char *id, | ||
142 | struct device *dev) | ||
143 | { | ||
144 | struct clk *r = clk_get(dev, id); | ||
145 | struct clk_lookup *l; | ||
146 | |||
147 | if (IS_ERR(r)) | ||
148 | return PTR_ERR(r); | ||
149 | |||
150 | l = clkdev_alloc(r, alias, alias_dev_name); | ||
151 | clk_put(r); | ||
152 | if (!l) | ||
153 | return -ENODEV; | ||
154 | clkdev_add(l); | ||
155 | return 0; | ||
156 | } | ||
157 | EXPORT_SYMBOL(clk_add_alias); | ||
158 | |||
159 | /* | ||
160 | * clkdev_drop - remove a clock dynamically allocated | ||
161 | */ | ||
162 | void clkdev_drop(struct clk_lookup *cl) | ||
163 | { | ||
164 | struct clk_lookup_alloc *cla = container_of(cl, struct clk_lookup_alloc, cl); | ||
165 | |||
166 | mutex_lock(&clocks_mutex); | ||
167 | list_del(&cl->node); | ||
168 | mutex_unlock(&clocks_mutex); | ||
169 | kfree(cla); | ||
170 | } | ||
171 | EXPORT_SYMBOL(clkdev_drop); | ||
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c index e2f63d68da51..dd0e0f211359 100644 --- a/arch/sh/kernel/cpu/clock-cpg.c +++ b/arch/sh/kernel/cpu/clock-cpg.c | |||
@@ -2,7 +2,7 @@ | |||
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <linux/slab.h> | 3 | #include <linux/slab.h> |
4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
5 | #include <asm/clkdev.h> | 5 | #include <linux/clkdev.h> |
6 | #include <asm/clock.h> | 6 | #include <asm/clock.h> |
7 | 7 | ||
8 | static struct clk master_clk = { | 8 | static struct clk master_clk = { |
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index 50f887dda565..4187cf4fe185 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c | |||
@@ -48,20 +48,4 @@ int __init clk_init(void) | |||
48 | return ret; | 48 | return ret; |
49 | } | 49 | } |
50 | 50 | ||
51 | /* | ||
52 | * Returns a clock. Note that we first try to use device id on the bus | ||
53 | * and clock name. If this fails, we try to use clock name only. | ||
54 | */ | ||
55 | struct clk *clk_get(struct device *dev, const char *con_id) | ||
56 | { | ||
57 | const char *dev_id = dev ? dev_name(dev) : NULL; | ||
58 | |||
59 | return clk_get_sys(dev_id, con_id); | ||
60 | } | ||
61 | EXPORT_SYMBOL_GPL(clk_get); | ||
62 | |||
63 | void clk_put(struct clk *clk) | ||
64 | { | ||
65 | } | ||
66 | EXPORT_SYMBOL_GPL(clk_put); | ||
67 | 51 | ||
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c index 6282a839e08e..3f6f8e98635c 100644 --- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/clkdev.h> | 16 | #include <linux/clkdev.h> |
17 | #include <asm/clock.h> | 17 | #include <asm/clock.h> |
18 | #include <asm/freq.h> | 18 | #include <asm/freq.h> |
19 | 19 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c index 71291ae201b9..93c646072c1b 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <asm/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <asm/clock.h> | 25 | #include <asm/clock.h> |
26 | 26 | ||
27 | /* SH7343 registers */ | 27 | /* SH7343 registers */ |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c index 7ce5bbcd4084..049dc0628ccc 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <asm/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <asm/clock.h> | 25 | #include <asm/clock.h> |
26 | 26 | ||
27 | /* SH7366 registers */ | 27 | /* SH7366 registers */ |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c index 2030f3d9fac7..9d23a36f0647 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <asm/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <asm/clock.h> | 25 | #include <asm/clock.h> |
26 | #include <asm/hwblk.h> | 26 | #include <asm/hwblk.h> |
27 | #include <cpu/sh7722.h> | 27 | #include <cpu/sh7722.h> |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c index d3938f0d3702..55493cd5bd8f 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <asm/clkdev.h> | 25 | #include <linux/clkdev.h> |
26 | #include <asm/clock.h> | 26 | #include <asm/clock.h> |
27 | #include <asm/hwblk.h> | 27 | #include <asm/hwblk.h> |
28 | #include <cpu/sh7723.h> | 28 | #include <cpu/sh7723.h> |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c index 271c0b325a9a..d08fa953c88b 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <asm/clkdev.h> | 25 | #include <linux/clkdev.h> |
26 | #include <asm/clock.h> | 26 | #include <asm/clock.h> |
27 | #include <asm/hwblk.h> | 27 | #include <asm/hwblk.h> |
28 | #include <cpu/sh7724.h> | 28 | #include <cpu/sh7724.h> |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c index ce39a2ae8c6c..e073e3eb4c3d 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/clkdev.h> | 15 | #include <linux/clkdev.h> |
16 | #include <asm/clock.h> | 16 | #include <asm/clock.h> |
17 | #include <asm/freq.h> | 17 | #include <asm/freq.h> |
18 | 18 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c index 1f1df48008cd..599630fc4d3b 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7763.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7763.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/clkdev.h> | 16 | #include <linux/clkdev.h> |
17 | #include <asm/clock.h> | 17 | #include <asm/clock.h> |
18 | #include <asm/freq.h> | 18 | #include <asm/freq.h> |
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c index 62d706350060..8894926479a6 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7780.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7780.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/clkdev.h> | 15 | #include <linux/clkdev.h> |
16 | #include <asm/clock.h> | 16 | #include <asm/clock.h> |
17 | #include <asm/freq.h> | 17 | #include <asm/freq.h> |
18 | #include <asm/io.h> | 18 | #include <asm/io.h> |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c index c3e458aaa2b7..2d960247f3eb 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/cpufreq.h> | 16 | #include <linux/cpufreq.h> |
17 | #include <asm/clkdev.h> | 17 | #include <linux/clkdev.h> |
18 | #include <asm/clock.h> | 18 | #include <asm/clock.h> |
19 | #include <asm/freq.h> | 19 | #include <asm/freq.h> |
20 | #include <cpu/sh7785.h> | 20 | #include <cpu/sh7785.h> |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c index 597c9fbe49c6..42e403be9076 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/clkdev.h> | 16 | #include <linux/clkdev.h> |
17 | #include <asm/clock.h> | 17 | #include <asm/clock.h> |
18 | #include <asm/freq.h> | 18 | #include <asm/freq.h> |
19 | 19 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c index 4f70df6b6169..1afdb93b8ccb 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <asm/clkdev.h> | 17 | #include <linux/clkdev.h> |
18 | #include <asm/clock.h> | 18 | #include <asm/clock.h> |
19 | #include <asm/freq.h> | 19 | #include <asm/freq.h> |
20 | 20 | ||
diff --git a/drivers/Kconfig b/drivers/Kconfig index a2b902f4d437..3d93b3a3d630 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig | |||
@@ -111,4 +111,6 @@ source "drivers/xen/Kconfig" | |||
111 | source "drivers/staging/Kconfig" | 111 | source "drivers/staging/Kconfig" |
112 | 112 | ||
113 | source "drivers/platform/Kconfig" | 113 | source "drivers/platform/Kconfig" |
114 | |||
115 | source "drivers/clk/Kconfig" | ||
114 | endmenu | 116 | endmenu |
diff --git a/drivers/Makefile b/drivers/Makefile index f3ebb30f1b7f..bf15ce7493d2 100644 --- a/drivers/Makefile +++ b/drivers/Makefile | |||
@@ -115,3 +115,5 @@ obj-$(CONFIG_VLYNQ) += vlynq/ | |||
115 | obj-$(CONFIG_STAGING) += staging/ | 115 | obj-$(CONFIG_STAGING) += staging/ |
116 | obj-y += platform/ | 116 | obj-y += platform/ |
117 | obj-y += ieee802154/ | 117 | obj-y += ieee802154/ |
118 | #common clk code | ||
119 | obj-y += clk/ | ||
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 2737b9752205..e7df019d29d4 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -147,6 +147,39 @@ static void amba_put_disable_pclk(struct amba_device *pcdev) | |||
147 | clk_put(pclk); | 147 | clk_put(pclk); |
148 | } | 148 | } |
149 | 149 | ||
150 | static int amba_get_enable_vcore(struct amba_device *pcdev) | ||
151 | { | ||
152 | struct regulator *vcore = regulator_get(&pcdev->dev, "vcore"); | ||
153 | int ret; | ||
154 | |||
155 | pcdev->vcore = vcore; | ||
156 | |||
157 | if (IS_ERR(vcore)) { | ||
158 | /* It is OK not to supply a vcore regulator */ | ||
159 | if (PTR_ERR(vcore) == -ENODEV) | ||
160 | return 0; | ||
161 | return PTR_ERR(vcore); | ||
162 | } | ||
163 | |||
164 | ret = regulator_enable(vcore); | ||
165 | if (ret) { | ||
166 | regulator_put(vcore); | ||
167 | pcdev->vcore = ERR_PTR(-ENODEV); | ||
168 | } | ||
169 | |||
170 | return ret; | ||
171 | } | ||
172 | |||
173 | static void amba_put_disable_vcore(struct amba_device *pcdev) | ||
174 | { | ||
175 | struct regulator *vcore = pcdev->vcore; | ||
176 | |||
177 | if (!IS_ERR(vcore)) { | ||
178 | regulator_disable(vcore); | ||
179 | regulator_put(vcore); | ||
180 | } | ||
181 | } | ||
182 | |||
150 | /* | 183 | /* |
151 | * These are the device model conversion veneers; they convert the | 184 | * These are the device model conversion veneers; they convert the |
152 | * device model structures to our more specific structures. | 185 | * device model structures to our more specific structures. |
@@ -159,6 +192,10 @@ static int amba_probe(struct device *dev) | |||
159 | int ret; | 192 | int ret; |
160 | 193 | ||
161 | do { | 194 | do { |
195 | ret = amba_get_enable_vcore(pcdev); | ||
196 | if (ret) | ||
197 | break; | ||
198 | |||
162 | ret = amba_get_enable_pclk(pcdev); | 199 | ret = amba_get_enable_pclk(pcdev); |
163 | if (ret) | 200 | if (ret) |
164 | break; | 201 | break; |
@@ -168,6 +205,7 @@ static int amba_probe(struct device *dev) | |||
168 | break; | 205 | break; |
169 | 206 | ||
170 | amba_put_disable_pclk(pcdev); | 207 | amba_put_disable_pclk(pcdev); |
208 | amba_put_disable_vcore(pcdev); | ||
171 | } while (0); | 209 | } while (0); |
172 | 210 | ||
173 | return ret; | 211 | return ret; |
@@ -180,6 +218,7 @@ static int amba_remove(struct device *dev) | |||
180 | int ret = drv->remove(pcdev); | 218 | int ret = drv->remove(pcdev); |
181 | 219 | ||
182 | amba_put_disable_pclk(pcdev); | 220 | amba_put_disable_pclk(pcdev); |
221 | amba_put_disable_vcore(pcdev); | ||
183 | 222 | ||
184 | return ret; | 223 | return ret; |
185 | } | 224 | } |
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig new file mode 100644 index 000000000000..4168c8896e16 --- /dev/null +++ b/drivers/clk/Kconfig | |||
@@ -0,0 +1,4 @@ | |||
1 | |||
2 | config CLKDEV_LOOKUP | ||
3 | bool | ||
4 | select HAVE_CLK | ||
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile new file mode 100644 index 000000000000..07613fa172c9 --- /dev/null +++ b/drivers/clk/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | |||
2 | obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o | ||
diff --git a/arch/arm/common/clkdev.c b/drivers/clk/clkdev.c index e2b2bb66e094..0fc0a79852de 100644 --- a/arch/arm/common/clkdev.c +++ b/drivers/clk/clkdev.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/common/clkdev.c | 2 | * drivers/clk/clkdev.c |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Russell King. | 4 | * Copyright (C) 2008 Russell King. |
5 | * | 5 | * |
@@ -18,10 +18,7 @@ | |||
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include <linux/mutex.h> | 19 | #include <linux/mutex.h> |
20 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
21 | #include <linux/slab.h> | 21 | #include <linux/clkdev.h> |
22 | |||
23 | #include <asm/clkdev.h> | ||
24 | #include <mach/clkdev.h> | ||
25 | 22 | ||
26 | static LIST_HEAD(clocks); | 23 | static LIST_HEAD(clocks); |
27 | static DEFINE_MUTEX(clocks_mutex); | 24 | static DEFINE_MUTEX(clocks_mutex); |
@@ -120,12 +117,12 @@ struct clk_lookup_alloc { | |||
120 | char con_id[MAX_CON_ID]; | 117 | char con_id[MAX_CON_ID]; |
121 | }; | 118 | }; |
122 | 119 | ||
123 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | 120 | struct clk_lookup * __init_refok |
124 | const char *dev_fmt, ...) | 121 | clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...) |
125 | { | 122 | { |
126 | struct clk_lookup_alloc *cla; | 123 | struct clk_lookup_alloc *cla; |
127 | 124 | ||
128 | cla = kzalloc(sizeof(*cla), GFP_KERNEL); | 125 | cla = __clkdev_alloc(sizeof(*cla)); |
129 | if (!cla) | 126 | if (!cla) |
130 | return NULL; | 127 | return NULL; |
131 | 128 | ||
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index d0602dd5d1b2..d5a5d4d9c19b 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -273,50 +273,6 @@ struct sdma_channel { | |||
273 | #define MXC_SDMA_MIN_PRIORITY 1 | 273 | #define MXC_SDMA_MIN_PRIORITY 1 |
274 | #define MXC_SDMA_MAX_PRIORITY 7 | 274 | #define MXC_SDMA_MAX_PRIORITY 7 |
275 | 275 | ||
276 | /** | ||
277 | * struct sdma_script_start_addrs - SDMA script start pointers | ||
278 | * | ||
279 | * start addresses of the different functions in the physical | ||
280 | * address space of the SDMA engine. | ||
281 | */ | ||
282 | struct sdma_script_start_addrs { | ||
283 | u32 ap_2_ap_addr; | ||
284 | u32 ap_2_bp_addr; | ||
285 | u32 ap_2_ap_fixed_addr; | ||
286 | u32 bp_2_ap_addr; | ||
287 | u32 loopback_on_dsp_side_addr; | ||
288 | u32 mcu_interrupt_only_addr; | ||
289 | u32 firi_2_per_addr; | ||
290 | u32 firi_2_mcu_addr; | ||
291 | u32 per_2_firi_addr; | ||
292 | u32 mcu_2_firi_addr; | ||
293 | u32 uart_2_per_addr; | ||
294 | u32 uart_2_mcu_addr; | ||
295 | u32 per_2_app_addr; | ||
296 | u32 mcu_2_app_addr; | ||
297 | u32 per_2_per_addr; | ||
298 | u32 uartsh_2_per_addr; | ||
299 | u32 uartsh_2_mcu_addr; | ||
300 | u32 per_2_shp_addr; | ||
301 | u32 mcu_2_shp_addr; | ||
302 | u32 ata_2_mcu_addr; | ||
303 | u32 mcu_2_ata_addr; | ||
304 | u32 app_2_per_addr; | ||
305 | u32 app_2_mcu_addr; | ||
306 | u32 shp_2_per_addr; | ||
307 | u32 shp_2_mcu_addr; | ||
308 | u32 mshc_2_mcu_addr; | ||
309 | u32 mcu_2_mshc_addr; | ||
310 | u32 spdif_2_mcu_addr; | ||
311 | u32 mcu_2_spdif_addr; | ||
312 | u32 asrc_2_mcu_addr; | ||
313 | u32 ext_mem_2_ipu_addr; | ||
314 | u32 descrambler_addr; | ||
315 | u32 dptc_dvfs_addr; | ||
316 | u32 utra_addr; | ||
317 | u32 ram_code_start_addr; | ||
318 | }; | ||
319 | |||
320 | #define SDMA_FIRMWARE_MAGIC 0x414d4453 | 276 | #define SDMA_FIRMWARE_MAGIC 0x414d4453 |
321 | 277 | ||
322 | /** | 278 | /** |
@@ -1127,8 +1083,74 @@ static void sdma_issue_pending(struct dma_chan *chan) | |||
1127 | */ | 1083 | */ |
1128 | } | 1084 | } |
1129 | 1085 | ||
1130 | static int __init sdma_init(struct sdma_engine *sdma, | 1086 | #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34 |
1131 | void *ram_code, int ram_code_size) | 1087 | |
1088 | static void sdma_add_scripts(struct sdma_engine *sdma, | ||
1089 | const struct sdma_script_start_addrs *addr) | ||
1090 | { | ||
1091 | s32 *addr_arr = (u32 *)addr; | ||
1092 | s32 *saddr_arr = (u32 *)sdma->script_addrs; | ||
1093 | int i; | ||
1094 | |||
1095 | for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++) | ||
1096 | if (addr_arr[i] > 0) | ||
1097 | saddr_arr[i] = addr_arr[i]; | ||
1098 | } | ||
1099 | |||
1100 | static int __init sdma_get_firmware(struct sdma_engine *sdma, | ||
1101 | const char *cpu_name, int to_version) | ||
1102 | { | ||
1103 | const struct firmware *fw; | ||
1104 | char *fwname; | ||
1105 | const struct sdma_firmware_header *header; | ||
1106 | int ret; | ||
1107 | const struct sdma_script_start_addrs *addr; | ||
1108 | unsigned short *ram_code; | ||
1109 | |||
1110 | fwname = kasprintf(GFP_KERNEL, "sdma-%s-to%d.bin", cpu_name, to_version); | ||
1111 | if (!fwname) | ||
1112 | return -ENOMEM; | ||
1113 | |||
1114 | ret = request_firmware(&fw, fwname, sdma->dev); | ||
1115 | if (ret) { | ||
1116 | kfree(fwname); | ||
1117 | return ret; | ||
1118 | } | ||
1119 | kfree(fwname); | ||
1120 | |||
1121 | if (fw->size < sizeof(*header)) | ||
1122 | goto err_firmware; | ||
1123 | |||
1124 | header = (struct sdma_firmware_header *)fw->data; | ||
1125 | |||
1126 | if (header->magic != SDMA_FIRMWARE_MAGIC) | ||
1127 | goto err_firmware; | ||
1128 | if (header->ram_code_start + header->ram_code_size > fw->size) | ||
1129 | goto err_firmware; | ||
1130 | |||
1131 | addr = (void *)header + header->script_addrs_start; | ||
1132 | ram_code = (void *)header + header->ram_code_start; | ||
1133 | |||
1134 | clk_enable(sdma->clk); | ||
1135 | /* download the RAM image for SDMA */ | ||
1136 | sdma_load_script(sdma, ram_code, | ||
1137 | header->ram_code_size, | ||
1138 | sdma->script_addrs->ram_code_start_addr); | ||
1139 | clk_disable(sdma->clk); | ||
1140 | |||
1141 | sdma_add_scripts(sdma, addr); | ||
1142 | |||
1143 | dev_info(sdma->dev, "loaded firmware %d.%d\n", | ||
1144 | header->version_major, | ||
1145 | header->version_minor); | ||
1146 | |||
1147 | err_firmware: | ||
1148 | release_firmware(fw); | ||
1149 | |||
1150 | return ret; | ||
1151 | } | ||
1152 | |||
1153 | static int __init sdma_init(struct sdma_engine *sdma) | ||
1132 | { | 1154 | { |
1133 | int i, ret; | 1155 | int i, ret; |
1134 | dma_addr_t ccb_phys; | 1156 | dma_addr_t ccb_phys; |
@@ -1192,11 +1214,6 @@ static int __init sdma_init(struct sdma_engine *sdma, | |||
1192 | 1214 | ||
1193 | __raw_writel(ccb_phys, sdma->regs + SDMA_H_C0PTR); | 1215 | __raw_writel(ccb_phys, sdma->regs + SDMA_H_C0PTR); |
1194 | 1216 | ||
1195 | /* download the RAM image for SDMA */ | ||
1196 | sdma_load_script(sdma, ram_code, | ||
1197 | ram_code_size, | ||
1198 | sdma->script_addrs->ram_code_start_addr); | ||
1199 | |||
1200 | /* Set bits of CONFIG register with given context switching mode */ | 1217 | /* Set bits of CONFIG register with given context switching mode */ |
1201 | __raw_writel(SDMA_H_CONFIG_CSM, sdma->regs + SDMA_H_CONFIG); | 1218 | __raw_writel(SDMA_H_CONFIG_CSM, sdma->regs + SDMA_H_CONFIG); |
1202 | 1219 | ||
@@ -1216,14 +1233,9 @@ err_dma_alloc: | |||
1216 | static int __init sdma_probe(struct platform_device *pdev) | 1233 | static int __init sdma_probe(struct platform_device *pdev) |
1217 | { | 1234 | { |
1218 | int ret; | 1235 | int ret; |
1219 | const struct firmware *fw; | ||
1220 | const struct sdma_firmware_header *header; | ||
1221 | const struct sdma_script_start_addrs *addr; | ||
1222 | int irq; | 1236 | int irq; |
1223 | unsigned short *ram_code; | ||
1224 | struct resource *iores; | 1237 | struct resource *iores; |
1225 | struct sdma_platform_data *pdata = pdev->dev.platform_data; | 1238 | struct sdma_platform_data *pdata = pdev->dev.platform_data; |
1226 | char *fwname; | ||
1227 | int i; | 1239 | int i; |
1228 | dma_cap_mask_t mask; | 1240 | dma_cap_mask_t mask; |
1229 | struct sdma_engine *sdma; | 1241 | struct sdma_engine *sdma; |
@@ -1262,38 +1274,9 @@ static int __init sdma_probe(struct platform_device *pdev) | |||
1262 | if (ret) | 1274 | if (ret) |
1263 | goto err_request_irq; | 1275 | goto err_request_irq; |
1264 | 1276 | ||
1265 | fwname = kasprintf(GFP_KERNEL, "sdma-%s-to%d.bin", | 1277 | sdma->script_addrs = kzalloc(sizeof(*sdma->script_addrs), GFP_KERNEL); |
1266 | pdata->cpu_name, pdata->to_version); | ||
1267 | if (!fwname) { | ||
1268 | ret = -ENOMEM; | ||
1269 | goto err_cputype; | ||
1270 | } | ||
1271 | |||
1272 | ret = request_firmware(&fw, fwname, &pdev->dev); | ||
1273 | if (ret) { | ||
1274 | dev_err(&pdev->dev, "request firmware \"%s\" failed with %d\n", | ||
1275 | fwname, ret); | ||
1276 | kfree(fwname); | ||
1277 | goto err_cputype; | ||
1278 | } | ||
1279 | kfree(fwname); | ||
1280 | |||
1281 | if (fw->size < sizeof(*header)) | ||
1282 | goto err_firmware; | ||
1283 | |||
1284 | header = (struct sdma_firmware_header *)fw->data; | ||
1285 | |||
1286 | if (header->magic != SDMA_FIRMWARE_MAGIC) | ||
1287 | goto err_firmware; | ||
1288 | if (header->ram_code_start + header->ram_code_size > fw->size) | ||
1289 | goto err_firmware; | ||
1290 | |||
1291 | addr = (void *)header + header->script_addrs_start; | ||
1292 | ram_code = (void *)header + header->ram_code_start; | ||
1293 | sdma->script_addrs = kmalloc(sizeof(*addr), GFP_KERNEL); | ||
1294 | if (!sdma->script_addrs) | 1278 | if (!sdma->script_addrs) |
1295 | goto err_firmware; | 1279 | goto err_alloc; |
1296 | memcpy(sdma->script_addrs, addr, sizeof(*addr)); | ||
1297 | 1280 | ||
1298 | sdma->version = pdata->sdma_version; | 1281 | sdma->version = pdata->sdma_version; |
1299 | 1282 | ||
@@ -1316,10 +1299,15 @@ static int __init sdma_probe(struct platform_device *pdev) | |||
1316 | list_add_tail(&sdmac->chan.device_node, &sdma->dma_device.channels); | 1299 | list_add_tail(&sdmac->chan.device_node, &sdma->dma_device.channels); |
1317 | } | 1300 | } |
1318 | 1301 | ||
1319 | ret = sdma_init(sdma, ram_code, header->ram_code_size); | 1302 | ret = sdma_init(sdma); |
1320 | if (ret) | 1303 | if (ret) |
1321 | goto err_init; | 1304 | goto err_init; |
1322 | 1305 | ||
1306 | if (pdata->script_addrs) | ||
1307 | sdma_add_scripts(sdma, pdata->script_addrs); | ||
1308 | |||
1309 | sdma_get_firmware(sdma, pdata->cpu_name, pdata->to_version); | ||
1310 | |||
1323 | sdma->dma_device.dev = &pdev->dev; | 1311 | sdma->dma_device.dev = &pdev->dev; |
1324 | 1312 | ||
1325 | sdma->dma_device.device_alloc_chan_resources = sdma_alloc_chan_resources; | 1313 | sdma->dma_device.device_alloc_chan_resources = sdma_alloc_chan_resources; |
@@ -1336,10 +1324,6 @@ static int __init sdma_probe(struct platform_device *pdev) | |||
1336 | goto err_init; | 1324 | goto err_init; |
1337 | } | 1325 | } |
1338 | 1326 | ||
1339 | dev_info(&pdev->dev, "initialized (firmware %d.%d)\n", | ||
1340 | header->version_major, | ||
1341 | header->version_minor); | ||
1342 | |||
1343 | /* request channel 0. This is an internal control channel | 1327 | /* request channel 0. This is an internal control channel |
1344 | * to the SDMA engine and not available to clients. | 1328 | * to the SDMA engine and not available to clients. |
1345 | */ | 1329 | */ |
@@ -1347,15 +1331,13 @@ static int __init sdma_probe(struct platform_device *pdev) | |||
1347 | dma_cap_set(DMA_SLAVE, mask); | 1331 | dma_cap_set(DMA_SLAVE, mask); |
1348 | dma_request_channel(mask, NULL, NULL); | 1332 | dma_request_channel(mask, NULL, NULL); |
1349 | 1333 | ||
1350 | release_firmware(fw); | 1334 | dev_info(sdma->dev, "initialized\n"); |
1351 | 1335 | ||
1352 | return 0; | 1336 | return 0; |
1353 | 1337 | ||
1354 | err_init: | 1338 | err_init: |
1355 | kfree(sdma->script_addrs); | 1339 | kfree(sdma->script_addrs); |
1356 | err_firmware: | 1340 | err_alloc: |
1357 | release_firmware(fw); | ||
1358 | err_cputype: | ||
1359 | free_irq(irq, sdma); | 1341 | free_irq(irq, sdma); |
1360 | err_request_irq: | 1342 | err_request_irq: |
1361 | iounmap(sdma->regs); | 1343 | iounmap(sdma->regs); |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 3143ac795eb0..082495bb08a7 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -230,11 +230,11 @@ config GPIO_STMPE | |||
230 | This enables support for the GPIOs found on the STMPE I/O | 230 | This enables support for the GPIOs found on the STMPE I/O |
231 | Expanders. | 231 | Expanders. |
232 | 232 | ||
233 | config GPIO_TC35892 | 233 | config GPIO_TC3589X |
234 | bool "TC35892 GPIOs" | 234 | bool "TC3589X GPIOs" |
235 | depends on MFD_TC35892 | 235 | depends on MFD_TC3589X |
236 | help | 236 | help |
237 | This enables support for the GPIOs found on the TC35892 | 237 | This enables support for the GPIOs found on the TC3589X |
238 | I/O Expander. | 238 | I/O Expander. |
239 | 239 | ||
240 | config GPIO_TWL4030 | 240 | config GPIO_TWL4030 |
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index bdf3ddec0652..39bfd7a37650 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile | |||
@@ -24,7 +24,7 @@ obj-$(CONFIG_GPIO_PCF857X) += pcf857x.o | |||
24 | obj-$(CONFIG_GPIO_PCH) += pch_gpio.o | 24 | obj-$(CONFIG_GPIO_PCH) += pch_gpio.o |
25 | obj-$(CONFIG_GPIO_PL061) += pl061.o | 25 | obj-$(CONFIG_GPIO_PL061) += pl061.o |
26 | obj-$(CONFIG_GPIO_STMPE) += stmpe-gpio.o | 26 | obj-$(CONFIG_GPIO_STMPE) += stmpe-gpio.o |
27 | obj-$(CONFIG_GPIO_TC35892) += tc35892-gpio.o | 27 | obj-$(CONFIG_GPIO_TC3589X) += tc3589x-gpio.o |
28 | obj-$(CONFIG_GPIO_TIMBERDALE) += timbgpio.o | 28 | obj-$(CONFIG_GPIO_TIMBERDALE) += timbgpio.o |
29 | obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o | 29 | obj-$(CONFIG_GPIO_TWL4030) += twl4030-gpio.o |
30 | obj-$(CONFIG_GPIO_UCB1400) += ucb1400_gpio.o | 30 | obj-$(CONFIG_GPIO_UCB1400) += ucb1400_gpio.o |
diff --git a/drivers/gpio/tc35892-gpio.c b/drivers/gpio/tc35892-gpio.c deleted file mode 100644 index 7e10c935a047..000000000000 --- a/drivers/gpio/tc35892-gpio.c +++ /dev/null | |||
@@ -1,389 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | * Author: Hanumath Prasad <hanumath.prasad@stericsson.com> for ST-Ericsson | ||
6 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/gpio.h> | ||
14 | #include <linux/irq.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/mfd/tc35892.h> | ||
17 | |||
18 | /* | ||
19 | * These registers are modified under the irq bus lock and cached to avoid | ||
20 | * unnecessary writes in bus_sync_unlock. | ||
21 | */ | ||
22 | enum { REG_IBE, REG_IEV, REG_IS, REG_IE }; | ||
23 | |||
24 | #define CACHE_NR_REGS 4 | ||
25 | #define CACHE_NR_BANKS 3 | ||
26 | |||
27 | struct tc35892_gpio { | ||
28 | struct gpio_chip chip; | ||
29 | struct tc35892 *tc35892; | ||
30 | struct device *dev; | ||
31 | struct mutex irq_lock; | ||
32 | |||
33 | int irq_base; | ||
34 | |||
35 | /* Caches of interrupt control registers for bus_lock */ | ||
36 | u8 regs[CACHE_NR_REGS][CACHE_NR_BANKS]; | ||
37 | u8 oldregs[CACHE_NR_REGS][CACHE_NR_BANKS]; | ||
38 | }; | ||
39 | |||
40 | static inline struct tc35892_gpio *to_tc35892_gpio(struct gpio_chip *chip) | ||
41 | { | ||
42 | return container_of(chip, struct tc35892_gpio, chip); | ||
43 | } | ||
44 | |||
45 | static int tc35892_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
46 | { | ||
47 | struct tc35892_gpio *tc35892_gpio = to_tc35892_gpio(chip); | ||
48 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
49 | u8 reg = TC35892_GPIODATA0 + (offset / 8) * 2; | ||
50 | u8 mask = 1 << (offset % 8); | ||
51 | int ret; | ||
52 | |||
53 | ret = tc35892_reg_read(tc35892, reg); | ||
54 | if (ret < 0) | ||
55 | return ret; | ||
56 | |||
57 | return ret & mask; | ||
58 | } | ||
59 | |||
60 | static void tc35892_gpio_set(struct gpio_chip *chip, unsigned offset, int val) | ||
61 | { | ||
62 | struct tc35892_gpio *tc35892_gpio = to_tc35892_gpio(chip); | ||
63 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
64 | u8 reg = TC35892_GPIODATA0 + (offset / 8) * 2; | ||
65 | unsigned pos = offset % 8; | ||
66 | u8 data[] = {!!val << pos, 1 << pos}; | ||
67 | |||
68 | tc35892_block_write(tc35892, reg, ARRAY_SIZE(data), data); | ||
69 | } | ||
70 | |||
71 | static int tc35892_gpio_direction_output(struct gpio_chip *chip, | ||
72 | unsigned offset, int val) | ||
73 | { | ||
74 | struct tc35892_gpio *tc35892_gpio = to_tc35892_gpio(chip); | ||
75 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
76 | u8 reg = TC35892_GPIODIR0 + offset / 8; | ||
77 | unsigned pos = offset % 8; | ||
78 | |||
79 | tc35892_gpio_set(chip, offset, val); | ||
80 | |||
81 | return tc35892_set_bits(tc35892, reg, 1 << pos, 1 << pos); | ||
82 | } | ||
83 | |||
84 | static int tc35892_gpio_direction_input(struct gpio_chip *chip, | ||
85 | unsigned offset) | ||
86 | { | ||
87 | struct tc35892_gpio *tc35892_gpio = to_tc35892_gpio(chip); | ||
88 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
89 | u8 reg = TC35892_GPIODIR0 + offset / 8; | ||
90 | unsigned pos = offset % 8; | ||
91 | |||
92 | return tc35892_set_bits(tc35892, reg, 1 << pos, 0); | ||
93 | } | ||
94 | |||
95 | static int tc35892_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
96 | { | ||
97 | struct tc35892_gpio *tc35892_gpio = to_tc35892_gpio(chip); | ||
98 | |||
99 | return tc35892_gpio->irq_base + offset; | ||
100 | } | ||
101 | |||
102 | static struct gpio_chip template_chip = { | ||
103 | .label = "tc35892", | ||
104 | .owner = THIS_MODULE, | ||
105 | .direction_input = tc35892_gpio_direction_input, | ||
106 | .get = tc35892_gpio_get, | ||
107 | .direction_output = tc35892_gpio_direction_output, | ||
108 | .set = tc35892_gpio_set, | ||
109 | .to_irq = tc35892_gpio_to_irq, | ||
110 | .can_sleep = 1, | ||
111 | }; | ||
112 | |||
113 | static int tc35892_gpio_irq_set_type(unsigned int irq, unsigned int type) | ||
114 | { | ||
115 | struct tc35892_gpio *tc35892_gpio = get_irq_chip_data(irq); | ||
116 | int offset = irq - tc35892_gpio->irq_base; | ||
117 | int regoffset = offset / 8; | ||
118 | int mask = 1 << (offset % 8); | ||
119 | |||
120 | if (type == IRQ_TYPE_EDGE_BOTH) { | ||
121 | tc35892_gpio->regs[REG_IBE][regoffset] |= mask; | ||
122 | return 0; | ||
123 | } | ||
124 | |||
125 | tc35892_gpio->regs[REG_IBE][regoffset] &= ~mask; | ||
126 | |||
127 | if (type == IRQ_TYPE_LEVEL_LOW || type == IRQ_TYPE_LEVEL_HIGH) | ||
128 | tc35892_gpio->regs[REG_IS][regoffset] |= mask; | ||
129 | else | ||
130 | tc35892_gpio->regs[REG_IS][regoffset] &= ~mask; | ||
131 | |||
132 | if (type == IRQ_TYPE_EDGE_RISING || type == IRQ_TYPE_LEVEL_HIGH) | ||
133 | tc35892_gpio->regs[REG_IEV][regoffset] |= mask; | ||
134 | else | ||
135 | tc35892_gpio->regs[REG_IEV][regoffset] &= ~mask; | ||
136 | |||
137 | return 0; | ||
138 | } | ||
139 | |||
140 | static void tc35892_gpio_irq_lock(unsigned int irq) | ||
141 | { | ||
142 | struct tc35892_gpio *tc35892_gpio = get_irq_chip_data(irq); | ||
143 | |||
144 | mutex_lock(&tc35892_gpio->irq_lock); | ||
145 | } | ||
146 | |||
147 | static void tc35892_gpio_irq_sync_unlock(unsigned int irq) | ||
148 | { | ||
149 | struct tc35892_gpio *tc35892_gpio = get_irq_chip_data(irq); | ||
150 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
151 | static const u8 regmap[] = { | ||
152 | [REG_IBE] = TC35892_GPIOIBE0, | ||
153 | [REG_IEV] = TC35892_GPIOIEV0, | ||
154 | [REG_IS] = TC35892_GPIOIS0, | ||
155 | [REG_IE] = TC35892_GPIOIE0, | ||
156 | }; | ||
157 | int i, j; | ||
158 | |||
159 | for (i = 0; i < CACHE_NR_REGS; i++) { | ||
160 | for (j = 0; j < CACHE_NR_BANKS; j++) { | ||
161 | u8 old = tc35892_gpio->oldregs[i][j]; | ||
162 | u8 new = tc35892_gpio->regs[i][j]; | ||
163 | |||
164 | if (new == old) | ||
165 | continue; | ||
166 | |||
167 | tc35892_gpio->oldregs[i][j] = new; | ||
168 | tc35892_reg_write(tc35892, regmap[i] + j * 8, new); | ||
169 | } | ||
170 | } | ||
171 | |||
172 | mutex_unlock(&tc35892_gpio->irq_lock); | ||
173 | } | ||
174 | |||
175 | static void tc35892_gpio_irq_mask(unsigned int irq) | ||
176 | { | ||
177 | struct tc35892_gpio *tc35892_gpio = get_irq_chip_data(irq); | ||
178 | int offset = irq - tc35892_gpio->irq_base; | ||
179 | int regoffset = offset / 8; | ||
180 | int mask = 1 << (offset % 8); | ||
181 | |||
182 | tc35892_gpio->regs[REG_IE][regoffset] &= ~mask; | ||
183 | } | ||
184 | |||
185 | static void tc35892_gpio_irq_unmask(unsigned int irq) | ||
186 | { | ||
187 | struct tc35892_gpio *tc35892_gpio = get_irq_chip_data(irq); | ||
188 | int offset = irq - tc35892_gpio->irq_base; | ||
189 | int regoffset = offset / 8; | ||
190 | int mask = 1 << (offset % 8); | ||
191 | |||
192 | tc35892_gpio->regs[REG_IE][regoffset] |= mask; | ||
193 | } | ||
194 | |||
195 | static struct irq_chip tc35892_gpio_irq_chip = { | ||
196 | .name = "tc35892-gpio", | ||
197 | .bus_lock = tc35892_gpio_irq_lock, | ||
198 | .bus_sync_unlock = tc35892_gpio_irq_sync_unlock, | ||
199 | .mask = tc35892_gpio_irq_mask, | ||
200 | .unmask = tc35892_gpio_irq_unmask, | ||
201 | .set_type = tc35892_gpio_irq_set_type, | ||
202 | }; | ||
203 | |||
204 | static irqreturn_t tc35892_gpio_irq(int irq, void *dev) | ||
205 | { | ||
206 | struct tc35892_gpio *tc35892_gpio = dev; | ||
207 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
208 | u8 status[CACHE_NR_BANKS]; | ||
209 | int ret; | ||
210 | int i; | ||
211 | |||
212 | ret = tc35892_block_read(tc35892, TC35892_GPIOMIS0, | ||
213 | ARRAY_SIZE(status), status); | ||
214 | if (ret < 0) | ||
215 | return IRQ_NONE; | ||
216 | |||
217 | for (i = 0; i < ARRAY_SIZE(status); i++) { | ||
218 | unsigned int stat = status[i]; | ||
219 | if (!stat) | ||
220 | continue; | ||
221 | |||
222 | while (stat) { | ||
223 | int bit = __ffs(stat); | ||
224 | int line = i * 8 + bit; | ||
225 | |||
226 | handle_nested_irq(tc35892_gpio->irq_base + line); | ||
227 | stat &= ~(1 << bit); | ||
228 | } | ||
229 | |||
230 | tc35892_reg_write(tc35892, TC35892_GPIOIC0 + i, status[i]); | ||
231 | } | ||
232 | |||
233 | return IRQ_HANDLED; | ||
234 | } | ||
235 | |||
236 | static int tc35892_gpio_irq_init(struct tc35892_gpio *tc35892_gpio) | ||
237 | { | ||
238 | int base = tc35892_gpio->irq_base; | ||
239 | int irq; | ||
240 | |||
241 | for (irq = base; irq < base + tc35892_gpio->chip.ngpio; irq++) { | ||
242 | set_irq_chip_data(irq, tc35892_gpio); | ||
243 | set_irq_chip_and_handler(irq, &tc35892_gpio_irq_chip, | ||
244 | handle_simple_irq); | ||
245 | set_irq_nested_thread(irq, 1); | ||
246 | #ifdef CONFIG_ARM | ||
247 | set_irq_flags(irq, IRQF_VALID); | ||
248 | #else | ||
249 | set_irq_noprobe(irq); | ||
250 | #endif | ||
251 | } | ||
252 | |||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | static void tc35892_gpio_irq_remove(struct tc35892_gpio *tc35892_gpio) | ||
257 | { | ||
258 | int base = tc35892_gpio->irq_base; | ||
259 | int irq; | ||
260 | |||
261 | for (irq = base; irq < base + tc35892_gpio->chip.ngpio; irq++) { | ||
262 | #ifdef CONFIG_ARM | ||
263 | set_irq_flags(irq, 0); | ||
264 | #endif | ||
265 | set_irq_chip_and_handler(irq, NULL, NULL); | ||
266 | set_irq_chip_data(irq, NULL); | ||
267 | } | ||
268 | } | ||
269 | |||
270 | static int __devinit tc35892_gpio_probe(struct platform_device *pdev) | ||
271 | { | ||
272 | struct tc35892 *tc35892 = dev_get_drvdata(pdev->dev.parent); | ||
273 | struct tc35892_gpio_platform_data *pdata; | ||
274 | struct tc35892_gpio *tc35892_gpio; | ||
275 | int ret; | ||
276 | int irq; | ||
277 | |||
278 | pdata = tc35892->pdata->gpio; | ||
279 | if (!pdata) | ||
280 | return -ENODEV; | ||
281 | |||
282 | irq = platform_get_irq(pdev, 0); | ||
283 | if (irq < 0) | ||
284 | return irq; | ||
285 | |||
286 | tc35892_gpio = kzalloc(sizeof(struct tc35892_gpio), GFP_KERNEL); | ||
287 | if (!tc35892_gpio) | ||
288 | return -ENOMEM; | ||
289 | |||
290 | mutex_init(&tc35892_gpio->irq_lock); | ||
291 | |||
292 | tc35892_gpio->dev = &pdev->dev; | ||
293 | tc35892_gpio->tc35892 = tc35892; | ||
294 | |||
295 | tc35892_gpio->chip = template_chip; | ||
296 | tc35892_gpio->chip.ngpio = tc35892->num_gpio; | ||
297 | tc35892_gpio->chip.dev = &pdev->dev; | ||
298 | tc35892_gpio->chip.base = pdata->gpio_base; | ||
299 | |||
300 | tc35892_gpio->irq_base = tc35892->irq_base + TC35892_INT_GPIO(0); | ||
301 | |||
302 | /* Bring the GPIO module out of reset */ | ||
303 | ret = tc35892_set_bits(tc35892, TC35892_RSTCTRL, | ||
304 | TC35892_RSTCTRL_GPIRST, 0); | ||
305 | if (ret < 0) | ||
306 | goto out_free; | ||
307 | |||
308 | ret = tc35892_gpio_irq_init(tc35892_gpio); | ||
309 | if (ret) | ||
310 | goto out_free; | ||
311 | |||
312 | ret = request_threaded_irq(irq, NULL, tc35892_gpio_irq, IRQF_ONESHOT, | ||
313 | "tc35892-gpio", tc35892_gpio); | ||
314 | if (ret) { | ||
315 | dev_err(&pdev->dev, "unable to get irq: %d\n", ret); | ||
316 | goto out_removeirq; | ||
317 | } | ||
318 | |||
319 | ret = gpiochip_add(&tc35892_gpio->chip); | ||
320 | if (ret) { | ||
321 | dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret); | ||
322 | goto out_freeirq; | ||
323 | } | ||
324 | |||
325 | if (pdata->setup) | ||
326 | pdata->setup(tc35892, tc35892_gpio->chip.base); | ||
327 | |||
328 | platform_set_drvdata(pdev, tc35892_gpio); | ||
329 | |||
330 | return 0; | ||
331 | |||
332 | out_freeirq: | ||
333 | free_irq(irq, tc35892_gpio); | ||
334 | out_removeirq: | ||
335 | tc35892_gpio_irq_remove(tc35892_gpio); | ||
336 | out_free: | ||
337 | kfree(tc35892_gpio); | ||
338 | return ret; | ||
339 | } | ||
340 | |||
341 | static int __devexit tc35892_gpio_remove(struct platform_device *pdev) | ||
342 | { | ||
343 | struct tc35892_gpio *tc35892_gpio = platform_get_drvdata(pdev); | ||
344 | struct tc35892 *tc35892 = tc35892_gpio->tc35892; | ||
345 | struct tc35892_gpio_platform_data *pdata = tc35892->pdata->gpio; | ||
346 | int irq = platform_get_irq(pdev, 0); | ||
347 | int ret; | ||
348 | |||
349 | if (pdata->remove) | ||
350 | pdata->remove(tc35892, tc35892_gpio->chip.base); | ||
351 | |||
352 | ret = gpiochip_remove(&tc35892_gpio->chip); | ||
353 | if (ret < 0) { | ||
354 | dev_err(tc35892_gpio->dev, | ||
355 | "unable to remove gpiochip: %d\n", ret); | ||
356 | return ret; | ||
357 | } | ||
358 | |||
359 | free_irq(irq, tc35892_gpio); | ||
360 | tc35892_gpio_irq_remove(tc35892_gpio); | ||
361 | |||
362 | platform_set_drvdata(pdev, NULL); | ||
363 | kfree(tc35892_gpio); | ||
364 | |||
365 | return 0; | ||
366 | } | ||
367 | |||
368 | static struct platform_driver tc35892_gpio_driver = { | ||
369 | .driver.name = "tc35892-gpio", | ||
370 | .driver.owner = THIS_MODULE, | ||
371 | .probe = tc35892_gpio_probe, | ||
372 | .remove = __devexit_p(tc35892_gpio_remove), | ||
373 | }; | ||
374 | |||
375 | static int __init tc35892_gpio_init(void) | ||
376 | { | ||
377 | return platform_driver_register(&tc35892_gpio_driver); | ||
378 | } | ||
379 | subsys_initcall(tc35892_gpio_init); | ||
380 | |||
381 | static void __exit tc35892_gpio_exit(void) | ||
382 | { | ||
383 | platform_driver_unregister(&tc35892_gpio_driver); | ||
384 | } | ||
385 | module_exit(tc35892_gpio_exit); | ||
386 | |||
387 | MODULE_LICENSE("GPL v2"); | ||
388 | MODULE_DESCRIPTION("TC35892 GPIO driver"); | ||
389 | MODULE_AUTHOR("Hanumath Prasad, Rabin Vincent"); | ||
diff --git a/drivers/gpio/tc3589x-gpio.c b/drivers/gpio/tc3589x-gpio.c new file mode 100644 index 000000000000..180d584454fb --- /dev/null +++ b/drivers/gpio/tc3589x-gpio.c | |||
@@ -0,0 +1,389 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | * Author: Hanumath Prasad <hanumath.prasad@stericsson.com> for ST-Ericsson | ||
6 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/gpio.h> | ||
14 | #include <linux/irq.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/mfd/tc3589x.h> | ||
17 | |||
18 | /* | ||
19 | * These registers are modified under the irq bus lock and cached to avoid | ||
20 | * unnecessary writes in bus_sync_unlock. | ||
21 | */ | ||
22 | enum { REG_IBE, REG_IEV, REG_IS, REG_IE }; | ||
23 | |||
24 | #define CACHE_NR_REGS 4 | ||
25 | #define CACHE_NR_BANKS 3 | ||
26 | |||
27 | struct tc3589x_gpio { | ||
28 | struct gpio_chip chip; | ||
29 | struct tc3589x *tc3589x; | ||
30 | struct device *dev; | ||
31 | struct mutex irq_lock; | ||
32 | |||
33 | int irq_base; | ||
34 | |||
35 | /* Caches of interrupt control registers for bus_lock */ | ||
36 | u8 regs[CACHE_NR_REGS][CACHE_NR_BANKS]; | ||
37 | u8 oldregs[CACHE_NR_REGS][CACHE_NR_BANKS]; | ||
38 | }; | ||
39 | |||
40 | static inline struct tc3589x_gpio *to_tc3589x_gpio(struct gpio_chip *chip) | ||
41 | { | ||
42 | return container_of(chip, struct tc3589x_gpio, chip); | ||
43 | } | ||
44 | |||
45 | static int tc3589x_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
46 | { | ||
47 | struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); | ||
48 | struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; | ||
49 | u8 reg = TC3589x_GPIODATA0 + (offset / 8) * 2; | ||
50 | u8 mask = 1 << (offset % 8); | ||
51 | int ret; | ||
52 | |||
53 | ret = tc3589x_reg_read(tc3589x, reg); | ||
54 | if (ret < 0) | ||
55 | return ret; | ||
56 | |||
57 | return ret & mask; | ||
58 | } | ||
59 | |||
60 | static void tc3589x_gpio_set(struct gpio_chip *chip, unsigned offset, int val) | ||
61 | { | ||
62 | struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); | ||
63 | struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; | ||
64 | u8 reg = TC3589x_GPIODATA0 + (offset / 8) * 2; | ||
65 | unsigned pos = offset % 8; | ||
66 | u8 data[] = {!!val << pos, 1 << pos}; | ||
67 | |||
68 | tc3589x_block_write(tc3589x, reg, ARRAY_SIZE(data), data); | ||
69 | } | ||
70 | |||
71 | static int tc3589x_gpio_direction_output(struct gpio_chip *chip, | ||
72 | unsigned offset, int val) | ||
73 | { | ||
74 | struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); | ||
75 | struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; | ||
76 | u8 reg = TC3589x_GPIODIR0 + offset / 8; | ||
77 | unsigned pos = offset % 8; | ||
78 | |||
79 | tc3589x_gpio_set(chip, offset, val); | ||
80 | |||
81 | return tc3589x_set_bits(tc3589x, reg, 1 << pos, 1 << pos); | ||
82 | } | ||
83 | |||
84 | static int tc3589x_gpio_direction_input(struct gpio_chip *chip, | ||
85 | unsigned offset) | ||
86 | { | ||
87 | struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); | ||
88 | struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; | ||
89 | u8 reg = TC3589x_GPIODIR0 + offset / 8; | ||
90 | unsigned pos = offset % 8; | ||
91 | |||
92 | return tc3589x_set_bits(tc3589x, reg, 1 << pos, 0); | ||
93 | } | ||
94 | |||
95 | static int tc3589x_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
96 | { | ||
97 | struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); | ||
98 | |||
99 | return tc3589x_gpio->irq_base + offset; | ||
100 | } | ||
101 | |||
102 | static struct gpio_chip template_chip = { | ||
103 | .label = "tc3589x", | ||
104 | .owner = THIS_MODULE, | ||
105 | .direction_input = tc3589x_gpio_direction_input, | ||
106 | .get = tc3589x_gpio_get, | ||
107 | .direction_output = tc3589x_gpio_direction_output, | ||
108 | .set = tc3589x_gpio_set, | ||
109 | .to_irq = tc3589x_gpio_to_irq, | ||
110 | .can_sleep = 1, | ||
111 | }; | ||
112 | |||
113 | static int tc3589x_gpio_irq_set_type(unsigned int irq, unsigned int type) | ||
114 | { | ||
115 | struct tc3589x_gpio *tc3589x_gpio = get_irq_chip_data(irq); | ||
116 | int offset = irq - tc3589x_gpio->irq_base; | ||
117 | int regoffset = offset / 8; | ||
118 | int mask = 1 << (offset % 8); | ||
119 | |||
120 | if (type == IRQ_TYPE_EDGE_BOTH) { | ||
121 | tc3589x_gpio->regs[REG_IBE][regoffset] |= mask; | ||
122 | return 0; | ||
123 | } | ||
124 | |||
125 | tc3589x_gpio->regs[REG_IBE][regoffset] &= ~mask; | ||
126 | |||
127 | if (type == IRQ_TYPE_LEVEL_LOW || type == IRQ_TYPE_LEVEL_HIGH) | ||
128 | tc3589x_gpio->regs[REG_IS][regoffset] |= mask; | ||
129 | else | ||
130 | tc3589x_gpio->regs[REG_IS][regoffset] &= ~mask; | ||
131 | |||
132 | if (type == IRQ_TYPE_EDGE_RISING || type == IRQ_TYPE_LEVEL_HIGH) | ||
133 | tc3589x_gpio->regs[REG_IEV][regoffset] |= mask; | ||
134 | else | ||
135 | tc3589x_gpio->regs[REG_IEV][regoffset] &= ~mask; | ||
136 | |||
137 | return 0; | ||
138 | } | ||
139 | |||
140 | static void tc3589x_gpio_irq_lock(unsigned int irq) | ||
141 | { | ||
142 | struct tc3589x_gpio *tc3589x_gpio = get_irq_chip_data(irq); | ||
143 | |||
144 | mutex_lock(&tc3589x_gpio->irq_lock); | ||
145 | } | ||
146 | |||
147 | static void tc3589x_gpio_irq_sync_unlock(unsigned int irq) | ||
148 | { | ||
149 | struct tc3589x_gpio *tc3589x_gpio = get_irq_chip_data(irq); | ||
150 | struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; | ||
151 | static const u8 regmap[] = { | ||
152 | [REG_IBE] = TC3589x_GPIOIBE0, | ||
153 | [REG_IEV] = TC3589x_GPIOIEV0, | ||
154 | [REG_IS] = TC3589x_GPIOIS0, | ||
155 | [REG_IE] = TC3589x_GPIOIE0, | ||
156 | }; | ||
157 | int i, j; | ||
158 | |||
159 | for (i = 0; i < CACHE_NR_REGS; i++) { | ||
160 | for (j = 0; j < CACHE_NR_BANKS; j++) { | ||
161 | u8 old = tc3589x_gpio->oldregs[i][j]; | ||
162 | u8 new = tc3589x_gpio->regs[i][j]; | ||
163 | |||
164 | if (new == old) | ||
165 | continue; | ||
166 | |||
167 | tc3589x_gpio->oldregs[i][j] = new; | ||
168 | tc3589x_reg_write(tc3589x, regmap[i] + j * 8, new); | ||
169 | } | ||
170 | } | ||
171 | |||
172 | mutex_unlock(&tc3589x_gpio->irq_lock); | ||
173 | } | ||
174 | |||
175 | static void tc3589x_gpio_irq_mask(unsigned int irq) | ||
176 | { | ||
177 | struct tc3589x_gpio *tc3589x_gpio = get_irq_chip_data(irq); | ||
178 | int offset = irq - tc3589x_gpio->irq_base; | ||
179 | int regoffset = offset / 8; | ||
180 | int mask = 1 << (offset % 8); | ||
181 | |||
182 | tc3589x_gpio->regs[REG_IE][regoffset] &= ~mask; | ||
183 | } | ||
184 | |||
185 | static void tc3589x_gpio_irq_unmask(unsigned int irq) | ||
186 | { | ||
187 | struct tc3589x_gpio *tc3589x_gpio = get_irq_chip_data(irq); | ||
188 | int offset = irq - tc3589x_gpio->irq_base; | ||
189 | int regoffset = offset / 8; | ||
190 | int mask = 1 << (offset % 8); | ||
191 | |||
192 | tc3589x_gpio->regs[REG_IE][regoffset] |= mask; | ||
193 | } | ||
194 | |||
195 | static struct irq_chip tc3589x_gpio_irq_chip = { | ||
196 | .name = "tc3589x-gpio", | ||
197 | .bus_lock = tc3589x_gpio_irq_lock, | ||
198 | .bus_sync_unlock = tc3589x_gpio_irq_sync_unlock, | ||
199 | .mask = tc3589x_gpio_irq_mask, | ||
200 | .unmask = tc3589x_gpio_irq_unmask, | ||
201 | .set_type = tc3589x_gpio_irq_set_type, | ||
202 | }; | ||
203 | |||
204 | static irqreturn_t tc3589x_gpio_irq(int irq, void *dev) | ||
205 | { | ||
206 | struct tc3589x_gpio *tc3589x_gpio = dev; | ||
207 | struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; | ||
208 | u8 status[CACHE_NR_BANKS]; | ||
209 | int ret; | ||
210 | int i; | ||
211 | |||
212 | ret = tc3589x_block_read(tc3589x, TC3589x_GPIOMIS0, | ||
213 | ARRAY_SIZE(status), status); | ||
214 | if (ret < 0) | ||
215 | return IRQ_NONE; | ||
216 | |||
217 | for (i = 0; i < ARRAY_SIZE(status); i++) { | ||
218 | unsigned int stat = status[i]; | ||
219 | if (!stat) | ||
220 | continue; | ||
221 | |||
222 | while (stat) { | ||
223 | int bit = __ffs(stat); | ||
224 | int line = i * 8 + bit; | ||
225 | |||
226 | handle_nested_irq(tc3589x_gpio->irq_base + line); | ||
227 | stat &= ~(1 << bit); | ||
228 | } | ||
229 | |||
230 | tc3589x_reg_write(tc3589x, TC3589x_GPIOIC0 + i, status[i]); | ||
231 | } | ||
232 | |||
233 | return IRQ_HANDLED; | ||
234 | } | ||
235 | |||
236 | static int tc3589x_gpio_irq_init(struct tc3589x_gpio *tc3589x_gpio) | ||
237 | { | ||
238 | int base = tc3589x_gpio->irq_base; | ||
239 | int irq; | ||
240 | |||
241 | for (irq = base; irq < base + tc3589x_gpio->chip.ngpio; irq++) { | ||
242 | set_irq_chip_data(irq, tc3589x_gpio); | ||
243 | set_irq_chip_and_handler(irq, &tc3589x_gpio_irq_chip, | ||
244 | handle_simple_irq); | ||
245 | set_irq_nested_thread(irq, 1); | ||
246 | #ifdef CONFIG_ARM | ||
247 | set_irq_flags(irq, IRQF_VALID); | ||
248 | #else | ||
249 | set_irq_noprobe(irq); | ||
250 | #endif | ||
251 | } | ||
252 | |||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | static void tc3589x_gpio_irq_remove(struct tc3589x_gpio *tc3589x_gpio) | ||
257 | { | ||
258 | int base = tc3589x_gpio->irq_base; | ||
259 | int irq; | ||
260 | |||
261 | for (irq = base; irq < base + tc3589x_gpio->chip.ngpio; irq++) { | ||
262 | #ifdef CONFIG_ARM | ||
263 | set_irq_flags(irq, 0); | ||
264 | #endif | ||
265 | set_irq_chip_and_handler(irq, NULL, NULL); | ||
266 | set_irq_chip_data(irq, NULL); | ||
267 | } | ||
268 | } | ||
269 | |||
270 | static int __devinit tc3589x_gpio_probe(struct platform_device *pdev) | ||
271 | { | ||
272 | struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent); | ||
273 | struct tc3589x_gpio_platform_data *pdata; | ||
274 | struct tc3589x_gpio *tc3589x_gpio; | ||
275 | int ret; | ||
276 | int irq; | ||
277 | |||
278 | pdata = tc3589x->pdata->gpio; | ||
279 | if (!pdata) | ||
280 | return -ENODEV; | ||
281 | |||
282 | irq = platform_get_irq(pdev, 0); | ||
283 | if (irq < 0) | ||
284 | return irq; | ||
285 | |||
286 | tc3589x_gpio = kzalloc(sizeof(struct tc3589x_gpio), GFP_KERNEL); | ||
287 | if (!tc3589x_gpio) | ||
288 | return -ENOMEM; | ||
289 | |||
290 | mutex_init(&tc3589x_gpio->irq_lock); | ||
291 | |||
292 | tc3589x_gpio->dev = &pdev->dev; | ||
293 | tc3589x_gpio->tc3589x = tc3589x; | ||
294 | |||
295 | tc3589x_gpio->chip = template_chip; | ||
296 | tc3589x_gpio->chip.ngpio = tc3589x->num_gpio; | ||
297 | tc3589x_gpio->chip.dev = &pdev->dev; | ||
298 | tc3589x_gpio->chip.base = pdata->gpio_base; | ||
299 | |||
300 | tc3589x_gpio->irq_base = tc3589x->irq_base + TC3589x_INT_GPIO(0); | ||
301 | |||
302 | /* Bring the GPIO module out of reset */ | ||
303 | ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL, | ||
304 | TC3589x_RSTCTRL_GPIRST, 0); | ||
305 | if (ret < 0) | ||
306 | goto out_free; | ||
307 | |||
308 | ret = tc3589x_gpio_irq_init(tc3589x_gpio); | ||
309 | if (ret) | ||
310 | goto out_free; | ||
311 | |||
312 | ret = request_threaded_irq(irq, NULL, tc3589x_gpio_irq, IRQF_ONESHOT, | ||
313 | "tc3589x-gpio", tc3589x_gpio); | ||
314 | if (ret) { | ||
315 | dev_err(&pdev->dev, "unable to get irq: %d\n", ret); | ||
316 | goto out_removeirq; | ||
317 | } | ||
318 | |||
319 | ret = gpiochip_add(&tc3589x_gpio->chip); | ||
320 | if (ret) { | ||
321 | dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret); | ||
322 | goto out_freeirq; | ||
323 | } | ||
324 | |||
325 | if (pdata->setup) | ||
326 | pdata->setup(tc3589x, tc3589x_gpio->chip.base); | ||
327 | |||
328 | platform_set_drvdata(pdev, tc3589x_gpio); | ||
329 | |||
330 | return 0; | ||
331 | |||
332 | out_freeirq: | ||
333 | free_irq(irq, tc3589x_gpio); | ||
334 | out_removeirq: | ||
335 | tc3589x_gpio_irq_remove(tc3589x_gpio); | ||
336 | out_free: | ||
337 | kfree(tc3589x_gpio); | ||
338 | return ret; | ||
339 | } | ||
340 | |||
341 | static int __devexit tc3589x_gpio_remove(struct platform_device *pdev) | ||
342 | { | ||
343 | struct tc3589x_gpio *tc3589x_gpio = platform_get_drvdata(pdev); | ||
344 | struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; | ||
345 | struct tc3589x_gpio_platform_data *pdata = tc3589x->pdata->gpio; | ||
346 | int irq = platform_get_irq(pdev, 0); | ||
347 | int ret; | ||
348 | |||
349 | if (pdata->remove) | ||
350 | pdata->remove(tc3589x, tc3589x_gpio->chip.base); | ||
351 | |||
352 | ret = gpiochip_remove(&tc3589x_gpio->chip); | ||
353 | if (ret < 0) { | ||
354 | dev_err(tc3589x_gpio->dev, | ||
355 | "unable to remove gpiochip: %d\n", ret); | ||
356 | return ret; | ||
357 | } | ||
358 | |||
359 | free_irq(irq, tc3589x_gpio); | ||
360 | tc3589x_gpio_irq_remove(tc3589x_gpio); | ||
361 | |||
362 | platform_set_drvdata(pdev, NULL); | ||
363 | kfree(tc3589x_gpio); | ||
364 | |||
365 | return 0; | ||
366 | } | ||
367 | |||
368 | static struct platform_driver tc3589x_gpio_driver = { | ||
369 | .driver.name = "tc3589x-gpio", | ||
370 | .driver.owner = THIS_MODULE, | ||
371 | .probe = tc3589x_gpio_probe, | ||
372 | .remove = __devexit_p(tc3589x_gpio_remove), | ||
373 | }; | ||
374 | |||
375 | static int __init tc3589x_gpio_init(void) | ||
376 | { | ||
377 | return platform_driver_register(&tc3589x_gpio_driver); | ||
378 | } | ||
379 | subsys_initcall(tc3589x_gpio_init); | ||
380 | |||
381 | static void __exit tc3589x_gpio_exit(void) | ||
382 | { | ||
383 | platform_driver_unregister(&tc3589x_gpio_driver); | ||
384 | } | ||
385 | module_exit(tc3589x_gpio_exit); | ||
386 | |||
387 | MODULE_LICENSE("GPL v2"); | ||
388 | MODULE_DESCRIPTION("TC3589x GPIO driver"); | ||
389 | MODULE_AUTHOR("Hanumath Prasad, Rabin Vincent"); | ||
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 3a87f3ba5f75..c76bd3183beb 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -459,6 +459,16 @@ config KEYBOARD_OMAP4 | |||
459 | To compile this driver as a module, choose M here: the | 459 | To compile this driver as a module, choose M here: the |
460 | module will be called omap4-keypad. | 460 | module will be called omap4-keypad. |
461 | 461 | ||
462 | config KEYBOARD_TC3589X | ||
463 | tristate "TC3589X Keypad support" | ||
464 | depends on MFD_TC3589X | ||
465 | help | ||
466 | Say Y here if you want to use the keypad controller on | ||
467 | TC35892/3 I/O expander. | ||
468 | |||
469 | To compile this driver as a module, choose M here: the | ||
470 | module will be called tc3589x-keypad. | ||
471 | |||
462 | config KEYBOARD_TNETV107X | 472 | config KEYBOARD_TNETV107X |
463 | tristate "TI TNETV107X keypad support" | 473 | tristate "TI TNETV107X keypad support" |
464 | depends on ARCH_DAVINCI_TNETV107X | 474 | depends on ARCH_DAVINCI_TNETV107X |
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 622de73a445d..2aa6ce248b71 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile | |||
@@ -41,6 +41,7 @@ obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o | |||
41 | obj-$(CONFIG_KEYBOARD_STMPE) += stmpe-keypad.o | 41 | obj-$(CONFIG_KEYBOARD_STMPE) += stmpe-keypad.o |
42 | obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o | 42 | obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o |
43 | obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o | 43 | obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o |
44 | obj-$(CONFIG_KEYBOARD_TC3589X) += tc3589x-keypad.o | ||
44 | obj-$(CONFIG_KEYBOARD_TNETV107X) += tnetv107x-keypad.o | 45 | obj-$(CONFIG_KEYBOARD_TNETV107X) += tnetv107x-keypad.o |
45 | obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o | 46 | obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o |
46 | obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o | 47 | obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o |
diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c new file mode 100644 index 000000000000..69dc0cb20a00 --- /dev/null +++ b/drivers/input/keyboard/tc3589x-keypad.c | |||
@@ -0,0 +1,472 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Jayeeta Banerjee <jayeeta.banerjee@stericsson.com> | ||
5 | * Author: Sundar Iyer <sundar.iyer@stericsson.com> | ||
6 | * | ||
7 | * License Terms: GNU General Public License, version 2 | ||
8 | * | ||
9 | * TC35893 MFD Keypad Controller driver | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/input.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/input/matrix_keypad.h> | ||
18 | #include <linux/i2c.h> | ||
19 | #include <linux/slab.h> | ||
20 | #include <linux/mfd/tc3589x.h> | ||
21 | |||
22 | /* Maximum supported keypad matrix row/columns size */ | ||
23 | #define TC3589x_MAX_KPROW 8 | ||
24 | #define TC3589x_MAX_KPCOL 12 | ||
25 | |||
26 | /* keypad related Constants */ | ||
27 | #define TC3589x_MAX_DEBOUNCE_SETTLE 0xFF | ||
28 | #define DEDICATED_KEY_VAL 0xFF | ||
29 | |||
30 | /* Pull up/down masks */ | ||
31 | #define TC3589x_NO_PULL_MASK 0x0 | ||
32 | #define TC3589x_PULL_DOWN_MASK 0x1 | ||
33 | #define TC3589x_PULL_UP_MASK 0x2 | ||
34 | #define TC3589x_PULLUP_ALL_MASK 0xAA | ||
35 | #define TC3589x_IO_PULL_VAL(index, mask) ((mask)<<((index)%4)*2)) | ||
36 | |||
37 | /* Bit masks for IOCFG register */ | ||
38 | #define IOCFG_BALLCFG 0x01 | ||
39 | #define IOCFG_IG 0x08 | ||
40 | |||
41 | #define KP_EVCODE_COL_MASK 0x0F | ||
42 | #define KP_EVCODE_ROW_MASK 0x70 | ||
43 | #define KP_RELEASE_EVT_MASK 0x80 | ||
44 | |||
45 | #define KP_ROW_SHIFT 4 | ||
46 | |||
47 | #define KP_NO_VALID_KEY_MASK 0x7F | ||
48 | |||
49 | /* bit masks for RESTCTRL register */ | ||
50 | #define TC3589x_KBDRST 0x2 | ||
51 | #define TC3589x_IRQRST 0x10 | ||
52 | #define TC3589x_RESET_ALL 0x1B | ||
53 | |||
54 | /* KBDMFS register bit mask */ | ||
55 | #define TC3589x_KBDMFS_EN 0x1 | ||
56 | |||
57 | /* CLKEN register bitmask */ | ||
58 | #define KPD_CLK_EN 0x1 | ||
59 | |||
60 | /* RSTINTCLR register bit mask */ | ||
61 | #define IRQ_CLEAR 0x1 | ||
62 | |||
63 | /* bit masks for keyboard interrupts*/ | ||
64 | #define TC3589x_EVT_LOSS_INT 0x8 | ||
65 | #define TC3589x_EVT_INT 0x4 | ||
66 | #define TC3589x_KBD_LOSS_INT 0x2 | ||
67 | #define TC3589x_KBD_INT 0x1 | ||
68 | |||
69 | /* bit masks for keyboard interrupt clear*/ | ||
70 | #define TC3589x_EVT_INT_CLR 0x2 | ||
71 | #define TC3589x_KBD_INT_CLR 0x1 | ||
72 | |||
73 | #define TC3589x_KBD_KEYMAP_SIZE 64 | ||
74 | |||
75 | /** | ||
76 | * struct tc_keypad - data structure used by keypad driver | ||
77 | * @input: pointer to input device object | ||
78 | * @board: keypad platform device | ||
79 | * @krow: number of rows | ||
80 | * @kcol: number of coloumns | ||
81 | * @keymap: matrix scan code table for keycodes | ||
82 | */ | ||
83 | struct tc_keypad { | ||
84 | struct tc3589x *tc3589x; | ||
85 | struct input_dev *input; | ||
86 | const struct tc3589x_keypad_platform_data *board; | ||
87 | unsigned int krow; | ||
88 | unsigned int kcol; | ||
89 | unsigned short keymap[TC3589x_KBD_KEYMAP_SIZE]; | ||
90 | bool keypad_stopped; | ||
91 | }; | ||
92 | |||
93 | static int __devinit tc3589x_keypad_init_key_hardware(struct tc_keypad *keypad) | ||
94 | { | ||
95 | int ret; | ||
96 | struct tc3589x *tc3589x = keypad->tc3589x; | ||
97 | u8 settle_time = keypad->board->settle_time; | ||
98 | u8 dbounce_period = keypad->board->debounce_period; | ||
99 | u8 rows = keypad->board->krow & 0xf; /* mask out the nibble */ | ||
100 | u8 column = keypad->board->kcol & 0xf; /* mask out the nibble */ | ||
101 | |||
102 | /* validate platform configurations */ | ||
103 | if (keypad->board->kcol > TC3589x_MAX_KPCOL || | ||
104 | keypad->board->krow > TC3589x_MAX_KPROW || | ||
105 | keypad->board->debounce_period > TC3589x_MAX_DEBOUNCE_SETTLE || | ||
106 | keypad->board->settle_time > TC3589x_MAX_DEBOUNCE_SETTLE) | ||
107 | return -EINVAL; | ||
108 | |||
109 | /* configure KBDSIZE 4 LSbits for cols and 4 MSbits for rows */ | ||
110 | ret = tc3589x_reg_write(tc3589x, TC3589x_KBDSIZE, | ||
111 | (rows << KP_ROW_SHIFT) | column); | ||
112 | if (ret < 0) | ||
113 | return ret; | ||
114 | |||
115 | /* configure dedicated key config, no dedicated key selected */ | ||
116 | ret = tc3589x_reg_write(tc3589x, TC3589x_KBCFG_LSB, DEDICATED_KEY_VAL); | ||
117 | if (ret < 0) | ||
118 | return ret; | ||
119 | |||
120 | ret = tc3589x_reg_write(tc3589x, TC3589x_KBCFG_MSB, DEDICATED_KEY_VAL); | ||
121 | if (ret < 0) | ||
122 | return ret; | ||
123 | |||
124 | /* Configure settle time */ | ||
125 | ret = tc3589x_reg_write(tc3589x, TC3589x_KBDSETTLE_REG, settle_time); | ||
126 | if (ret < 0) | ||
127 | return ret; | ||
128 | |||
129 | /* Configure debounce time */ | ||
130 | ret = tc3589x_reg_write(tc3589x, TC3589x_KBDBOUNCE, dbounce_period); | ||
131 | if (ret < 0) | ||
132 | return ret; | ||
133 | |||
134 | /* Start of initialise keypad GPIOs */ | ||
135 | ret = tc3589x_set_bits(tc3589x, TC3589x_IOCFG, 0x0, IOCFG_IG); | ||
136 | if (ret < 0) | ||
137 | return ret; | ||
138 | |||
139 | /* Configure pull-up resistors for all row GPIOs */ | ||
140 | ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG0_LSB, | ||
141 | TC3589x_PULLUP_ALL_MASK); | ||
142 | if (ret < 0) | ||
143 | return ret; | ||
144 | |||
145 | ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG0_MSB, | ||
146 | TC3589x_PULLUP_ALL_MASK); | ||
147 | if (ret < 0) | ||
148 | return ret; | ||
149 | |||
150 | /* Configure pull-up resistors for all column GPIOs */ | ||
151 | ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG1_LSB, | ||
152 | TC3589x_PULLUP_ALL_MASK); | ||
153 | if (ret < 0) | ||
154 | return ret; | ||
155 | |||
156 | ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG1_MSB, | ||
157 | TC3589x_PULLUP_ALL_MASK); | ||
158 | if (ret < 0) | ||
159 | return ret; | ||
160 | |||
161 | ret = tc3589x_reg_write(tc3589x, TC3589x_IOPULLCFG2_LSB, | ||
162 | TC3589x_PULLUP_ALL_MASK); | ||
163 | |||
164 | return ret; | ||
165 | } | ||
166 | |||
167 | #define TC35893_DATA_REGS 4 | ||
168 | #define TC35893_KEYCODE_FIFO_EMPTY 0x7f | ||
169 | #define TC35893_KEYCODE_FIFO_CLEAR 0xff | ||
170 | #define TC35893_KEYPAD_ROW_SHIFT 0x3 | ||
171 | |||
172 | static irqreturn_t tc3589x_keypad_irq(int irq, void *dev) | ||
173 | { | ||
174 | struct tc_keypad *keypad = dev; | ||
175 | struct tc3589x *tc3589x = keypad->tc3589x; | ||
176 | u8 i, row_index, col_index, kbd_code, up; | ||
177 | u8 code; | ||
178 | |||
179 | for (i = 0; i < TC35893_DATA_REGS * 2; i++) { | ||
180 | kbd_code = tc3589x_reg_read(tc3589x, TC3589x_EVTCODE_FIFO); | ||
181 | |||
182 | /* loop till fifo is empty and no more keys are pressed */ | ||
183 | if (kbd_code == TC35893_KEYCODE_FIFO_EMPTY || | ||
184 | kbd_code == TC35893_KEYCODE_FIFO_CLEAR) | ||
185 | continue; | ||
186 | |||
187 | /* valid key is found */ | ||
188 | col_index = kbd_code & KP_EVCODE_COL_MASK; | ||
189 | row_index = (kbd_code & KP_EVCODE_ROW_MASK) >> KP_ROW_SHIFT; | ||
190 | code = MATRIX_SCAN_CODE(row_index, col_index, | ||
191 | TC35893_KEYPAD_ROW_SHIFT); | ||
192 | up = kbd_code & KP_RELEASE_EVT_MASK; | ||
193 | |||
194 | input_event(keypad->input, EV_MSC, MSC_SCAN, code); | ||
195 | input_report_key(keypad->input, keypad->keymap[code], !up); | ||
196 | input_sync(keypad->input); | ||
197 | } | ||
198 | |||
199 | /* clear IRQ */ | ||
200 | tc3589x_set_bits(tc3589x, TC3589x_KBDIC, | ||
201 | 0x0, TC3589x_EVT_INT_CLR | TC3589x_KBD_INT_CLR); | ||
202 | /* enable IRQ */ | ||
203 | tc3589x_set_bits(tc3589x, TC3589x_KBDMSK, | ||
204 | 0x0, TC3589x_EVT_LOSS_INT | TC3589x_EVT_INT); | ||
205 | |||
206 | return IRQ_HANDLED; | ||
207 | } | ||
208 | |||
209 | static int tc3589x_keypad_enable(struct tc_keypad *keypad) | ||
210 | { | ||
211 | struct tc3589x *tc3589x = keypad->tc3589x; | ||
212 | int ret; | ||
213 | |||
214 | /* pull the keypad module out of reset */ | ||
215 | ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL, TC3589x_KBDRST, 0x0); | ||
216 | if (ret < 0) | ||
217 | return ret; | ||
218 | |||
219 | /* configure KBDMFS */ | ||
220 | ret = tc3589x_set_bits(tc3589x, TC3589x_KBDMFS, 0x0, TC3589x_KBDMFS_EN); | ||
221 | if (ret < 0) | ||
222 | return ret; | ||
223 | |||
224 | /* enable the keypad clock */ | ||
225 | ret = tc3589x_set_bits(tc3589x, TC3589x_CLKEN, 0x0, KPD_CLK_EN); | ||
226 | if (ret < 0) | ||
227 | return ret; | ||
228 | |||
229 | /* clear pending IRQs */ | ||
230 | ret = tc3589x_set_bits(tc3589x, TC3589x_RSTINTCLR, 0x0, 0x1); | ||
231 | if (ret < 0) | ||
232 | return ret; | ||
233 | |||
234 | /* enable the IRQs */ | ||
235 | ret = tc3589x_set_bits(tc3589x, TC3589x_KBDMSK, 0x0, | ||
236 | TC3589x_EVT_LOSS_INT | TC3589x_EVT_INT); | ||
237 | if (ret < 0) | ||
238 | return ret; | ||
239 | |||
240 | keypad->keypad_stopped = false; | ||
241 | |||
242 | return ret; | ||
243 | } | ||
244 | |||
245 | static int tc3589x_keypad_disable(struct tc_keypad *keypad) | ||
246 | { | ||
247 | struct tc3589x *tc3589x = keypad->tc3589x; | ||
248 | int ret; | ||
249 | |||
250 | /* clear IRQ */ | ||
251 | ret = tc3589x_set_bits(tc3589x, TC3589x_KBDIC, | ||
252 | 0x0, TC3589x_EVT_INT_CLR | TC3589x_KBD_INT_CLR); | ||
253 | if (ret < 0) | ||
254 | return ret; | ||
255 | |||
256 | /* disable all interrupts */ | ||
257 | ret = tc3589x_set_bits(tc3589x, TC3589x_KBDMSK, | ||
258 | ~(TC3589x_EVT_LOSS_INT | TC3589x_EVT_INT), 0x0); | ||
259 | if (ret < 0) | ||
260 | return ret; | ||
261 | |||
262 | /* disable the keypad module */ | ||
263 | ret = tc3589x_set_bits(tc3589x, TC3589x_CLKEN, 0x1, 0x0); | ||
264 | if (ret < 0) | ||
265 | return ret; | ||
266 | |||
267 | /* put the keypad module into reset */ | ||
268 | ret = tc3589x_set_bits(tc3589x, TC3589x_RSTCTRL, TC3589x_KBDRST, 0x1); | ||
269 | |||
270 | keypad->keypad_stopped = true; | ||
271 | |||
272 | return ret; | ||
273 | } | ||
274 | |||
275 | static int tc3589x_keypad_open(struct input_dev *input) | ||
276 | { | ||
277 | int error; | ||
278 | struct tc_keypad *keypad = input_get_drvdata(input); | ||
279 | |||
280 | /* enable the keypad module */ | ||
281 | error = tc3589x_keypad_enable(keypad); | ||
282 | if (error < 0) { | ||
283 | dev_err(&input->dev, "failed to enable keypad module\n"); | ||
284 | return error; | ||
285 | } | ||
286 | |||
287 | error = tc3589x_keypad_init_key_hardware(keypad); | ||
288 | if (error < 0) { | ||
289 | dev_err(&input->dev, "failed to configure keypad module\n"); | ||
290 | return error; | ||
291 | } | ||
292 | |||
293 | return 0; | ||
294 | } | ||
295 | |||
296 | static void tc3589x_keypad_close(struct input_dev *input) | ||
297 | { | ||
298 | struct tc_keypad *keypad = input_get_drvdata(input); | ||
299 | |||
300 | /* disable the keypad module */ | ||
301 | tc3589x_keypad_disable(keypad); | ||
302 | } | ||
303 | |||
304 | static int __devinit tc3589x_keypad_probe(struct platform_device *pdev) | ||
305 | { | ||
306 | struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent); | ||
307 | struct tc_keypad *keypad; | ||
308 | struct input_dev *input; | ||
309 | const struct tc3589x_keypad_platform_data *plat; | ||
310 | int error, irq; | ||
311 | |||
312 | plat = tc3589x->pdata->keypad; | ||
313 | if (!plat) { | ||
314 | dev_err(&pdev->dev, "invalid keypad platform data\n"); | ||
315 | return -EINVAL; | ||
316 | } | ||
317 | |||
318 | irq = platform_get_irq(pdev, 0); | ||
319 | if (irq < 0) | ||
320 | return irq; | ||
321 | |||
322 | keypad = kzalloc(sizeof(struct tc_keypad), GFP_KERNEL); | ||
323 | input = input_allocate_device(); | ||
324 | if (!keypad || !input) { | ||
325 | dev_err(&pdev->dev, "failed to allocate keypad memory\n"); | ||
326 | error = -ENOMEM; | ||
327 | goto err_free_mem; | ||
328 | } | ||
329 | |||
330 | keypad->board = plat; | ||
331 | keypad->input = input; | ||
332 | keypad->tc3589x = tc3589x; | ||
333 | |||
334 | input->id.bustype = BUS_I2C; | ||
335 | input->name = pdev->name; | ||
336 | input->dev.parent = &pdev->dev; | ||
337 | |||
338 | input->keycode = keypad->keymap; | ||
339 | input->keycodesize = sizeof(keypad->keymap[0]); | ||
340 | input->keycodemax = ARRAY_SIZE(keypad->keymap); | ||
341 | |||
342 | input->open = tc3589x_keypad_open; | ||
343 | input->close = tc3589x_keypad_close; | ||
344 | |||
345 | input_set_drvdata(input, keypad); | ||
346 | |||
347 | input_set_capability(input, EV_MSC, MSC_SCAN); | ||
348 | |||
349 | __set_bit(EV_KEY, input->evbit); | ||
350 | if (!plat->no_autorepeat) | ||
351 | __set_bit(EV_REP, input->evbit); | ||
352 | |||
353 | matrix_keypad_build_keymap(plat->keymap_data, 0x3, | ||
354 | input->keycode, input->keybit); | ||
355 | |||
356 | error = request_threaded_irq(irq, NULL, | ||
357 | tc3589x_keypad_irq, plat->irqtype, | ||
358 | "tc3589x-keypad", keypad); | ||
359 | if (error < 0) { | ||
360 | dev_err(&pdev->dev, | ||
361 | "Could not allocate irq %d,error %d\n", | ||
362 | irq, error); | ||
363 | goto err_free_mem; | ||
364 | } | ||
365 | |||
366 | error = input_register_device(input); | ||
367 | if (error) { | ||
368 | dev_err(&pdev->dev, "Could not register input device\n"); | ||
369 | goto err_free_irq; | ||
370 | } | ||
371 | |||
372 | /* let platform decide if keypad is a wakeup source or not */ | ||
373 | device_init_wakeup(&pdev->dev, plat->enable_wakeup); | ||
374 | device_set_wakeup_capable(&pdev->dev, plat->enable_wakeup); | ||
375 | |||
376 | platform_set_drvdata(pdev, keypad); | ||
377 | |||
378 | return 0; | ||
379 | |||
380 | err_free_irq: | ||
381 | free_irq(irq, keypad); | ||
382 | err_free_mem: | ||
383 | input_free_device(input); | ||
384 | kfree(keypad); | ||
385 | return error; | ||
386 | } | ||
387 | |||
388 | static int __devexit tc3589x_keypad_remove(struct platform_device *pdev) | ||
389 | { | ||
390 | struct tc_keypad *keypad = platform_get_drvdata(pdev); | ||
391 | int irq = platform_get_irq(pdev, 0); | ||
392 | |||
393 | if (!keypad->keypad_stopped) | ||
394 | tc3589x_keypad_disable(keypad); | ||
395 | |||
396 | free_irq(irq, keypad); | ||
397 | |||
398 | input_unregister_device(keypad->input); | ||
399 | |||
400 | kfree(keypad); | ||
401 | |||
402 | return 0; | ||
403 | } | ||
404 | |||
405 | #ifdef CONFIG_PM | ||
406 | static int tc3589x_keypad_suspend(struct device *dev) | ||
407 | { | ||
408 | struct platform_device *pdev = to_platform_device(dev); | ||
409 | struct tc_keypad *keypad = platform_get_drvdata(pdev); | ||
410 | int irq = platform_get_irq(pdev, 0); | ||
411 | |||
412 | /* keypad is already off; we do nothing */ | ||
413 | if (keypad->keypad_stopped) | ||
414 | return 0; | ||
415 | |||
416 | /* if device is not a wakeup source, disable it for powersave */ | ||
417 | if (!device_may_wakeup(&pdev->dev)) | ||
418 | tc3589x_keypad_disable(keypad); | ||
419 | else | ||
420 | enable_irq_wake(irq); | ||
421 | |||
422 | return 0; | ||
423 | } | ||
424 | |||
425 | static int tc3589x_keypad_resume(struct device *dev) | ||
426 | { | ||
427 | struct platform_device *pdev = to_platform_device(dev); | ||
428 | struct tc_keypad *keypad = platform_get_drvdata(pdev); | ||
429 | int irq = platform_get_irq(pdev, 0); | ||
430 | |||
431 | if (!keypad->keypad_stopped) | ||
432 | return 0; | ||
433 | |||
434 | /* enable the device to resume normal operations */ | ||
435 | if (!device_may_wakeup(&pdev->dev)) | ||
436 | tc3589x_keypad_enable(keypad); | ||
437 | else | ||
438 | disable_irq_wake(irq); | ||
439 | |||
440 | return 0; | ||
441 | } | ||
442 | |||
443 | static const SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops, | ||
444 | tc3589x_keypad_suspend, tc3589x_keypad_resume); | ||
445 | #endif | ||
446 | |||
447 | static struct platform_driver tc3589x_keypad_driver = { | ||
448 | .driver.name = "tc3589x-keypad", | ||
449 | .driver.owner = THIS_MODULE, | ||
450 | #ifdef CONFIG_PM | ||
451 | .driver.pm = &tc3589x_keypad_dev_pm_ops, | ||
452 | #endif | ||
453 | .probe = tc3589x_keypad_probe, | ||
454 | .remove = __devexit_p(tc3589x_keypad_remove), | ||
455 | }; | ||
456 | |||
457 | static int __init tc3589x_keypad_init(void) | ||
458 | { | ||
459 | return platform_driver_register(&tc3589x_keypad_driver); | ||
460 | } | ||
461 | module_init(tc3589x_keypad_init); | ||
462 | |||
463 | static void __exit tc3589x_keypad_exit(void) | ||
464 | { | ||
465 | return platform_driver_unregister(&tc3589x_keypad_driver); | ||
466 | } | ||
467 | module_exit(tc3589x_keypad_exit); | ||
468 | |||
469 | MODULE_LICENSE("GPL v2"); | ||
470 | MODULE_AUTHOR("Jayeeta Banerjee/Sundar Iyer"); | ||
471 | MODULE_DESCRIPTION("TC35893 Keypad Driver"); | ||
472 | MODULE_ALIAS("platform:tc3589x-keypad") | ||
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 3a1493b8b5e5..e8e704f52746 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -218,12 +218,12 @@ config MFD_STMPE | |||
218 | Keypad: stmpe-keypad | 218 | Keypad: stmpe-keypad |
219 | Touchscreen: stmpe-ts | 219 | Touchscreen: stmpe-ts |
220 | 220 | ||
221 | config MFD_TC35892 | 221 | config MFD_TC3589X |
222 | bool "Support Toshiba TC35892" | 222 | bool "Support Toshiba TC35892 and variants" |
223 | depends on I2C=y && GENERIC_HARDIRQS | 223 | depends on I2C=y && GENERIC_HARDIRQS |
224 | select MFD_CORE | 224 | select MFD_CORE |
225 | help | 225 | help |
226 | Support for the Toshiba TC35892 I/O Expander. | 226 | Support for the Toshiba TC35892 and variants I/O Expander. |
227 | 227 | ||
228 | This driver provides common support for accessing the device, | 228 | This driver provides common support for accessing the device, |
229 | additional drivers must be enabled in order to use the | 229 | additional drivers must be enabled in order to use the |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index f54b3659abbb..e590d1e44cf0 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
@@ -16,7 +16,7 @@ obj-$(CONFIG_MFD_DAVINCI_VOICECODEC) += davinci_voicecodec.o | |||
16 | obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o | 16 | obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o |
17 | 17 | ||
18 | obj-$(CONFIG_MFD_STMPE) += stmpe.o | 18 | obj-$(CONFIG_MFD_STMPE) += stmpe.o |
19 | obj-$(CONFIG_MFD_TC35892) += tc35892.o | 19 | obj-$(CONFIG_MFD_TC3589X) += tc3589x.o |
20 | obj-$(CONFIG_MFD_T7L66XB) += t7l66xb.o tmio_core.o | 20 | obj-$(CONFIG_MFD_T7L66XB) += t7l66xb.o tmio_core.o |
21 | obj-$(CONFIG_MFD_TC6387XB) += tc6387xb.o tmio_core.o | 21 | obj-$(CONFIG_MFD_TC6387XB) += tc6387xb.o tmio_core.o |
22 | obj-$(CONFIG_MFD_TC6393XB) += tc6393xb.o tmio_core.o | 22 | obj-$(CONFIG_MFD_TC6393XB) += tc6393xb.o tmio_core.o |
diff --git a/drivers/mfd/tc35892.c b/drivers/mfd/tc35892.c deleted file mode 100644 index e619e2a55997..000000000000 --- a/drivers/mfd/tc35892.c +++ /dev/null | |||
@@ -1,345 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | * Author: Hanumath Prasad <hanumath.prasad@stericsson.com> for ST-Ericsson | ||
6 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/irq.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/mfd/core.h> | ||
15 | #include <linux/mfd/tc35892.h> | ||
16 | |||
17 | /** | ||
18 | * tc35892_reg_read() - read a single TC35892 register | ||
19 | * @tc35892: Device to read from | ||
20 | * @reg: Register to read | ||
21 | */ | ||
22 | int tc35892_reg_read(struct tc35892 *tc35892, u8 reg) | ||
23 | { | ||
24 | int ret; | ||
25 | |||
26 | ret = i2c_smbus_read_byte_data(tc35892->i2c, reg); | ||
27 | if (ret < 0) | ||
28 | dev_err(tc35892->dev, "failed to read reg %#x: %d\n", | ||
29 | reg, ret); | ||
30 | |||
31 | return ret; | ||
32 | } | ||
33 | EXPORT_SYMBOL_GPL(tc35892_reg_read); | ||
34 | |||
35 | /** | ||
36 | * tc35892_reg_read() - write a single TC35892 register | ||
37 | * @tc35892: Device to write to | ||
38 | * @reg: Register to read | ||
39 | * @data: Value to write | ||
40 | */ | ||
41 | int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data) | ||
42 | { | ||
43 | int ret; | ||
44 | |||
45 | ret = i2c_smbus_write_byte_data(tc35892->i2c, reg, data); | ||
46 | if (ret < 0) | ||
47 | dev_err(tc35892->dev, "failed to write reg %#x: %d\n", | ||
48 | reg, ret); | ||
49 | |||
50 | return ret; | ||
51 | } | ||
52 | EXPORT_SYMBOL_GPL(tc35892_reg_write); | ||
53 | |||
54 | /** | ||
55 | * tc35892_block_read() - read multiple TC35892 registers | ||
56 | * @tc35892: Device to read from | ||
57 | * @reg: First register | ||
58 | * @length: Number of registers | ||
59 | * @values: Buffer to write to | ||
60 | */ | ||
61 | int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length, u8 *values) | ||
62 | { | ||
63 | int ret; | ||
64 | |||
65 | ret = i2c_smbus_read_i2c_block_data(tc35892->i2c, reg, length, values); | ||
66 | if (ret < 0) | ||
67 | dev_err(tc35892->dev, "failed to read regs %#x: %d\n", | ||
68 | reg, ret); | ||
69 | |||
70 | return ret; | ||
71 | } | ||
72 | EXPORT_SYMBOL_GPL(tc35892_block_read); | ||
73 | |||
74 | /** | ||
75 | * tc35892_block_write() - write multiple TC35892 registers | ||
76 | * @tc35892: Device to write to | ||
77 | * @reg: First register | ||
78 | * @length: Number of registers | ||
79 | * @values: Values to write | ||
80 | */ | ||
81 | int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length, | ||
82 | const u8 *values) | ||
83 | { | ||
84 | int ret; | ||
85 | |||
86 | ret = i2c_smbus_write_i2c_block_data(tc35892->i2c, reg, length, | ||
87 | values); | ||
88 | if (ret < 0) | ||
89 | dev_err(tc35892->dev, "failed to write regs %#x: %d\n", | ||
90 | reg, ret); | ||
91 | |||
92 | return ret; | ||
93 | } | ||
94 | EXPORT_SYMBOL_GPL(tc35892_block_write); | ||
95 | |||
96 | /** | ||
97 | * tc35892_set_bits() - set the value of a bitfield in a TC35892 register | ||
98 | * @tc35892: Device to write to | ||
99 | * @reg: Register to write | ||
100 | * @mask: Mask of bits to set | ||
101 | * @values: Value to set | ||
102 | */ | ||
103 | int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val) | ||
104 | { | ||
105 | int ret; | ||
106 | |||
107 | mutex_lock(&tc35892->lock); | ||
108 | |||
109 | ret = tc35892_reg_read(tc35892, reg); | ||
110 | if (ret < 0) | ||
111 | goto out; | ||
112 | |||
113 | ret &= ~mask; | ||
114 | ret |= val; | ||
115 | |||
116 | ret = tc35892_reg_write(tc35892, reg, ret); | ||
117 | |||
118 | out: | ||
119 | mutex_unlock(&tc35892->lock); | ||
120 | return ret; | ||
121 | } | ||
122 | EXPORT_SYMBOL_GPL(tc35892_set_bits); | ||
123 | |||
124 | static struct resource gpio_resources[] = { | ||
125 | { | ||
126 | .start = TC35892_INT_GPIIRQ, | ||
127 | .end = TC35892_INT_GPIIRQ, | ||
128 | .flags = IORESOURCE_IRQ, | ||
129 | }, | ||
130 | }; | ||
131 | |||
132 | static struct mfd_cell tc35892_devs[] = { | ||
133 | { | ||
134 | .name = "tc35892-gpio", | ||
135 | .num_resources = ARRAY_SIZE(gpio_resources), | ||
136 | .resources = &gpio_resources[0], | ||
137 | }, | ||
138 | }; | ||
139 | |||
140 | static irqreturn_t tc35892_irq(int irq, void *data) | ||
141 | { | ||
142 | struct tc35892 *tc35892 = data; | ||
143 | int status; | ||
144 | |||
145 | status = tc35892_reg_read(tc35892, TC35892_IRQST); | ||
146 | if (status < 0) | ||
147 | return IRQ_NONE; | ||
148 | |||
149 | while (status) { | ||
150 | int bit = __ffs(status); | ||
151 | |||
152 | handle_nested_irq(tc35892->irq_base + bit); | ||
153 | status &= ~(1 << bit); | ||
154 | } | ||
155 | |||
156 | /* | ||
157 | * A dummy read or write (to any register) appears to be necessary to | ||
158 | * have the last interrupt clear (for example, GPIO IC write) take | ||
159 | * effect. | ||
160 | */ | ||
161 | tc35892_reg_read(tc35892, TC35892_IRQST); | ||
162 | |||
163 | return IRQ_HANDLED; | ||
164 | } | ||
165 | |||
166 | static void tc35892_irq_dummy(unsigned int irq) | ||
167 | { | ||
168 | /* No mask/unmask at this level */ | ||
169 | } | ||
170 | |||
171 | static struct irq_chip tc35892_irq_chip = { | ||
172 | .name = "tc35892", | ||
173 | .mask = tc35892_irq_dummy, | ||
174 | .unmask = tc35892_irq_dummy, | ||
175 | }; | ||
176 | |||
177 | static int tc35892_irq_init(struct tc35892 *tc35892) | ||
178 | { | ||
179 | int base = tc35892->irq_base; | ||
180 | int irq; | ||
181 | |||
182 | for (irq = base; irq < base + TC35892_NR_INTERNAL_IRQS; irq++) { | ||
183 | set_irq_chip_data(irq, tc35892); | ||
184 | set_irq_chip_and_handler(irq, &tc35892_irq_chip, | ||
185 | handle_edge_irq); | ||
186 | set_irq_nested_thread(irq, 1); | ||
187 | #ifdef CONFIG_ARM | ||
188 | set_irq_flags(irq, IRQF_VALID); | ||
189 | #else | ||
190 | set_irq_noprobe(irq); | ||
191 | #endif | ||
192 | } | ||
193 | |||
194 | return 0; | ||
195 | } | ||
196 | |||
197 | static void tc35892_irq_remove(struct tc35892 *tc35892) | ||
198 | { | ||
199 | int base = tc35892->irq_base; | ||
200 | int irq; | ||
201 | |||
202 | for (irq = base; irq < base + TC35892_NR_INTERNAL_IRQS; irq++) { | ||
203 | #ifdef CONFIG_ARM | ||
204 | set_irq_flags(irq, 0); | ||
205 | #endif | ||
206 | set_irq_chip_and_handler(irq, NULL, NULL); | ||
207 | set_irq_chip_data(irq, NULL); | ||
208 | } | ||
209 | } | ||
210 | |||
211 | static int tc35892_chip_init(struct tc35892 *tc35892) | ||
212 | { | ||
213 | int manf, ver, ret; | ||
214 | |||
215 | manf = tc35892_reg_read(tc35892, TC35892_MANFCODE); | ||
216 | if (manf < 0) | ||
217 | return manf; | ||
218 | |||
219 | ver = tc35892_reg_read(tc35892, TC35892_VERSION); | ||
220 | if (ver < 0) | ||
221 | return ver; | ||
222 | |||
223 | if (manf != TC35892_MANFCODE_MAGIC) { | ||
224 | dev_err(tc35892->dev, "unknown manufacturer: %#x\n", manf); | ||
225 | return -EINVAL; | ||
226 | } | ||
227 | |||
228 | dev_info(tc35892->dev, "manufacturer: %#x, version: %#x\n", manf, ver); | ||
229 | |||
230 | /* Put everything except the IRQ module into reset */ | ||
231 | ret = tc35892_reg_write(tc35892, TC35892_RSTCTRL, | ||
232 | TC35892_RSTCTRL_TIMRST | ||
233 | | TC35892_RSTCTRL_ROTRST | ||
234 | | TC35892_RSTCTRL_KBDRST | ||
235 | | TC35892_RSTCTRL_GPIRST); | ||
236 | if (ret < 0) | ||
237 | return ret; | ||
238 | |||
239 | /* Clear the reset interrupt. */ | ||
240 | return tc35892_reg_write(tc35892, TC35892_RSTINTCLR, 0x1); | ||
241 | } | ||
242 | |||
243 | static int __devinit tc35892_probe(struct i2c_client *i2c, | ||
244 | const struct i2c_device_id *id) | ||
245 | { | ||
246 | struct tc35892_platform_data *pdata = i2c->dev.platform_data; | ||
247 | struct tc35892 *tc35892; | ||
248 | int ret; | ||
249 | |||
250 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA | ||
251 | | I2C_FUNC_SMBUS_I2C_BLOCK)) | ||
252 | return -EIO; | ||
253 | |||
254 | tc35892 = kzalloc(sizeof(struct tc35892), GFP_KERNEL); | ||
255 | if (!tc35892) | ||
256 | return -ENOMEM; | ||
257 | |||
258 | mutex_init(&tc35892->lock); | ||
259 | |||
260 | tc35892->dev = &i2c->dev; | ||
261 | tc35892->i2c = i2c; | ||
262 | tc35892->pdata = pdata; | ||
263 | tc35892->irq_base = pdata->irq_base; | ||
264 | tc35892->num_gpio = id->driver_data; | ||
265 | |||
266 | i2c_set_clientdata(i2c, tc35892); | ||
267 | |||
268 | ret = tc35892_chip_init(tc35892); | ||
269 | if (ret) | ||
270 | goto out_free; | ||
271 | |||
272 | ret = tc35892_irq_init(tc35892); | ||
273 | if (ret) | ||
274 | goto out_free; | ||
275 | |||
276 | ret = request_threaded_irq(tc35892->i2c->irq, NULL, tc35892_irq, | ||
277 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | ||
278 | "tc35892", tc35892); | ||
279 | if (ret) { | ||
280 | dev_err(tc35892->dev, "failed to request IRQ: %d\n", ret); | ||
281 | goto out_removeirq; | ||
282 | } | ||
283 | |||
284 | ret = mfd_add_devices(tc35892->dev, -1, tc35892_devs, | ||
285 | ARRAY_SIZE(tc35892_devs), NULL, | ||
286 | tc35892->irq_base); | ||
287 | if (ret) { | ||
288 | dev_err(tc35892->dev, "failed to add children\n"); | ||
289 | goto out_freeirq; | ||
290 | } | ||
291 | |||
292 | return 0; | ||
293 | |||
294 | out_freeirq: | ||
295 | free_irq(tc35892->i2c->irq, tc35892); | ||
296 | out_removeirq: | ||
297 | tc35892_irq_remove(tc35892); | ||
298 | out_free: | ||
299 | kfree(tc35892); | ||
300 | return ret; | ||
301 | } | ||
302 | |||
303 | static int __devexit tc35892_remove(struct i2c_client *client) | ||
304 | { | ||
305 | struct tc35892 *tc35892 = i2c_get_clientdata(client); | ||
306 | |||
307 | mfd_remove_devices(tc35892->dev); | ||
308 | |||
309 | free_irq(tc35892->i2c->irq, tc35892); | ||
310 | tc35892_irq_remove(tc35892); | ||
311 | |||
312 | kfree(tc35892); | ||
313 | |||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | static const struct i2c_device_id tc35892_id[] = { | ||
318 | { "tc35892", 24 }, | ||
319 | { } | ||
320 | }; | ||
321 | MODULE_DEVICE_TABLE(i2c, tc35892_id); | ||
322 | |||
323 | static struct i2c_driver tc35892_driver = { | ||
324 | .driver.name = "tc35892", | ||
325 | .driver.owner = THIS_MODULE, | ||
326 | .probe = tc35892_probe, | ||
327 | .remove = __devexit_p(tc35892_remove), | ||
328 | .id_table = tc35892_id, | ||
329 | }; | ||
330 | |||
331 | static int __init tc35892_init(void) | ||
332 | { | ||
333 | return i2c_add_driver(&tc35892_driver); | ||
334 | } | ||
335 | subsys_initcall(tc35892_init); | ||
336 | |||
337 | static void __exit tc35892_exit(void) | ||
338 | { | ||
339 | i2c_del_driver(&tc35892_driver); | ||
340 | } | ||
341 | module_exit(tc35892_exit); | ||
342 | |||
343 | MODULE_LICENSE("GPL v2"); | ||
344 | MODULE_DESCRIPTION("TC35892 MFD core driver"); | ||
345 | MODULE_AUTHOR("Hanumath Prasad, Rabin Vincent"); | ||
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c new file mode 100644 index 000000000000..729dbeed2ce0 --- /dev/null +++ b/drivers/mfd/tc3589x.c | |||
@@ -0,0 +1,422 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | * Author: Hanumath Prasad <hanumath.prasad@stericsson.com> for ST-Ericsson | ||
6 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/irq.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/mfd/core.h> | ||
15 | #include <linux/mfd/tc3589x.h> | ||
16 | |||
17 | #define TC3589x_CLKMODE_MODCTL_SLEEP 0x0 | ||
18 | #define TC3589x_CLKMODE_MODCTL_OPERATION (1 << 0) | ||
19 | |||
20 | /** | ||
21 | * tc3589x_reg_read() - read a single TC3589x register | ||
22 | * @tc3589x: Device to read from | ||
23 | * @reg: Register to read | ||
24 | */ | ||
25 | int tc3589x_reg_read(struct tc3589x *tc3589x, u8 reg) | ||
26 | { | ||
27 | int ret; | ||
28 | |||
29 | ret = i2c_smbus_read_byte_data(tc3589x->i2c, reg); | ||
30 | if (ret < 0) | ||
31 | dev_err(tc3589x->dev, "failed to read reg %#x: %d\n", | ||
32 | reg, ret); | ||
33 | |||
34 | return ret; | ||
35 | } | ||
36 | EXPORT_SYMBOL_GPL(tc3589x_reg_read); | ||
37 | |||
38 | /** | ||
39 | * tc3589x_reg_read() - write a single TC3589x register | ||
40 | * @tc3589x: Device to write to | ||
41 | * @reg: Register to read | ||
42 | * @data: Value to write | ||
43 | */ | ||
44 | int tc3589x_reg_write(struct tc3589x *tc3589x, u8 reg, u8 data) | ||
45 | { | ||
46 | int ret; | ||
47 | |||
48 | ret = i2c_smbus_write_byte_data(tc3589x->i2c, reg, data); | ||
49 | if (ret < 0) | ||
50 | dev_err(tc3589x->dev, "failed to write reg %#x: %d\n", | ||
51 | reg, ret); | ||
52 | |||
53 | return ret; | ||
54 | } | ||
55 | EXPORT_SYMBOL_GPL(tc3589x_reg_write); | ||
56 | |||
57 | /** | ||
58 | * tc3589x_block_read() - read multiple TC3589x registers | ||
59 | * @tc3589x: Device to read from | ||
60 | * @reg: First register | ||
61 | * @length: Number of registers | ||
62 | * @values: Buffer to write to | ||
63 | */ | ||
64 | int tc3589x_block_read(struct tc3589x *tc3589x, u8 reg, u8 length, u8 *values) | ||
65 | { | ||
66 | int ret; | ||
67 | |||
68 | ret = i2c_smbus_read_i2c_block_data(tc3589x->i2c, reg, length, values); | ||
69 | if (ret < 0) | ||
70 | dev_err(tc3589x->dev, "failed to read regs %#x: %d\n", | ||
71 | reg, ret); | ||
72 | |||
73 | return ret; | ||
74 | } | ||
75 | EXPORT_SYMBOL_GPL(tc3589x_block_read); | ||
76 | |||
77 | /** | ||
78 | * tc3589x_block_write() - write multiple TC3589x registers | ||
79 | * @tc3589x: Device to write to | ||
80 | * @reg: First register | ||
81 | * @length: Number of registers | ||
82 | * @values: Values to write | ||
83 | */ | ||
84 | int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length, | ||
85 | const u8 *values) | ||
86 | { | ||
87 | int ret; | ||
88 | |||
89 | ret = i2c_smbus_write_i2c_block_data(tc3589x->i2c, reg, length, | ||
90 | values); | ||
91 | if (ret < 0) | ||
92 | dev_err(tc3589x->dev, "failed to write regs %#x: %d\n", | ||
93 | reg, ret); | ||
94 | |||
95 | return ret; | ||
96 | } | ||
97 | EXPORT_SYMBOL_GPL(tc3589x_block_write); | ||
98 | |||
99 | /** | ||
100 | * tc3589x_set_bits() - set the value of a bitfield in a TC3589x register | ||
101 | * @tc3589x: Device to write to | ||
102 | * @reg: Register to write | ||
103 | * @mask: Mask of bits to set | ||
104 | * @values: Value to set | ||
105 | */ | ||
106 | int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val) | ||
107 | { | ||
108 | int ret; | ||
109 | |||
110 | mutex_lock(&tc3589x->lock); | ||
111 | |||
112 | ret = tc3589x_reg_read(tc3589x, reg); | ||
113 | if (ret < 0) | ||
114 | goto out; | ||
115 | |||
116 | ret &= ~mask; | ||
117 | ret |= val; | ||
118 | |||
119 | ret = tc3589x_reg_write(tc3589x, reg, ret); | ||
120 | |||
121 | out: | ||
122 | mutex_unlock(&tc3589x->lock); | ||
123 | return ret; | ||
124 | } | ||
125 | EXPORT_SYMBOL_GPL(tc3589x_set_bits); | ||
126 | |||
127 | static struct resource gpio_resources[] = { | ||
128 | { | ||
129 | .start = TC3589x_INT_GPIIRQ, | ||
130 | .end = TC3589x_INT_GPIIRQ, | ||
131 | .flags = IORESOURCE_IRQ, | ||
132 | }, | ||
133 | }; | ||
134 | |||
135 | static struct resource keypad_resources[] = { | ||
136 | { | ||
137 | .start = TC3589x_INT_KBDIRQ, | ||
138 | .end = TC3589x_INT_KBDIRQ, | ||
139 | .flags = IORESOURCE_IRQ, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | static struct mfd_cell tc3589x_dev_gpio[] = { | ||
144 | { | ||
145 | .name = "tc3589x-gpio", | ||
146 | .num_resources = ARRAY_SIZE(gpio_resources), | ||
147 | .resources = &gpio_resources[0], | ||
148 | }, | ||
149 | }; | ||
150 | |||
151 | static struct mfd_cell tc3589x_dev_keypad[] = { | ||
152 | { | ||
153 | .name = "tc3589x-keypad", | ||
154 | .num_resources = ARRAY_SIZE(keypad_resources), | ||
155 | .resources = &keypad_resources[0], | ||
156 | }, | ||
157 | }; | ||
158 | |||
159 | static irqreturn_t tc3589x_irq(int irq, void *data) | ||
160 | { | ||
161 | struct tc3589x *tc3589x = data; | ||
162 | int status; | ||
163 | |||
164 | again: | ||
165 | status = tc3589x_reg_read(tc3589x, TC3589x_IRQST); | ||
166 | if (status < 0) | ||
167 | return IRQ_NONE; | ||
168 | |||
169 | while (status) { | ||
170 | int bit = __ffs(status); | ||
171 | |||
172 | handle_nested_irq(tc3589x->irq_base + bit); | ||
173 | status &= ~(1 << bit); | ||
174 | } | ||
175 | |||
176 | /* | ||
177 | * A dummy read or write (to any register) appears to be necessary to | ||
178 | * have the last interrupt clear (for example, GPIO IC write) take | ||
179 | * effect. In such a case, recheck for any interrupt which is still | ||
180 | * pending. | ||
181 | */ | ||
182 | status = tc3589x_reg_read(tc3589x, TC3589x_IRQST); | ||
183 | if (status) | ||
184 | goto again; | ||
185 | |||
186 | return IRQ_HANDLED; | ||
187 | } | ||
188 | |||
189 | static int tc3589x_irq_init(struct tc3589x *tc3589x) | ||
190 | { | ||
191 | int base = tc3589x->irq_base; | ||
192 | int irq; | ||
193 | |||
194 | for (irq = base; irq < base + TC3589x_NR_INTERNAL_IRQS; irq++) { | ||
195 | set_irq_chip_data(irq, tc3589x); | ||
196 | set_irq_chip_and_handler(irq, &dummy_irq_chip, | ||
197 | handle_edge_irq); | ||
198 | set_irq_nested_thread(irq, 1); | ||
199 | #ifdef CONFIG_ARM | ||
200 | set_irq_flags(irq, IRQF_VALID); | ||
201 | #else | ||
202 | set_irq_noprobe(irq); | ||
203 | #endif | ||
204 | } | ||
205 | |||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | static void tc3589x_irq_remove(struct tc3589x *tc3589x) | ||
210 | { | ||
211 | int base = tc3589x->irq_base; | ||
212 | int irq; | ||
213 | |||
214 | for (irq = base; irq < base + TC3589x_NR_INTERNAL_IRQS; irq++) { | ||
215 | #ifdef CONFIG_ARM | ||
216 | set_irq_flags(irq, 0); | ||
217 | #endif | ||
218 | set_irq_chip_and_handler(irq, NULL, NULL); | ||
219 | set_irq_chip_data(irq, NULL); | ||
220 | } | ||
221 | } | ||
222 | |||
223 | static int tc3589x_chip_init(struct tc3589x *tc3589x) | ||
224 | { | ||
225 | int manf, ver, ret; | ||
226 | |||
227 | manf = tc3589x_reg_read(tc3589x, TC3589x_MANFCODE); | ||
228 | if (manf < 0) | ||
229 | return manf; | ||
230 | |||
231 | ver = tc3589x_reg_read(tc3589x, TC3589x_VERSION); | ||
232 | if (ver < 0) | ||
233 | return ver; | ||
234 | |||
235 | if (manf != TC3589x_MANFCODE_MAGIC) { | ||
236 | dev_err(tc3589x->dev, "unknown manufacturer: %#x\n", manf); | ||
237 | return -EINVAL; | ||
238 | } | ||
239 | |||
240 | dev_info(tc3589x->dev, "manufacturer: %#x, version: %#x\n", manf, ver); | ||
241 | |||
242 | /* | ||
243 | * Put everything except the IRQ module into reset; | ||
244 | * also spare the GPIO module for any pin initialization | ||
245 | * done during pre-kernel boot | ||
246 | */ | ||
247 | ret = tc3589x_reg_write(tc3589x, TC3589x_RSTCTRL, | ||
248 | TC3589x_RSTCTRL_TIMRST | ||
249 | | TC3589x_RSTCTRL_ROTRST | ||
250 | | TC3589x_RSTCTRL_KBDRST); | ||
251 | if (ret < 0) | ||
252 | return ret; | ||
253 | |||
254 | /* Clear the reset interrupt. */ | ||
255 | return tc3589x_reg_write(tc3589x, TC3589x_RSTINTCLR, 0x1); | ||
256 | } | ||
257 | |||
258 | static int __devinit tc3589x_device_init(struct tc3589x *tc3589x) | ||
259 | { | ||
260 | int ret = 0; | ||
261 | unsigned int blocks = tc3589x->pdata->block; | ||
262 | |||
263 | if (blocks & TC3589x_BLOCK_GPIO) { | ||
264 | ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_gpio, | ||
265 | ARRAY_SIZE(tc3589x_dev_gpio), NULL, | ||
266 | tc3589x->irq_base); | ||
267 | if (ret) { | ||
268 | dev_err(tc3589x->dev, "failed to add gpio child\n"); | ||
269 | return ret; | ||
270 | } | ||
271 | dev_info(tc3589x->dev, "added gpio block\n"); | ||
272 | } | ||
273 | |||
274 | if (blocks & TC3589x_BLOCK_KEYPAD) { | ||
275 | ret = mfd_add_devices(tc3589x->dev, -1, tc3589x_dev_keypad, | ||
276 | ARRAY_SIZE(tc3589x_dev_keypad), NULL, | ||
277 | tc3589x->irq_base); | ||
278 | if (ret) { | ||
279 | dev_err(tc3589x->dev, "failed to keypad child\n"); | ||
280 | return ret; | ||
281 | } | ||
282 | dev_info(tc3589x->dev, "added keypad block\n"); | ||
283 | } | ||
284 | |||
285 | return ret; | ||
286 | } | ||
287 | |||
288 | static int __devinit tc3589x_probe(struct i2c_client *i2c, | ||
289 | const struct i2c_device_id *id) | ||
290 | { | ||
291 | struct tc3589x_platform_data *pdata = i2c->dev.platform_data; | ||
292 | struct tc3589x *tc3589x; | ||
293 | int ret; | ||
294 | |||
295 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA | ||
296 | | I2C_FUNC_SMBUS_I2C_BLOCK)) | ||
297 | return -EIO; | ||
298 | |||
299 | tc3589x = kzalloc(sizeof(struct tc3589x), GFP_KERNEL); | ||
300 | if (!tc3589x) | ||
301 | return -ENOMEM; | ||
302 | |||
303 | mutex_init(&tc3589x->lock); | ||
304 | |||
305 | tc3589x->dev = &i2c->dev; | ||
306 | tc3589x->i2c = i2c; | ||
307 | tc3589x->pdata = pdata; | ||
308 | tc3589x->irq_base = pdata->irq_base; | ||
309 | tc3589x->num_gpio = id->driver_data; | ||
310 | |||
311 | i2c_set_clientdata(i2c, tc3589x); | ||
312 | |||
313 | ret = tc3589x_chip_init(tc3589x); | ||
314 | if (ret) | ||
315 | goto out_free; | ||
316 | |||
317 | ret = tc3589x_irq_init(tc3589x); | ||
318 | if (ret) | ||
319 | goto out_free; | ||
320 | |||
321 | ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq, | ||
322 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | ||
323 | "tc3589x", tc3589x); | ||
324 | if (ret) { | ||
325 | dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret); | ||
326 | goto out_removeirq; | ||
327 | } | ||
328 | |||
329 | ret = tc3589x_device_init(tc3589x); | ||
330 | if (ret) { | ||
331 | dev_err(tc3589x->dev, "failed to add child devices\n"); | ||
332 | goto out_freeirq; | ||
333 | } | ||
334 | |||
335 | return 0; | ||
336 | |||
337 | out_freeirq: | ||
338 | free_irq(tc3589x->i2c->irq, tc3589x); | ||
339 | out_removeirq: | ||
340 | tc3589x_irq_remove(tc3589x); | ||
341 | out_free: | ||
342 | kfree(tc3589x); | ||
343 | return ret; | ||
344 | } | ||
345 | |||
346 | static int __devexit tc3589x_remove(struct i2c_client *client) | ||
347 | { | ||
348 | struct tc3589x *tc3589x = i2c_get_clientdata(client); | ||
349 | |||
350 | mfd_remove_devices(tc3589x->dev); | ||
351 | |||
352 | free_irq(tc3589x->i2c->irq, tc3589x); | ||
353 | tc3589x_irq_remove(tc3589x); | ||
354 | |||
355 | kfree(tc3589x); | ||
356 | |||
357 | return 0; | ||
358 | } | ||
359 | |||
360 | static int tc3589x_suspend(struct device *dev) | ||
361 | { | ||
362 | struct tc3589x *tc3589x = dev_get_drvdata(dev); | ||
363 | struct i2c_client *client = tc3589x->i2c; | ||
364 | int ret = 0; | ||
365 | |||
366 | /* put the system to sleep mode */ | ||
367 | if (!device_may_wakeup(&client->dev)) | ||
368 | ret = tc3589x_reg_write(tc3589x, TC3589x_CLKMODE, | ||
369 | TC3589x_CLKMODE_MODCTL_SLEEP); | ||
370 | |||
371 | return ret; | ||
372 | } | ||
373 | |||
374 | static int tc3589x_resume(struct device *dev) | ||
375 | { | ||
376 | struct tc3589x *tc3589x = dev_get_drvdata(dev); | ||
377 | struct i2c_client *client = tc3589x->i2c; | ||
378 | int ret = 0; | ||
379 | |||
380 | /* enable the system into operation */ | ||
381 | if (!device_may_wakeup(&client->dev)) | ||
382 | ret = tc3589x_reg_write(tc3589x, TC3589x_CLKMODE, | ||
383 | TC3589x_CLKMODE_MODCTL_OPERATION); | ||
384 | |||
385 | return ret; | ||
386 | } | ||
387 | |||
388 | static const SIMPLE_DEV_PM_OPS(tc3589x_dev_pm_ops, tc3589x_suspend, | ||
389 | tc3589x_resume); | ||
390 | |||
391 | static const struct i2c_device_id tc3589x_id[] = { | ||
392 | { "tc3589x", 24 }, | ||
393 | { } | ||
394 | }; | ||
395 | MODULE_DEVICE_TABLE(i2c, tc3589x_id); | ||
396 | |||
397 | static struct i2c_driver tc3589x_driver = { | ||
398 | .driver.name = "tc3589x", | ||
399 | .driver.owner = THIS_MODULE, | ||
400 | #ifdef CONFIG_PM | ||
401 | .driver.pm = &tc3589x_dev_pm_ops, | ||
402 | #endif | ||
403 | .probe = tc3589x_probe, | ||
404 | .remove = __devexit_p(tc3589x_remove), | ||
405 | .id_table = tc3589x_id, | ||
406 | }; | ||
407 | |||
408 | static int __init tc3589x_init(void) | ||
409 | { | ||
410 | return i2c_add_driver(&tc3589x_driver); | ||
411 | } | ||
412 | subsys_initcall(tc3589x_init); | ||
413 | |||
414 | static void __exit tc3589x_exit(void) | ||
415 | { | ||
416 | i2c_del_driver(&tc3589x_driver); | ||
417 | } | ||
418 | module_exit(tc3589x_exit); | ||
419 | |||
420 | MODULE_LICENSE("GPL v2"); | ||
421 | MODULE_DESCRIPTION("TC3589x MFD core driver"); | ||
422 | MODULE_AUTHOR("Hanumath Prasad, Rabin Vincent"); | ||
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 87b4fc6c98c2..563022825667 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/highmem.h> | 19 | #include <linux/highmem.h> |
20 | #include <linux/log2.h> | 20 | #include <linux/log2.h> |
21 | #include <linux/mmc/host.h> | 21 | #include <linux/mmc/host.h> |
22 | #include <linux/mmc/card.h> | ||
22 | #include <linux/amba/bus.h> | 23 | #include <linux/amba/bus.h> |
23 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
24 | #include <linux/scatterlist.h> | 25 | #include <linux/scatterlist.h> |
@@ -45,6 +46,12 @@ static unsigned int fmax = 515633; | |||
45 | * is asserted (likewise for RX) | 46 | * is asserted (likewise for RX) |
46 | * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY | 47 | * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY |
47 | * is asserted (likewise for RX) | 48 | * is asserted (likewise for RX) |
49 | * @broken_blockend: the MCI_DATABLOCKEND is broken on the hardware | ||
50 | * and will not work at all. | ||
51 | * @broken_blockend_dma: the MCI_DATABLOCKEND is broken on the hardware when | ||
52 | * using DMA. | ||
53 | * @sdio: variant supports SDIO | ||
54 | * @st_clkdiv: true if using a ST-specific clock divider algorithm | ||
48 | */ | 55 | */ |
49 | struct variant_data { | 56 | struct variant_data { |
50 | unsigned int clkreg; | 57 | unsigned int clkreg; |
@@ -52,6 +59,10 @@ struct variant_data { | |||
52 | unsigned int datalength_bits; | 59 | unsigned int datalength_bits; |
53 | unsigned int fifosize; | 60 | unsigned int fifosize; |
54 | unsigned int fifohalfsize; | 61 | unsigned int fifohalfsize; |
62 | bool broken_blockend; | ||
63 | bool broken_blockend_dma; | ||
64 | bool sdio; | ||
65 | bool st_clkdiv; | ||
55 | }; | 66 | }; |
56 | 67 | ||
57 | static struct variant_data variant_arm = { | 68 | static struct variant_data variant_arm = { |
@@ -65,6 +76,8 @@ static struct variant_data variant_u300 = { | |||
65 | .fifohalfsize = 8 * 4, | 76 | .fifohalfsize = 8 * 4, |
66 | .clkreg_enable = 1 << 13, /* HWFCEN */ | 77 | .clkreg_enable = 1 << 13, /* HWFCEN */ |
67 | .datalength_bits = 16, | 78 | .datalength_bits = 16, |
79 | .broken_blockend_dma = true, | ||
80 | .sdio = true, | ||
68 | }; | 81 | }; |
69 | 82 | ||
70 | static struct variant_data variant_ux500 = { | 83 | static struct variant_data variant_ux500 = { |
@@ -73,7 +86,11 @@ static struct variant_data variant_ux500 = { | |||
73 | .clkreg = MCI_CLK_ENABLE, | 86 | .clkreg = MCI_CLK_ENABLE, |
74 | .clkreg_enable = 1 << 14, /* HWFCEN */ | 87 | .clkreg_enable = 1 << 14, /* HWFCEN */ |
75 | .datalength_bits = 24, | 88 | .datalength_bits = 24, |
89 | .broken_blockend = true, | ||
90 | .sdio = true, | ||
91 | .st_clkdiv = true, | ||
76 | }; | 92 | }; |
93 | |||
77 | /* | 94 | /* |
78 | * This must be called with host->lock held | 95 | * This must be called with host->lock held |
79 | */ | 96 | */ |
@@ -86,7 +103,22 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) | |||
86 | if (desired >= host->mclk) { | 103 | if (desired >= host->mclk) { |
87 | clk = MCI_CLK_BYPASS; | 104 | clk = MCI_CLK_BYPASS; |
88 | host->cclk = host->mclk; | 105 | host->cclk = host->mclk; |
106 | } else if (variant->st_clkdiv) { | ||
107 | /* | ||
108 | * DB8500 TRM says f = mclk / (clkdiv + 2) | ||
109 | * => clkdiv = (mclk / f) - 2 | ||
110 | * Round the divider up so we don't exceed the max | ||
111 | * frequency | ||
112 | */ | ||
113 | clk = DIV_ROUND_UP(host->mclk, desired) - 2; | ||
114 | if (clk >= 256) | ||
115 | clk = 255; | ||
116 | host->cclk = host->mclk / (clk + 2); | ||
89 | } else { | 117 | } else { |
118 | /* | ||
119 | * PL180 TRM says f = mclk / (2 * (clkdiv + 1)) | ||
120 | * => clkdiv = mclk / (2 * f) - 1 | ||
121 | */ | ||
90 | clk = host->mclk / (2 * desired) - 1; | 122 | clk = host->mclk / (2 * desired) - 1; |
91 | if (clk >= 256) | 123 | if (clk >= 256) |
92 | clk = 255; | 124 | clk = 255; |
@@ -129,10 +161,26 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq) | |||
129 | spin_lock(&host->lock); | 161 | spin_lock(&host->lock); |
130 | } | 162 | } |
131 | 163 | ||
164 | static void mmci_set_mask1(struct mmci_host *host, unsigned int mask) | ||
165 | { | ||
166 | void __iomem *base = host->base; | ||
167 | |||
168 | if (host->singleirq) { | ||
169 | unsigned int mask0 = readl(base + MMCIMASK0); | ||
170 | |||
171 | mask0 &= ~MCI_IRQ1MASK; | ||
172 | mask0 |= mask; | ||
173 | |||
174 | writel(mask0, base + MMCIMASK0); | ||
175 | } | ||
176 | |||
177 | writel(mask, base + MMCIMASK1); | ||
178 | } | ||
179 | |||
132 | static void mmci_stop_data(struct mmci_host *host) | 180 | static void mmci_stop_data(struct mmci_host *host) |
133 | { | 181 | { |
134 | writel(0, host->base + MMCIDATACTRL); | 182 | writel(0, host->base + MMCIDATACTRL); |
135 | writel(0, host->base + MMCIMASK1); | 183 | mmci_set_mask1(host, 0); |
136 | host->data = NULL; | 184 | host->data = NULL; |
137 | } | 185 | } |
138 | 186 | ||
@@ -162,6 +210,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | |||
162 | host->data = data; | 210 | host->data = data; |
163 | host->size = data->blksz * data->blocks; | 211 | host->size = data->blksz * data->blocks; |
164 | host->data_xfered = 0; | 212 | host->data_xfered = 0; |
213 | host->blockend = false; | ||
214 | host->dataend = false; | ||
165 | 215 | ||
166 | mmci_init_sg(host, data); | 216 | mmci_init_sg(host, data); |
167 | 217 | ||
@@ -196,9 +246,14 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | |||
196 | irqmask = MCI_TXFIFOHALFEMPTYMASK; | 246 | irqmask = MCI_TXFIFOHALFEMPTYMASK; |
197 | } | 247 | } |
198 | 248 | ||
249 | /* The ST Micro variants has a special bit to enable SDIO */ | ||
250 | if (variant->sdio && host->mmc->card) | ||
251 | if (mmc_card_sdio(host->mmc->card)) | ||
252 | datactrl |= MCI_ST_DPSM_SDIOEN; | ||
253 | |||
199 | writel(datactrl, base + MMCIDATACTRL); | 254 | writel(datactrl, base + MMCIDATACTRL); |
200 | writel(readl(base + MMCIMASK0) & ~MCI_DATAENDMASK, base + MMCIMASK0); | 255 | writel(readl(base + MMCIMASK0) & ~MCI_DATAENDMASK, base + MMCIMASK0); |
201 | writel(irqmask, base + MMCIMASK1); | 256 | mmci_set_mask1(host, irqmask); |
202 | } | 257 | } |
203 | 258 | ||
204 | static void | 259 | static void |
@@ -233,20 +288,9 @@ static void | |||
233 | mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | 288 | mmci_data_irq(struct mmci_host *host, struct mmc_data *data, |
234 | unsigned int status) | 289 | unsigned int status) |
235 | { | 290 | { |
236 | if (status & MCI_DATABLOCKEND) { | 291 | struct variant_data *variant = host->variant; |
237 | host->data_xfered += data->blksz; | 292 | |
238 | #ifdef CONFIG_ARCH_U300 | 293 | /* First check for errors */ |
239 | /* | ||
240 | * On the U300 some signal or other is | ||
241 | * badly routed so that a data write does | ||
242 | * not properly terminate with a MCI_DATAEND | ||
243 | * status flag. This quirk will make writes | ||
244 | * work again. | ||
245 | */ | ||
246 | if (data->flags & MMC_DATA_WRITE) | ||
247 | status |= MCI_DATAEND; | ||
248 | #endif | ||
249 | } | ||
250 | if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) { | 294 | if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) { |
251 | dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status); | 295 | dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status); |
252 | if (status & MCI_DATACRCFAIL) | 296 | if (status & MCI_DATACRCFAIL) |
@@ -255,7 +299,10 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | |||
255 | data->error = -ETIMEDOUT; | 299 | data->error = -ETIMEDOUT; |
256 | else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) | 300 | else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) |
257 | data->error = -EIO; | 301 | data->error = -EIO; |
258 | status |= MCI_DATAEND; | 302 | |
303 | /* Force-complete the transaction */ | ||
304 | host->blockend = true; | ||
305 | host->dataend = true; | ||
259 | 306 | ||
260 | /* | 307 | /* |
261 | * We hit an error condition. Ensure that any data | 308 | * We hit an error condition. Ensure that any data |
@@ -273,9 +320,64 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | |||
273 | local_irq_restore(flags); | 320 | local_irq_restore(flags); |
274 | } | 321 | } |
275 | } | 322 | } |
276 | if (status & MCI_DATAEND) { | 323 | |
324 | /* | ||
325 | * On ARM variants in PIO mode, MCI_DATABLOCKEND | ||
326 | * is always sent first, and we increase the | ||
327 | * transfered number of bytes for that IRQ. Then | ||
328 | * MCI_DATAEND follows and we conclude the transaction. | ||
329 | * | ||
330 | * On the Ux500 single-IRQ variant MCI_DATABLOCKEND | ||
331 | * doesn't seem to immediately clear from the status, | ||
332 | * so we can't use it keep count when only one irq is | ||
333 | * used because the irq will hit for other reasons, and | ||
334 | * then the flag is still up. So we use the MCI_DATAEND | ||
335 | * IRQ at the end of the entire transfer because | ||
336 | * MCI_DATABLOCKEND is broken. | ||
337 | * | ||
338 | * In the U300, the IRQs can arrive out-of-order, | ||
339 | * e.g. MCI_DATABLOCKEND sometimes arrives after MCI_DATAEND, | ||
340 | * so for this case we use the flags "blockend" and | ||
341 | * "dataend" to make sure both IRQs have arrived before | ||
342 | * concluding the transaction. (This does not apply | ||
343 | * to the Ux500 which doesn't fire MCI_DATABLOCKEND | ||
344 | * at all.) In DMA mode it suffers from the same problem | ||
345 | * as the Ux500. | ||
346 | */ | ||
347 | if (status & MCI_DATABLOCKEND) { | ||
348 | /* | ||
349 | * Just being a little over-cautious, we do not | ||
350 | * use this progressive update if the hardware blockend | ||
351 | * flag is unreliable: since it can stay high between | ||
352 | * IRQs it will corrupt the transfer counter. | ||
353 | */ | ||
354 | if (!variant->broken_blockend) | ||
355 | host->data_xfered += data->blksz; | ||
356 | host->blockend = true; | ||
357 | } | ||
358 | |||
359 | if (status & MCI_DATAEND) | ||
360 | host->dataend = true; | ||
361 | |||
362 | /* | ||
363 | * On variants with broken blockend we shall only wait for dataend, | ||
364 | * on others we must sync with the blockend signal since they can | ||
365 | * appear out-of-order. | ||
366 | */ | ||
367 | if (host->dataend && (host->blockend || variant->broken_blockend)) { | ||
277 | mmci_stop_data(host); | 368 | mmci_stop_data(host); |
278 | 369 | ||
370 | /* Reset these flags */ | ||
371 | host->blockend = false; | ||
372 | host->dataend = false; | ||
373 | |||
374 | /* | ||
375 | * Variants with broken blockend flags need to handle the | ||
376 | * end of the entire transfer here. | ||
377 | */ | ||
378 | if (variant->broken_blockend && !data->error) | ||
379 | host->data_xfered += data->blksz * data->blocks; | ||
380 | |||
279 | if (!data->stop) { | 381 | if (!data->stop) { |
280 | mmci_request_end(host, data->mrq); | 382 | mmci_request_end(host, data->mrq); |
281 | } else { | 383 | } else { |
@@ -356,7 +458,32 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem | |||
356 | variant->fifosize : variant->fifohalfsize; | 458 | variant->fifosize : variant->fifohalfsize; |
357 | count = min(remain, maxcnt); | 459 | count = min(remain, maxcnt); |
358 | 460 | ||
359 | writesl(base + MMCIFIFO, ptr, count >> 2); | 461 | /* |
462 | * The ST Micro variant for SDIO transfer sizes | ||
463 | * less then 8 bytes should have clock H/W flow | ||
464 | * control disabled. | ||
465 | */ | ||
466 | if (variant->sdio && | ||
467 | mmc_card_sdio(host->mmc->card)) { | ||
468 | if (count < 8) | ||
469 | writel(readl(host->base + MMCICLOCK) & | ||
470 | ~variant->clkreg_enable, | ||
471 | host->base + MMCICLOCK); | ||
472 | else | ||
473 | writel(readl(host->base + MMCICLOCK) | | ||
474 | variant->clkreg_enable, | ||
475 | host->base + MMCICLOCK); | ||
476 | } | ||
477 | |||
478 | /* | ||
479 | * SDIO especially may want to send something that is | ||
480 | * not divisible by 4 (as opposed to card sectors | ||
481 | * etc), and the FIFO only accept full 32-bit writes. | ||
482 | * So compensate by adding +3 on the count, a single | ||
483 | * byte become a 32bit write, 7 bytes will be two | ||
484 | * 32bit writes etc. | ||
485 | */ | ||
486 | writesl(base + MMCIFIFO, ptr, (count + 3) >> 2); | ||
360 | 487 | ||
361 | ptr += count; | 488 | ptr += count; |
362 | remain -= count; | 489 | remain -= count; |
@@ -437,7 +564,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id) | |||
437 | * "any data available" mode. | 564 | * "any data available" mode. |
438 | */ | 565 | */ |
439 | if (status & MCI_RXACTIVE && host->size < variant->fifosize) | 566 | if (status & MCI_RXACTIVE && host->size < variant->fifosize) |
440 | writel(MCI_RXDATAAVLBLMASK, base + MMCIMASK1); | 567 | mmci_set_mask1(host, MCI_RXDATAAVLBLMASK); |
441 | 568 | ||
442 | /* | 569 | /* |
443 | * If we run out of data, disable the data IRQs; this | 570 | * If we run out of data, disable the data IRQs; this |
@@ -446,7 +573,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id) | |||
446 | * stops us racing with our data end IRQ. | 573 | * stops us racing with our data end IRQ. |
447 | */ | 574 | */ |
448 | if (host->size == 0) { | 575 | if (host->size == 0) { |
449 | writel(0, base + MMCIMASK1); | 576 | mmci_set_mask1(host, 0); |
450 | writel(readl(base + MMCIMASK0) | MCI_DATAENDMASK, base + MMCIMASK0); | 577 | writel(readl(base + MMCIMASK0) | MCI_DATAENDMASK, base + MMCIMASK0); |
451 | } | 578 | } |
452 | 579 | ||
@@ -469,6 +596,14 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) | |||
469 | struct mmc_data *data; | 596 | struct mmc_data *data; |
470 | 597 | ||
471 | status = readl(host->base + MMCISTATUS); | 598 | status = readl(host->base + MMCISTATUS); |
599 | |||
600 | if (host->singleirq) { | ||
601 | if (status & readl(host->base + MMCIMASK1)) | ||
602 | mmci_pio_irq(irq, dev_id); | ||
603 | |||
604 | status &= ~MCI_IRQ1MASK; | ||
605 | } | ||
606 | |||
472 | status &= readl(host->base + MMCIMASK0); | 607 | status &= readl(host->base + MMCIMASK0); |
473 | writel(status, host->base + MMCICLEAR); | 608 | writel(status, host->base + MMCICLEAR); |
474 | 609 | ||
@@ -635,6 +770,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
635 | struct variant_data *variant = id->data; | 770 | struct variant_data *variant = id->data; |
636 | struct mmci_host *host; | 771 | struct mmci_host *host; |
637 | struct mmc_host *mmc; | 772 | struct mmc_host *mmc; |
773 | unsigned int mask; | ||
638 | int ret; | 774 | int ret; |
639 | 775 | ||
640 | /* must have platform data */ | 776 | /* must have platform data */ |
@@ -806,20 +942,30 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
806 | if (ret) | 942 | if (ret) |
807 | goto unmap; | 943 | goto unmap; |
808 | 944 | ||
809 | ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, DRIVER_NAME " (pio)", host); | 945 | if (dev->irq[1] == NO_IRQ) |
810 | if (ret) | 946 | host->singleirq = true; |
811 | goto irq0_free; | 947 | else { |
948 | ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, | ||
949 | DRIVER_NAME " (pio)", host); | ||
950 | if (ret) | ||
951 | goto irq0_free; | ||
952 | } | ||
812 | 953 | ||
813 | writel(MCI_IRQENABLE, host->base + MMCIMASK0); | 954 | mask = MCI_IRQENABLE; |
955 | /* Don't use the datablockend flag if it's broken */ | ||
956 | if (variant->broken_blockend) | ||
957 | mask &= ~MCI_DATABLOCKEND; | ||
814 | 958 | ||
815 | amba_set_drvdata(dev, mmc); | 959 | writel(mask, host->base + MMCIMASK0); |
816 | 960 | ||
817 | mmc_add_host(mmc); | 961 | amba_set_drvdata(dev, mmc); |
818 | 962 | ||
819 | dev_info(&dev->dev, "%s: MMCI rev %x cfg %02x at 0x%016llx irq %d,%d\n", | 963 | dev_info(&dev->dev, "%s: PL%03x rev%u at 0x%08llx irq %d,%d\n", |
820 | mmc_hostname(mmc), amba_rev(dev), amba_config(dev), | 964 | mmc_hostname(mmc), amba_part(dev), amba_rev(dev), |
821 | (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]); | 965 | (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]); |
822 | 966 | ||
967 | mmc_add_host(mmc); | ||
968 | |||
823 | return 0; | 969 | return 0; |
824 | 970 | ||
825 | irq0_free: | 971 | irq0_free: |
@@ -864,7 +1010,8 @@ static int __devexit mmci_remove(struct amba_device *dev) | |||
864 | writel(0, host->base + MMCIDATACTRL); | 1010 | writel(0, host->base + MMCIDATACTRL); |
865 | 1011 | ||
866 | free_irq(dev->irq[0], host); | 1012 | free_irq(dev->irq[0], host); |
867 | free_irq(dev->irq[1], host); | 1013 | if (!host->singleirq) |
1014 | free_irq(dev->irq[1], host); | ||
868 | 1015 | ||
869 | if (host->gpio_wp != -ENOSYS) | 1016 | if (host->gpio_wp != -ENOSYS) |
870 | gpio_free(host->gpio_wp); | 1017 | gpio_free(host->gpio_wp); |
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 4ae887fc0189..df06f01aac89 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
@@ -139,6 +139,11 @@ | |||
139 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ | 139 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ |
140 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATABLOCKENDMASK) | 140 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATABLOCKENDMASK) |
141 | 141 | ||
142 | /* These interrupts are directed to IRQ1 when two IRQ lines are available */ | ||
143 | #define MCI_IRQ1MASK \ | ||
144 | (MCI_RXFIFOHALFFULLMASK | MCI_RXDATAAVLBLMASK | \ | ||
145 | MCI_TXFIFOHALFEMPTYMASK) | ||
146 | |||
142 | #define NR_SG 16 | 147 | #define NR_SG 16 |
143 | 148 | ||
144 | struct clk; | 149 | struct clk; |
@@ -154,6 +159,7 @@ struct mmci_host { | |||
154 | int gpio_cd; | 159 | int gpio_cd; |
155 | int gpio_wp; | 160 | int gpio_wp; |
156 | int gpio_cd_irq; | 161 | int gpio_cd_irq; |
162 | bool singleirq; | ||
157 | 163 | ||
158 | unsigned int data_xfered; | 164 | unsigned int data_xfered; |
159 | 165 | ||
@@ -171,6 +177,9 @@ struct mmci_host { | |||
171 | struct timer_list timer; | 177 | struct timer_list timer; |
172 | unsigned int oldstat; | 178 | unsigned int oldstat; |
173 | 179 | ||
180 | bool blockend; | ||
181 | bool dataend; | ||
182 | |||
174 | /* pio stuff */ | 183 | /* pio stuff */ |
175 | struct sg_mapping_iter sg_miter; | 184 | struct sg_mapping_iter sg_miter; |
176 | unsigned int size; | 185 | unsigned int size; |
diff --git a/drivers/net/caif/caif_shm_u5500.c b/drivers/net/caif/caif_shm_u5500.c index 32b1c6fb2de1..5f771ab712c4 100644 --- a/drivers/net/caif/caif_shm_u5500.c +++ b/drivers/net/caif/caif_shm_u5500.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
14 | #include <mach/mbox.h> | 14 | #include <mach/mbox-db5500.h> |
15 | #include <net/caif/caif_shm.h> | 15 | #include <net/caif/caif_shm.h> |
16 | 16 | ||
17 | MODULE_LICENSE("GPL"); | 17 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig index c80a7a6e7698..de886f3dfd39 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig | |||
@@ -215,7 +215,8 @@ config PCMCIA_PXA2XX | |||
215 | depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ | 215 | depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ |
216 | || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ | 216 | || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ |
217 | || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ | 217 | || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ |
218 | || MACH_VPAC270 || MACH_BALLOON3) | 218 | || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \ |
219 | || MACH_COLIBRI320) | ||
219 | select PCMCIA_SOC_COMMON | 220 | select PCMCIA_SOC_COMMON |
220 | help | 221 | help |
221 | Say Y here to include support for the PXA2xx PCMCIA controller | 222 | Say Y here to include support for the PXA2xx PCMCIA controller |
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 8d9386a22eb3..29935ea921df 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
@@ -50,8 +50,9 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o | |||
50 | sa1100_cs-y += sa1100_generic.o | 50 | sa1100_cs-y += sa1100_generic.o |
51 | sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o | 51 | sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o |
52 | sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o | 52 | sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o |
53 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o | 53 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o |
54 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o | 54 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o |
55 | sa1100_cs-$(CONFIG_SA1100_NANOENGINE) += sa1100_nanoengine.o | ||
55 | sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o | 56 | sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o |
56 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o | 57 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o |
57 | 58 | ||
@@ -70,6 +71,8 @@ pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o | |||
70 | pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o | 71 | pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o |
71 | pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o | 72 | pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o |
72 | pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o | 73 | pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o |
74 | pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o | ||
75 | pxa2xx-obj-$(CONFIG_MACH_COLIBRI320) += pxa2xx_colibri.o | ||
73 | 76 | ||
74 | obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) | 77 | obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) |
75 | 78 | ||
diff --git a/drivers/pcmcia/pxa2xx_balloon3.c b/drivers/pcmcia/pxa2xx_balloon3.c index dbbdd0063202..453c54c97612 100644 --- a/drivers/pcmcia/pxa2xx_balloon3.c +++ b/drivers/pcmcia/pxa2xx_balloon3.c | |||
@@ -39,12 +39,10 @@ static struct pcmcia_irqs irqs[] = { | |||
39 | static int balloon3_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | 39 | static int balloon3_pcmcia_hw_init(struct soc_pcmcia_socket *skt) |
40 | { | 40 | { |
41 | uint16_t ver; | 41 | uint16_t ver; |
42 | int ret; | ||
43 | static void __iomem *fpga_ver; | ||
44 | 42 | ||
45 | ver = __raw_readw(BALLOON3_FPGA_VER); | 43 | ver = __raw_readw(BALLOON3_FPGA_VER); |
46 | if (ver > 0x0201) | 44 | if (ver < 0x4f08) |
47 | pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. " | 45 | pr_warn("The FPGA code, version 0x%04x, is too old. " |
48 | "PCMCIA/CF support might be broken in this version!", | 46 | "PCMCIA/CF support might be broken in this version!", |
49 | ver); | 47 | ver); |
50 | 48 | ||
@@ -97,8 +95,9 @@ static void balloon3_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | |||
97 | static int balloon3_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | 95 | static int balloon3_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, |
98 | const socket_state_t *state) | 96 | const socket_state_t *state) |
99 | { | 97 | { |
100 | __raw_writew((state->flags & SS_RESET) ? BALLOON3_CF_RESET : 0, | 98 | __raw_writew(BALLOON3_CF_RESET, BALLOON3_CF_CONTROL_REG | |
101 | BALLOON3_CF_CONTROL_REG); | 99 | ((state->flags & SS_RESET) ? |
100 | BALLOON3_FPGA_SETnCLR : 0)); | ||
102 | return 0; | 101 | return 0; |
103 | } | 102 | } |
104 | 103 | ||
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index ae07b4db8a6e..3755e7c8c715 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | 27 | ||
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/smemc.h> | ||
29 | #include <asm/io.h> | 30 | #include <asm/io.h> |
30 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
31 | #include <asm/system.h> | 32 | #include <asm/system.h> |
@@ -116,37 +117,49 @@ static inline u_int pxa2xx_pcmcia_cmd_time(u_int mem_clk_10khz, | |||
116 | 117 | ||
117 | static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock ) | 118 | static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock ) |
118 | { | 119 | { |
119 | MCMEM(sock) = ((pxa2xx_mcxx_setup(speed, clock) | 120 | uint32_t val; |
121 | |||
122 | val = ((pxa2xx_mcxx_setup(speed, clock) | ||
120 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) | 123 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) |
121 | | ((pxa2xx_mcxx_asst(speed, clock) | 124 | | ((pxa2xx_mcxx_asst(speed, clock) |
122 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) | 125 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) |
123 | | ((pxa2xx_mcxx_hold(speed, clock) | 126 | | ((pxa2xx_mcxx_hold(speed, clock) |
124 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); | 127 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); |
125 | 128 | ||
129 | __raw_writel(val, MCMEM(sock)); | ||
130 | |||
126 | return 0; | 131 | return 0; |
127 | } | 132 | } |
128 | 133 | ||
129 | static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock ) | 134 | static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock ) |
130 | { | 135 | { |
131 | MCIO(sock) = ((pxa2xx_mcxx_setup(speed, clock) | 136 | uint32_t val; |
137 | |||
138 | val = ((pxa2xx_mcxx_setup(speed, clock) | ||
132 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) | 139 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) |
133 | | ((pxa2xx_mcxx_asst(speed, clock) | 140 | | ((pxa2xx_mcxx_asst(speed, clock) |
134 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) | 141 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) |
135 | | ((pxa2xx_mcxx_hold(speed, clock) | 142 | | ((pxa2xx_mcxx_hold(speed, clock) |
136 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); | 143 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); |
137 | 144 | ||
145 | __raw_writel(val, MCIO(sock)); | ||
146 | |||
138 | return 0; | 147 | return 0; |
139 | } | 148 | } |
140 | 149 | ||
141 | static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock ) | 150 | static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock ) |
142 | { | 151 | { |
143 | MCATT(sock) = ((pxa2xx_mcxx_setup(speed, clock) | 152 | uint32_t val; |
153 | |||
154 | val = ((pxa2xx_mcxx_setup(speed, clock) | ||
144 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) | 155 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) |
145 | | ((pxa2xx_mcxx_asst(speed, clock) | 156 | | ((pxa2xx_mcxx_asst(speed, clock) |
146 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) | 157 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) |
147 | | ((pxa2xx_mcxx_hold(speed, clock) | 158 | | ((pxa2xx_mcxx_hold(speed, clock) |
148 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); | 159 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); |
149 | 160 | ||
161 | __raw_writel(val, MCATT(sock)); | ||
162 | |||
150 | return 0; | 163 | return 0; |
151 | } | 164 | } |
152 | 165 | ||
@@ -166,8 +179,8 @@ static int pxa2xx_pcmcia_set_mcxx(struct soc_pcmcia_socket *skt, unsigned int cl | |||
166 | 179 | ||
167 | static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt) | 180 | static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt) |
168 | { | 181 | { |
169 | unsigned int clk = get_memclk_frequency_10khz(); | 182 | unsigned long clk = clk_get_rate(skt->clk); |
170 | return pxa2xx_pcmcia_set_mcxx(skt, clk); | 183 | return pxa2xx_pcmcia_set_mcxx(skt, clk / 10000); |
171 | } | 184 | } |
172 | 185 | ||
173 | #ifdef CONFIG_CPU_FREQ | 186 | #ifdef CONFIG_CPU_FREQ |
@@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
205 | static void pxa2xx_configure_sockets(struct device *dev) | 218 | static void pxa2xx_configure_sockets(struct device *dev) |
206 | { | 219 | { |
207 | struct pcmcia_low_level *ops = dev->platform_data; | 220 | struct pcmcia_low_level *ops = dev->platform_data; |
208 | |||
209 | /* | 221 | /* |
210 | * We have at least one socket, so set MECR:CIT | 222 | * We have at least one socket, so set MECR:CIT |
211 | * (Card Is There) | 223 | * (Card Is There) |
212 | */ | 224 | */ |
213 | MECR |= MECR_CIT; | 225 | uint32_t mecr = MECR_CIT; |
214 | 226 | ||
215 | /* Set MECR:NOS (Number Of Sockets) */ | 227 | /* Set MECR:NOS (Number Of Sockets) */ |
216 | if ((ops->first + ops->nr) > 1 || | 228 | if ((ops->first + ops->nr) > 1 || |
217 | machine_is_viper() || machine_is_arcom_zeus()) | 229 | machine_is_viper() || machine_is_arcom_zeus()) |
218 | MECR |= MECR_NOS; | 230 | mecr |= MECR_NOS; |
219 | else | 231 | |
220 | MECR &= ~MECR_NOS; | 232 | __raw_writel(mecr, MECR); |
221 | } | 233 | } |
222 | 234 | ||
223 | static const char *skt_names[] = { | 235 | static const char *skt_names[] = { |
@@ -270,24 +282,41 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
270 | struct pcmcia_low_level *ops; | 282 | struct pcmcia_low_level *ops; |
271 | struct skt_dev_info *sinfo; | 283 | struct skt_dev_info *sinfo; |
272 | struct soc_pcmcia_socket *skt; | 284 | struct soc_pcmcia_socket *skt; |
285 | struct clk *clk; | ||
273 | 286 | ||
274 | ops = (struct pcmcia_low_level *)dev->dev.platform_data; | 287 | ops = (struct pcmcia_low_level *)dev->dev.platform_data; |
275 | if (!ops) | 288 | if (!ops) { |
289 | ret = -ENODEV; | ||
290 | goto err0; | ||
291 | } | ||
292 | |||
293 | if (cpu_is_pxa320() && ops->nr > 1) { | ||
294 | dev_err(&dev->dev, "pxa320 supports only one pcmcia slot"); | ||
295 | ret = -EINVAL; | ||
296 | goto err0; | ||
297 | } | ||
298 | |||
299 | clk = clk_get(&dev->dev, NULL); | ||
300 | if (!clk) | ||
276 | return -ENODEV; | 301 | return -ENODEV; |
277 | 302 | ||
278 | pxa2xx_drv_pcmcia_ops(ops); | 303 | pxa2xx_drv_pcmcia_ops(ops); |
279 | 304 | ||
280 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); | 305 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); |
281 | if (!sinfo) | 306 | if (!sinfo) { |
307 | clk_put(clk); | ||
282 | return -ENOMEM; | 308 | return -ENOMEM; |
309 | } | ||
283 | 310 | ||
284 | sinfo->nskt = ops->nr; | 311 | sinfo->nskt = ops->nr; |
312 | sinfo->clk = clk; | ||
285 | 313 | ||
286 | /* Initialize processor specific parameters */ | 314 | /* Initialize processor specific parameters */ |
287 | for (i = 0; i < ops->nr; i++) { | 315 | for (i = 0; i < ops->nr; i++) { |
288 | skt = &sinfo->skt[i]; | 316 | skt = &sinfo->skt[i]; |
289 | 317 | ||
290 | skt->nr = ops->first + i; | 318 | skt->nr = ops->first + i; |
319 | skt->clk = clk; | ||
291 | skt->ops = ops; | 320 | skt->ops = ops; |
292 | skt->socket.owner = ops->owner; | 321 | skt->socket.owner = ops->owner; |
293 | skt->socket.dev.parent = &dev->dev; | 322 | skt->socket.dev.parent = &dev->dev; |
@@ -295,18 +324,26 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
295 | 324 | ||
296 | ret = pxa2xx_drv_pcmcia_add_one(skt); | 325 | ret = pxa2xx_drv_pcmcia_add_one(skt); |
297 | if (ret) | 326 | if (ret) |
298 | break; | 327 | goto err1; |
299 | } | 328 | } |
300 | 329 | ||
301 | if (ret) { | 330 | if (ret) { |
302 | while (--i >= 0) | 331 | while (--i >= 0) |
303 | soc_pcmcia_remove_one(&sinfo->skt[i]); | 332 | soc_pcmcia_remove_one(&sinfo->skt[i]); |
304 | kfree(sinfo); | 333 | kfree(sinfo); |
334 | clk_put(clk); | ||
305 | } else { | 335 | } else { |
306 | pxa2xx_configure_sockets(&dev->dev); | 336 | pxa2xx_configure_sockets(&dev->dev); |
307 | dev_set_drvdata(&dev->dev, sinfo); | 337 | dev_set_drvdata(&dev->dev, sinfo); |
308 | } | 338 | } |
309 | 339 | ||
340 | return 0; | ||
341 | |||
342 | err1: | ||
343 | while (--i >= 0) | ||
344 | soc_pcmcia_remove_one(&sinfo->skt[i]); | ||
345 | kfree(sinfo); | ||
346 | err0: | ||
310 | return ret; | 347 | return ret; |
311 | } | 348 | } |
312 | 349 | ||
@@ -320,6 +357,7 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev) | |||
320 | for (i = 0; i < sinfo->nskt; i++) | 357 | for (i = 0; i < sinfo->nskt; i++) |
321 | soc_pcmcia_remove_one(&sinfo->skt[i]); | 358 | soc_pcmcia_remove_one(&sinfo->skt[i]); |
322 | 359 | ||
360 | clk_put(sinfo->clk); | ||
323 | kfree(sinfo); | 361 | kfree(sinfo); |
324 | return 0; | 362 | return 0; |
325 | } | 363 | } |
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c new file mode 100644 index 000000000000..c3f72192af66 --- /dev/null +++ b/drivers/pcmcia/pxa2xx_colibri.c | |||
@@ -0,0 +1,229 @@ | |||
1 | /* | ||
2 | * linux/drivers/pcmcia/pxa2xx_colibri.c | ||
3 | * | ||
4 | * Driver for Toradex Colibri PXA270 CF socket | ||
5 | * | ||
6 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/gpio.h> | ||
18 | |||
19 | #include <asm/mach-types.h> | ||
20 | |||
21 | #include "soc_common.h" | ||
22 | |||
23 | #define COLIBRI270_RESET_GPIO 53 | ||
24 | #define COLIBRI270_PPEN_GPIO 107 | ||
25 | #define COLIBRI270_BVD1_GPIO 83 | ||
26 | #define COLIBRI270_BVD2_GPIO 82 | ||
27 | #define COLIBRI270_DETECT_GPIO 84 | ||
28 | #define COLIBRI270_READY_GPIO 1 | ||
29 | |||
30 | #define COLIBRI320_RESET_GPIO 77 | ||
31 | #define COLIBRI320_PPEN_GPIO 57 | ||
32 | #define COLIBRI320_BVD1_GPIO 53 | ||
33 | #define COLIBRI320_BVD2_GPIO 79 | ||
34 | #define COLIBRI320_DETECT_GPIO 81 | ||
35 | #define COLIBRI320_READY_GPIO 29 | ||
36 | |||
37 | static struct { | ||
38 | int reset_gpio; | ||
39 | int ppen_gpio; | ||
40 | int bvd1_gpio; | ||
41 | int bvd2_gpio; | ||
42 | int detect_gpio; | ||
43 | int ready_gpio; | ||
44 | } colibri_pcmcia_gpio; | ||
45 | |||
46 | static struct pcmcia_irqs colibri_irqs[] = { | ||
47 | { | ||
48 | .sock = 0, | ||
49 | .str = "PCMCIA CD" | ||
50 | }, | ||
51 | }; | ||
52 | |||
53 | static int colibri_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | ||
54 | { | ||
55 | int ret; | ||
56 | |||
57 | ret = gpio_request(colibri_pcmcia_gpio.detect_gpio, "DETECT"); | ||
58 | if (ret) | ||
59 | goto err1; | ||
60 | ret = gpio_direction_input(colibri_pcmcia_gpio.detect_gpio); | ||
61 | if (ret) | ||
62 | goto err2; | ||
63 | |||
64 | ret = gpio_request(colibri_pcmcia_gpio.ready_gpio, "READY"); | ||
65 | if (ret) | ||
66 | goto err2; | ||
67 | ret = gpio_direction_input(colibri_pcmcia_gpio.ready_gpio); | ||
68 | if (ret) | ||
69 | goto err3; | ||
70 | |||
71 | ret = gpio_request(colibri_pcmcia_gpio.bvd1_gpio, "BVD1"); | ||
72 | if (ret) | ||
73 | goto err3; | ||
74 | ret = gpio_direction_input(colibri_pcmcia_gpio.bvd1_gpio); | ||
75 | if (ret) | ||
76 | goto err4; | ||
77 | |||
78 | ret = gpio_request(colibri_pcmcia_gpio.bvd2_gpio, "BVD2"); | ||
79 | if (ret) | ||
80 | goto err4; | ||
81 | ret = gpio_direction_input(colibri_pcmcia_gpio.bvd2_gpio); | ||
82 | if (ret) | ||
83 | goto err5; | ||
84 | |||
85 | ret = gpio_request(colibri_pcmcia_gpio.ppen_gpio, "PPEN"); | ||
86 | if (ret) | ||
87 | goto err5; | ||
88 | ret = gpio_direction_output(colibri_pcmcia_gpio.ppen_gpio, 0); | ||
89 | if (ret) | ||
90 | goto err6; | ||
91 | |||
92 | ret = gpio_request(colibri_pcmcia_gpio.reset_gpio, "RESET"); | ||
93 | if (ret) | ||
94 | goto err6; | ||
95 | ret = gpio_direction_output(colibri_pcmcia_gpio.reset_gpio, 1); | ||
96 | if (ret) | ||
97 | goto err7; | ||
98 | |||
99 | colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpio.detect_gpio); | ||
100 | skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpio.ready_gpio); | ||
101 | |||
102 | return soc_pcmcia_request_irqs(skt, colibri_irqs, | ||
103 | ARRAY_SIZE(colibri_irqs)); | ||
104 | |||
105 | err7: | ||
106 | gpio_free(colibri_pcmcia_gpio.detect_gpio); | ||
107 | err6: | ||
108 | gpio_free(colibri_pcmcia_gpio.ready_gpio); | ||
109 | err5: | ||
110 | gpio_free(colibri_pcmcia_gpio.bvd1_gpio); | ||
111 | err4: | ||
112 | gpio_free(colibri_pcmcia_gpio.bvd2_gpio); | ||
113 | err3: | ||
114 | gpio_free(colibri_pcmcia_gpio.reset_gpio); | ||
115 | err2: | ||
116 | gpio_free(colibri_pcmcia_gpio.ppen_gpio); | ||
117 | err1: | ||
118 | return ret; | ||
119 | } | ||
120 | |||
121 | static void colibri_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | ||
122 | { | ||
123 | gpio_free(colibri_pcmcia_gpio.detect_gpio); | ||
124 | gpio_free(colibri_pcmcia_gpio.ready_gpio); | ||
125 | gpio_free(colibri_pcmcia_gpio.bvd1_gpio); | ||
126 | gpio_free(colibri_pcmcia_gpio.bvd2_gpio); | ||
127 | gpio_free(colibri_pcmcia_gpio.reset_gpio); | ||
128 | gpio_free(colibri_pcmcia_gpio.ppen_gpio); | ||
129 | } | ||
130 | |||
131 | static void colibri_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | ||
132 | struct pcmcia_state *state) | ||
133 | { | ||
134 | |||
135 | state->detect = !!gpio_get_value(colibri_pcmcia_gpio.detect_gpio); | ||
136 | state->ready = !!gpio_get_value(colibri_pcmcia_gpio.ready_gpio); | ||
137 | state->bvd1 = !!gpio_get_value(colibri_pcmcia_gpio.bvd1_gpio); | ||
138 | state->bvd2 = !!gpio_get_value(colibri_pcmcia_gpio.bvd2_gpio); | ||
139 | state->wrprot = 0; | ||
140 | state->vs_3v = 1; | ||
141 | state->vs_Xv = 0; | ||
142 | } | ||
143 | |||
144 | static int | ||
145 | colibri_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | ||
146 | const socket_state_t *state) | ||
147 | { | ||
148 | gpio_set_value(colibri_pcmcia_gpio.ppen_gpio, | ||
149 | !(state->Vcc == 33 && state->Vpp < 50)); | ||
150 | gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags & SS_RESET); | ||
151 | return 0; | ||
152 | } | ||
153 | |||
154 | static void colibri_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | ||
155 | { | ||
156 | } | ||
157 | |||
158 | static void colibri_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | ||
159 | { | ||
160 | } | ||
161 | |||
162 | static struct pcmcia_low_level colibri_pcmcia_ops = { | ||
163 | .owner = THIS_MODULE, | ||
164 | |||
165 | .first = 0, | ||
166 | .nr = 1, | ||
167 | |||
168 | .hw_init = colibri_pcmcia_hw_init, | ||
169 | .hw_shutdown = colibri_pcmcia_hw_shutdown, | ||
170 | |||
171 | .socket_state = colibri_pcmcia_socket_state, | ||
172 | .configure_socket = colibri_pcmcia_configure_socket, | ||
173 | |||
174 | .socket_init = colibri_pcmcia_socket_init, | ||
175 | .socket_suspend = colibri_pcmcia_socket_suspend, | ||
176 | }; | ||
177 | |||
178 | static struct platform_device *colibri_pcmcia_device; | ||
179 | |||
180 | static int __init colibri_pcmcia_init(void) | ||
181 | { | ||
182 | int ret; | ||
183 | |||
184 | colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); | ||
185 | if (!colibri_pcmcia_device) | ||
186 | return -ENOMEM; | ||
187 | |||
188 | /* Colibri PXA270 */ | ||
189 | if (machine_is_colibri()) { | ||
190 | colibri_pcmcia_gpio.reset_gpio = COLIBRI270_RESET_GPIO; | ||
191 | colibri_pcmcia_gpio.ppen_gpio = COLIBRI270_PPEN_GPIO; | ||
192 | colibri_pcmcia_gpio.bvd1_gpio = COLIBRI270_BVD1_GPIO; | ||
193 | colibri_pcmcia_gpio.bvd2_gpio = COLIBRI270_BVD2_GPIO; | ||
194 | colibri_pcmcia_gpio.detect_gpio = COLIBRI270_DETECT_GPIO; | ||
195 | colibri_pcmcia_gpio.ready_gpio = COLIBRI270_READY_GPIO; | ||
196 | /* Colibri PXA320 */ | ||
197 | } else if (machine_is_colibri320()) { | ||
198 | colibri_pcmcia_gpio.reset_gpio = COLIBRI320_RESET_GPIO; | ||
199 | colibri_pcmcia_gpio.ppen_gpio = COLIBRI320_PPEN_GPIO; | ||
200 | colibri_pcmcia_gpio.bvd1_gpio = COLIBRI320_BVD1_GPIO; | ||
201 | colibri_pcmcia_gpio.bvd2_gpio = COLIBRI320_BVD2_GPIO; | ||
202 | colibri_pcmcia_gpio.detect_gpio = COLIBRI320_DETECT_GPIO; | ||
203 | colibri_pcmcia_gpio.ready_gpio = COLIBRI320_READY_GPIO; | ||
204 | } | ||
205 | |||
206 | ret = platform_device_add_data(colibri_pcmcia_device, | ||
207 | &colibri_pcmcia_ops, sizeof(colibri_pcmcia_ops)); | ||
208 | |||
209 | if (!ret) | ||
210 | ret = platform_device_add(colibri_pcmcia_device); | ||
211 | |||
212 | if (ret) | ||
213 | platform_device_put(colibri_pcmcia_device); | ||
214 | |||
215 | return ret; | ||
216 | } | ||
217 | |||
218 | static void __exit colibri_pcmcia_exit(void) | ||
219 | { | ||
220 | platform_device_unregister(colibri_pcmcia_device); | ||
221 | } | ||
222 | |||
223 | module_init(colibri_pcmcia_init); | ||
224 | module_exit(colibri_pcmcia_exit); | ||
225 | |||
226 | MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); | ||
227 | MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270/PXA320"); | ||
228 | MODULE_ALIAS("platform:pxa2xx-pcmcia"); | ||
229 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index 6b228590b3fd..fb9740d3e9a7 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c | |||
@@ -53,6 +53,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { | |||
53 | #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) | 53 | #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) |
54 | pcmcia_h3600_init, | 54 | pcmcia_h3600_init, |
55 | #endif | 55 | #endif |
56 | #ifdef CONFIG_SA1100_NANOENGINE | ||
57 | pcmcia_nanoengine_init, | ||
58 | #endif | ||
56 | #ifdef CONFIG_SA1100_SHANNON | 59 | #ifdef CONFIG_SA1100_SHANNON |
57 | pcmcia_shannon_init, | 60 | pcmcia_shannon_init, |
58 | #endif | 61 | #endif |
diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h index 794f96a35bba..adb08dbc723f 100644 --- a/drivers/pcmcia/sa1100_generic.h +++ b/drivers/pcmcia/sa1100_generic.h | |||
@@ -13,6 +13,7 @@ extern int pcmcia_freebird_init(struct device *); | |||
13 | extern int pcmcia_gcplus_init(struct device *); | 13 | extern int pcmcia_gcplus_init(struct device *); |
14 | extern int pcmcia_graphicsmaster_init(struct device *); | 14 | extern int pcmcia_graphicsmaster_init(struct device *); |
15 | extern int pcmcia_h3600_init(struct device *); | 15 | extern int pcmcia_h3600_init(struct device *); |
16 | extern int pcmcia_nanoengine_init(struct device *); | ||
16 | extern int pcmcia_pangolin_init(struct device *); | 17 | extern int pcmcia_pangolin_init(struct device *); |
17 | extern int pcmcia_pfs168_init(struct device *); | 18 | extern int pcmcia_pfs168_init(struct device *); |
18 | extern int pcmcia_shannon_init(struct device *); | 19 | extern int pcmcia_shannon_init(struct device *); |
diff --git a/drivers/pcmcia/sa1100_nanoengine.c b/drivers/pcmcia/sa1100_nanoengine.c new file mode 100644 index 000000000000..3d2652e2f5ae --- /dev/null +++ b/drivers/pcmcia/sa1100_nanoengine.c | |||
@@ -0,0 +1,219 @@ | |||
1 | /* | ||
2 | * drivers/pcmcia/sa1100_nanoengine.c | ||
3 | * | ||
4 | * PCMCIA implementation routines for BSI nanoEngine. | ||
5 | * | ||
6 | * In order to have a fully functional pcmcia subsystem in a BSE nanoEngine | ||
7 | * board you should carefully read this: | ||
8 | * http://cambuca.ldhs.cetuc.puc-rio.br/nanoengine/ | ||
9 | * | ||
10 | * Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> | ||
11 | * | ||
12 | * Based on original work for kernel 2.4 by | ||
13 | * Miguel Freitas <miguel@cpti.cetuc.puc-rio.br> | ||
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 version 2 as | ||
17 | * published by the Free Software Foundation. | ||
18 | * | ||
19 | */ | ||
20 | #include <linux/device.h> | ||
21 | #include <linux/errno.h> | ||
22 | #include <linux/interrupt.h> | ||
23 | #include <linux/irq.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/kernel.h> | ||
26 | #include <linux/module.h> | ||
27 | #include <linux/signal.h> | ||
28 | |||
29 | #include <asm/mach-types.h> | ||
30 | #include <asm/irq.h> | ||
31 | |||
32 | #include <mach/hardware.h> | ||
33 | #include <mach/nanoengine.h> | ||
34 | |||
35 | #include "sa1100_generic.h" | ||
36 | |||
37 | static struct pcmcia_irqs irqs_skt0[] = { | ||
38 | /* socket, IRQ, name */ | ||
39 | { 0, NANOENGINE_IRQ_GPIO_PC_CD0, "PC CD0" }, | ||
40 | }; | ||
41 | |||
42 | static struct pcmcia_irqs irqs_skt1[] = { | ||
43 | /* socket, IRQ, name */ | ||
44 | { 1, NANOENGINE_IRQ_GPIO_PC_CD1, "PC CD1" }, | ||
45 | }; | ||
46 | |||
47 | struct nanoengine_pins { | ||
48 | unsigned input_pins; | ||
49 | unsigned output_pins; | ||
50 | unsigned clear_outputs; | ||
51 | unsigned transition_pins; | ||
52 | unsigned pci_irq; | ||
53 | struct pcmcia_irqs *pcmcia_irqs; | ||
54 | unsigned pcmcia_irqs_size; | ||
55 | }; | ||
56 | |||
57 | static struct nanoengine_pins nano_skts[] = { | ||
58 | { | ||
59 | .input_pins = GPIO_PC_READY0 | GPIO_PC_CD0, | ||
60 | .output_pins = GPIO_PC_RESET0, | ||
61 | .clear_outputs = GPIO_PC_RESET0, | ||
62 | .transition_pins = NANOENGINE_IRQ_GPIO_PC_CD0, | ||
63 | .pci_irq = NANOENGINE_IRQ_GPIO_PC_READY0, | ||
64 | .pcmcia_irqs = irqs_skt0, | ||
65 | .pcmcia_irqs_size = ARRAY_SIZE(irqs_skt0) | ||
66 | }, { | ||
67 | .input_pins = GPIO_PC_READY1 | GPIO_PC_CD1, | ||
68 | .output_pins = GPIO_PC_RESET1, | ||
69 | .clear_outputs = GPIO_PC_RESET1, | ||
70 | .transition_pins = NANOENGINE_IRQ_GPIO_PC_CD1, | ||
71 | .pci_irq = NANOENGINE_IRQ_GPIO_PC_READY1, | ||
72 | .pcmcia_irqs = irqs_skt1, | ||
73 | .pcmcia_irqs_size = ARRAY_SIZE(irqs_skt1) | ||
74 | } | ||
75 | }; | ||
76 | |||
77 | unsigned num_nano_pcmcia_sockets = ARRAY_SIZE(nano_skts); | ||
78 | |||
79 | static int nanoengine_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | ||
80 | { | ||
81 | unsigned i = skt->nr; | ||
82 | |||
83 | if (i >= num_nano_pcmcia_sockets) | ||
84 | return -ENXIO; | ||
85 | |||
86 | GPDR &= ~nano_skts[i].input_pins; | ||
87 | GPDR |= nano_skts[i].output_pins; | ||
88 | GPCR = nano_skts[i].clear_outputs; | ||
89 | set_irq_type(nano_skts[i].transition_pins, IRQ_TYPE_EDGE_BOTH); | ||
90 | skt->socket.pci_irq = nano_skts[i].pci_irq; | ||
91 | |||
92 | return soc_pcmcia_request_irqs(skt, | ||
93 | nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size); | ||
94 | } | ||
95 | |||
96 | /* | ||
97 | * Release all resources. | ||
98 | */ | ||
99 | static void nanoengine_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | ||
100 | { | ||
101 | unsigned i = skt->nr; | ||
102 | |||
103 | if (i >= num_nano_pcmcia_sockets) | ||
104 | return; | ||
105 | |||
106 | soc_pcmcia_free_irqs(skt, | ||
107 | nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size); | ||
108 | } | ||
109 | |||
110 | static int nanoengine_pcmcia_configure_socket( | ||
111 | struct soc_pcmcia_socket *skt, const socket_state_t *state) | ||
112 | { | ||
113 | unsigned reset; | ||
114 | unsigned i = skt->nr; | ||
115 | |||
116 | if (i >= num_nano_pcmcia_sockets) | ||
117 | return -ENXIO; | ||
118 | |||
119 | switch (i) { | ||
120 | case 0: | ||
121 | reset = GPIO_PC_RESET0; | ||
122 | break; | ||
123 | case 1: | ||
124 | reset = GPIO_PC_RESET1; | ||
125 | break; | ||
126 | default: | ||
127 | return -ENXIO; | ||
128 | } | ||
129 | |||
130 | if (state->flags & SS_RESET) | ||
131 | GPSR = reset; | ||
132 | else | ||
133 | GPCR = reset; | ||
134 | |||
135 | return 0; | ||
136 | } | ||
137 | |||
138 | static void nanoengine_pcmcia_socket_state( | ||
139 | struct soc_pcmcia_socket *skt, struct pcmcia_state *state) | ||
140 | { | ||
141 | unsigned long levels = GPLR; | ||
142 | unsigned i = skt->nr; | ||
143 | |||
144 | if (i >= num_nano_pcmcia_sockets) | ||
145 | return; | ||
146 | |||
147 | memset(state, 0, sizeof(struct pcmcia_state)); | ||
148 | switch (i) { | ||
149 | case 0: | ||
150 | state->ready = (levels & GPIO_PC_READY0) ? 1 : 0; | ||
151 | state->detect = !(levels & GPIO_PC_CD0) ? 1 : 0; | ||
152 | break; | ||
153 | case 1: | ||
154 | state->ready = (levels & GPIO_PC_READY1) ? 1 : 0; | ||
155 | state->detect = !(levels & GPIO_PC_CD1) ? 1 : 0; | ||
156 | break; | ||
157 | default: | ||
158 | return; | ||
159 | } | ||
160 | state->bvd1 = 1; | ||
161 | state->bvd2 = 1; | ||
162 | state->wrprot = 0; /* Not available */ | ||
163 | state->vs_3v = 1; /* Can only apply 3.3V */ | ||
164 | state->vs_Xv = 0; | ||
165 | } | ||
166 | |||
167 | /* | ||
168 | * Enable card status IRQs on (re-)initialisation. This can | ||
169 | * be called at initialisation, power management event, or | ||
170 | * pcmcia event. | ||
171 | */ | ||
172 | static void nanoengine_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | ||
173 | { | ||
174 | unsigned i = skt->nr; | ||
175 | |||
176 | if (i >= num_nano_pcmcia_sockets) | ||
177 | return; | ||
178 | |||
179 | soc_pcmcia_enable_irqs(skt, | ||
180 | nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size); | ||
181 | } | ||
182 | |||
183 | /* | ||
184 | * Disable card status IRQs on suspend. | ||
185 | */ | ||
186 | static void nanoengine_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | ||
187 | { | ||
188 | unsigned i = skt->nr; | ||
189 | |||
190 | if (i >= num_nano_pcmcia_sockets) | ||
191 | return; | ||
192 | |||
193 | soc_pcmcia_disable_irqs(skt, | ||
194 | nano_skts[i].pcmcia_irqs, nano_skts[i].pcmcia_irqs_size); | ||
195 | } | ||
196 | |||
197 | static struct pcmcia_low_level nanoengine_pcmcia_ops = { | ||
198 | .owner = THIS_MODULE, | ||
199 | |||
200 | .hw_init = nanoengine_pcmcia_hw_init, | ||
201 | .hw_shutdown = nanoengine_pcmcia_hw_shutdown, | ||
202 | |||
203 | .configure_socket = nanoengine_pcmcia_configure_socket, | ||
204 | .socket_state = nanoengine_pcmcia_socket_state, | ||
205 | .socket_init = nanoengine_pcmcia_socket_init, | ||
206 | .socket_suspend = nanoengine_pcmcia_socket_suspend, | ||
207 | }; | ||
208 | |||
209 | int pcmcia_nanoengine_init(struct device *dev) | ||
210 | { | ||
211 | int ret = -ENODEV; | ||
212 | |||
213 | if (machine_is_nanoengine()) | ||
214 | ret = sa11xx_drv_pcmcia_probe( | ||
215 | dev, &nanoengine_pcmcia_ops, 0, 2); | ||
216 | |||
217 | return ret; | ||
218 | } | ||
219 | |||
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index 2fe8cb8e95cd..5a9a392eacdf 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -31,20 +31,20 @@ | |||
31 | ======================================================================*/ | 31 | ======================================================================*/ |
32 | 32 | ||
33 | 33 | ||
34 | #include <linux/module.h> | 34 | #include <linux/cpufreq.h> |
35 | #include <linux/moduleparam.h> | ||
36 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/interrupt.h> | ||
37 | #include <linux/io.h> | ||
38 | #include <linux/irq.h> | ||
37 | #include <linux/kernel.h> | 39 | #include <linux/kernel.h> |
38 | #include <linux/timer.h> | ||
39 | #include <linux/mm.h> | 40 | #include <linux/mm.h> |
41 | #include <linux/module.h> | ||
42 | #include <linux/moduleparam.h> | ||
40 | #include <linux/mutex.h> | 43 | #include <linux/mutex.h> |
41 | #include <linux/interrupt.h> | ||
42 | #include <linux/irq.h> | ||
43 | #include <linux/spinlock.h> | 44 | #include <linux/spinlock.h> |
44 | #include <linux/cpufreq.h> | 45 | #include <linux/timer.h> |
45 | 46 | ||
46 | #include <mach/hardware.h> | 47 | #include <mach/hardware.h> |
47 | #include <asm/io.h> | ||
48 | #include <asm/system.h> | 48 | #include <asm/system.h> |
49 | 49 | ||
50 | #include "soc_common.h" | 50 | #include "soc_common.h" |
@@ -74,7 +74,8 @@ EXPORT_SYMBOL(soc_pcmcia_debug); | |||
74 | 74 | ||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | #define to_soc_pcmcia_socket(x) container_of(x, struct soc_pcmcia_socket, socket) | 77 | #define to_soc_pcmcia_socket(x) \ |
78 | container_of(x, struct soc_pcmcia_socket, socket) | ||
78 | 79 | ||
79 | static unsigned short | 80 | static unsigned short |
80 | calc_speed(unsigned short *spds, int num, unsigned short dflt) | 81 | calc_speed(unsigned short *spds, int num, unsigned short dflt) |
@@ -91,11 +92,15 @@ calc_speed(unsigned short *spds, int num, unsigned short dflt) | |||
91 | return speed; | 92 | return speed; |
92 | } | 93 | } |
93 | 94 | ||
94 | void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt, struct soc_pcmcia_timing *timing) | 95 | void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *skt, |
96 | struct soc_pcmcia_timing *timing) | ||
95 | { | 97 | { |
96 | timing->io = calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS); | 98 | timing->io = |
97 | timing->mem = calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS); | 99 | calc_speed(skt->spd_io, MAX_IO_WIN, SOC_PCMCIA_IO_ACCESS); |
98 | timing->attr = calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS); | 100 | timing->mem = |
101 | calc_speed(skt->spd_mem, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS); | ||
102 | timing->attr = | ||
103 | calc_speed(skt->spd_attr, MAX_WIN, SOC_PCMCIA_3V_MEM_ACCESS); | ||
99 | } | 104 | } |
100 | EXPORT_SYMBOL(soc_common_pcmcia_get_timing); | 105 | EXPORT_SYMBOL(soc_common_pcmcia_get_timing); |
101 | 106 | ||
@@ -137,8 +142,8 @@ static unsigned int soc_common_pcmcia_skt_state(struct soc_pcmcia_socket *skt) | |||
137 | * | 142 | * |
138 | * Convert PCMCIA socket state to our socket configure structure. | 143 | * Convert PCMCIA socket state to our socket configure structure. |
139 | */ | 144 | */ |
140 | static int | 145 | static int soc_common_pcmcia_config_skt( |
141 | soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *state) | 146 | struct soc_pcmcia_socket *skt, socket_state_t *state) |
142 | { | 147 | { |
143 | int ret; | 148 | int ret; |
144 | 149 | ||
@@ -150,7 +155,8 @@ soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *stat | |||
150 | */ | 155 | */ |
151 | if (skt->irq_state != 1 && state->io_irq) { | 156 | if (skt->irq_state != 1 && state->io_irq) { |
152 | skt->irq_state = 1; | 157 | skt->irq_state = 1; |
153 | set_irq_type(skt->socket.pci_irq, IRQ_TYPE_EDGE_FALLING); | 158 | set_irq_type(skt->socket.pci_irq, |
159 | IRQ_TYPE_EDGE_FALLING); | ||
154 | } else if (skt->irq_state == 1 && state->io_irq == 0) { | 160 | } else if (skt->irq_state == 1 && state->io_irq == 0) { |
155 | skt->irq_state = 0; | 161 | skt->irq_state = 0; |
156 | set_irq_type(skt->socket.pci_irq, IRQ_TYPE_NONE); | 162 | set_irq_type(skt->socket.pci_irq, IRQ_TYPE_NONE); |
@@ -304,24 +310,24 @@ soc_common_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status) | |||
304 | * of power configuration, reset, &c. We also record the value of | 310 | * of power configuration, reset, &c. We also record the value of |
305 | * `state' in order to regurgitate it to the PCMCIA core later. | 311 | * `state' in order to regurgitate it to the PCMCIA core later. |
306 | */ | 312 | */ |
307 | static int | 313 | static int soc_common_pcmcia_set_socket( |
308 | soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state) | 314 | struct pcmcia_socket *sock, socket_state_t *state) |
309 | { | 315 | { |
310 | struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock); | 316 | struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock); |
311 | 317 | ||
312 | debug(skt, 2, "mask: %s%s%s%s%s%sflags: %s%s%s%s%s%sVcc %d Vpp %d irq %d\n", | 318 | debug(skt, 2, "mask: %s%s%s%s%s%s flags: %s%s%s%s%s%s Vcc %d Vpp %d irq %d\n", |
313 | (state->csc_mask==0)?"<NONE> ":"", | 319 | (state->csc_mask == 0) ? "<NONE> " : "", |
314 | (state->csc_mask&SS_DETECT)?"DETECT ":"", | 320 | (state->csc_mask & SS_DETECT) ? "DETECT " : "", |
315 | (state->csc_mask&SS_READY)?"READY ":"", | 321 | (state->csc_mask & SS_READY) ? "READY " : "", |
316 | (state->csc_mask&SS_BATDEAD)?"BATDEAD ":"", | 322 | (state->csc_mask & SS_BATDEAD) ? "BATDEAD " : "", |
317 | (state->csc_mask&SS_BATWARN)?"BATWARN ":"", | 323 | (state->csc_mask & SS_BATWARN) ? "BATWARN " : "", |
318 | (state->csc_mask&SS_STSCHG)?"STSCHG ":"", | 324 | (state->csc_mask & SS_STSCHG) ? "STSCHG " : "", |
319 | (state->flags==0)?"<NONE> ":"", | 325 | (state->flags == 0) ? "<NONE> " : "", |
320 | (state->flags&SS_PWR_AUTO)?"PWR_AUTO ":"", | 326 | (state->flags & SS_PWR_AUTO) ? "PWR_AUTO " : "", |
321 | (state->flags&SS_IOCARD)?"IOCARD ":"", | 327 | (state->flags & SS_IOCARD) ? "IOCARD " : "", |
322 | (state->flags&SS_RESET)?"RESET ":"", | 328 | (state->flags & SS_RESET) ? "RESET " : "", |
323 | (state->flags&SS_SPKR_ENA)?"SPKR_ENA ":"", | 329 | (state->flags & SS_SPKR_ENA) ? "SPKR_ENA " : "", |
324 | (state->flags&SS_OUTPUT_ENA)?"OUTPUT_ENA ":"", | 330 | (state->flags & SS_OUTPUT_ENA) ? "OUTPUT_ENA " : "", |
325 | state->Vcc, state->Vpp, state->io_irq); | 331 | state->Vcc, state->Vpp, state->io_irq); |
326 | 332 | ||
327 | return soc_common_pcmcia_config_skt(skt, state); | 333 | return soc_common_pcmcia_config_skt(skt, state); |
@@ -336,8 +342,8 @@ soc_common_pcmcia_set_socket(struct pcmcia_socket *sock, socket_state_t *state) | |||
336 | * | 342 | * |
337 | * Returns: 0 on success, -1 on error | 343 | * Returns: 0 on success, -1 on error |
338 | */ | 344 | */ |
339 | static int | 345 | static int soc_common_pcmcia_set_io_map( |
340 | soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *map) | 346 | struct pcmcia_socket *sock, struct pccard_io_map *map) |
341 | { | 347 | { |
342 | struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock); | 348 | struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock); |
343 | unsigned short speed = map->speed; | 349 | unsigned short speed = map->speed; |
@@ -346,14 +352,14 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m | |||
346 | map->map, map->speed, (unsigned long long)map->start, | 352 | map->map, map->speed, (unsigned long long)map->start, |
347 | (unsigned long long)map->stop); | 353 | (unsigned long long)map->stop); |
348 | debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n", | 354 | debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n", |
349 | (map->flags==0)?"<NONE>":"", | 355 | (map->flags == 0) ? "<NONE>" : "", |
350 | (map->flags&MAP_ACTIVE)?"ACTIVE ":"", | 356 | (map->flags & MAP_ACTIVE) ? "ACTIVE " : "", |
351 | (map->flags&MAP_16BIT)?"16BIT ":"", | 357 | (map->flags & MAP_16BIT) ? "16BIT " : "", |
352 | (map->flags&MAP_AUTOSZ)?"AUTOSZ ":"", | 358 | (map->flags & MAP_AUTOSZ) ? "AUTOSZ " : "", |
353 | (map->flags&MAP_0WS)?"0WS ":"", | 359 | (map->flags & MAP_0WS) ? "0WS " : "", |
354 | (map->flags&MAP_WRPROT)?"WRPROT ":"", | 360 | (map->flags & MAP_WRPROT) ? "WRPROT " : "", |
355 | (map->flags&MAP_USE_WAIT)?"USE_WAIT ":"", | 361 | (map->flags & MAP_USE_WAIT) ? "USE_WAIT " : "", |
356 | (map->flags&MAP_PREFETCH)?"PREFETCH ":""); | 362 | (map->flags & MAP_PREFETCH) ? "PREFETCH " : ""); |
357 | 363 | ||
358 | if (map->map >= MAX_IO_WIN) { | 364 | if (map->map >= MAX_IO_WIN) { |
359 | printk(KERN_ERR "%s(): map (%d) out of range\n", __func__, | 365 | printk(KERN_ERR "%s(): map (%d) out of range\n", __func__, |
@@ -390,8 +396,8 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m | |||
390 | * | 396 | * |
391 | * Returns: 0 on success, -ERRNO on error | 397 | * Returns: 0 on success, -ERRNO on error |
392 | */ | 398 | */ |
393 | static int | 399 | static int soc_common_pcmcia_set_mem_map( |
394 | soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *map) | 400 | struct pcmcia_socket *sock, struct pccard_mem_map *map) |
395 | { | 401 | { |
396 | struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock); | 402 | struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock); |
397 | struct resource *res; | 403 | struct resource *res; |
@@ -400,14 +406,14 @@ soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map | |||
400 | debug(skt, 2, "map %u speed %u card_start %08x\n", | 406 | debug(skt, 2, "map %u speed %u card_start %08x\n", |
401 | map->map, map->speed, map->card_start); | 407 | map->map, map->speed, map->card_start); |
402 | debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n", | 408 | debug(skt, 2, "flags: %s%s%s%s%s%s%s%s\n", |
403 | (map->flags==0)?"<NONE>":"", | 409 | (map->flags == 0) ? "<NONE>" : "", |
404 | (map->flags&MAP_ACTIVE)?"ACTIVE ":"", | 410 | (map->flags & MAP_ACTIVE) ? "ACTIVE " : "", |
405 | (map->flags&MAP_16BIT)?"16BIT ":"", | 411 | (map->flags & MAP_16BIT) ? "16BIT " : "", |
406 | (map->flags&MAP_AUTOSZ)?"AUTOSZ ":"", | 412 | (map->flags & MAP_AUTOSZ) ? "AUTOSZ " : "", |
407 | (map->flags&MAP_0WS)?"0WS ":"", | 413 | (map->flags & MAP_0WS) ? "0WS " : "", |
408 | (map->flags&MAP_WRPROT)?"WRPROT ":"", | 414 | (map->flags & MAP_WRPROT) ? "WRPROT " : "", |
409 | (map->flags&MAP_ATTRIB)?"ATTRIB ":"", | 415 | (map->flags & MAP_ATTRIB) ? "ATTRIB " : "", |
410 | (map->flags&MAP_USE_WAIT)?"USE_WAIT ":""); | 416 | (map->flags & MAP_USE_WAIT) ? "USE_WAIT " : ""); |
411 | 417 | ||
412 | if (map->map >= MAX_WIN) | 418 | if (map->map >= MAX_WIN) |
413 | return -EINVAL; | 419 | return -EINVAL; |
@@ -462,8 +468,8 @@ static struct bittbl conf_bits[] = { | |||
462 | { SS_OUTPUT_ENA, "SS_OUTPUT_ENA" }, | 468 | { SS_OUTPUT_ENA, "SS_OUTPUT_ENA" }, |
463 | }; | 469 | }; |
464 | 470 | ||
465 | static void | 471 | static void dump_bits(char **p, const char *prefix, |
466 | dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, int sz) | 472 | unsigned int val, struct bittbl *bits, int sz) |
467 | { | 473 | { |
468 | char *b = *p; | 474 | char *b = *p; |
469 | int i; | 475 | int i; |
@@ -481,13 +487,14 @@ dump_bits(char **p, const char *prefix, unsigned int val, struct bittbl *bits, i | |||
481 | * | 487 | * |
482 | * Returns: the number of characters added to the buffer | 488 | * Returns: the number of characters added to the buffer |
483 | */ | 489 | */ |
484 | static ssize_t show_status(struct device *dev, struct device_attribute *attr, char *buf) | 490 | static ssize_t show_status( |
491 | struct device *dev, struct device_attribute *attr, char *buf) | ||
485 | { | 492 | { |
486 | struct soc_pcmcia_socket *skt = | 493 | struct soc_pcmcia_socket *skt = |
487 | container_of(dev, struct soc_pcmcia_socket, socket.dev); | 494 | container_of(dev, struct soc_pcmcia_socket, socket.dev); |
488 | char *p = buf; | 495 | char *p = buf; |
489 | 496 | ||
490 | p+=sprintf(p, "slot : %d\n", skt->nr); | 497 | p += sprintf(p, "slot : %d\n", skt->nr); |
491 | 498 | ||
492 | dump_bits(&p, "status", skt->status, | 499 | dump_bits(&p, "status", skt->status, |
493 | status_bits, ARRAY_SIZE(status_bits)); | 500 | status_bits, ARRAY_SIZE(status_bits)); |
@@ -496,12 +503,12 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, ch | |||
496 | dump_bits(&p, "cs_flags", skt->cs_state.flags, | 503 | dump_bits(&p, "cs_flags", skt->cs_state.flags, |
497 | conf_bits, ARRAY_SIZE(conf_bits)); | 504 | conf_bits, ARRAY_SIZE(conf_bits)); |
498 | 505 | ||
499 | p+=sprintf(p, "Vcc : %d\n", skt->cs_state.Vcc); | 506 | p += sprintf(p, "Vcc : %d\n", skt->cs_state.Vcc); |
500 | p+=sprintf(p, "Vpp : %d\n", skt->cs_state.Vpp); | 507 | p += sprintf(p, "Vpp : %d\n", skt->cs_state.Vpp); |
501 | p+=sprintf(p, "IRQ : %d (%d)\n", skt->cs_state.io_irq, | 508 | p += sprintf(p, "IRQ : %d (%d)\n", skt->cs_state.io_irq, |
502 | skt->socket.pci_irq); | 509 | skt->socket.pci_irq); |
503 | if (skt->ops->show_timing) | 510 | if (skt->ops->show_timing) |
504 | p+=skt->ops->show_timing(skt, p); | 511 | p += skt->ops->show_timing(skt, p); |
505 | 512 | ||
506 | return p-buf; | 513 | return p-buf; |
507 | } | 514 | } |
@@ -594,7 +601,7 @@ soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data) | |||
594 | 601 | ||
595 | mutex_lock(&soc_pcmcia_sockets_lock); | 602 | mutex_lock(&soc_pcmcia_sockets_lock); |
596 | list_for_each_entry(skt, &soc_pcmcia_sockets, node) | 603 | list_for_each_entry(skt, &soc_pcmcia_sockets, node) |
597 | if ( skt->ops->frequency_change ) | 604 | if (skt->ops->frequency_change) |
598 | ret += skt->ops->frequency_change(skt, val, freqs); | 605 | ret += skt->ops->frequency_change(skt, val, freqs); |
599 | mutex_unlock(&soc_pcmcia_sockets_lock); | 606 | mutex_unlock(&soc_pcmcia_sockets_lock); |
600 | 607 | ||
@@ -620,7 +627,8 @@ fs_initcall(soc_pcmcia_cpufreq_register); | |||
620 | 627 | ||
621 | static void soc_pcmcia_cpufreq_unregister(void) | 628 | static void soc_pcmcia_cpufreq_unregister(void) |
622 | { | 629 | { |
623 | cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER); | 630 | cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, |
631 | CPUFREQ_TRANSITION_NOTIFIER); | ||
624 | } | 632 | } |
625 | module_exit(soc_pcmcia_cpufreq_unregister); | 633 | module_exit(soc_pcmcia_cpufreq_unregister); |
626 | 634 | ||
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h index bbcd5385a221..9daa73615c8b 100644 --- a/drivers/pcmcia/soc_common.h +++ b/drivers/pcmcia/soc_common.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define _ASM_ARCH_PCMCIA | 10 | #define _ASM_ARCH_PCMCIA |
11 | 11 | ||
12 | /* include the world */ | 12 | /* include the world */ |
13 | #include <linux/clk.h> | ||
13 | #include <linux/cpufreq.h> | 14 | #include <linux/cpufreq.h> |
14 | #include <pcmcia/ss.h> | 15 | #include <pcmcia/ss.h> |
15 | #include <pcmcia/cistpl.h> | 16 | #include <pcmcia/cistpl.h> |
@@ -29,6 +30,7 @@ struct soc_pcmcia_socket { | |||
29 | * Info from low level handler | 30 | * Info from low level handler |
30 | */ | 31 | */ |
31 | unsigned int nr; | 32 | unsigned int nr; |
33 | struct clk *clk; | ||
32 | 34 | ||
33 | /* | 35 | /* |
34 | * Core PCMCIA state | 36 | * Core PCMCIA state |
@@ -56,6 +58,7 @@ struct soc_pcmcia_socket { | |||
56 | 58 | ||
57 | struct skt_dev_info { | 59 | struct skt_dev_info { |
58 | int nskt; | 60 | int nskt; |
61 | struct clk *clk; | ||
59 | struct soc_pcmcia_socket skt[0]; | 62 | struct soc_pcmcia_socket skt[0]; |
60 | }; | 63 | }; |
61 | 64 | ||
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index e4a44b641702..88ea52b8647a 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c | |||
@@ -39,10 +39,10 @@ | |||
39 | #include <mach/regs-ost.h> | 39 | #include <mach/regs-ost.h> |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #define RTC_DEF_DIVIDER 32768 - 1 | 42 | #define RTC_DEF_DIVIDER (32768 - 1) |
43 | #define RTC_DEF_TRIM 0 | 43 | #define RTC_DEF_TRIM 0 |
44 | 44 | ||
45 | static unsigned long rtc_freq = 1024; | 45 | static const unsigned long RTC_FREQ = 1024; |
46 | static unsigned long timer_freq; | 46 | static unsigned long timer_freq; |
47 | static struct rtc_time rtc_alarm; | 47 | static struct rtc_time rtc_alarm; |
48 | static DEFINE_SPINLOCK(sa1100_rtc_lock); | 48 | static DEFINE_SPINLOCK(sa1100_rtc_lock); |
@@ -61,7 +61,8 @@ static inline int rtc_periodic_alarm(struct rtc_time *tm) | |||
61 | * Calculate the next alarm time given the requested alarm time mask | 61 | * Calculate the next alarm time given the requested alarm time mask |
62 | * and the current time. | 62 | * and the current time. |
63 | */ | 63 | */ |
64 | static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm) | 64 | static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, |
65 | struct rtc_time *alrm) | ||
65 | { | 66 | { |
66 | unsigned long next_time; | 67 | unsigned long next_time; |
67 | unsigned long now_time; | 68 | unsigned long now_time; |
@@ -116,7 +117,23 @@ static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id) | |||
116 | rtsr = RTSR; | 117 | rtsr = RTSR; |
117 | /* clear interrupt sources */ | 118 | /* clear interrupt sources */ |
118 | RTSR = 0; | 119 | RTSR = 0; |
119 | RTSR = (RTSR_AL | RTSR_HZ) & (rtsr >> 2); | 120 | /* Fix for a nasty initialization problem the in SA11xx RTSR register. |
121 | * See also the comments in sa1100_rtc_probe(). */ | ||
122 | if (rtsr & (RTSR_ALE | RTSR_HZE)) { | ||
123 | /* This is the original code, before there was the if test | ||
124 | * above. This code does not clear interrupts that were not | ||
125 | * enabled. */ | ||
126 | RTSR = (RTSR_AL | RTSR_HZ) & (rtsr >> 2); | ||
127 | } else { | ||
128 | /* For some reason, it is possible to enter this routine | ||
129 | * without interruptions enabled, it has been tested with | ||
130 | * several units (Bug in SA11xx chip?). | ||
131 | * | ||
132 | * This situation leads to an infinite "loop" of interrupt | ||
133 | * routine calling and as a result the processor seems to | ||
134 | * lock on its first call to open(). */ | ||
135 | RTSR = RTSR_AL | RTSR_HZ; | ||
136 | } | ||
120 | 137 | ||
121 | /* clear alarm interrupt if it has occurred */ | 138 | /* clear alarm interrupt if it has occurred */ |
122 | if (rtsr & RTSR_AL) | 139 | if (rtsr & RTSR_AL) |
@@ -139,8 +156,58 @@ static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id) | |||
139 | return IRQ_HANDLED; | 156 | return IRQ_HANDLED; |
140 | } | 157 | } |
141 | 158 | ||
159 | static int sa1100_irq_set_freq(struct device *dev, int freq) | ||
160 | { | ||
161 | if (freq < 1 || freq > timer_freq) { | ||
162 | return -EINVAL; | ||
163 | } else { | ||
164 | struct rtc_device *rtc = (struct rtc_device *)dev; | ||
165 | |||
166 | rtc->irq_freq = freq; | ||
167 | |||
168 | return 0; | ||
169 | } | ||
170 | } | ||
171 | |||
142 | static int rtc_timer1_count; | 172 | static int rtc_timer1_count; |
143 | 173 | ||
174 | static int sa1100_irq_set_state(struct device *dev, int enabled) | ||
175 | { | ||
176 | spin_lock_irq(&sa1100_rtc_lock); | ||
177 | if (enabled) { | ||
178 | struct rtc_device *rtc = (struct rtc_device *)dev; | ||
179 | |||
180 | OSMR1 = timer_freq / rtc->irq_freq + OSCR; | ||
181 | OIER |= OIER_E1; | ||
182 | rtc_timer1_count = 1; | ||
183 | } else { | ||
184 | OIER &= ~OIER_E1; | ||
185 | } | ||
186 | spin_unlock_irq(&sa1100_rtc_lock); | ||
187 | |||
188 | return 0; | ||
189 | } | ||
190 | |||
191 | static inline int sa1100_timer1_retrigger(struct rtc_device *rtc) | ||
192 | { | ||
193 | unsigned long diff; | ||
194 | unsigned long period = timer_freq / rtc->irq_freq; | ||
195 | |||
196 | spin_lock_irq(&sa1100_rtc_lock); | ||
197 | |||
198 | do { | ||
199 | OSMR1 += period; | ||
200 | diff = OSMR1 - OSCR; | ||
201 | /* If OSCR > OSMR1, diff is a very large number (unsigned | ||
202 | * math). This means we have a lost interrupt. */ | ||
203 | } while (diff > period); | ||
204 | OIER |= OIER_E1; | ||
205 | |||
206 | spin_unlock_irq(&sa1100_rtc_lock); | ||
207 | |||
208 | return 0; | ||
209 | } | ||
210 | |||
144 | static irqreturn_t timer1_interrupt(int irq, void *dev_id) | 211 | static irqreturn_t timer1_interrupt(int irq, void *dev_id) |
145 | { | 212 | { |
146 | struct platform_device *pdev = to_platform_device(dev_id); | 213 | struct platform_device *pdev = to_platform_device(dev_id); |
@@ -158,7 +225,11 @@ static irqreturn_t timer1_interrupt(int irq, void *dev_id) | |||
158 | rtc_update_irq(rtc, rtc_timer1_count, RTC_PF | RTC_IRQF); | 225 | rtc_update_irq(rtc, rtc_timer1_count, RTC_PF | RTC_IRQF); |
159 | 226 | ||
160 | if (rtc_timer1_count == 1) | 227 | if (rtc_timer1_count == 1) |
161 | rtc_timer1_count = (rtc_freq * ((1 << 30) / (timer_freq >> 2))); | 228 | rtc_timer1_count = |
229 | (rtc->irq_freq * ((1 << 30) / (timer_freq >> 2))); | ||
230 | |||
231 | /* retrigger. */ | ||
232 | sa1100_timer1_retrigger(rtc); | ||
162 | 233 | ||
163 | return IRQ_HANDLED; | 234 | return IRQ_HANDLED; |
164 | } | 235 | } |
@@ -166,8 +237,10 @@ static irqreturn_t timer1_interrupt(int irq, void *dev_id) | |||
166 | static int sa1100_rtc_read_callback(struct device *dev, int data) | 237 | static int sa1100_rtc_read_callback(struct device *dev, int data) |
167 | { | 238 | { |
168 | if (data & RTC_PF) { | 239 | if (data & RTC_PF) { |
240 | struct rtc_device *rtc = (struct rtc_device *)dev; | ||
241 | |||
169 | /* interpolate missed periods and set match for the next */ | 242 | /* interpolate missed periods and set match for the next */ |
170 | unsigned long period = timer_freq / rtc_freq; | 243 | unsigned long period = timer_freq / rtc->irq_freq; |
171 | unsigned long oscr = OSCR; | 244 | unsigned long oscr = OSCR; |
172 | unsigned long osmr1 = OSMR1; | 245 | unsigned long osmr1 = OSMR1; |
173 | unsigned long missed = (oscr - osmr1)/period; | 246 | unsigned long missed = (oscr - osmr1)/period; |
@@ -178,7 +251,7 @@ static int sa1100_rtc_read_callback(struct device *dev, int data) | |||
178 | * Here we compare (match - OSCR) 8 instead of 0 -- | 251 | * Here we compare (match - OSCR) 8 instead of 0 -- |
179 | * see comment in pxa_timer_interrupt() for explanation. | 252 | * see comment in pxa_timer_interrupt() for explanation. |
180 | */ | 253 | */ |
181 | while( (signed long)((osmr1 = OSMR1) - OSCR) <= 8 ) { | 254 | while ((signed long)((osmr1 = OSMR1) - OSCR) <= 8) { |
182 | data += 0x100; | 255 | data += 0x100; |
183 | OSSR = OSSR_M1; /* clear match on timer 1 */ | 256 | OSSR = OSSR_M1; /* clear match on timer 1 */ |
184 | OSMR1 = osmr1 + period; | 257 | OSMR1 = osmr1 + period; |
@@ -190,25 +263,29 @@ static int sa1100_rtc_read_callback(struct device *dev, int data) | |||
190 | static int sa1100_rtc_open(struct device *dev) | 263 | static int sa1100_rtc_open(struct device *dev) |
191 | { | 264 | { |
192 | int ret; | 265 | int ret; |
266 | struct rtc_device *rtc = (struct rtc_device *)dev; | ||
193 | 267 | ||
194 | ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, IRQF_DISABLED, | 268 | ret = request_irq(IRQ_RTC1Hz, sa1100_rtc_interrupt, IRQF_DISABLED, |
195 | "rtc 1Hz", dev); | 269 | "rtc 1Hz", dev); |
196 | if (ret) { | 270 | if (ret) { |
197 | dev_err(dev, "IRQ %d already in use.\n", IRQ_RTC1Hz); | 271 | dev_err(dev, "IRQ %d already in use.\n", IRQ_RTC1Hz); |
198 | goto fail_ui; | 272 | goto fail_ui; |
199 | } | 273 | } |
200 | ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, IRQF_DISABLED, | 274 | ret = request_irq(IRQ_RTCAlrm, sa1100_rtc_interrupt, IRQF_DISABLED, |
201 | "rtc Alrm", dev); | 275 | "rtc Alrm", dev); |
202 | if (ret) { | 276 | if (ret) { |
203 | dev_err(dev, "IRQ %d already in use.\n", IRQ_RTCAlrm); | 277 | dev_err(dev, "IRQ %d already in use.\n", IRQ_RTCAlrm); |
204 | goto fail_ai; | 278 | goto fail_ai; |
205 | } | 279 | } |
206 | ret = request_irq(IRQ_OST1, timer1_interrupt, IRQF_DISABLED, | 280 | ret = request_irq(IRQ_OST1, timer1_interrupt, IRQF_DISABLED, |
207 | "rtc timer", dev); | 281 | "rtc timer", dev); |
208 | if (ret) { | 282 | if (ret) { |
209 | dev_err(dev, "IRQ %d already in use.\n", IRQ_OST1); | 283 | dev_err(dev, "IRQ %d already in use.\n", IRQ_OST1); |
210 | goto fail_pi; | 284 | goto fail_pi; |
211 | } | 285 | } |
286 | rtc->max_user_freq = RTC_FREQ; | ||
287 | sa1100_irq_set_freq(dev, RTC_FREQ); | ||
288 | |||
212 | return 0; | 289 | return 0; |
213 | 290 | ||
214 | fail_pi: | 291 | fail_pi: |
@@ -236,7 +313,7 @@ static void sa1100_rtc_release(struct device *dev) | |||
236 | static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd, | 313 | static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd, |
237 | unsigned long arg) | 314 | unsigned long arg) |
238 | { | 315 | { |
239 | switch(cmd) { | 316 | switch (cmd) { |
240 | case RTC_AIE_OFF: | 317 | case RTC_AIE_OFF: |
241 | spin_lock_irq(&sa1100_rtc_lock); | 318 | spin_lock_irq(&sa1100_rtc_lock); |
242 | RTSR &= ~RTSR_ALE; | 319 | RTSR &= ~RTSR_ALE; |
@@ -257,25 +334,6 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd, | |||
257 | RTSR |= RTSR_HZE; | 334 | RTSR |= RTSR_HZE; |
258 | spin_unlock_irq(&sa1100_rtc_lock); | 335 | spin_unlock_irq(&sa1100_rtc_lock); |
259 | return 0; | 336 | return 0; |
260 | case RTC_PIE_OFF: | ||
261 | spin_lock_irq(&sa1100_rtc_lock); | ||
262 | OIER &= ~OIER_E1; | ||
263 | spin_unlock_irq(&sa1100_rtc_lock); | ||
264 | return 0; | ||
265 | case RTC_PIE_ON: | ||
266 | spin_lock_irq(&sa1100_rtc_lock); | ||
267 | OSMR1 = timer_freq / rtc_freq + OSCR; | ||
268 | OIER |= OIER_E1; | ||
269 | rtc_timer1_count = 1; | ||
270 | spin_unlock_irq(&sa1100_rtc_lock); | ||
271 | return 0; | ||
272 | case RTC_IRQP_READ: | ||
273 | return put_user(rtc_freq, (unsigned long *)arg); | ||
274 | case RTC_IRQP_SET: | ||
275 | if (arg < 1 || arg > timer_freq) | ||
276 | return -EINVAL; | ||
277 | rtc_freq = arg; | ||
278 | return 0; | ||
279 | } | 337 | } |
280 | return -ENOIOCTLCMD; | 338 | return -ENOIOCTLCMD; |
281 | } | 339 | } |
@@ -327,12 +385,15 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
327 | 385 | ||
328 | static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) | 386 | static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) |
329 | { | 387 | { |
388 | struct rtc_device *rtc = (struct rtc_device *)dev; | ||
389 | |||
330 | seq_printf(seq, "trim/divider\t: 0x%08x\n", (u32) RTTR); | 390 | seq_printf(seq, "trim/divider\t: 0x%08x\n", (u32) RTTR); |
331 | seq_printf(seq, "update_IRQ\t: %s\n", | 391 | seq_printf(seq, "update_IRQ\t: %s\n", |
332 | (RTSR & RTSR_HZE) ? "yes" : "no"); | 392 | (RTSR & RTSR_HZE) ? "yes" : "no"); |
333 | seq_printf(seq, "periodic_IRQ\t: %s\n", | 393 | seq_printf(seq, "periodic_IRQ\t: %s\n", |
334 | (OIER & OIER_E1) ? "yes" : "no"); | 394 | (OIER & OIER_E1) ? "yes" : "no"); |
335 | seq_printf(seq, "periodic_freq\t: %ld\n", rtc_freq); | 395 | seq_printf(seq, "periodic_freq\t: %d\n", rtc->irq_freq); |
396 | seq_printf(seq, "RTSR\t\t: 0x%08x\n", (u32)RTSR); | ||
336 | 397 | ||
337 | return 0; | 398 | return 0; |
338 | } | 399 | } |
@@ -347,6 +408,8 @@ static const struct rtc_class_ops sa1100_rtc_ops = { | |||
347 | .read_alarm = sa1100_rtc_read_alarm, | 408 | .read_alarm = sa1100_rtc_read_alarm, |
348 | .set_alarm = sa1100_rtc_set_alarm, | 409 | .set_alarm = sa1100_rtc_set_alarm, |
349 | .proc = sa1100_rtc_proc, | 410 | .proc = sa1100_rtc_proc, |
411 | .irq_set_freq = sa1100_irq_set_freq, | ||
412 | .irq_set_state = sa1100_irq_set_state, | ||
350 | }; | 413 | }; |
351 | 414 | ||
352 | static int sa1100_rtc_probe(struct platform_device *pdev) | 415 | static int sa1100_rtc_probe(struct platform_device *pdev) |
@@ -364,7 +427,8 @@ static int sa1100_rtc_probe(struct platform_device *pdev) | |||
364 | */ | 427 | */ |
365 | if (RTTR == 0) { | 428 | if (RTTR == 0) { |
366 | RTTR = RTC_DEF_DIVIDER + (RTC_DEF_TRIM << 16); | 429 | RTTR = RTC_DEF_DIVIDER + (RTC_DEF_TRIM << 16); |
367 | dev_warn(&pdev->dev, "warning: initializing default clock divider/trim value\n"); | 430 | dev_warn(&pdev->dev, "warning: " |
431 | "initializing default clock divider/trim value\n"); | ||
368 | /* The current RTC value probably doesn't make sense either */ | 432 | /* The current RTC value probably doesn't make sense either */ |
369 | RCNR = 0; | 433 | RCNR = 0; |
370 | } | 434 | } |
@@ -372,13 +436,42 @@ static int sa1100_rtc_probe(struct platform_device *pdev) | |||
372 | device_init_wakeup(&pdev->dev, 1); | 436 | device_init_wakeup(&pdev->dev, 1); |
373 | 437 | ||
374 | rtc = rtc_device_register(pdev->name, &pdev->dev, &sa1100_rtc_ops, | 438 | rtc = rtc_device_register(pdev->name, &pdev->dev, &sa1100_rtc_ops, |
375 | THIS_MODULE); | 439 | THIS_MODULE); |
376 | 440 | ||
377 | if (IS_ERR(rtc)) | 441 | if (IS_ERR(rtc)) |
378 | return PTR_ERR(rtc); | 442 | return PTR_ERR(rtc); |
379 | 443 | ||
380 | platform_set_drvdata(pdev, rtc); | 444 | platform_set_drvdata(pdev, rtc); |
381 | 445 | ||
446 | /* Set the irq_freq */ | ||
447 | /*TODO: Find out who is messing with this value after we initialize | ||
448 | * it here.*/ | ||
449 | rtc->irq_freq = RTC_FREQ; | ||
450 | |||
451 | /* Fix for a nasty initialization problem the in SA11xx RTSR register. | ||
452 | * See also the comments in sa1100_rtc_interrupt(). | ||
453 | * | ||
454 | * Sometimes bit 1 of the RTSR (RTSR_HZ) will wake up 1, which means an | ||
455 | * interrupt pending, even though interrupts were never enabled. | ||
456 | * In this case, this bit it must be reset before enabling | ||
457 | * interruptions to avoid a nonexistent interrupt to occur. | ||
458 | * | ||
459 | * In principle, the same problem would apply to bit 0, although it has | ||
460 | * never been observed to happen. | ||
461 | * | ||
462 | * This issue is addressed both here and in sa1100_rtc_interrupt(). | ||
463 | * If the issue is not addressed here, in the times when the processor | ||
464 | * wakes up with the bit set there will be one spurious interrupt. | ||
465 | * | ||
466 | * The issue is also dealt with in sa1100_rtc_interrupt() to be on the | ||
467 | * safe side, once the condition that lead to this strange | ||
468 | * initialization is unknown and could in principle happen during | ||
469 | * normal processing. | ||
470 | * | ||
471 | * Notice that clearing bit 1 and 0 is accomplished by writting ONES to | ||
472 | * the corresponding bits in RTSR. */ | ||
473 | RTSR = RTSR_AL | RTSR_HZ; | ||
474 | |||
382 | return 0; | 475 | return 0; |
383 | } | 476 | } |
384 | 477 | ||
@@ -386,7 +479,7 @@ static int sa1100_rtc_remove(struct platform_device *pdev) | |||
386 | { | 479 | { |
387 | struct rtc_device *rtc = platform_get_drvdata(pdev); | 480 | struct rtc_device *rtc = platform_get_drvdata(pdev); |
388 | 481 | ||
389 | if (rtc) | 482 | if (rtc) |
390 | rtc_device_unregister(rtc); | 483 | rtc_device_unregister(rtc); |
391 | 484 | ||
392 | return 0; | 485 | return 0; |
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 6ca7a44f29c2..e76d7d000128 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * | 7 | * |
8 | * Copyright 1999 ARM Limited | 8 | * Copyright 1999 ARM Limited |
9 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 9 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
10 | * Copyright (C) 2010 ST-Ericsson SA | ||
10 | * | 11 | * |
11 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
@@ -48,6 +49,9 @@ | |||
48 | #include <linux/amba/serial.h> | 49 | #include <linux/amba/serial.h> |
49 | #include <linux/clk.h> | 50 | #include <linux/clk.h> |
50 | #include <linux/slab.h> | 51 | #include <linux/slab.h> |
52 | #include <linux/dmaengine.h> | ||
53 | #include <linux/dma-mapping.h> | ||
54 | #include <linux/scatterlist.h> | ||
51 | 55 | ||
52 | #include <asm/io.h> | 56 | #include <asm/io.h> |
53 | #include <asm/sizes.h> | 57 | #include <asm/sizes.h> |
@@ -63,21 +67,6 @@ | |||
63 | #define UART_DR_ERROR (UART011_DR_OE|UART011_DR_BE|UART011_DR_PE|UART011_DR_FE) | 67 | #define UART_DR_ERROR (UART011_DR_OE|UART011_DR_BE|UART011_DR_PE|UART011_DR_FE) |
64 | #define UART_DUMMY_DR_RX (1 << 16) | 68 | #define UART_DUMMY_DR_RX (1 << 16) |
65 | 69 | ||
66 | /* | ||
67 | * We wrap our port structure around the generic uart_port. | ||
68 | */ | ||
69 | struct uart_amba_port { | ||
70 | struct uart_port port; | ||
71 | struct clk *clk; | ||
72 | unsigned int im; /* interrupt mask */ | ||
73 | unsigned int old_status; | ||
74 | unsigned int ifls; /* vendor-specific */ | ||
75 | unsigned int lcrh_tx; /* vendor-specific */ | ||
76 | unsigned int lcrh_rx; /* vendor-specific */ | ||
77 | bool oversampling; /* vendor-specific */ | ||
78 | bool autorts; | ||
79 | }; | ||
80 | |||
81 | /* There is by now at least one vendor with differing details, so handle it */ | 70 | /* There is by now at least one vendor with differing details, so handle it */ |
82 | struct vendor_data { | 71 | struct vendor_data { |
83 | unsigned int ifls; | 72 | unsigned int ifls; |
@@ -85,6 +74,7 @@ struct vendor_data { | |||
85 | unsigned int lcrh_tx; | 74 | unsigned int lcrh_tx; |
86 | unsigned int lcrh_rx; | 75 | unsigned int lcrh_rx; |
87 | bool oversampling; | 76 | bool oversampling; |
77 | bool dma_threshold; | ||
88 | }; | 78 | }; |
89 | 79 | ||
90 | static struct vendor_data vendor_arm = { | 80 | static struct vendor_data vendor_arm = { |
@@ -93,6 +83,7 @@ static struct vendor_data vendor_arm = { | |||
93 | .lcrh_tx = UART011_LCRH, | 83 | .lcrh_tx = UART011_LCRH, |
94 | .lcrh_rx = UART011_LCRH, | 84 | .lcrh_rx = UART011_LCRH, |
95 | .oversampling = false, | 85 | .oversampling = false, |
86 | .dma_threshold = false, | ||
96 | }; | 87 | }; |
97 | 88 | ||
98 | static struct vendor_data vendor_st = { | 89 | static struct vendor_data vendor_st = { |
@@ -101,22 +92,535 @@ static struct vendor_data vendor_st = { | |||
101 | .lcrh_tx = ST_UART011_LCRH_TX, | 92 | .lcrh_tx = ST_UART011_LCRH_TX, |
102 | .lcrh_rx = ST_UART011_LCRH_RX, | 93 | .lcrh_rx = ST_UART011_LCRH_RX, |
103 | .oversampling = true, | 94 | .oversampling = true, |
95 | .dma_threshold = true, | ||
96 | }; | ||
97 | |||
98 | /* Deals with DMA transactions */ | ||
99 | struct pl011_dmatx_data { | ||
100 | struct dma_chan *chan; | ||
101 | struct scatterlist sg; | ||
102 | char *buf; | ||
103 | bool queued; | ||
104 | }; | 104 | }; |
105 | 105 | ||
106 | /* | ||
107 | * We wrap our port structure around the generic uart_port. | ||
108 | */ | ||
109 | struct uart_amba_port { | ||
110 | struct uart_port port; | ||
111 | struct clk *clk; | ||
112 | const struct vendor_data *vendor; | ||
113 | unsigned int dmacr; /* dma control reg */ | ||
114 | unsigned int im; /* interrupt mask */ | ||
115 | unsigned int old_status; | ||
116 | unsigned int fifosize; /* vendor-specific */ | ||
117 | unsigned int lcrh_tx; /* vendor-specific */ | ||
118 | unsigned int lcrh_rx; /* vendor-specific */ | ||
119 | bool autorts; | ||
120 | char type[12]; | ||
121 | #ifdef CONFIG_DMA_ENGINE | ||
122 | /* DMA stuff */ | ||
123 | bool using_dma; | ||
124 | struct pl011_dmatx_data dmatx; | ||
125 | #endif | ||
126 | }; | ||
127 | |||
128 | /* | ||
129 | * All the DMA operation mode stuff goes inside this ifdef. | ||
130 | * This assumes that you have a generic DMA device interface, | ||
131 | * no custom DMA interfaces are supported. | ||
132 | */ | ||
133 | #ifdef CONFIG_DMA_ENGINE | ||
134 | |||
135 | #define PL011_DMA_BUFFER_SIZE PAGE_SIZE | ||
136 | |||
137 | static void pl011_dma_probe_initcall(struct uart_amba_port *uap) | ||
138 | { | ||
139 | /* DMA is the sole user of the platform data right now */ | ||
140 | struct amba_pl011_data *plat = uap->port.dev->platform_data; | ||
141 | struct dma_slave_config tx_conf = { | ||
142 | .dst_addr = uap->port.mapbase + UART01x_DR, | ||
143 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, | ||
144 | .direction = DMA_TO_DEVICE, | ||
145 | .dst_maxburst = uap->fifosize >> 1, | ||
146 | }; | ||
147 | struct dma_chan *chan; | ||
148 | dma_cap_mask_t mask; | ||
149 | |||
150 | /* We need platform data */ | ||
151 | if (!plat || !plat->dma_filter) { | ||
152 | dev_info(uap->port.dev, "no DMA platform data\n"); | ||
153 | return; | ||
154 | } | ||
155 | |||
156 | /* Try to acquire a generic DMA engine slave channel */ | ||
157 | dma_cap_zero(mask); | ||
158 | dma_cap_set(DMA_SLAVE, mask); | ||
159 | |||
160 | chan = dma_request_channel(mask, plat->dma_filter, plat->dma_tx_param); | ||
161 | if (!chan) { | ||
162 | dev_err(uap->port.dev, "no TX DMA channel!\n"); | ||
163 | return; | ||
164 | } | ||
165 | |||
166 | dmaengine_slave_config(chan, &tx_conf); | ||
167 | uap->dmatx.chan = chan; | ||
168 | |||
169 | dev_info(uap->port.dev, "DMA channel TX %s\n", | ||
170 | dma_chan_name(uap->dmatx.chan)); | ||
171 | } | ||
172 | |||
173 | #ifndef MODULE | ||
174 | /* | ||
175 | * Stack up the UARTs and let the above initcall be done at device | ||
176 | * initcall time, because the serial driver is called as an arch | ||
177 | * initcall, and at this time the DMA subsystem is not yet registered. | ||
178 | * At this point the driver will switch over to using DMA where desired. | ||
179 | */ | ||
180 | struct dma_uap { | ||
181 | struct list_head node; | ||
182 | struct uart_amba_port *uap; | ||
183 | }; | ||
184 | |||
185 | static LIST_HEAD(pl011_dma_uarts); | ||
186 | |||
187 | static int __init pl011_dma_initcall(void) | ||
188 | { | ||
189 | struct list_head *node, *tmp; | ||
190 | |||
191 | list_for_each_safe(node, tmp, &pl011_dma_uarts) { | ||
192 | struct dma_uap *dmau = list_entry(node, struct dma_uap, node); | ||
193 | pl011_dma_probe_initcall(dmau->uap); | ||
194 | list_del(node); | ||
195 | kfree(dmau); | ||
196 | } | ||
197 | return 0; | ||
198 | } | ||
199 | |||
200 | device_initcall(pl011_dma_initcall); | ||
201 | |||
202 | static void pl011_dma_probe(struct uart_amba_port *uap) | ||
203 | { | ||
204 | struct dma_uap *dmau = kzalloc(sizeof(struct dma_uap), GFP_KERNEL); | ||
205 | if (dmau) { | ||
206 | dmau->uap = uap; | ||
207 | list_add_tail(&dmau->node, &pl011_dma_uarts); | ||
208 | } | ||
209 | } | ||
210 | #else | ||
211 | static void pl011_dma_probe(struct uart_amba_port *uap) | ||
212 | { | ||
213 | pl011_dma_probe_initcall(uap); | ||
214 | } | ||
215 | #endif | ||
216 | |||
217 | static void pl011_dma_remove(struct uart_amba_port *uap) | ||
218 | { | ||
219 | /* TODO: remove the initcall if it has not yet executed */ | ||
220 | if (uap->dmatx.chan) | ||
221 | dma_release_channel(uap->dmatx.chan); | ||
222 | } | ||
223 | |||
224 | |||
225 | /* Forward declare this for the refill routine */ | ||
226 | static int pl011_dma_tx_refill(struct uart_amba_port *uap); | ||
227 | |||
228 | /* | ||
229 | * The current DMA TX buffer has been sent. | ||
230 | * Try to queue up another DMA buffer. | ||
231 | */ | ||
232 | static void pl011_dma_tx_callback(void *data) | ||
233 | { | ||
234 | struct uart_amba_port *uap = data; | ||
235 | struct pl011_dmatx_data *dmatx = &uap->dmatx; | ||
236 | unsigned long flags; | ||
237 | u16 dmacr; | ||
238 | |||
239 | spin_lock_irqsave(&uap->port.lock, flags); | ||
240 | if (uap->dmatx.queued) | ||
241 | dma_unmap_sg(dmatx->chan->device->dev, &dmatx->sg, 1, | ||
242 | DMA_TO_DEVICE); | ||
243 | |||
244 | dmacr = uap->dmacr; | ||
245 | uap->dmacr = dmacr & ~UART011_TXDMAE; | ||
246 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
247 | |||
248 | /* | ||
249 | * If TX DMA was disabled, it means that we've stopped the DMA for | ||
250 | * some reason (eg, XOFF received, or we want to send an X-char.) | ||
251 | * | ||
252 | * Note: we need to be careful here of a potential race between DMA | ||
253 | * and the rest of the driver - if the driver disables TX DMA while | ||
254 | * a TX buffer completing, we must update the tx queued status to | ||
255 | * get further refills (hence we check dmacr). | ||
256 | */ | ||
257 | if (!(dmacr & UART011_TXDMAE) || uart_tx_stopped(&uap->port) || | ||
258 | uart_circ_empty(&uap->port.state->xmit)) { | ||
259 | uap->dmatx.queued = false; | ||
260 | spin_unlock_irqrestore(&uap->port.lock, flags); | ||
261 | return; | ||
262 | } | ||
263 | |||
264 | if (pl011_dma_tx_refill(uap) <= 0) { | ||
265 | /* | ||
266 | * We didn't queue a DMA buffer for some reason, but we | ||
267 | * have data pending to be sent. Re-enable the TX IRQ. | ||
268 | */ | ||
269 | uap->im |= UART011_TXIM; | ||
270 | writew(uap->im, uap->port.membase + UART011_IMSC); | ||
271 | } | ||
272 | spin_unlock_irqrestore(&uap->port.lock, flags); | ||
273 | } | ||
274 | |||
275 | /* | ||
276 | * Try to refill the TX DMA buffer. | ||
277 | * Locking: called with port lock held and IRQs disabled. | ||
278 | * Returns: | ||
279 | * 1 if we queued up a TX DMA buffer. | ||
280 | * 0 if we didn't want to handle this by DMA | ||
281 | * <0 on error | ||
282 | */ | ||
283 | static int pl011_dma_tx_refill(struct uart_amba_port *uap) | ||
284 | { | ||
285 | struct pl011_dmatx_data *dmatx = &uap->dmatx; | ||
286 | struct dma_chan *chan = dmatx->chan; | ||
287 | struct dma_device *dma_dev = chan->device; | ||
288 | struct dma_async_tx_descriptor *desc; | ||
289 | struct circ_buf *xmit = &uap->port.state->xmit; | ||
290 | unsigned int count; | ||
291 | |||
292 | /* | ||
293 | * Try to avoid the overhead involved in using DMA if the | ||
294 | * transaction fits in the first half of the FIFO, by using | ||
295 | * the standard interrupt handling. This ensures that we | ||
296 | * issue a uart_write_wakeup() at the appropriate time. | ||
297 | */ | ||
298 | count = uart_circ_chars_pending(xmit); | ||
299 | if (count < (uap->fifosize >> 1)) { | ||
300 | uap->dmatx.queued = false; | ||
301 | return 0; | ||
302 | } | ||
303 | |||
304 | /* | ||
305 | * Bodge: don't send the last character by DMA, as this | ||
306 | * will prevent XON from notifying us to restart DMA. | ||
307 | */ | ||
308 | count -= 1; | ||
309 | |||
310 | /* Else proceed to copy the TX chars to the DMA buffer and fire DMA */ | ||
311 | if (count > PL011_DMA_BUFFER_SIZE) | ||
312 | count = PL011_DMA_BUFFER_SIZE; | ||
313 | |||
314 | if (xmit->tail < xmit->head) | ||
315 | memcpy(&dmatx->buf[0], &xmit->buf[xmit->tail], count); | ||
316 | else { | ||
317 | size_t first = UART_XMIT_SIZE - xmit->tail; | ||
318 | size_t second = xmit->head; | ||
319 | |||
320 | memcpy(&dmatx->buf[0], &xmit->buf[xmit->tail], first); | ||
321 | if (second) | ||
322 | memcpy(&dmatx->buf[first], &xmit->buf[0], second); | ||
323 | } | ||
324 | |||
325 | dmatx->sg.length = count; | ||
326 | |||
327 | if (dma_map_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE) != 1) { | ||
328 | uap->dmatx.queued = false; | ||
329 | dev_dbg(uap->port.dev, "unable to map TX DMA\n"); | ||
330 | return -EBUSY; | ||
331 | } | ||
332 | |||
333 | desc = dma_dev->device_prep_slave_sg(chan, &dmatx->sg, 1, DMA_TO_DEVICE, | ||
334 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | ||
335 | if (!desc) { | ||
336 | dma_unmap_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE); | ||
337 | uap->dmatx.queued = false; | ||
338 | /* | ||
339 | * If DMA cannot be used right now, we complete this | ||
340 | * transaction via IRQ and let the TTY layer retry. | ||
341 | */ | ||
342 | dev_dbg(uap->port.dev, "TX DMA busy\n"); | ||
343 | return -EBUSY; | ||
344 | } | ||
345 | |||
346 | /* Some data to go along to the callback */ | ||
347 | desc->callback = pl011_dma_tx_callback; | ||
348 | desc->callback_param = uap; | ||
349 | |||
350 | /* All errors should happen at prepare time */ | ||
351 | dmaengine_submit(desc); | ||
352 | |||
353 | /* Fire the DMA transaction */ | ||
354 | dma_dev->device_issue_pending(chan); | ||
355 | |||
356 | uap->dmacr |= UART011_TXDMAE; | ||
357 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
358 | uap->dmatx.queued = true; | ||
359 | |||
360 | /* | ||
361 | * Now we know that DMA will fire, so advance the ring buffer | ||
362 | * with the stuff we just dispatched. | ||
363 | */ | ||
364 | xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1); | ||
365 | uap->port.icount.tx += count; | ||
366 | |||
367 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | ||
368 | uart_write_wakeup(&uap->port); | ||
369 | |||
370 | return 1; | ||
371 | } | ||
372 | |||
373 | /* | ||
374 | * We received a transmit interrupt without a pending X-char but with | ||
375 | * pending characters. | ||
376 | * Locking: called with port lock held and IRQs disabled. | ||
377 | * Returns: | ||
378 | * false if we want to use PIO to transmit | ||
379 | * true if we queued a DMA buffer | ||
380 | */ | ||
381 | static bool pl011_dma_tx_irq(struct uart_amba_port *uap) | ||
382 | { | ||
383 | if (!uap->using_dma) | ||
384 | return false; | ||
385 | |||
386 | /* | ||
387 | * If we already have a TX buffer queued, but received a | ||
388 | * TX interrupt, it will be because we've just sent an X-char. | ||
389 | * Ensure the TX DMA is enabled and the TX IRQ is disabled. | ||
390 | */ | ||
391 | if (uap->dmatx.queued) { | ||
392 | uap->dmacr |= UART011_TXDMAE; | ||
393 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
394 | uap->im &= ~UART011_TXIM; | ||
395 | writew(uap->im, uap->port.membase + UART011_IMSC); | ||
396 | return true; | ||
397 | } | ||
398 | |||
399 | /* | ||
400 | * We don't have a TX buffer queued, so try to queue one. | ||
401 | * If we succesfully queued a buffer, mask the TX IRQ. | ||
402 | */ | ||
403 | if (pl011_dma_tx_refill(uap) > 0) { | ||
404 | uap->im &= ~UART011_TXIM; | ||
405 | writew(uap->im, uap->port.membase + UART011_IMSC); | ||
406 | return true; | ||
407 | } | ||
408 | return false; | ||
409 | } | ||
410 | |||
411 | /* | ||
412 | * Stop the DMA transmit (eg, due to received XOFF). | ||
413 | * Locking: called with port lock held and IRQs disabled. | ||
414 | */ | ||
415 | static inline void pl011_dma_tx_stop(struct uart_amba_port *uap) | ||
416 | { | ||
417 | if (uap->dmatx.queued) { | ||
418 | uap->dmacr &= ~UART011_TXDMAE; | ||
419 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
420 | } | ||
421 | } | ||
422 | |||
423 | /* | ||
424 | * Try to start a DMA transmit, or in the case of an XON/OFF | ||
425 | * character queued for send, try to get that character out ASAP. | ||
426 | * Locking: called with port lock held and IRQs disabled. | ||
427 | * Returns: | ||
428 | * false if we want the TX IRQ to be enabled | ||
429 | * true if we have a buffer queued | ||
430 | */ | ||
431 | static inline bool pl011_dma_tx_start(struct uart_amba_port *uap) | ||
432 | { | ||
433 | u16 dmacr; | ||
434 | |||
435 | if (!uap->using_dma) | ||
436 | return false; | ||
437 | |||
438 | if (!uap->port.x_char) { | ||
439 | /* no X-char, try to push chars out in DMA mode */ | ||
440 | bool ret = true; | ||
441 | |||
442 | if (!uap->dmatx.queued) { | ||
443 | if (pl011_dma_tx_refill(uap) > 0) { | ||
444 | uap->im &= ~UART011_TXIM; | ||
445 | ret = true; | ||
446 | } else { | ||
447 | uap->im |= UART011_TXIM; | ||
448 | ret = false; | ||
449 | } | ||
450 | writew(uap->im, uap->port.membase + UART011_IMSC); | ||
451 | } else if (!(uap->dmacr & UART011_TXDMAE)) { | ||
452 | uap->dmacr |= UART011_TXDMAE; | ||
453 | writew(uap->dmacr, | ||
454 | uap->port.membase + UART011_DMACR); | ||
455 | } | ||
456 | return ret; | ||
457 | } | ||
458 | |||
459 | /* | ||
460 | * We have an X-char to send. Disable DMA to prevent it loading | ||
461 | * the TX fifo, and then see if we can stuff it into the FIFO. | ||
462 | */ | ||
463 | dmacr = uap->dmacr; | ||
464 | uap->dmacr &= ~UART011_TXDMAE; | ||
465 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
466 | |||
467 | if (readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF) { | ||
468 | /* | ||
469 | * No space in the FIFO, so enable the transmit interrupt | ||
470 | * so we know when there is space. Note that once we've | ||
471 | * loaded the character, we should just re-enable DMA. | ||
472 | */ | ||
473 | return false; | ||
474 | } | ||
475 | |||
476 | writew(uap->port.x_char, uap->port.membase + UART01x_DR); | ||
477 | uap->port.icount.tx++; | ||
478 | uap->port.x_char = 0; | ||
479 | |||
480 | /* Success - restore the DMA state */ | ||
481 | uap->dmacr = dmacr; | ||
482 | writew(dmacr, uap->port.membase + UART011_DMACR); | ||
483 | |||
484 | return true; | ||
485 | } | ||
486 | |||
487 | /* | ||
488 | * Flush the transmit buffer. | ||
489 | * Locking: called with port lock held and IRQs disabled. | ||
490 | */ | ||
491 | static void pl011_dma_flush_buffer(struct uart_port *port) | ||
492 | { | ||
493 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | ||
494 | |||
495 | if (!uap->using_dma) | ||
496 | return; | ||
497 | |||
498 | /* Avoid deadlock with the DMA engine callback */ | ||
499 | spin_unlock(&uap->port.lock); | ||
500 | dmaengine_terminate_all(uap->dmatx.chan); | ||
501 | spin_lock(&uap->port.lock); | ||
502 | if (uap->dmatx.queued) { | ||
503 | dma_unmap_sg(uap->dmatx.chan->device->dev, &uap->dmatx.sg, 1, | ||
504 | DMA_TO_DEVICE); | ||
505 | uap->dmatx.queued = false; | ||
506 | uap->dmacr &= ~UART011_TXDMAE; | ||
507 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
508 | } | ||
509 | } | ||
510 | |||
511 | |||
512 | static void pl011_dma_startup(struct uart_amba_port *uap) | ||
513 | { | ||
514 | if (!uap->dmatx.chan) | ||
515 | return; | ||
516 | |||
517 | uap->dmatx.buf = kmalloc(PL011_DMA_BUFFER_SIZE, GFP_KERNEL); | ||
518 | if (!uap->dmatx.buf) { | ||
519 | dev_err(uap->port.dev, "no memory for DMA TX buffer\n"); | ||
520 | uap->port.fifosize = uap->fifosize; | ||
521 | return; | ||
522 | } | ||
523 | |||
524 | sg_init_one(&uap->dmatx.sg, uap->dmatx.buf, PL011_DMA_BUFFER_SIZE); | ||
525 | |||
526 | /* The DMA buffer is now the FIFO the TTY subsystem can use */ | ||
527 | uap->port.fifosize = PL011_DMA_BUFFER_SIZE; | ||
528 | uap->using_dma = true; | ||
529 | |||
530 | /* Turn on DMA error (RX/TX will be enabled on demand) */ | ||
531 | uap->dmacr |= UART011_DMAONERR; | ||
532 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
533 | |||
534 | /* | ||
535 | * ST Micro variants has some specific dma burst threshold | ||
536 | * compensation. Set this to 16 bytes, so burst will only | ||
537 | * be issued above/below 16 bytes. | ||
538 | */ | ||
539 | if (uap->vendor->dma_threshold) | ||
540 | writew(ST_UART011_DMAWM_RX_16 | ST_UART011_DMAWM_TX_16, | ||
541 | uap->port.membase + ST_UART011_DMAWM); | ||
542 | } | ||
543 | |||
544 | static void pl011_dma_shutdown(struct uart_amba_port *uap) | ||
545 | { | ||
546 | if (!uap->using_dma) | ||
547 | return; | ||
548 | |||
549 | /* Disable RX and TX DMA */ | ||
550 | while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_BUSY) | ||
551 | barrier(); | ||
552 | |||
553 | spin_lock_irq(&uap->port.lock); | ||
554 | uap->dmacr &= ~(UART011_DMAONERR | UART011_RXDMAE | UART011_TXDMAE); | ||
555 | writew(uap->dmacr, uap->port.membase + UART011_DMACR); | ||
556 | spin_unlock_irq(&uap->port.lock); | ||
557 | |||
558 | /* In theory, this should already be done by pl011_dma_flush_buffer */ | ||
559 | dmaengine_terminate_all(uap->dmatx.chan); | ||
560 | if (uap->dmatx.queued) { | ||
561 | dma_unmap_sg(uap->dmatx.chan->device->dev, &uap->dmatx.sg, 1, | ||
562 | DMA_TO_DEVICE); | ||
563 | uap->dmatx.queued = false; | ||
564 | } | ||
565 | |||
566 | kfree(uap->dmatx.buf); | ||
567 | |||
568 | uap->using_dma = false; | ||
569 | } | ||
570 | |||
571 | #else | ||
572 | /* Blank functions if the DMA engine is not available */ | ||
573 | static inline void pl011_dma_probe(struct uart_amba_port *uap) | ||
574 | { | ||
575 | } | ||
576 | |||
577 | static inline void pl011_dma_remove(struct uart_amba_port *uap) | ||
578 | { | ||
579 | } | ||
580 | |||
581 | static inline void pl011_dma_startup(struct uart_amba_port *uap) | ||
582 | { | ||
583 | } | ||
584 | |||
585 | static inline void pl011_dma_shutdown(struct uart_amba_port *uap) | ||
586 | { | ||
587 | } | ||
588 | |||
589 | static inline bool pl011_dma_tx_irq(struct uart_amba_port *uap) | ||
590 | { | ||
591 | return false; | ||
592 | } | ||
593 | |||
594 | static inline void pl011_dma_tx_stop(struct uart_amba_port *uap) | ||
595 | { | ||
596 | } | ||
597 | |||
598 | static inline bool pl011_dma_tx_start(struct uart_amba_port *uap) | ||
599 | { | ||
600 | return false; | ||
601 | } | ||
602 | |||
603 | #define pl011_dma_flush_buffer NULL | ||
604 | #endif | ||
605 | |||
606 | |||
106 | static void pl011_stop_tx(struct uart_port *port) | 607 | static void pl011_stop_tx(struct uart_port *port) |
107 | { | 608 | { |
108 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 609 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
109 | 610 | ||
110 | uap->im &= ~UART011_TXIM; | 611 | uap->im &= ~UART011_TXIM; |
111 | writew(uap->im, uap->port.membase + UART011_IMSC); | 612 | writew(uap->im, uap->port.membase + UART011_IMSC); |
613 | pl011_dma_tx_stop(uap); | ||
112 | } | 614 | } |
113 | 615 | ||
114 | static void pl011_start_tx(struct uart_port *port) | 616 | static void pl011_start_tx(struct uart_port *port) |
115 | { | 617 | { |
116 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 618 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
117 | 619 | ||
118 | uap->im |= UART011_TXIM; | 620 | if (!pl011_dma_tx_start(uap)) { |
119 | writew(uap->im, uap->port.membase + UART011_IMSC); | 621 | uap->im |= UART011_TXIM; |
622 | writew(uap->im, uap->port.membase + UART011_IMSC); | ||
623 | } | ||
120 | } | 624 | } |
121 | 625 | ||
122 | static void pl011_stop_rx(struct uart_port *port) | 626 | static void pl011_stop_rx(struct uart_port *port) |
@@ -203,7 +707,11 @@ static void pl011_tx_chars(struct uart_amba_port *uap) | |||
203 | return; | 707 | return; |
204 | } | 708 | } |
205 | 709 | ||
206 | count = uap->port.fifosize >> 1; | 710 | /* If we are using DMA mode, try to send some characters. */ |
711 | if (pl011_dma_tx_irq(uap)) | ||
712 | return; | ||
713 | |||
714 | count = uap->fifosize >> 1; | ||
207 | do { | 715 | do { |
208 | writew(xmit->buf[xmit->tail], uap->port.membase + UART01x_DR); | 716 | writew(xmit->buf[xmit->tail], uap->port.membase + UART01x_DR); |
209 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 717 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
@@ -246,10 +754,11 @@ static void pl011_modem_status(struct uart_amba_port *uap) | |||
246 | static irqreturn_t pl011_int(int irq, void *dev_id) | 754 | static irqreturn_t pl011_int(int irq, void *dev_id) |
247 | { | 755 | { |
248 | struct uart_amba_port *uap = dev_id; | 756 | struct uart_amba_port *uap = dev_id; |
757 | unsigned long flags; | ||
249 | unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT; | 758 | unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT; |
250 | int handled = 0; | 759 | int handled = 0; |
251 | 760 | ||
252 | spin_lock(&uap->port.lock); | 761 | spin_lock_irqsave(&uap->port.lock, flags); |
253 | 762 | ||
254 | status = readw(uap->port.membase + UART011_MIS); | 763 | status = readw(uap->port.membase + UART011_MIS); |
255 | if (status) { | 764 | if (status) { |
@@ -274,7 +783,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id) | |||
274 | handled = 1; | 783 | handled = 1; |
275 | } | 784 | } |
276 | 785 | ||
277 | spin_unlock(&uap->port.lock); | 786 | spin_unlock_irqrestore(&uap->port.lock, flags); |
278 | 787 | ||
279 | return IRQ_RETVAL(handled); | 788 | return IRQ_RETVAL(handled); |
280 | } | 789 | } |
@@ -396,7 +905,7 @@ static int pl011_startup(struct uart_port *port) | |||
396 | if (retval) | 905 | if (retval) |
397 | goto clk_dis; | 906 | goto clk_dis; |
398 | 907 | ||
399 | writew(uap->ifls, uap->port.membase + UART011_IFLS); | 908 | writew(uap->vendor->ifls, uap->port.membase + UART011_IFLS); |
400 | 909 | ||
401 | /* | 910 | /* |
402 | * Provoke TX FIFO interrupt into asserting. | 911 | * Provoke TX FIFO interrupt into asserting. |
@@ -423,11 +932,18 @@ static int pl011_startup(struct uart_port *port) | |||
423 | cr = UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE; | 932 | cr = UART01x_CR_UARTEN | UART011_CR_RXE | UART011_CR_TXE; |
424 | writew(cr, uap->port.membase + UART011_CR); | 933 | writew(cr, uap->port.membase + UART011_CR); |
425 | 934 | ||
935 | /* Clear pending error interrupts */ | ||
936 | writew(UART011_OEIS | UART011_BEIS | UART011_PEIS | UART011_FEIS, | ||
937 | uap->port.membase + UART011_ICR); | ||
938 | |||
426 | /* | 939 | /* |
427 | * initialise the old status of the modem signals | 940 | * initialise the old status of the modem signals |
428 | */ | 941 | */ |
429 | uap->old_status = readw(uap->port.membase + UART01x_FR) & UART01x_FR_MODEM_ANY; | 942 | uap->old_status = readw(uap->port.membase + UART01x_FR) & UART01x_FR_MODEM_ANY; |
430 | 943 | ||
944 | /* Startup DMA */ | ||
945 | pl011_dma_startup(uap); | ||
946 | |||
431 | /* | 947 | /* |
432 | * Finally, enable interrupts | 948 | * Finally, enable interrupts |
433 | */ | 949 | */ |
@@ -467,6 +983,8 @@ static void pl011_shutdown(struct uart_port *port) | |||
467 | writew(0xffff, uap->port.membase + UART011_ICR); | 983 | writew(0xffff, uap->port.membase + UART011_ICR); |
468 | spin_unlock_irq(&uap->port.lock); | 984 | spin_unlock_irq(&uap->port.lock); |
469 | 985 | ||
986 | pl011_dma_shutdown(uap); | ||
987 | |||
470 | /* | 988 | /* |
471 | * Free the interrupt | 989 | * Free the interrupt |
472 | */ | 990 | */ |
@@ -498,13 +1016,18 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
498 | struct uart_amba_port *uap = (struct uart_amba_port *)port; | 1016 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
499 | unsigned int lcr_h, old_cr; | 1017 | unsigned int lcr_h, old_cr; |
500 | unsigned long flags; | 1018 | unsigned long flags; |
501 | unsigned int baud, quot; | 1019 | unsigned int baud, quot, clkdiv; |
1020 | |||
1021 | if (uap->vendor->oversampling) | ||
1022 | clkdiv = 8; | ||
1023 | else | ||
1024 | clkdiv = 16; | ||
502 | 1025 | ||
503 | /* | 1026 | /* |
504 | * Ask the core to calculate the divisor for us. | 1027 | * Ask the core to calculate the divisor for us. |
505 | */ | 1028 | */ |
506 | baud = uart_get_baud_rate(port, termios, old, 0, | 1029 | baud = uart_get_baud_rate(port, termios, old, 0, |
507 | port->uartclk/(uap->oversampling ? 8 : 16)); | 1030 | port->uartclk / clkdiv); |
508 | 1031 | ||
509 | if (baud > port->uartclk/16) | 1032 | if (baud > port->uartclk/16) |
510 | quot = DIV_ROUND_CLOSEST(port->uartclk * 8, baud); | 1033 | quot = DIV_ROUND_CLOSEST(port->uartclk * 8, baud); |
@@ -532,7 +1055,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
532 | if (!(termios->c_cflag & PARODD)) | 1055 | if (!(termios->c_cflag & PARODD)) |
533 | lcr_h |= UART01x_LCRH_EPS; | 1056 | lcr_h |= UART01x_LCRH_EPS; |
534 | } | 1057 | } |
535 | if (port->fifosize > 1) | 1058 | if (uap->fifosize > 1) |
536 | lcr_h |= UART01x_LCRH_FEN; | 1059 | lcr_h |= UART01x_LCRH_FEN; |
537 | 1060 | ||
538 | spin_lock_irqsave(&port->lock, flags); | 1061 | spin_lock_irqsave(&port->lock, flags); |
@@ -588,8 +1111,8 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
588 | uap->autorts = false; | 1111 | uap->autorts = false; |
589 | } | 1112 | } |
590 | 1113 | ||
591 | if (uap->oversampling) { | 1114 | if (uap->vendor->oversampling) { |
592 | if (baud > port->uartclk/16) | 1115 | if (baud > port->uartclk / 16) |
593 | old_cr |= ST_UART011_CR_OVSFACT; | 1116 | old_cr |= ST_UART011_CR_OVSFACT; |
594 | else | 1117 | else |
595 | old_cr &= ~ST_UART011_CR_OVSFACT; | 1118 | old_cr &= ~ST_UART011_CR_OVSFACT; |
@@ -622,7 +1145,8 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, | |||
622 | 1145 | ||
623 | static const char *pl011_type(struct uart_port *port) | 1146 | static const char *pl011_type(struct uart_port *port) |
624 | { | 1147 | { |
625 | return port->type == PORT_AMBA ? "AMBA/PL011" : NULL; | 1148 | struct uart_amba_port *uap = (struct uart_amba_port *)port; |
1149 | return uap->port.type == PORT_AMBA ? uap->type : NULL; | ||
626 | } | 1150 | } |
627 | 1151 | ||
628 | /* | 1152 | /* |
@@ -679,6 +1203,7 @@ static struct uart_ops amba_pl011_pops = { | |||
679 | .break_ctl = pl011_break_ctl, | 1203 | .break_ctl = pl011_break_ctl, |
680 | .startup = pl011_startup, | 1204 | .startup = pl011_startup, |
681 | .shutdown = pl011_shutdown, | 1205 | .shutdown = pl011_shutdown, |
1206 | .flush_buffer = pl011_dma_flush_buffer, | ||
682 | .set_termios = pl011_set_termios, | 1207 | .set_termios = pl011_set_termios, |
683 | .type = pl011_type, | 1208 | .type = pl011_type, |
684 | .release_port = pl010_release_port, | 1209 | .release_port = pl010_release_port, |
@@ -761,7 +1286,7 @@ pl011_console_get_options(struct uart_amba_port *uap, int *baud, | |||
761 | 1286 | ||
762 | *baud = uap->port.uartclk * 4 / (64 * ibrd + fbrd); | 1287 | *baud = uap->port.uartclk * 4 / (64 * ibrd + fbrd); |
763 | 1288 | ||
764 | if (uap->oversampling) { | 1289 | if (uap->vendor->oversampling) { |
765 | if (readw(uap->port.membase + UART011_CR) | 1290 | if (readw(uap->port.membase + UART011_CR) |
766 | & ST_UART011_CR_OVSFACT) | 1291 | & ST_UART011_CR_OVSFACT) |
767 | *baud *= 2; | 1292 | *baud *= 2; |
@@ -858,19 +1383,22 @@ static int pl011_probe(struct amba_device *dev, struct amba_id *id) | |||
858 | goto unmap; | 1383 | goto unmap; |
859 | } | 1384 | } |
860 | 1385 | ||
861 | uap->ifls = vendor->ifls; | 1386 | uap->vendor = vendor; |
862 | uap->lcrh_rx = vendor->lcrh_rx; | 1387 | uap->lcrh_rx = vendor->lcrh_rx; |
863 | uap->lcrh_tx = vendor->lcrh_tx; | 1388 | uap->lcrh_tx = vendor->lcrh_tx; |
864 | uap->oversampling = vendor->oversampling; | 1389 | uap->fifosize = vendor->fifosize; |
865 | uap->port.dev = &dev->dev; | 1390 | uap->port.dev = &dev->dev; |
866 | uap->port.mapbase = dev->res.start; | 1391 | uap->port.mapbase = dev->res.start; |
867 | uap->port.membase = base; | 1392 | uap->port.membase = base; |
868 | uap->port.iotype = UPIO_MEM; | 1393 | uap->port.iotype = UPIO_MEM; |
869 | uap->port.irq = dev->irq[0]; | 1394 | uap->port.irq = dev->irq[0]; |
870 | uap->port.fifosize = vendor->fifosize; | 1395 | uap->port.fifosize = uap->fifosize; |
871 | uap->port.ops = &amba_pl011_pops; | 1396 | uap->port.ops = &amba_pl011_pops; |
872 | uap->port.flags = UPF_BOOT_AUTOCONF; | 1397 | uap->port.flags = UPF_BOOT_AUTOCONF; |
873 | uap->port.line = i; | 1398 | uap->port.line = i; |
1399 | pl011_dma_probe(uap); | ||
1400 | |||
1401 | snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev)); | ||
874 | 1402 | ||
875 | amba_ports[i] = uap; | 1403 | amba_ports[i] = uap; |
876 | 1404 | ||
@@ -879,6 +1407,7 @@ static int pl011_probe(struct amba_device *dev, struct amba_id *id) | |||
879 | if (ret) { | 1407 | if (ret) { |
880 | amba_set_drvdata(dev, NULL); | 1408 | amba_set_drvdata(dev, NULL); |
881 | amba_ports[i] = NULL; | 1409 | amba_ports[i] = NULL; |
1410 | pl011_dma_remove(uap); | ||
882 | clk_put(uap->clk); | 1411 | clk_put(uap->clk); |
883 | unmap: | 1412 | unmap: |
884 | iounmap(base); | 1413 | iounmap(base); |
@@ -902,6 +1431,7 @@ static int pl011_remove(struct amba_device *dev) | |||
902 | if (amba_ports[i] == uap) | 1431 | if (amba_ports[i] == uap) |
903 | amba_ports[i] = NULL; | 1432 | amba_ports[i] = NULL; |
904 | 1433 | ||
1434 | pl011_dma_remove(uap); | ||
905 | iounmap(uap->port.membase); | 1435 | iounmap(uap->port.membase); |
906 | clk_put(uap->clk); | 1436 | clk_put(uap->clk); |
907 | kfree(uap); | 1437 | kfree(uap); |
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 67eb3770868f..5a7c8f1d76c6 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig | |||
@@ -41,6 +41,7 @@ config USB_ARCH_HAS_OHCI | |||
41 | default y if MFD_TC6393XB | 41 | default y if MFD_TC6393XB |
42 | default y if ARCH_W90X900 | 42 | default y if ARCH_W90X900 |
43 | default y if ARCH_DAVINCI_DA8XX | 43 | default y if ARCH_DAVINCI_DA8XX |
44 | default y if ARCH_CNS3XXX | ||
44 | # PPC: | 45 | # PPC: |
45 | default y if STB03xxx | 46 | default y if STB03xxx |
46 | default y if PPC_MPC52xx | 47 | default y if PPC_MPC52xx |
@@ -66,6 +67,7 @@ config USB_ARCH_HAS_EHCI | |||
66 | default y if ARCH_AT91SAM9G45 | 67 | default y if ARCH_AT91SAM9G45 |
67 | default y if ARCH_MXC | 68 | default y if ARCH_MXC |
68 | default y if ARCH_OMAP3 | 69 | default y if ARCH_OMAP3 |
70 | default y if ARCH_CNS3XXX | ||
69 | default PCI | 71 | default PCI |
70 | 72 | ||
71 | # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface. | 73 | # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface. |
diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c index 5bdbfe619853..77b1eb577029 100644 --- a/drivers/usb/gadget/fsl_mxc_udc.c +++ b/drivers/usb/gadget/fsl_mxc_udc.c | |||
@@ -93,9 +93,9 @@ void fsl_udc_clk_finalize(struct platform_device *pdev) | |||
93 | 93 | ||
94 | /* workaround ENGcm09152 for i.MX35 */ | 94 | /* workaround ENGcm09152 for i.MX35 */ |
95 | if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) { | 95 | if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) { |
96 | v = readl(MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR + | 96 | v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + |
97 | USBPHYCTRL_OTGBASE_OFFSET)); | 97 | USBPHYCTRL_OTGBASE_OFFSET)); |
98 | writel(v | USBPHYCTRL_EVDO, MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR + | 98 | writel(v | USBPHYCTRL_EVDO, MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + |
99 | USBPHYCTRL_OTGBASE_OFFSET)); | 99 | USBPHYCTRL_OTGBASE_OFFSET)); |
100 | } | 100 | } |
101 | #endif | 101 | #endif |
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 6f4f8e6a40c7..f8970d151d2a 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -147,6 +147,14 @@ config USB_W90X900_EHCI | |||
147 | ---help--- | 147 | ---help--- |
148 | Enables support for the W90X900 USB controller | 148 | Enables support for the W90X900 USB controller |
149 | 149 | ||
150 | config USB_CNS3XXX_EHCI | ||
151 | bool "Cavium CNS3XXX EHCI Module" | ||
152 | depends on USB_EHCI_HCD && ARCH_CNS3XXX | ||
153 | ---help--- | ||
154 | Enable support for the CNS3XXX SOC's on-chip EHCI controller. | ||
155 | It is needed for high-speed (480Mbit/sec) USB 2.0 device | ||
156 | support. | ||
157 | |||
150 | config USB_OXU210HP_HCD | 158 | config USB_OXU210HP_HCD |
151 | tristate "OXU210HP HCD support" | 159 | tristate "OXU210HP HCD support" |
152 | depends on USB | 160 | depends on USB |
@@ -286,6 +294,13 @@ config USB_OHCI_HCD_SSB | |||
286 | 294 | ||
287 | If unsure, say N. | 295 | If unsure, say N. |
288 | 296 | ||
297 | config USB_CNS3XXX_OHCI | ||
298 | bool "Cavium CNS3XXX OHCI Module" | ||
299 | depends on USB_OHCI_HCD && ARCH_CNS3XXX | ||
300 | ---help--- | ||
301 | Enable support for the CNS3XXX SOC's on-chip OHCI controller. | ||
302 | It is needed for low-speed USB 1.0 device support. | ||
303 | |||
289 | config USB_OHCI_BIG_ENDIAN_DESC | 304 | config USB_OHCI_BIG_ENDIAN_DESC |
290 | bool | 305 | bool |
291 | depends on USB_OHCI_HCD | 306 | depends on USB_OHCI_HCD |
diff --git a/drivers/usb/host/ehci-cns3xxx.c b/drivers/usb/host/ehci-cns3xxx.c new file mode 100644 index 000000000000..708a05b5d258 --- /dev/null +++ b/drivers/usb/host/ehci-cns3xxx.c | |||
@@ -0,0 +1,171 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Cavium Networks | ||
3 | * | ||
4 | * This file is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License, Version 2, as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/atomic.h> | ||
11 | #include <mach/cns3xxx.h> | ||
12 | #include <mach/pm.h> | ||
13 | |||
14 | static int cns3xxx_ehci_init(struct usb_hcd *hcd) | ||
15 | { | ||
16 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
17 | int retval; | ||
18 | |||
19 | /* | ||
20 | * EHCI and OHCI share the same clock and power, | ||
21 | * resetting twice would cause the 1st controller been reset. | ||
22 | * Therefore only do power up at the first up device, and | ||
23 | * power down at the last down device. | ||
24 | * | ||
25 | * Set USB AHB INCR length to 16 | ||
26 | */ | ||
27 | if (atomic_inc_return(&usb_pwr_ref) == 1) { | ||
28 | cns3xxx_pwr_power_up(1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB); | ||
29 | cns3xxx_pwr_clk_en(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
30 | cns3xxx_pwr_soft_rst(1 << PM_SOFT_RST_REG_OFFST_USB_HOST); | ||
31 | __raw_writel((__raw_readl(MISC_CHIP_CONFIG_REG) | (0X2 << 24)), | ||
32 | MISC_CHIP_CONFIG_REG); | ||
33 | } | ||
34 | |||
35 | ehci->caps = hcd->regs; | ||
36 | ehci->regs = hcd->regs | ||
37 | + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); | ||
38 | ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); | ||
39 | |||
40 | hcd->has_tt = 0; | ||
41 | ehci_reset(ehci); | ||
42 | |||
43 | retval = ehci_init(hcd); | ||
44 | if (retval) | ||
45 | return retval; | ||
46 | |||
47 | ehci_port_power(ehci, 0); | ||
48 | |||
49 | return retval; | ||
50 | } | ||
51 | |||
52 | static const struct hc_driver cns3xxx_ehci_hc_driver = { | ||
53 | .description = hcd_name, | ||
54 | .product_desc = "CNS3XXX EHCI Host Controller", | ||
55 | .hcd_priv_size = sizeof(struct ehci_hcd), | ||
56 | .irq = ehci_irq, | ||
57 | .flags = HCD_MEMORY | HCD_USB2, | ||
58 | .reset = cns3xxx_ehci_init, | ||
59 | .start = ehci_run, | ||
60 | .stop = ehci_stop, | ||
61 | .shutdown = ehci_shutdown, | ||
62 | .urb_enqueue = ehci_urb_enqueue, | ||
63 | .urb_dequeue = ehci_urb_dequeue, | ||
64 | .endpoint_disable = ehci_endpoint_disable, | ||
65 | .endpoint_reset = ehci_endpoint_reset, | ||
66 | .get_frame_number = ehci_get_frame, | ||
67 | .hub_status_data = ehci_hub_status_data, | ||
68 | .hub_control = ehci_hub_control, | ||
69 | #ifdef CONFIG_PM | ||
70 | .bus_suspend = ehci_bus_suspend, | ||
71 | .bus_resume = ehci_bus_resume, | ||
72 | #endif | ||
73 | .relinquish_port = ehci_relinquish_port, | ||
74 | .port_handed_over = ehci_port_handed_over, | ||
75 | |||
76 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | ||
77 | }; | ||
78 | |||
79 | static int cns3xxx_ehci_probe(struct platform_device *pdev) | ||
80 | { | ||
81 | struct device *dev = &pdev->dev; | ||
82 | struct usb_hcd *hcd; | ||
83 | const struct hc_driver *driver = &cns3xxx_ehci_hc_driver; | ||
84 | struct resource *res; | ||
85 | int irq; | ||
86 | int retval; | ||
87 | |||
88 | if (usb_disabled()) | ||
89 | return -ENODEV; | ||
90 | |||
91 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | ||
92 | if (!res) { | ||
93 | dev_err(dev, "Found HC with no IRQ.\n"); | ||
94 | return -ENODEV; | ||
95 | } | ||
96 | irq = res->start; | ||
97 | |||
98 | hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); | ||
99 | if (!hcd) | ||
100 | return -ENOMEM; | ||
101 | |||
102 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
103 | if (!res) { | ||
104 | dev_err(dev, "Found HC with no register addr.\n"); | ||
105 | retval = -ENODEV; | ||
106 | goto err1; | ||
107 | } | ||
108 | |||
109 | hcd->rsrc_start = res->start; | ||
110 | hcd->rsrc_len = res->end - res->start + 1; | ||
111 | |||
112 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, | ||
113 | driver->description)) { | ||
114 | dev_dbg(dev, "controller already in use\n"); | ||
115 | retval = -EBUSY; | ||
116 | goto err1; | ||
117 | } | ||
118 | |||
119 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); | ||
120 | if (hcd->regs == NULL) { | ||
121 | dev_dbg(dev, "error mapping memory\n"); | ||
122 | retval = -EFAULT; | ||
123 | goto err2; | ||
124 | } | ||
125 | |||
126 | retval = usb_add_hcd(hcd, irq, IRQF_SHARED); | ||
127 | if (retval == 0) | ||
128 | return retval; | ||
129 | |||
130 | iounmap(hcd->regs); | ||
131 | err2: | ||
132 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
133 | err1: | ||
134 | usb_put_hcd(hcd); | ||
135 | |||
136 | return retval; | ||
137 | } | ||
138 | |||
139 | static int cns3xxx_ehci_remove(struct platform_device *pdev) | ||
140 | { | ||
141 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | ||
142 | |||
143 | usb_remove_hcd(hcd); | ||
144 | iounmap(hcd->regs); | ||
145 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
146 | |||
147 | /* | ||
148 | * EHCI and OHCI share the same clock and power, | ||
149 | * resetting twice would cause the 1st controller been reset. | ||
150 | * Therefore only do power up at the first up device, and | ||
151 | * power down at the last down device. | ||
152 | */ | ||
153 | if (atomic_dec_return(&usb_pwr_ref) == 0) | ||
154 | cns3xxx_pwr_clk_dis(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
155 | |||
156 | usb_put_hcd(hcd); | ||
157 | |||
158 | platform_set_drvdata(pdev, NULL); | ||
159 | |||
160 | return 0; | ||
161 | } | ||
162 | |||
163 | MODULE_ALIAS("platform:cns3xxx-ehci"); | ||
164 | |||
165 | static struct platform_driver cns3xxx_ehci_driver = { | ||
166 | .probe = cns3xxx_ehci_probe, | ||
167 | .remove = cns3xxx_ehci_remove, | ||
168 | .driver = { | ||
169 | .name = "cns3xxx-ehci", | ||
170 | }, | ||
171 | }; | ||
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index e9062806d4a2..d0c8f7c03e05 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -1216,6 +1216,11 @@ MODULE_LICENSE ("GPL"); | |||
1216 | #define PLATFORM_DRIVER ehci_octeon_driver | 1216 | #define PLATFORM_DRIVER ehci_octeon_driver |
1217 | #endif | 1217 | #endif |
1218 | 1218 | ||
1219 | #ifdef CONFIG_USB_CNS3XXX_EHCI | ||
1220 | #include "ehci-cns3xxx.c" | ||
1221 | #define PLATFORM_DRIVER cns3xxx_ehci_driver | ||
1222 | #endif | ||
1223 | |||
1219 | #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ | 1224 | #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ |
1220 | !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \ | 1225 | !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \ |
1221 | !defined(XILINX_OF_PLATFORM_DRIVER) | 1226 | !defined(XILINX_OF_PLATFORM_DRIVER) |
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index bce85055019a..a22d2df769a9 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #define ULPI_VIEWPORT_OFFSET 0x170 | 28 | #define ULPI_VIEWPORT_OFFSET 0x170 |
29 | 29 | ||
30 | struct ehci_mxc_priv { | 30 | struct ehci_mxc_priv { |
31 | struct clk *usbclk, *ahbclk; | 31 | struct clk *usbclk, *ahbclk, *phy1clk; |
32 | struct usb_hcd *hcd; | 32 | struct usb_hcd *hcd; |
33 | }; | 33 | }; |
34 | 34 | ||
@@ -168,17 +168,6 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
168 | goto err_ioremap; | 168 | goto err_ioremap; |
169 | } | 169 | } |
170 | 170 | ||
171 | /* call platform specific init function */ | ||
172 | if (pdata->init) { | ||
173 | ret = pdata->init(pdev); | ||
174 | if (ret) { | ||
175 | dev_err(dev, "platform init failed\n"); | ||
176 | goto err_init; | ||
177 | } | ||
178 | /* platforms need some time to settle changed IO settings */ | ||
179 | mdelay(10); | ||
180 | } | ||
181 | |||
182 | /* enable clocks */ | 171 | /* enable clocks */ |
183 | priv->usbclk = clk_get(dev, "usb"); | 172 | priv->usbclk = clk_get(dev, "usb"); |
184 | if (IS_ERR(priv->usbclk)) { | 173 | if (IS_ERR(priv->usbclk)) { |
@@ -196,6 +185,28 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
196 | clk_enable(priv->ahbclk); | 185 | clk_enable(priv->ahbclk); |
197 | } | 186 | } |
198 | 187 | ||
188 | /* "dr" device has its own clock */ | ||
189 | if (pdev->id == 0) { | ||
190 | priv->phy1clk = clk_get(dev, "usb_phy1"); | ||
191 | if (IS_ERR(priv->phy1clk)) { | ||
192 | ret = PTR_ERR(priv->phy1clk); | ||
193 | goto err_clk_phy; | ||
194 | } | ||
195 | clk_enable(priv->phy1clk); | ||
196 | } | ||
197 | |||
198 | |||
199 | /* call platform specific init function */ | ||
200 | if (pdata->init) { | ||
201 | ret = pdata->init(pdev); | ||
202 | if (ret) { | ||
203 | dev_err(dev, "platform init failed\n"); | ||
204 | goto err_init; | ||
205 | } | ||
206 | /* platforms need some time to settle changed IO settings */ | ||
207 | mdelay(10); | ||
208 | } | ||
209 | |||
199 | /* setup specific usb hw */ | 210 | /* setup specific usb hw */ |
200 | ret = mxc_initialize_usb_hw(pdev->id, pdata->flags); | 211 | ret = mxc_initialize_usb_hw(pdev->id, pdata->flags); |
201 | if (ret < 0) | 212 | if (ret < 0) |
@@ -230,6 +241,11 @@ err_add: | |||
230 | if (pdata && pdata->exit) | 241 | if (pdata && pdata->exit) |
231 | pdata->exit(pdev); | 242 | pdata->exit(pdev); |
232 | err_init: | 243 | err_init: |
244 | if (priv->phy1clk) { | ||
245 | clk_disable(priv->phy1clk); | ||
246 | clk_put(priv->phy1clk); | ||
247 | } | ||
248 | err_clk_phy: | ||
233 | if (priv->ahbclk) { | 249 | if (priv->ahbclk) { |
234 | clk_disable(priv->ahbclk); | 250 | clk_disable(priv->ahbclk); |
235 | clk_put(priv->ahbclk); | 251 | clk_put(priv->ahbclk); |
@@ -273,6 +289,10 @@ static int __exit ehci_mxc_drv_remove(struct platform_device *pdev) | |||
273 | clk_disable(priv->ahbclk); | 289 | clk_disable(priv->ahbclk); |
274 | clk_put(priv->ahbclk); | 290 | clk_put(priv->ahbclk); |
275 | } | 291 | } |
292 | if (priv->phy1clk) { | ||
293 | clk_disable(priv->phy1clk); | ||
294 | clk_put(priv->phy1clk); | ||
295 | } | ||
276 | 296 | ||
277 | kfree(priv); | 297 | kfree(priv); |
278 | 298 | ||
diff --git a/drivers/usb/host/ohci-cns3xxx.c b/drivers/usb/host/ohci-cns3xxx.c new file mode 100644 index 000000000000..f05ef87e934c --- /dev/null +++ b/drivers/usb/host/ohci-cns3xxx.c | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Cavium Networks | ||
3 | * | ||
4 | * This file is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License, Version 2, as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/atomic.h> | ||
11 | #include <mach/cns3xxx.h> | ||
12 | #include <mach/pm.h> | ||
13 | |||
14 | static int __devinit | ||
15 | cns3xxx_ohci_start(struct usb_hcd *hcd) | ||
16 | { | ||
17 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | ||
18 | int ret; | ||
19 | |||
20 | /* | ||
21 | * EHCI and OHCI share the same clock and power, | ||
22 | * resetting twice would cause the 1st controller been reset. | ||
23 | * Therefore only do power up at the first up device, and | ||
24 | * power down at the last down device. | ||
25 | * | ||
26 | * Set USB AHB INCR length to 16 | ||
27 | */ | ||
28 | if (atomic_inc_return(&usb_pwr_ref) == 1) { | ||
29 | cns3xxx_pwr_power_up(1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB); | ||
30 | cns3xxx_pwr_clk_en(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
31 | cns3xxx_pwr_soft_rst(1 << PM_SOFT_RST_REG_OFFST_USB_HOST); | ||
32 | __raw_writel((__raw_readl(MISC_CHIP_CONFIG_REG) | (0X2 << 24)), | ||
33 | MISC_CHIP_CONFIG_REG); | ||
34 | } | ||
35 | |||
36 | ret = ohci_init(ohci); | ||
37 | if (ret < 0) | ||
38 | return ret; | ||
39 | |||
40 | ohci->num_ports = 1; | ||
41 | |||
42 | ret = ohci_run(ohci); | ||
43 | if (ret < 0) { | ||
44 | err("can't start %s", hcd->self.bus_name); | ||
45 | ohci_stop(hcd); | ||
46 | return ret; | ||
47 | } | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | static const struct hc_driver cns3xxx_ohci_hc_driver = { | ||
52 | .description = hcd_name, | ||
53 | .product_desc = "CNS3XXX OHCI Host controller", | ||
54 | .hcd_priv_size = sizeof(struct ohci_hcd), | ||
55 | .irq = ohci_irq, | ||
56 | .flags = HCD_USB11 | HCD_MEMORY, | ||
57 | .start = cns3xxx_ohci_start, | ||
58 | .stop = ohci_stop, | ||
59 | .shutdown = ohci_shutdown, | ||
60 | .urb_enqueue = ohci_urb_enqueue, | ||
61 | .urb_dequeue = ohci_urb_dequeue, | ||
62 | .endpoint_disable = ohci_endpoint_disable, | ||
63 | .get_frame_number = ohci_get_frame, | ||
64 | .hub_status_data = ohci_hub_status_data, | ||
65 | .hub_control = ohci_hub_control, | ||
66 | #ifdef CONFIG_PM | ||
67 | .bus_suspend = ohci_bus_suspend, | ||
68 | .bus_resume = ohci_bus_resume, | ||
69 | #endif | ||
70 | .start_port_reset = ohci_start_port_reset, | ||
71 | }; | ||
72 | |||
73 | static int cns3xxx_ohci_probe(struct platform_device *pdev) | ||
74 | { | ||
75 | struct device *dev = &pdev->dev; | ||
76 | struct usb_hcd *hcd; | ||
77 | const struct hc_driver *driver = &cns3xxx_ohci_hc_driver; | ||
78 | struct resource *res; | ||
79 | int irq; | ||
80 | int retval; | ||
81 | |||
82 | if (usb_disabled()) | ||
83 | return -ENODEV; | ||
84 | |||
85 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | ||
86 | if (!res) { | ||
87 | dev_err(dev, "Found HC with no IRQ.\n"); | ||
88 | return -ENODEV; | ||
89 | } | ||
90 | irq = res->start; | ||
91 | |||
92 | hcd = usb_create_hcd(driver, dev, dev_name(dev)); | ||
93 | if (!hcd) | ||
94 | return -ENOMEM; | ||
95 | |||
96 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
97 | if (!res) { | ||
98 | dev_err(dev, "Found HC with no register addr.\n"); | ||
99 | retval = -ENODEV; | ||
100 | goto err1; | ||
101 | } | ||
102 | hcd->rsrc_start = res->start; | ||
103 | hcd->rsrc_len = res->end - res->start + 1; | ||
104 | |||
105 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, | ||
106 | driver->description)) { | ||
107 | dev_dbg(dev, "controller already in use\n"); | ||
108 | retval = -EBUSY; | ||
109 | goto err1; | ||
110 | } | ||
111 | |||
112 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); | ||
113 | if (!hcd->regs) { | ||
114 | dev_dbg(dev, "error mapping memory\n"); | ||
115 | retval = -EFAULT; | ||
116 | goto err2; | ||
117 | } | ||
118 | |||
119 | ohci_hcd_init(hcd_to_ohci(hcd)); | ||
120 | |||
121 | retval = usb_add_hcd(hcd, irq, IRQF_SHARED); | ||
122 | if (retval == 0) | ||
123 | return retval; | ||
124 | |||
125 | iounmap(hcd->regs); | ||
126 | err2: | ||
127 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
128 | err1: | ||
129 | usb_put_hcd(hcd); | ||
130 | return retval; | ||
131 | } | ||
132 | |||
133 | static int cns3xxx_ohci_remove(struct platform_device *pdev) | ||
134 | { | ||
135 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | ||
136 | |||
137 | usb_remove_hcd(hcd); | ||
138 | iounmap(hcd->regs); | ||
139 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
140 | |||
141 | /* | ||
142 | * EHCI and OHCI share the same clock and power, | ||
143 | * resetting twice would cause the 1st controller been reset. | ||
144 | * Therefore only do power up at the first up device, and | ||
145 | * power down at the last down device. | ||
146 | */ | ||
147 | if (atomic_dec_return(&usb_pwr_ref) == 0) | ||
148 | cns3xxx_pwr_clk_dis(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); | ||
149 | |||
150 | usb_put_hcd(hcd); | ||
151 | |||
152 | platform_set_drvdata(pdev, NULL); | ||
153 | |||
154 | return 0; | ||
155 | } | ||
156 | |||
157 | MODULE_ALIAS("platform:cns3xxx-ohci"); | ||
158 | |||
159 | static struct platform_driver ohci_hcd_cns3xxx_driver = { | ||
160 | .probe = cns3xxx_ohci_probe, | ||
161 | .remove = cns3xxx_ohci_remove, | ||
162 | .driver = { | ||
163 | .name = "cns3xxx-ohci", | ||
164 | }, | ||
165 | }; | ||
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 5179acb7aa2f..5cb6731ba443 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -1111,6 +1111,11 @@ MODULE_LICENSE ("GPL"); | |||
1111 | #define PLATFORM_DRIVER ohci_octeon_driver | 1111 | #define PLATFORM_DRIVER ohci_octeon_driver |
1112 | #endif | 1112 | #endif |
1113 | 1113 | ||
1114 | #ifdef CONFIG_USB_CNS3XXX_OHCI | ||
1115 | #include "ohci-cns3xxx.c" | ||
1116 | #define PLATFORM_DRIVER ohci_hcd_cns3xxx_driver | ||
1117 | #endif | ||
1118 | |||
1114 | #if !defined(PCI_DRIVER) && \ | 1119 | #if !defined(PCI_DRIVER) && \ |
1115 | !defined(PLATFORM_DRIVER) && \ | 1120 | !defined(PLATFORM_DRIVER) && \ |
1116 | !defined(OMAP1_PLATFORM_DRIVER) && \ | 1121 | !defined(OMAP1_PLATFORM_DRIVER) && \ |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 9f36a29b10b4..55dc6fb6e909 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -1932,6 +1932,16 @@ config FB_PXA_PARAMETERS | |||
1932 | 1932 | ||
1933 | <file:Documentation/fb/pxafb.txt> describes the available parameters. | 1933 | <file:Documentation/fb/pxafb.txt> describes the available parameters. |
1934 | 1934 | ||
1935 | config PXA3XX_GCU | ||
1936 | tristate "PXA3xx 2D graphics accelerator driver" | ||
1937 | depends on FB_PXA | ||
1938 | help | ||
1939 | Kernelspace driver for the 2D graphics controller unit (GCU) | ||
1940 | found on PXA3xx processors. There is a counterpart driver in the | ||
1941 | DirectFB suite, see http://www.directfb.org/ | ||
1942 | |||
1943 | If you compile this as a module, it will be called pxa3xx_gcu. | ||
1944 | |||
1935 | config FB_MBX | 1945 | config FB_MBX |
1936 | tristate "2700G LCD framebuffer support" | 1946 | tristate "2700G LCD framebuffer support" |
1937 | depends on FB && ARCH_PXA | 1947 | depends on FB && ARCH_PXA |
diff --git a/drivers/video/Makefile b/drivers/video/Makefile index f9de51c39ad7..8c8fabdff9d0 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile | |||
@@ -101,6 +101,7 @@ obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o | |||
101 | obj-$(CONFIG_FB_ASILIANT) += asiliantfb.o | 101 | obj-$(CONFIG_FB_ASILIANT) += asiliantfb.o |
102 | obj-$(CONFIG_FB_PXA) += pxafb.o | 102 | obj-$(CONFIG_FB_PXA) += pxafb.o |
103 | obj-$(CONFIG_FB_PXA168) += pxa168fb.o | 103 | obj-$(CONFIG_FB_PXA168) += pxa168fb.o |
104 | obj-$(CONFIG_PXA3XX_GCU) += pxa3xx-gcu.o | ||
104 | obj-$(CONFIG_FB_W100) += w100fb.o | 105 | obj-$(CONFIG_FB_W100) += w100fb.o |
105 | obj-$(CONFIG_FB_TMIO) += tmiofb.o | 106 | obj-$(CONFIG_FB_TMIO) += tmiofb.o |
106 | obj-$(CONFIG_FB_AU1100) += au1100fb.o | 107 | obj-$(CONFIG_FB_AU1100) += au1100fb.o |
diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c new file mode 100644 index 000000000000..b81168df253d --- /dev/null +++ b/drivers/video/pxa3xx-gcu.c | |||
@@ -0,0 +1,772 @@ | |||
1 | /* | ||
2 | * pxa3xx-gc.c - Linux kernel module for PXA3xx graphics controllers | ||
3 | * | ||
4 | * This driver needs a DirectFB counterpart in user space, communication | ||
5 | * is handled via mmap()ed memory areas and an ioctl. | ||
6 | * | ||
7 | * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de> | ||
8 | * Copyright (c) 2009 Janine Kropp <nin@directfb.org> | ||
9 | * Copyright (c) 2009 Denis Oliver Kropp <dok@directfb.org> | ||
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 as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | /* | ||
27 | * WARNING: This controller is attached to System Bus 2 of the PXA which | ||
28 | * needs its arbiter to be enabled explictly (CKENB & 1<<9). | ||
29 | * There is currently no way to do this from Linux, so you need to teach | ||
30 | * your bootloader for now. | ||
31 | */ | ||
32 | |||
33 | #include <linux/module.h> | ||
34 | #include <linux/version.h> | ||
35 | |||
36 | #include <linux/platform_device.h> | ||
37 | #include <linux/dma-mapping.h> | ||
38 | #include <linux/miscdevice.h> | ||
39 | #include <linux/interrupt.h> | ||
40 | #include <linux/spinlock.h> | ||
41 | #include <linux/uaccess.h> | ||
42 | #include <linux/ioctl.h> | ||
43 | #include <linux/delay.h> | ||
44 | #include <linux/sched.h> | ||
45 | #include <linux/slab.h> | ||
46 | #include <linux/clk.h> | ||
47 | #include <linux/fs.h> | ||
48 | #include <linux/io.h> | ||
49 | |||
50 | #include "pxa3xx-gcu.h" | ||
51 | |||
52 | #define DRV_NAME "pxa3xx-gcu" | ||
53 | #define MISCDEV_MINOR 197 | ||
54 | |||
55 | #define REG_GCCR 0x00 | ||
56 | #define GCCR_SYNC_CLR (1 << 9) | ||
57 | #define GCCR_BP_RST (1 << 8) | ||
58 | #define GCCR_ABORT (1 << 6) | ||
59 | #define GCCR_STOP (1 << 4) | ||
60 | |||
61 | #define REG_GCISCR 0x04 | ||
62 | #define REG_GCIECR 0x08 | ||
63 | #define REG_GCRBBR 0x20 | ||
64 | #define REG_GCRBLR 0x24 | ||
65 | #define REG_GCRBHR 0x28 | ||
66 | #define REG_GCRBTR 0x2C | ||
67 | #define REG_GCRBEXHR 0x30 | ||
68 | |||
69 | #define IE_EOB (1 << 0) | ||
70 | #define IE_EEOB (1 << 5) | ||
71 | #define IE_ALL 0xff | ||
72 | |||
73 | #define SHARED_SIZE PAGE_ALIGN(sizeof(struct pxa3xx_gcu_shared)) | ||
74 | |||
75 | /* #define PXA3XX_GCU_DEBUG */ | ||
76 | /* #define PXA3XX_GCU_DEBUG_TIMER */ | ||
77 | |||
78 | #ifdef PXA3XX_GCU_DEBUG | ||
79 | #define QDUMP(msg) \ | ||
80 | do { \ | ||
81 | QPRINT(priv, KERN_DEBUG, msg); \ | ||
82 | } while (0) | ||
83 | #else | ||
84 | #define QDUMP(msg) do {} while (0) | ||
85 | #endif | ||
86 | |||
87 | #define QERROR(msg) \ | ||
88 | do { \ | ||
89 | QPRINT(priv, KERN_ERR, msg); \ | ||
90 | } while (0) | ||
91 | |||
92 | struct pxa3xx_gcu_batch { | ||
93 | struct pxa3xx_gcu_batch *next; | ||
94 | u32 *ptr; | ||
95 | dma_addr_t phys; | ||
96 | unsigned long length; | ||
97 | }; | ||
98 | |||
99 | struct pxa3xx_gcu_priv { | ||
100 | void __iomem *mmio_base; | ||
101 | struct clk *clk; | ||
102 | struct pxa3xx_gcu_shared *shared; | ||
103 | dma_addr_t shared_phys; | ||
104 | struct resource *resource_mem; | ||
105 | struct miscdevice misc_dev; | ||
106 | struct file_operations misc_fops; | ||
107 | wait_queue_head_t wait_idle; | ||
108 | wait_queue_head_t wait_free; | ||
109 | spinlock_t spinlock; | ||
110 | struct timeval base_time; | ||
111 | |||
112 | struct pxa3xx_gcu_batch *free; | ||
113 | |||
114 | struct pxa3xx_gcu_batch *ready; | ||
115 | struct pxa3xx_gcu_batch *ready_last; | ||
116 | struct pxa3xx_gcu_batch *running; | ||
117 | }; | ||
118 | |||
119 | static inline unsigned long | ||
120 | gc_readl(struct pxa3xx_gcu_priv *priv, unsigned int off) | ||
121 | { | ||
122 | return __raw_readl(priv->mmio_base + off); | ||
123 | } | ||
124 | |||
125 | static inline void | ||
126 | gc_writel(struct pxa3xx_gcu_priv *priv, unsigned int off, unsigned long val) | ||
127 | { | ||
128 | __raw_writel(val, priv->mmio_base + off); | ||
129 | } | ||
130 | |||
131 | #define QPRINT(priv, level, msg) \ | ||
132 | do { \ | ||
133 | struct timeval tv; \ | ||
134 | struct pxa3xx_gcu_shared *shared = priv->shared; \ | ||
135 | u32 base = gc_readl(priv, REG_GCRBBR); \ | ||
136 | \ | ||
137 | do_gettimeofday(&tv); \ | ||
138 | \ | ||
139 | printk(level "%ld.%03ld.%03ld - %-17s: %-21s (%s, " \ | ||
140 | "STATUS " \ | ||
141 | "0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, " \ | ||
142 | "T %5ld)\n", \ | ||
143 | tv.tv_sec - priv->base_time.tv_sec, \ | ||
144 | tv.tv_usec / 1000, tv.tv_usec % 1000, \ | ||
145 | __func__, msg, \ | ||
146 | shared->hw_running ? "running" : " idle", \ | ||
147 | gc_readl(priv, REG_GCISCR), \ | ||
148 | gc_readl(priv, REG_GCRBBR), \ | ||
149 | gc_readl(priv, REG_GCRBLR), \ | ||
150 | (gc_readl(priv, REG_GCRBEXHR) - base) / 4, \ | ||
151 | (gc_readl(priv, REG_GCRBHR) - base) / 4, \ | ||
152 | (gc_readl(priv, REG_GCRBTR) - base) / 4); \ | ||
153 | } while (0) | ||
154 | |||
155 | static void | ||
156 | pxa3xx_gcu_reset(struct pxa3xx_gcu_priv *priv) | ||
157 | { | ||
158 | QDUMP("RESET"); | ||
159 | |||
160 | /* disable interrupts */ | ||
161 | gc_writel(priv, REG_GCIECR, 0); | ||
162 | |||
163 | /* reset hardware */ | ||
164 | gc_writel(priv, REG_GCCR, GCCR_ABORT); | ||
165 | gc_writel(priv, REG_GCCR, 0); | ||
166 | |||
167 | memset(priv->shared, 0, SHARED_SIZE); | ||
168 | priv->shared->buffer_phys = priv->shared_phys; | ||
169 | priv->shared->magic = PXA3XX_GCU_SHARED_MAGIC; | ||
170 | |||
171 | do_gettimeofday(&priv->base_time); | ||
172 | |||
173 | /* set up the ring buffer pointers */ | ||
174 | gc_writel(priv, REG_GCRBLR, 0); | ||
175 | gc_writel(priv, REG_GCRBBR, priv->shared_phys); | ||
176 | gc_writel(priv, REG_GCRBTR, priv->shared_phys); | ||
177 | |||
178 | /* enable all IRQs except EOB */ | ||
179 | gc_writel(priv, REG_GCIECR, IE_ALL & ~IE_EOB); | ||
180 | } | ||
181 | |||
182 | static void | ||
183 | dump_whole_state(struct pxa3xx_gcu_priv *priv) | ||
184 | { | ||
185 | struct pxa3xx_gcu_shared *sh = priv->shared; | ||
186 | u32 base = gc_readl(priv, REG_GCRBBR); | ||
187 | |||
188 | QDUMP("DUMP"); | ||
189 | |||
190 | printk(KERN_DEBUG "== PXA3XX-GCU DUMP ==\n" | ||
191 | "%s, STATUS 0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, T %5ld\n", | ||
192 | sh->hw_running ? "running" : "idle ", | ||
193 | gc_readl(priv, REG_GCISCR), | ||
194 | gc_readl(priv, REG_GCRBBR), | ||
195 | gc_readl(priv, REG_GCRBLR), | ||
196 | (gc_readl(priv, REG_GCRBEXHR) - base) / 4, | ||
197 | (gc_readl(priv, REG_GCRBHR) - base) / 4, | ||
198 | (gc_readl(priv, REG_GCRBTR) - base) / 4); | ||
199 | } | ||
200 | |||
201 | static void | ||
202 | flush_running(struct pxa3xx_gcu_priv *priv) | ||
203 | { | ||
204 | struct pxa3xx_gcu_batch *running = priv->running; | ||
205 | struct pxa3xx_gcu_batch *next; | ||
206 | |||
207 | while (running) { | ||
208 | next = running->next; | ||
209 | running->next = priv->free; | ||
210 | priv->free = running; | ||
211 | running = next; | ||
212 | } | ||
213 | |||
214 | priv->running = NULL; | ||
215 | } | ||
216 | |||
217 | static void | ||
218 | run_ready(struct pxa3xx_gcu_priv *priv) | ||
219 | { | ||
220 | unsigned int num = 0; | ||
221 | struct pxa3xx_gcu_shared *shared = priv->shared; | ||
222 | struct pxa3xx_gcu_batch *ready = priv->ready; | ||
223 | |||
224 | QDUMP("Start"); | ||
225 | |||
226 | BUG_ON(!ready); | ||
227 | |||
228 | shared->buffer[num++] = 0x05000000; | ||
229 | |||
230 | while (ready) { | ||
231 | shared->buffer[num++] = 0x00000001; | ||
232 | shared->buffer[num++] = ready->phys; | ||
233 | ready = ready->next; | ||
234 | } | ||
235 | |||
236 | shared->buffer[num++] = 0x05000000; | ||
237 | priv->running = priv->ready; | ||
238 | priv->ready = priv->ready_last = NULL; | ||
239 | gc_writel(priv, REG_GCRBLR, 0); | ||
240 | shared->hw_running = 1; | ||
241 | |||
242 | /* ring base address */ | ||
243 | gc_writel(priv, REG_GCRBBR, shared->buffer_phys); | ||
244 | |||
245 | /* ring tail address */ | ||
246 | gc_writel(priv, REG_GCRBTR, shared->buffer_phys + num * 4); | ||
247 | |||
248 | /* ring length */ | ||
249 | gc_writel(priv, REG_GCRBLR, ((num + 63) & ~63) * 4); | ||
250 | } | ||
251 | |||
252 | static irqreturn_t | ||
253 | pxa3xx_gcu_handle_irq(int irq, void *ctx) | ||
254 | { | ||
255 | struct pxa3xx_gcu_priv *priv = ctx; | ||
256 | struct pxa3xx_gcu_shared *shared = priv->shared; | ||
257 | u32 status = gc_readl(priv, REG_GCISCR) & IE_ALL; | ||
258 | |||
259 | QDUMP("-Interrupt"); | ||
260 | |||
261 | if (!status) | ||
262 | return IRQ_NONE; | ||
263 | |||
264 | spin_lock(&priv->spinlock); | ||
265 | shared->num_interrupts++; | ||
266 | |||
267 | if (status & IE_EEOB) { | ||
268 | QDUMP(" [EEOB]"); | ||
269 | |||
270 | flush_running(priv); | ||
271 | wake_up_all(&priv->wait_free); | ||
272 | |||
273 | if (priv->ready) { | ||
274 | run_ready(priv); | ||
275 | } else { | ||
276 | /* There is no more data prepared by the userspace. | ||
277 | * Set hw_running = 0 and wait for the next userspace | ||
278 | * kick-off */ | ||
279 | shared->num_idle++; | ||
280 | shared->hw_running = 0; | ||
281 | |||
282 | QDUMP(" '-> Idle."); | ||
283 | |||
284 | /* set ring buffer length to zero */ | ||
285 | gc_writel(priv, REG_GCRBLR, 0); | ||
286 | |||
287 | wake_up_all(&priv->wait_idle); | ||
288 | } | ||
289 | |||
290 | shared->num_done++; | ||
291 | } else { | ||
292 | QERROR(" [???]"); | ||
293 | dump_whole_state(priv); | ||
294 | } | ||
295 | |||
296 | /* Clear the interrupt */ | ||
297 | gc_writel(priv, REG_GCISCR, status); | ||
298 | spin_unlock(&priv->spinlock); | ||
299 | |||
300 | return IRQ_HANDLED; | ||
301 | } | ||
302 | |||
303 | static int | ||
304 | pxa3xx_gcu_wait_idle(struct pxa3xx_gcu_priv *priv) | ||
305 | { | ||
306 | int ret = 0; | ||
307 | |||
308 | QDUMP("Waiting for idle..."); | ||
309 | |||
310 | /* Does not need to be atomic. There's a lock in user space, | ||
311 | * but anyhow, this is just for statistics. */ | ||
312 | priv->shared->num_wait_idle++; | ||
313 | |||
314 | while (priv->shared->hw_running) { | ||
315 | int num = priv->shared->num_interrupts; | ||
316 | u32 rbexhr = gc_readl(priv, REG_GCRBEXHR); | ||
317 | |||
318 | ret = wait_event_interruptible_timeout(priv->wait_idle, | ||
319 | !priv->shared->hw_running, HZ*4); | ||
320 | |||
321 | if (ret < 0) | ||
322 | break; | ||
323 | |||
324 | if (ret > 0) | ||
325 | continue; | ||
326 | |||
327 | if (gc_readl(priv, REG_GCRBEXHR) == rbexhr && | ||
328 | priv->shared->num_interrupts == num) { | ||
329 | QERROR("TIMEOUT"); | ||
330 | ret = -ETIMEDOUT; | ||
331 | break; | ||
332 | } | ||
333 | } | ||
334 | |||
335 | QDUMP("done"); | ||
336 | |||
337 | return ret; | ||
338 | } | ||
339 | |||
340 | static int | ||
341 | pxa3xx_gcu_wait_free(struct pxa3xx_gcu_priv *priv) | ||
342 | { | ||
343 | int ret = 0; | ||
344 | |||
345 | QDUMP("Waiting for free..."); | ||
346 | |||
347 | /* Does not need to be atomic. There's a lock in user space, | ||
348 | * but anyhow, this is just for statistics. */ | ||
349 | priv->shared->num_wait_free++; | ||
350 | |||
351 | while (!priv->free) { | ||
352 | u32 rbexhr = gc_readl(priv, REG_GCRBEXHR); | ||
353 | |||
354 | ret = wait_event_interruptible_timeout(priv->wait_free, | ||
355 | priv->free, HZ*4); | ||
356 | |||
357 | if (ret < 0) | ||
358 | break; | ||
359 | |||
360 | if (ret > 0) | ||
361 | continue; | ||
362 | |||
363 | if (gc_readl(priv, REG_GCRBEXHR) == rbexhr) { | ||
364 | QERROR("TIMEOUT"); | ||
365 | ret = -ETIMEDOUT; | ||
366 | break; | ||
367 | } | ||
368 | } | ||
369 | |||
370 | QDUMP("done"); | ||
371 | |||
372 | return ret; | ||
373 | } | ||
374 | |||
375 | /* Misc device layer */ | ||
376 | |||
377 | static ssize_t | ||
378 | pxa3xx_gcu_misc_write(struct file *filp, const char *buff, | ||
379 | size_t count, loff_t *offp) | ||
380 | { | ||
381 | int ret; | ||
382 | unsigned long flags; | ||
383 | struct pxa3xx_gcu_batch *buffer; | ||
384 | struct pxa3xx_gcu_priv *priv = | ||
385 | container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops); | ||
386 | |||
387 | int words = count / 4; | ||
388 | |||
389 | /* Does not need to be atomic. There's a lock in user space, | ||
390 | * but anyhow, this is just for statistics. */ | ||
391 | priv->shared->num_writes++; | ||
392 | |||
393 | priv->shared->num_words += words; | ||
394 | |||
395 | /* Last word reserved for batch buffer end command */ | ||
396 | if (words >= PXA3XX_GCU_BATCH_WORDS) | ||
397 | return -E2BIG; | ||
398 | |||
399 | /* Wait for a free buffer */ | ||
400 | if (!priv->free) { | ||
401 | ret = pxa3xx_gcu_wait_free(priv); | ||
402 | if (ret < 0) | ||
403 | return ret; | ||
404 | } | ||
405 | |||
406 | /* | ||
407 | * Get buffer from free list | ||
408 | */ | ||
409 | spin_lock_irqsave(&priv->spinlock, flags); | ||
410 | |||
411 | buffer = priv->free; | ||
412 | priv->free = buffer->next; | ||
413 | |||
414 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
415 | |||
416 | |||
417 | /* Copy data from user into buffer */ | ||
418 | ret = copy_from_user(buffer->ptr, buff, words * 4); | ||
419 | if (ret) { | ||
420 | spin_lock_irqsave(&priv->spinlock, flags); | ||
421 | buffer->next = priv->free; | ||
422 | priv->free = buffer; | ||
423 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
424 | return ret; | ||
425 | } | ||
426 | |||
427 | buffer->length = words; | ||
428 | |||
429 | /* Append batch buffer end command */ | ||
430 | buffer->ptr[words] = 0x01000000; | ||
431 | |||
432 | /* | ||
433 | * Add buffer to ready list | ||
434 | */ | ||
435 | spin_lock_irqsave(&priv->spinlock, flags); | ||
436 | |||
437 | buffer->next = NULL; | ||
438 | |||
439 | if (priv->ready) { | ||
440 | BUG_ON(priv->ready_last == NULL); | ||
441 | |||
442 | priv->ready_last->next = buffer; | ||
443 | } else | ||
444 | priv->ready = buffer; | ||
445 | |||
446 | priv->ready_last = buffer; | ||
447 | |||
448 | if (!priv->shared->hw_running) | ||
449 | run_ready(priv); | ||
450 | |||
451 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
452 | |||
453 | return words * 4; | ||
454 | } | ||
455 | |||
456 | |||
457 | static long | ||
458 | pxa3xx_gcu_misc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
459 | { | ||
460 | unsigned long flags; | ||
461 | struct pxa3xx_gcu_priv *priv = | ||
462 | container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops); | ||
463 | |||
464 | switch (cmd) { | ||
465 | case PXA3XX_GCU_IOCTL_RESET: | ||
466 | spin_lock_irqsave(&priv->spinlock, flags); | ||
467 | pxa3xx_gcu_reset(priv); | ||
468 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
469 | return 0; | ||
470 | |||
471 | case PXA3XX_GCU_IOCTL_WAIT_IDLE: | ||
472 | return pxa3xx_gcu_wait_idle(priv); | ||
473 | } | ||
474 | |||
475 | return -ENOSYS; | ||
476 | } | ||
477 | |||
478 | static int | ||
479 | pxa3xx_gcu_misc_mmap(struct file *filp, struct vm_area_struct *vma) | ||
480 | { | ||
481 | unsigned int size = vma->vm_end - vma->vm_start; | ||
482 | struct pxa3xx_gcu_priv *priv = | ||
483 | container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops); | ||
484 | |||
485 | switch (vma->vm_pgoff) { | ||
486 | case 0: | ||
487 | /* hand out the shared data area */ | ||
488 | if (size != SHARED_SIZE) | ||
489 | return -EINVAL; | ||
490 | |||
491 | return dma_mmap_coherent(NULL, vma, | ||
492 | priv->shared, priv->shared_phys, size); | ||
493 | |||
494 | case SHARED_SIZE >> PAGE_SHIFT: | ||
495 | /* hand out the MMIO base for direct register access | ||
496 | * from userspace */ | ||
497 | if (size != resource_size(priv->resource_mem)) | ||
498 | return -EINVAL; | ||
499 | |||
500 | vma->vm_flags |= VM_IO; | ||
501 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
502 | |||
503 | return io_remap_pfn_range(vma, vma->vm_start, | ||
504 | priv->resource_mem->start >> PAGE_SHIFT, | ||
505 | size, vma->vm_page_prot); | ||
506 | } | ||
507 | |||
508 | return -EINVAL; | ||
509 | } | ||
510 | |||
511 | |||
512 | #ifdef PXA3XX_GCU_DEBUG_TIMER | ||
513 | static struct timer_list pxa3xx_gcu_debug_timer; | ||
514 | |||
515 | static void pxa3xx_gcu_debug_timedout(unsigned long ptr) | ||
516 | { | ||
517 | struct pxa3xx_gcu_priv *priv = (struct pxa3xx_gcu_priv *) ptr; | ||
518 | |||
519 | QERROR("Timer DUMP"); | ||
520 | |||
521 | /* init the timer structure */ | ||
522 | init_timer(&pxa3xx_gcu_debug_timer); | ||
523 | pxa3xx_gcu_debug_timer.function = pxa3xx_gcu_debug_timedout; | ||
524 | pxa3xx_gcu_debug_timer.data = ptr; | ||
525 | pxa3xx_gcu_debug_timer.expires = jiffies + 5*HZ; /* one second */ | ||
526 | |||
527 | add_timer(&pxa3xx_gcu_debug_timer); | ||
528 | } | ||
529 | |||
530 | static void pxa3xx_gcu_init_debug_timer(void) | ||
531 | { | ||
532 | pxa3xx_gcu_debug_timedout((unsigned long) &pxa3xx_gcu_debug_timer); | ||
533 | } | ||
534 | #else | ||
535 | static inline void pxa3xx_gcu_init_debug_timer(void) {} | ||
536 | #endif | ||
537 | |||
538 | static int | ||
539 | add_buffer(struct platform_device *dev, | ||
540 | struct pxa3xx_gcu_priv *priv) | ||
541 | { | ||
542 | struct pxa3xx_gcu_batch *buffer; | ||
543 | |||
544 | buffer = kzalloc(sizeof(struct pxa3xx_gcu_batch), GFP_KERNEL); | ||
545 | if (!buffer) | ||
546 | return -ENOMEM; | ||
547 | |||
548 | buffer->ptr = dma_alloc_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4, | ||
549 | &buffer->phys, GFP_KERNEL); | ||
550 | if (!buffer->ptr) { | ||
551 | kfree(buffer); | ||
552 | return -ENOMEM; | ||
553 | } | ||
554 | |||
555 | buffer->next = priv->free; | ||
556 | |||
557 | priv->free = buffer; | ||
558 | |||
559 | return 0; | ||
560 | } | ||
561 | |||
562 | static void | ||
563 | free_buffers(struct platform_device *dev, | ||
564 | struct pxa3xx_gcu_priv *priv) | ||
565 | { | ||
566 | struct pxa3xx_gcu_batch *next, *buffer = priv->free; | ||
567 | |||
568 | while (buffer) { | ||
569 | next = buffer->next; | ||
570 | |||
571 | dma_free_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4, | ||
572 | buffer->ptr, buffer->phys); | ||
573 | |||
574 | kfree(buffer); | ||
575 | |||
576 | buffer = next; | ||
577 | } | ||
578 | |||
579 | priv->free = NULL; | ||
580 | } | ||
581 | |||
582 | static int __devinit | ||
583 | pxa3xx_gcu_probe(struct platform_device *dev) | ||
584 | { | ||
585 | int i, ret, irq; | ||
586 | struct resource *r; | ||
587 | struct pxa3xx_gcu_priv *priv; | ||
588 | |||
589 | priv = kzalloc(sizeof(struct pxa3xx_gcu_priv), GFP_KERNEL); | ||
590 | if (!priv) | ||
591 | return -ENOMEM; | ||
592 | |||
593 | for (i = 0; i < 8; i++) { | ||
594 | ret = add_buffer(dev, priv); | ||
595 | if (ret) { | ||
596 | dev_err(&dev->dev, "failed to allocate DMA memory\n"); | ||
597 | goto err_free_priv; | ||
598 | } | ||
599 | } | ||
600 | |||
601 | init_waitqueue_head(&priv->wait_idle); | ||
602 | init_waitqueue_head(&priv->wait_free); | ||
603 | spin_lock_init(&priv->spinlock); | ||
604 | |||
605 | /* we allocate the misc device structure as part of our own allocation, | ||
606 | * so we can get a pointer to our priv structure later on with | ||
607 | * container_of(). This isn't really necessary as we have a fixed minor | ||
608 | * number anyway, but this is to avoid statics. */ | ||
609 | |||
610 | priv->misc_fops.owner = THIS_MODULE; | ||
611 | priv->misc_fops.write = pxa3xx_gcu_misc_write; | ||
612 | priv->misc_fops.unlocked_ioctl = pxa3xx_gcu_misc_ioctl; | ||
613 | priv->misc_fops.mmap = pxa3xx_gcu_misc_mmap; | ||
614 | |||
615 | priv->misc_dev.minor = MISCDEV_MINOR, | ||
616 | priv->misc_dev.name = DRV_NAME, | ||
617 | priv->misc_dev.fops = &priv->misc_fops, | ||
618 | |||
619 | /* register misc device */ | ||
620 | ret = misc_register(&priv->misc_dev); | ||
621 | if (ret < 0) { | ||
622 | dev_err(&dev->dev, "misc_register() for minor %d failed\n", | ||
623 | MISCDEV_MINOR); | ||
624 | goto err_free_priv; | ||
625 | } | ||
626 | |||
627 | /* handle IO resources */ | ||
628 | r = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
629 | if (r == NULL) { | ||
630 | dev_err(&dev->dev, "no I/O memory resource defined\n"); | ||
631 | ret = -ENODEV; | ||
632 | goto err_misc_deregister; | ||
633 | } | ||
634 | |||
635 | if (!request_mem_region(r->start, resource_size(r), dev->name)) { | ||
636 | dev_err(&dev->dev, "failed to request I/O memory\n"); | ||
637 | ret = -EBUSY; | ||
638 | goto err_misc_deregister; | ||
639 | } | ||
640 | |||
641 | priv->mmio_base = ioremap_nocache(r->start, resource_size(r)); | ||
642 | if (!priv->mmio_base) { | ||
643 | dev_err(&dev->dev, "failed to map I/O memory\n"); | ||
644 | ret = -EBUSY; | ||
645 | goto err_free_mem_region; | ||
646 | } | ||
647 | |||
648 | /* allocate dma memory */ | ||
649 | priv->shared = dma_alloc_coherent(&dev->dev, SHARED_SIZE, | ||
650 | &priv->shared_phys, GFP_KERNEL); | ||
651 | |||
652 | if (!priv->shared) { | ||
653 | dev_err(&dev->dev, "failed to allocate DMA memory\n"); | ||
654 | ret = -ENOMEM; | ||
655 | goto err_free_io; | ||
656 | } | ||
657 | |||
658 | /* enable the clock */ | ||
659 | priv->clk = clk_get(&dev->dev, NULL); | ||
660 | if (IS_ERR(priv->clk)) { | ||
661 | dev_err(&dev->dev, "failed to get clock\n"); | ||
662 | ret = -ENODEV; | ||
663 | goto err_free_dma; | ||
664 | } | ||
665 | |||
666 | ret = clk_enable(priv->clk); | ||
667 | if (ret < 0) { | ||
668 | dev_err(&dev->dev, "failed to enable clock\n"); | ||
669 | goto err_put_clk; | ||
670 | } | ||
671 | |||
672 | /* request the IRQ */ | ||
673 | irq = platform_get_irq(dev, 0); | ||
674 | if (irq < 0) { | ||
675 | dev_err(&dev->dev, "no IRQ defined\n"); | ||
676 | ret = -ENODEV; | ||
677 | goto err_put_clk; | ||
678 | } | ||
679 | |||
680 | ret = request_irq(irq, pxa3xx_gcu_handle_irq, | ||
681 | IRQF_DISABLED, DRV_NAME, priv); | ||
682 | if (ret) { | ||
683 | dev_err(&dev->dev, "request_irq failed\n"); | ||
684 | ret = -EBUSY; | ||
685 | goto err_put_clk; | ||
686 | } | ||
687 | |||
688 | platform_set_drvdata(dev, priv); | ||
689 | priv->resource_mem = r; | ||
690 | pxa3xx_gcu_reset(priv); | ||
691 | pxa3xx_gcu_init_debug_timer(); | ||
692 | |||
693 | dev_info(&dev->dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", | ||
694 | (void *) r->start, (void *) priv->shared_phys, | ||
695 | SHARED_SIZE, irq); | ||
696 | return 0; | ||
697 | |||
698 | err_put_clk: | ||
699 | clk_disable(priv->clk); | ||
700 | clk_put(priv->clk); | ||
701 | |||
702 | err_free_dma: | ||
703 | dma_free_coherent(&dev->dev, SHARED_SIZE, | ||
704 | priv->shared, priv->shared_phys); | ||
705 | |||
706 | err_free_io: | ||
707 | iounmap(priv->mmio_base); | ||
708 | |||
709 | err_free_mem_region: | ||
710 | release_mem_region(r->start, resource_size(r)); | ||
711 | |||
712 | err_misc_deregister: | ||
713 | misc_deregister(&priv->misc_dev); | ||
714 | |||
715 | err_free_priv: | ||
716 | platform_set_drvdata(dev, NULL); | ||
717 | free_buffers(dev, priv); | ||
718 | kfree(priv); | ||
719 | return ret; | ||
720 | } | ||
721 | |||
722 | static int __devexit | ||
723 | pxa3xx_gcu_remove(struct platform_device *dev) | ||
724 | { | ||
725 | struct pxa3xx_gcu_priv *priv = platform_get_drvdata(dev); | ||
726 | struct resource *r = priv->resource_mem; | ||
727 | |||
728 | pxa3xx_gcu_wait_idle(priv); | ||
729 | |||
730 | misc_deregister(&priv->misc_dev); | ||
731 | dma_free_coherent(&dev->dev, SHARED_SIZE, | ||
732 | priv->shared, priv->shared_phys); | ||
733 | iounmap(priv->mmio_base); | ||
734 | release_mem_region(r->start, resource_size(r)); | ||
735 | platform_set_drvdata(dev, NULL); | ||
736 | clk_disable(priv->clk); | ||
737 | free_buffers(dev, priv); | ||
738 | kfree(priv); | ||
739 | |||
740 | return 0; | ||
741 | } | ||
742 | |||
743 | static struct platform_driver pxa3xx_gcu_driver = { | ||
744 | .probe = pxa3xx_gcu_probe, | ||
745 | .remove = __devexit_p(pxa3xx_gcu_remove), | ||
746 | .driver = { | ||
747 | .owner = THIS_MODULE, | ||
748 | .name = DRV_NAME, | ||
749 | }, | ||
750 | }; | ||
751 | |||
752 | static int __init | ||
753 | pxa3xx_gcu_init(void) | ||
754 | { | ||
755 | return platform_driver_register(&pxa3xx_gcu_driver); | ||
756 | } | ||
757 | |||
758 | static void __exit | ||
759 | pxa3xx_gcu_exit(void) | ||
760 | { | ||
761 | platform_driver_unregister(&pxa3xx_gcu_driver); | ||
762 | } | ||
763 | |||
764 | module_init(pxa3xx_gcu_init); | ||
765 | module_exit(pxa3xx_gcu_exit); | ||
766 | |||
767 | MODULE_DESCRIPTION("PXA3xx graphics controller unit driver"); | ||
768 | MODULE_LICENSE("GPL"); | ||
769 | MODULE_ALIAS_MISCDEV(MISCDEV_MINOR); | ||
770 | MODULE_AUTHOR("Janine Kropp <nin@directfb.org>, " | ||
771 | "Denis Oliver Kropp <dok@directfb.org>, " | ||
772 | "Daniel Mack <daniel@caiaq.de>"); | ||
diff --git a/drivers/video/pxa3xx-gcu.h b/drivers/video/pxa3xx-gcu.h new file mode 100644 index 000000000000..0428ed03dc49 --- /dev/null +++ b/drivers/video/pxa3xx-gcu.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef __PXA3XX_GCU_H__ | ||
2 | #define __PXA3XX_GCU_H__ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Number of 32bit words in display list (ring buffer). */ | ||
7 | #define PXA3XX_GCU_BUFFER_WORDS ((256 * 1024 - 256) / 4) | ||
8 | |||
9 | /* To be increased when breaking the ABI */ | ||
10 | #define PXA3XX_GCU_SHARED_MAGIC 0x30000001 | ||
11 | |||
12 | #define PXA3XX_GCU_BATCH_WORDS 8192 | ||
13 | |||
14 | struct pxa3xx_gcu_shared { | ||
15 | u32 buffer[PXA3XX_GCU_BUFFER_WORDS]; | ||
16 | |||
17 | bool hw_running; | ||
18 | |||
19 | unsigned long buffer_phys; | ||
20 | |||
21 | unsigned int num_words; | ||
22 | unsigned int num_writes; | ||
23 | unsigned int num_done; | ||
24 | unsigned int num_interrupts; | ||
25 | unsigned int num_wait_idle; | ||
26 | unsigned int num_wait_free; | ||
27 | unsigned int num_idle; | ||
28 | |||
29 | u32 magic; | ||
30 | }; | ||
31 | |||
32 | /* Initialization and synchronization. | ||
33 | * Hardware is started upon write(). */ | ||
34 | #define PXA3XX_GCU_IOCTL_RESET _IO('G', 0) | ||
35 | #define PXA3XX_GCU_IOCTL_WAIT_IDLE _IO('G', 2) | ||
36 | |||
37 | #endif /* __PXA3XX_GCU_H__ */ | ||
38 | |||
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index 2ee7dac55a3c..86f7cac1026c 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c | |||
@@ -270,7 +270,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) | |||
270 | return -ENOMEM; | 270 | return -ENOMEM; |
271 | } | 271 | } |
272 | 272 | ||
273 | imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL); | 273 | imx2_wdt.clk = clk_get(&pdev->dev, NULL); |
274 | if (IS_ERR(imx2_wdt.clk)) { | 274 | if (IS_ERR(imx2_wdt.clk)) { |
275 | dev_err(&pdev->dev, "can't get Watchdog clock\n"); | 275 | dev_err(&pdev->dev, "can't get Watchdog clock\n"); |
276 | return PTR_ERR(imx2_wdt.clk); | 276 | return PTR_ERR(imx2_wdt.clk); |
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 2367fb3f70bc..74802bc5ded9 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c | |||
@@ -499,7 +499,7 @@ static int __init parse_crash_elf64_headers(void) | |||
499 | /* Do some basic Verification. */ | 499 | /* Do some basic Verification. */ |
500 | if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0 || | 500 | if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0 || |
501 | (ehdr.e_type != ET_CORE) || | 501 | (ehdr.e_type != ET_CORE) || |
502 | !vmcore_elf_check_arch(&ehdr) || | 502 | !vmcore_elf64_check_arch(&ehdr) || |
503 | ehdr.e_ident[EI_CLASS] != ELFCLASS64 || | 503 | ehdr.e_ident[EI_CLASS] != ELFCLASS64 || |
504 | ehdr.e_ident[EI_VERSION] != EV_CURRENT || | 504 | ehdr.e_ident[EI_VERSION] != EV_CURRENT || |
505 | ehdr.e_version != EV_CURRENT || | 505 | ehdr.e_version != EV_CURRENT || |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index c6454cca0447..9e7f259346e1 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/resource.h> | 20 | #include <linux/resource.h> |
21 | #include <linux/regulator/consumer.h> | ||
21 | 22 | ||
22 | #define AMBA_NR_IRQS 2 | 23 | #define AMBA_NR_IRQS 2 |
23 | #define AMBA_CID 0xb105f00d | 24 | #define AMBA_CID 0xb105f00d |
@@ -28,6 +29,7 @@ struct amba_device { | |||
28 | struct device dev; | 29 | struct device dev; |
29 | struct resource res; | 30 | struct resource res; |
30 | struct clk *pclk; | 31 | struct clk *pclk; |
32 | struct regulator *vcore; | ||
31 | u64 dma_mask; | 33 | u64 dma_mask; |
32 | unsigned int periphid; | 34 | unsigned int periphid; |
33 | unsigned int irq[AMBA_NR_IRQS]; | 35 | unsigned int irq[AMBA_NR_IRQS]; |
@@ -71,6 +73,12 @@ void amba_release_regions(struct amba_device *); | |||
71 | #define amba_pclk_disable(d) \ | 73 | #define amba_pclk_disable(d) \ |
72 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 74 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) |
73 | 75 | ||
76 | #define amba_vcore_enable(d) \ | ||
77 | (IS_ERR((d)->vcore) ? 0 : regulator_enable((d)->vcore)) | ||
78 | |||
79 | #define amba_vcore_disable(d) \ | ||
80 | do { if (!IS_ERR((d)->vcore)) regulator_disable((d)->vcore); } while (0) | ||
81 | |||
74 | /* Some drivers don't use the struct amba_device */ | 82 | /* Some drivers don't use the struct amba_device */ |
75 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) | 83 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) |
76 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) | 84 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index 6021588ba0a8..5479fdc849e9 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -113,6 +113,21 @@ | |||
113 | #define UART01x_LCRH_PEN 0x02 | 113 | #define UART01x_LCRH_PEN 0x02 |
114 | #define UART01x_LCRH_BRK 0x01 | 114 | #define UART01x_LCRH_BRK 0x01 |
115 | 115 | ||
116 | #define ST_UART011_DMAWM_RX_1 (0 << 3) | ||
117 | #define ST_UART011_DMAWM_RX_2 (1 << 3) | ||
118 | #define ST_UART011_DMAWM_RX_4 (2 << 3) | ||
119 | #define ST_UART011_DMAWM_RX_8 (3 << 3) | ||
120 | #define ST_UART011_DMAWM_RX_16 (4 << 3) | ||
121 | #define ST_UART011_DMAWM_RX_32 (5 << 3) | ||
122 | #define ST_UART011_DMAWM_RX_48 (6 << 3) | ||
123 | #define ST_UART011_DMAWM_TX_1 0 | ||
124 | #define ST_UART011_DMAWM_TX_2 1 | ||
125 | #define ST_UART011_DMAWM_TX_4 2 | ||
126 | #define ST_UART011_DMAWM_TX_8 3 | ||
127 | #define ST_UART011_DMAWM_TX_16 4 | ||
128 | #define ST_UART011_DMAWM_TX_32 5 | ||
129 | #define ST_UART011_DMAWM_TX_48 6 | ||
130 | |||
116 | #define UART010_IIR_RTIS 0x08 | 131 | #define UART010_IIR_RTIS 0x08 |
117 | #define UART010_IIR_TIS 0x04 | 132 | #define UART010_IIR_TIS 0x04 |
118 | #define UART010_IIR_RIS 0x02 | 133 | #define UART010_IIR_RIS 0x02 |
@@ -180,6 +195,13 @@ struct amba_device; /* in uncompress this is included but amba/bus.h is not */ | |||
180 | struct amba_pl010_data { | 195 | struct amba_pl010_data { |
181 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); | 196 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); |
182 | }; | 197 | }; |
198 | |||
199 | struct dma_chan; | ||
200 | struct amba_pl011_data { | ||
201 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
202 | void *dma_rx_param; | ||
203 | void *dma_tx_param; | ||
204 | }; | ||
183 | #endif | 205 | #endif |
184 | 206 | ||
185 | #endif | 207 | #endif |
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h new file mode 100644 index 000000000000..457bcb0a310a --- /dev/null +++ b/include/linux/clkdev.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * include/linux/clkdev.h | ||
3 | * | ||
4 | * Copyright (C) 2008 Russell King. | ||
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 | * Helper for the clk API to assist looking up a struct clk. | ||
11 | */ | ||
12 | #ifndef __CLKDEV_H | ||
13 | #define __CLKDEV_H | ||
14 | |||
15 | #include <asm/clkdev.h> | ||
16 | |||
17 | struct clk; | ||
18 | struct device; | ||
19 | |||
20 | struct clk_lookup { | ||
21 | struct list_head node; | ||
22 | const char *dev_id; | ||
23 | const char *con_id; | ||
24 | struct clk *clk; | ||
25 | }; | ||
26 | |||
27 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | ||
28 | const char *dev_fmt, ...); | ||
29 | |||
30 | void clkdev_add(struct clk_lookup *cl); | ||
31 | void clkdev_drop(struct clk_lookup *cl); | ||
32 | |||
33 | void clkdev_add_table(struct clk_lookup *, size_t); | ||
34 | int clk_add_alias(const char *, const char *, char *, struct device *); | ||
35 | |||
36 | #endif | ||
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 0026f267da20..088cd4ace4ef 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -20,7 +20,14 @@ extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | |||
20 | #define vmcore_elf_check_arch_cross(x) 0 | 20 | #define vmcore_elf_check_arch_cross(x) 0 |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | 23 | /* |
24 | * Architecture code can redefine this if there are any special checks | ||
25 | * needed for 64-bit ELF vmcores. In case of 32-bit only architecture, | ||
26 | * this can be set to zero. | ||
27 | */ | ||
28 | #ifndef vmcore_elf64_check_arch | ||
29 | #define vmcore_elf64_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | ||
30 | #endif | ||
24 | 31 | ||
25 | /* | 32 | /* |
26 | * is_kdump_kernel() checks whether this kernel is booting after a panic of | 33 | * is_kdump_kernel() checks whether this kernel is booting after a panic of |
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h deleted file mode 100644 index eff3094ca84e..000000000000 --- a/include/linux/mfd/tc35892.h +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_MFD_TC35892_H | ||
8 | #define __LINUX_MFD_TC35892_H | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | |||
12 | #define TC35892_RSTCTRL_IRQRST (1 << 4) | ||
13 | #define TC35892_RSTCTRL_TIMRST (1 << 3) | ||
14 | #define TC35892_RSTCTRL_ROTRST (1 << 2) | ||
15 | #define TC35892_RSTCTRL_KBDRST (1 << 1) | ||
16 | #define TC35892_RSTCTRL_GPIRST (1 << 0) | ||
17 | |||
18 | #define TC35892_IRQST 0x91 | ||
19 | |||
20 | #define TC35892_MANFCODE_MAGIC 0x03 | ||
21 | #define TC35892_MANFCODE 0x80 | ||
22 | #define TC35892_VERSION 0x81 | ||
23 | #define TC35892_IOCFG 0xA7 | ||
24 | |||
25 | #define TC35892_CLKMODE 0x88 | ||
26 | #define TC35892_CLKCFG 0x89 | ||
27 | #define TC35892_CLKEN 0x8A | ||
28 | |||
29 | #define TC35892_RSTCTRL 0x82 | ||
30 | #define TC35892_EXTRSTN 0x83 | ||
31 | #define TC35892_RSTINTCLR 0x84 | ||
32 | |||
33 | #define TC35892_GPIOIS0 0xC9 | ||
34 | #define TC35892_GPIOIS1 0xCA | ||
35 | #define TC35892_GPIOIS2 0xCB | ||
36 | #define TC35892_GPIOIBE0 0xCC | ||
37 | #define TC35892_GPIOIBE1 0xCD | ||
38 | #define TC35892_GPIOIBE2 0xCE | ||
39 | #define TC35892_GPIOIEV0 0xCF | ||
40 | #define TC35892_GPIOIEV1 0xD0 | ||
41 | #define TC35892_GPIOIEV2 0xD1 | ||
42 | #define TC35892_GPIOIE0 0xD2 | ||
43 | #define TC35892_GPIOIE1 0xD3 | ||
44 | #define TC35892_GPIOIE2 0xD4 | ||
45 | #define TC35892_GPIORIS0 0xD6 | ||
46 | #define TC35892_GPIORIS1 0xD7 | ||
47 | #define TC35892_GPIORIS2 0xD8 | ||
48 | #define TC35892_GPIOMIS0 0xD9 | ||
49 | #define TC35892_GPIOMIS1 0xDA | ||
50 | #define TC35892_GPIOMIS2 0xDB | ||
51 | #define TC35892_GPIOIC0 0xDC | ||
52 | #define TC35892_GPIOIC1 0xDD | ||
53 | #define TC35892_GPIOIC2 0xDE | ||
54 | |||
55 | #define TC35892_GPIODATA0 0xC0 | ||
56 | #define TC35892_GPIOMASK0 0xc1 | ||
57 | #define TC35892_GPIODATA1 0xC2 | ||
58 | #define TC35892_GPIOMASK1 0xc3 | ||
59 | #define TC35892_GPIODATA2 0xC4 | ||
60 | #define TC35892_GPIOMASK2 0xC5 | ||
61 | |||
62 | #define TC35892_GPIODIR0 0xC6 | ||
63 | #define TC35892_GPIODIR1 0xC7 | ||
64 | #define TC35892_GPIODIR2 0xC8 | ||
65 | |||
66 | #define TC35892_GPIOSYNC0 0xE6 | ||
67 | #define TC35892_GPIOSYNC1 0xE7 | ||
68 | #define TC35892_GPIOSYNC2 0xE8 | ||
69 | |||
70 | #define TC35892_GPIOWAKE0 0xE9 | ||
71 | #define TC35892_GPIOWAKE1 0xEA | ||
72 | #define TC35892_GPIOWAKE2 0xEB | ||
73 | |||
74 | #define TC35892_GPIOODM0 0xE0 | ||
75 | #define TC35892_GPIOODE0 0xE1 | ||
76 | #define TC35892_GPIOODM1 0xE2 | ||
77 | #define TC35892_GPIOODE1 0xE3 | ||
78 | #define TC35892_GPIOODM2 0xE4 | ||
79 | #define TC35892_GPIOODE2 0xE5 | ||
80 | |||
81 | #define TC35892_INT_GPIIRQ 0 | ||
82 | #define TC35892_INT_TI0IRQ 1 | ||
83 | #define TC35892_INT_TI1IRQ 2 | ||
84 | #define TC35892_INT_TI2IRQ 3 | ||
85 | #define TC35892_INT_ROTIRQ 5 | ||
86 | #define TC35892_INT_KBDIRQ 6 | ||
87 | #define TC35892_INT_PORIRQ 7 | ||
88 | |||
89 | #define TC35892_NR_INTERNAL_IRQS 8 | ||
90 | #define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x)) | ||
91 | |||
92 | struct tc35892 { | ||
93 | struct mutex lock; | ||
94 | struct device *dev; | ||
95 | struct i2c_client *i2c; | ||
96 | |||
97 | int irq_base; | ||
98 | int num_gpio; | ||
99 | struct tc35892_platform_data *pdata; | ||
100 | }; | ||
101 | |||
102 | extern int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data); | ||
103 | extern int tc35892_reg_read(struct tc35892 *tc35892, u8 reg); | ||
104 | extern int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length, | ||
105 | u8 *values); | ||
106 | extern int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length, | ||
107 | const u8 *values); | ||
108 | extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val); | ||
109 | |||
110 | /** | ||
111 | * struct tc35892_gpio_platform_data - TC35892 GPIO platform data | ||
112 | * @gpio_base: first gpio number assigned to TC35892. A maximum of | ||
113 | * %TC35892_NR_GPIOS GPIOs will be allocated. | ||
114 | * @setup: callback for board-specific initialization | ||
115 | * @remove: callback for board-specific teardown | ||
116 | */ | ||
117 | struct tc35892_gpio_platform_data { | ||
118 | int gpio_base; | ||
119 | void (*setup)(struct tc35892 *tc35892, unsigned gpio_base); | ||
120 | void (*remove)(struct tc35892 *tc35892, unsigned gpio_base); | ||
121 | }; | ||
122 | |||
123 | /** | ||
124 | * struct tc35892_platform_data - TC35892 platform data | ||
125 | * @irq_base: base IRQ number. %TC35892_NR_IRQS irqs will be used. | ||
126 | * @gpio: GPIO-specific platform data | ||
127 | */ | ||
128 | struct tc35892_platform_data { | ||
129 | int irq_base; | ||
130 | struct tc35892_gpio_platform_data *gpio; | ||
131 | }; | ||
132 | |||
133 | #define TC35892_NR_GPIOS 24 | ||
134 | #define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS) | ||
135 | |||
136 | #endif | ||
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h new file mode 100644 index 000000000000..16c76e124f9c --- /dev/null +++ b/include/linux/mfd/tc3589x.h | |||
@@ -0,0 +1,195 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_MFD_TC3589x_H | ||
8 | #define __LINUX_MFD_TC3589x_H | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | |||
12 | enum tx3589x_block { | ||
13 | TC3589x_BLOCK_GPIO = 1 << 0, | ||
14 | TC3589x_BLOCK_KEYPAD = 1 << 1, | ||
15 | }; | ||
16 | |||
17 | #define TC3589x_RSTCTRL_IRQRST (1 << 4) | ||
18 | #define TC3589x_RSTCTRL_TIMRST (1 << 3) | ||
19 | #define TC3589x_RSTCTRL_ROTRST (1 << 2) | ||
20 | #define TC3589x_RSTCTRL_KBDRST (1 << 1) | ||
21 | #define TC3589x_RSTCTRL_GPIRST (1 << 0) | ||
22 | |||
23 | /* Keyboard Configuration Registers */ | ||
24 | #define TC3589x_KBDSETTLE_REG 0x01 | ||
25 | #define TC3589x_KBDBOUNCE 0x02 | ||
26 | #define TC3589x_KBDSIZE 0x03 | ||
27 | #define TC3589x_KBCFG_LSB 0x04 | ||
28 | #define TC3589x_KBCFG_MSB 0x05 | ||
29 | #define TC3589x_KBDIC 0x08 | ||
30 | #define TC3589x_KBDMSK 0x09 | ||
31 | #define TC3589x_EVTCODE_FIFO 0x10 | ||
32 | #define TC3589x_KBDMFS 0x8F | ||
33 | |||
34 | #define TC3589x_IRQST 0x91 | ||
35 | |||
36 | #define TC3589x_MANFCODE_MAGIC 0x03 | ||
37 | #define TC3589x_MANFCODE 0x80 | ||
38 | #define TC3589x_VERSION 0x81 | ||
39 | #define TC3589x_IOCFG 0xA7 | ||
40 | |||
41 | #define TC3589x_CLKMODE 0x88 | ||
42 | #define TC3589x_CLKCFG 0x89 | ||
43 | #define TC3589x_CLKEN 0x8A | ||
44 | |||
45 | #define TC3589x_RSTCTRL 0x82 | ||
46 | #define TC3589x_EXTRSTN 0x83 | ||
47 | #define TC3589x_RSTINTCLR 0x84 | ||
48 | |||
49 | /* Pull up/down configuration registers */ | ||
50 | #define TC3589x_IOCFG 0xA7 | ||
51 | #define TC3589x_IOPULLCFG0_LSB 0xAA | ||
52 | #define TC3589x_IOPULLCFG0_MSB 0xAB | ||
53 | #define TC3589x_IOPULLCFG1_LSB 0xAC | ||
54 | #define TC3589x_IOPULLCFG1_MSB 0xAD | ||
55 | #define TC3589x_IOPULLCFG2_LSB 0xAE | ||
56 | |||
57 | #define TC3589x_GPIOIS0 0xC9 | ||
58 | #define TC3589x_GPIOIS1 0xCA | ||
59 | #define TC3589x_GPIOIS2 0xCB | ||
60 | #define TC3589x_GPIOIBE0 0xCC | ||
61 | #define TC3589x_GPIOIBE1 0xCD | ||
62 | #define TC3589x_GPIOIBE2 0xCE | ||
63 | #define TC3589x_GPIOIEV0 0xCF | ||
64 | #define TC3589x_GPIOIEV1 0xD0 | ||
65 | #define TC3589x_GPIOIEV2 0xD1 | ||
66 | #define TC3589x_GPIOIE0 0xD2 | ||
67 | #define TC3589x_GPIOIE1 0xD3 | ||
68 | #define TC3589x_GPIOIE2 0xD4 | ||
69 | #define TC3589x_GPIORIS0 0xD6 | ||
70 | #define TC3589x_GPIORIS1 0xD7 | ||
71 | #define TC3589x_GPIORIS2 0xD8 | ||
72 | #define TC3589x_GPIOMIS0 0xD9 | ||
73 | #define TC3589x_GPIOMIS1 0xDA | ||
74 | #define TC3589x_GPIOMIS2 0xDB | ||
75 | #define TC3589x_GPIOIC0 0xDC | ||
76 | #define TC3589x_GPIOIC1 0xDD | ||
77 | #define TC3589x_GPIOIC2 0xDE | ||
78 | |||
79 | #define TC3589x_GPIODATA0 0xC0 | ||
80 | #define TC3589x_GPIOMASK0 0xc1 | ||
81 | #define TC3589x_GPIODATA1 0xC2 | ||
82 | #define TC3589x_GPIOMASK1 0xc3 | ||
83 | #define TC3589x_GPIODATA2 0xC4 | ||
84 | #define TC3589x_GPIOMASK2 0xC5 | ||
85 | |||
86 | #define TC3589x_GPIODIR0 0xC6 | ||
87 | #define TC3589x_GPIODIR1 0xC7 | ||
88 | #define TC3589x_GPIODIR2 0xC8 | ||
89 | |||
90 | #define TC3589x_GPIOSYNC0 0xE6 | ||
91 | #define TC3589x_GPIOSYNC1 0xE7 | ||
92 | #define TC3589x_GPIOSYNC2 0xE8 | ||
93 | |||
94 | #define TC3589x_GPIOWAKE0 0xE9 | ||
95 | #define TC3589x_GPIOWAKE1 0xEA | ||
96 | #define TC3589x_GPIOWAKE2 0xEB | ||
97 | |||
98 | #define TC3589x_GPIOODM0 0xE0 | ||
99 | #define TC3589x_GPIOODE0 0xE1 | ||
100 | #define TC3589x_GPIOODM1 0xE2 | ||
101 | #define TC3589x_GPIOODE1 0xE3 | ||
102 | #define TC3589x_GPIOODM2 0xE4 | ||
103 | #define TC3589x_GPIOODE2 0xE5 | ||
104 | |||
105 | #define TC3589x_INT_GPIIRQ 0 | ||
106 | #define TC3589x_INT_TI0IRQ 1 | ||
107 | #define TC3589x_INT_TI1IRQ 2 | ||
108 | #define TC3589x_INT_TI2IRQ 3 | ||
109 | #define TC3589x_INT_ROTIRQ 5 | ||
110 | #define TC3589x_INT_KBDIRQ 6 | ||
111 | #define TC3589x_INT_PORIRQ 7 | ||
112 | |||
113 | #define TC3589x_NR_INTERNAL_IRQS 8 | ||
114 | #define TC3589x_INT_GPIO(x) (TC3589x_NR_INTERNAL_IRQS + (x)) | ||
115 | |||
116 | struct tc3589x { | ||
117 | struct mutex lock; | ||
118 | struct device *dev; | ||
119 | struct i2c_client *i2c; | ||
120 | |||
121 | int irq_base; | ||
122 | int num_gpio; | ||
123 | struct tc3589x_platform_data *pdata; | ||
124 | }; | ||
125 | |||
126 | extern int tc3589x_reg_write(struct tc3589x *tc3589x, u8 reg, u8 data); | ||
127 | extern int tc3589x_reg_read(struct tc3589x *tc3589x, u8 reg); | ||
128 | extern int tc3589x_block_read(struct tc3589x *tc3589x, u8 reg, u8 length, | ||
129 | u8 *values); | ||
130 | extern int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length, | ||
131 | const u8 *values); | ||
132 | extern int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val); | ||
133 | |||
134 | /* | ||
135 | * Keypad related platform specific constants | ||
136 | * These values may be modified for fine tuning | ||
137 | */ | ||
138 | #define TC_KPD_ROWS 0x8 | ||
139 | #define TC_KPD_COLUMNS 0x8 | ||
140 | #define TC_KPD_DEBOUNCE_PERIOD 0xA3 | ||
141 | #define TC_KPD_SETTLE_TIME 0xA3 | ||
142 | |||
143 | /** | ||
144 | * struct tc35893_platform_data - data structure for platform specific data | ||
145 | * @keymap_data: matrix scan code table for keycodes | ||
146 | * @krow: mask for available rows, value is 0xFF | ||
147 | * @kcol: mask for available columns, value is 0xFF | ||
148 | * @debounce_period: platform specific debounce time | ||
149 | * @settle_time: platform specific settle down time | ||
150 | * @irqtype: type of interrupt, falling or rising edge | ||
151 | * @enable_wakeup: specifies if keypad event can wake up system from sleep | ||
152 | * @no_autorepeat: flag for auto repetition | ||
153 | */ | ||
154 | struct tc3589x_keypad_platform_data { | ||
155 | const struct matrix_keymap_data *keymap_data; | ||
156 | u8 krow; | ||
157 | u8 kcol; | ||
158 | u8 debounce_period; | ||
159 | u8 settle_time; | ||
160 | unsigned long irqtype; | ||
161 | bool enable_wakeup; | ||
162 | bool no_autorepeat; | ||
163 | }; | ||
164 | |||
165 | /** | ||
166 | * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data | ||
167 | * @gpio_base: first gpio number assigned to TC3589x. A maximum of | ||
168 | * %TC3589x_NR_GPIOS GPIOs will be allocated. | ||
169 | * @setup: callback for board-specific initialization | ||
170 | * @remove: callback for board-specific teardown | ||
171 | */ | ||
172 | struct tc3589x_gpio_platform_data { | ||
173 | int gpio_base; | ||
174 | void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
175 | void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
176 | }; | ||
177 | |||
178 | /** | ||
179 | * struct tc3589x_platform_data - TC3589x platform data | ||
180 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) | ||
181 | * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used. | ||
182 | * @gpio: GPIO-specific platform data | ||
183 | * @keypad: keypad-specific platform data | ||
184 | */ | ||
185 | struct tc3589x_platform_data { | ||
186 | unsigned int block; | ||
187 | int irq_base; | ||
188 | struct tc3589x_gpio_platform_data *gpio; | ||
189 | const struct tc3589x_keypad_platform_data *keypad; | ||
190 | }; | ||
191 | |||
192 | #define TC3589x_NR_GPIOS 24 | ||
193 | #define TC3589x_NR_IRQS TC3589x_INT_GPIO(TC3589x_NR_GPIOS) | ||
194 | |||
195 | #endif | ||
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index c18d7efa1b4b..df140cd3ea47 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -152,6 +152,7 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec) | |||
152 | */ | 152 | */ |
153 | for (sft = 32; sft > 0; sft--) { | 153 | for (sft = 32; sft > 0; sft--) { |
154 | tmp = (u64) to << sft; | 154 | tmp = (u64) to << sft; |
155 | tmp += from / 2; | ||
155 | do_div(tmp, from); | 156 | do_div(tmp, from); |
156 | if ((tmp >> sftacc) == 0) | 157 | if ((tmp >> sftacc) == 0) |
157 | break; | 158 | break; |
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index f2f32eee2c5b..038b3d1e2981 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c | |||
@@ -38,6 +38,7 @@ static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */ | |||
38 | static char gpfx; /* prefix for global symbol name (sometimes '_') */ | 38 | static char gpfx; /* prefix for global symbol name (sometimes '_') */ |
39 | static struct stat sb; /* Remember .st_size, etc. */ | 39 | static struct stat sb; /* Remember .st_size, etc. */ |
40 | static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */ | 40 | static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */ |
41 | static const char *altmcount; /* alternate mcount symbol name */ | ||
41 | 42 | ||
42 | /* setjmp() return values */ | 43 | /* setjmp() return values */ |
43 | enum { | 44 | enum { |
@@ -299,7 +300,9 @@ do_file(char const *const fname) | |||
299 | fail_file(); | 300 | fail_file(); |
300 | } break; | 301 | } break; |
301 | case EM_386: reltype = R_386_32; break; | 302 | case EM_386: reltype = R_386_32; break; |
302 | case EM_ARM: reltype = R_ARM_ABS32; break; | 303 | case EM_ARM: reltype = R_ARM_ABS32; |
304 | altmcount = "__gnu_mcount_nc"; | ||
305 | break; | ||
303 | case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; | 306 | case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; |
304 | case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break; | 307 | case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break; |
305 | case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break; | 308 | case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break; |
@@ -357,7 +360,7 @@ do_file(char const *const fname) | |||
357 | int | 360 | int |
358 | main(int argc, char const *argv[]) | 361 | main(int argc, char const *argv[]) |
359 | { | 362 | { |
360 | const char ftrace[] = "kernel/trace/ftrace.o"; | 363 | const char ftrace[] = "/ftrace.o"; |
361 | int ftrace_size = sizeof(ftrace) - 1; | 364 | int ftrace_size = sizeof(ftrace) - 1; |
362 | int n_error = 0; /* gcc-4.3.0 false positive complaint */ | 365 | int n_error = 0; /* gcc-4.3.0 false positive complaint */ |
363 | 366 | ||
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index 39667174971d..baf187bee983 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h | |||
@@ -275,11 +275,12 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, | |||
275 | Elf_Sym const *const symp = | 275 | Elf_Sym const *const symp = |
276 | &sym0[Elf_r_sym(relp)]; | 276 | &sym0[Elf_r_sym(relp)]; |
277 | char const *symname = &str0[w(symp->st_name)]; | 277 | char const *symname = &str0[w(symp->st_name)]; |
278 | char const *mcount = '_' == gpfx ? "_mcount" : "mcount"; | ||
278 | 279 | ||
279 | if ('.' == symname[0]) | 280 | if ('.' == symname[0]) |
280 | ++symname; /* ppc64 hack */ | 281 | ++symname; /* ppc64 hack */ |
281 | if (0 == strcmp((('_' == gpfx) ? "_mcount" : "mcount"), | 282 | if (0 == strcmp(mcount, symname) || |
282 | symname)) | 283 | (altmcount && 0 == strcmp(altmcount, symname))) |
283 | mcountsym = Elf_r_sym(relp); | 284 | mcountsym = Elf_r_sym(relp); |
284 | } | 285 | } |
285 | 286 | ||