diff options
69 files changed, 654 insertions, 867 deletions
diff --git a/Documentation/devicetree/bindings/rtc/nvidia,tegra20-rtc.txt b/Documentation/devicetree/bindings/rtc/nvidia,tegra20-rtc.txt new file mode 100644 index 000000000000..93f45e9dce7c --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/nvidia,tegra20-rtc.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | NVIDIA Tegra20 real-time clock | ||
2 | |||
3 | The Tegra RTC maintains seconds and milliseconds counters, and five alarm | ||
4 | registers. The alarms and other interrupts may wake the system from low-power | ||
5 | state. | ||
6 | |||
7 | Required properties: | ||
8 | |||
9 | - compatible : should be "nvidia,tegra20-rtc". | ||
10 | - reg : Specifies base physical address and size of the registers. | ||
11 | - interrupts : A single interrupt specifier. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | timer { | ||
16 | compatible = "nvidia,tegra20-rtc"; | ||
17 | reg = <0x7000e000 0x100>; | ||
18 | interrupts = <0 2 0x04>; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/timer/nvidia,tegra20-timer.txt b/Documentation/devicetree/bindings/timer/nvidia,tegra20-timer.txt new file mode 100644 index 000000000000..e019fdc38773 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/nvidia,tegra20-timer.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | NVIDIA Tegra20 timer | ||
2 | |||
3 | The Tegra20 timer provides four 29-bit timer channels and a single 32-bit free | ||
4 | running counter. The first two channels may also trigger a watchdog reset. | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : should be "nvidia,tegra20-timer". | ||
9 | - reg : Specifies base physical address and size of the registers. | ||
10 | - interrupts : A list of 4 interrupts; one per timer channel. | ||
11 | |||
12 | Example: | ||
13 | |||
14 | timer { | ||
15 | compatible = "nvidia,tegra20-timer"; | ||
16 | reg = <0x60005000 0x60>; | ||
17 | interrupts = <0 0 0x04 | ||
18 | 0 1 0x04 | ||
19 | 0 41 0x04 | ||
20 | 0 42 0x04>; | ||
21 | }; | ||
diff --git a/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt new file mode 100644 index 000000000000..906109d4c593 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/nvidia,tegra30-timer.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | NVIDIA Tegra30 timer | ||
2 | |||
3 | The Tegra30 timer provides ten 29-bit timer channels, a single 32-bit free | ||
4 | running counter, and 5 watchdog modules. The first two channels may also | ||
5 | trigger a legacy watchdog reset. | ||
6 | |||
7 | Required properties: | ||
8 | |||
9 | - compatible : should be "nvidia,tegra30-timer", "nvidia,tegra20-timer". | ||
10 | - reg : Specifies base physical address and size of the registers. | ||
11 | - interrupts : A list of 6 interrupts; one per each of timer channels 1 | ||
12 | through 5, and one for the shared interrupt for the remaining channels. | ||
13 | |||
14 | timer { | ||
15 | compatible = "nvidia,tegra30-timer", "nvidia,tegra20-timer"; | ||
16 | reg = <0x60005000 0x400>; | ||
17 | interrupts = <0 0 0x04 | ||
18 | 0 1 0x04 | ||
19 | 0 41 0x04 | ||
20 | 0 42 0x04 | ||
21 | 0 121 0x04 | ||
22 | 0 122 0x04>; | ||
23 | }; | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3bb60c8adbff..2277f9530b00 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -650,6 +650,7 @@ config ARCH_TEGRA | |||
650 | select HAVE_CLK | 650 | select HAVE_CLK |
651 | select HAVE_SMP | 651 | select HAVE_SMP |
652 | select MIGHT_HAVE_CACHE_L2X0 | 652 | select MIGHT_HAVE_CACHE_L2X0 |
653 | select SPARSE_IRQ | ||
653 | select USE_OF | 654 | select USE_OF |
654 | help | 655 | help |
655 | This enables support for NVIDIA Tegra based systems (Tegra APX, | 656 | This enables support for NVIDIA Tegra based systems (Tegra APX, |
@@ -891,6 +892,7 @@ config ARCH_U8500 | |||
891 | select GENERIC_CLOCKEVENTS | 892 | select GENERIC_CLOCKEVENTS |
892 | select HAVE_SMP | 893 | select HAVE_SMP |
893 | select MIGHT_HAVE_CACHE_L2X0 | 894 | select MIGHT_HAVE_CACHE_L2X0 |
895 | select SPARSE_IRQ | ||
894 | help | 896 | help |
895 | Support for ST-Ericsson's Ux500 architecture | 897 | Support for ST-Ericsson's Ux500 architecture |
896 | 898 | ||
@@ -905,6 +907,7 @@ config ARCH_NOMADIK | |||
905 | select MIGHT_HAVE_CACHE_L2X0 | 907 | select MIGHT_HAVE_CACHE_L2X0 |
906 | select PINCTRL | 908 | select PINCTRL |
907 | select PINCTRL_STN8815 | 909 | select PINCTRL_STN8815 |
910 | select SPARSE_IRQ | ||
908 | help | 911 | help |
909 | Support for the Nomadik platform by ST-Ericsson | 912 | Support for the Nomadik platform by ST-Ericsson |
910 | 913 | ||
@@ -948,7 +951,7 @@ config ARCH_OMAP | |||
948 | help | 951 | help |
949 | Support for TI's OMAP platform (OMAP1/2/3/4). | 952 | Support for TI's OMAP platform (OMAP1/2/3/4). |
950 | 953 | ||
951 | config ARCH_VT8500 | 954 | config ARCH_VT8500_SINGLE |
952 | bool "VIA/WonderMedia 85xx" | 955 | bool "VIA/WonderMedia 85xx" |
953 | select ARCH_HAS_CPUFREQ | 956 | select ARCH_HAS_CPUFREQ |
954 | select ARCH_REQUIRE_GPIOLIB | 957 | select ARCH_REQUIRE_GPIOLIB |
@@ -958,22 +961,12 @@ config ARCH_VT8500 | |||
958 | select GENERIC_CLOCKEVENTS | 961 | select GENERIC_CLOCKEVENTS |
959 | select GENERIC_GPIO | 962 | select GENERIC_GPIO |
960 | select HAVE_CLK | 963 | select HAVE_CLK |
964 | select MULTI_IRQ_HANDLER | ||
965 | select SPARSE_IRQ | ||
961 | select USE_OF | 966 | select USE_OF |
962 | help | 967 | help |
963 | Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. | 968 | Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. |
964 | 969 | ||
965 | config ARCH_ZYNQ | ||
966 | bool "Xilinx Zynq ARM Cortex A9 Platform" | ||
967 | select ARM_AMBA | ||
968 | select ARM_GIC | ||
969 | select COMMON_CLK | ||
970 | select CPU_V7 | ||
971 | select GENERIC_CLOCKEVENTS | ||
972 | select ICST | ||
973 | select MIGHT_HAVE_CACHE_L2X0 | ||
974 | select USE_OF | ||
975 | help | ||
976 | Support for Xilinx Zynq ARM Cortex A9 Platform | ||
977 | endchoice | 970 | endchoice |
978 | 971 | ||
979 | menu "Multiple platform selection" | 972 | menu "Multiple platform selection" |
@@ -1074,7 +1067,6 @@ source "arch/arm/mach-mxs/Kconfig" | |||
1074 | source "arch/arm/mach-netx/Kconfig" | 1067 | source "arch/arm/mach-netx/Kconfig" |
1075 | 1068 | ||
1076 | source "arch/arm/mach-nomadik/Kconfig" | 1069 | source "arch/arm/mach-nomadik/Kconfig" |
1077 | source "arch/arm/plat-nomadik/Kconfig" | ||
1078 | 1070 | ||
1079 | source "arch/arm/plat-omap/Kconfig" | 1071 | source "arch/arm/plat-omap/Kconfig" |
1080 | 1072 | ||
@@ -1137,8 +1129,12 @@ source "arch/arm/mach-versatile/Kconfig" | |||
1137 | source "arch/arm/mach-vexpress/Kconfig" | 1129 | source "arch/arm/mach-vexpress/Kconfig" |
1138 | source "arch/arm/plat-versatile/Kconfig" | 1130 | source "arch/arm/plat-versatile/Kconfig" |
1139 | 1131 | ||
1132 | source "arch/arm/mach-vt8500/Kconfig" | ||
1133 | |||
1140 | source "arch/arm/mach-w90x900/Kconfig" | 1134 | source "arch/arm/mach-w90x900/Kconfig" |
1141 | 1135 | ||
1136 | source "arch/arm/mach-zynq/Kconfig" | ||
1137 | |||
1142 | # Definitions to make life easier | 1138 | # Definitions to make life easier |
1143 | config ARCH_ACORN | 1139 | config ARCH_ACORN |
1144 | bool | 1140 | bool |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 512b39438548..661030d6bc6c 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -379,6 +379,13 @@ choice | |||
379 | Say Y here if you want kernel low-level debugging support | 379 | Say Y here if you want kernel low-level debugging support |
380 | on Allwinner A1X based platforms on the UART1. | 380 | on Allwinner A1X based platforms on the UART1. |
381 | 381 | ||
382 | config DEBUG_TEGRA_UART | ||
383 | depends on ARCH_TEGRA | ||
384 | bool "Use Tegra UART for low-level debug" | ||
385 | help | ||
386 | Say Y here if you want kernel low-level debugging support | ||
387 | on Tegra based platforms. | ||
388 | |||
382 | config DEBUG_VEXPRESS_UART0_DETECT | 389 | config DEBUG_VEXPRESS_UART0_DETECT |
383 | bool "Autodetect UART0 on Versatile Express Cortex-A core tiles" | 390 | bool "Autodetect UART0 on Versatile Express Cortex-A core tiles" |
384 | depends on ARCH_VEXPRESS && CPU_CP15_MMU | 391 | depends on ARCH_VEXPRESS && CPU_CP15_MMU |
@@ -452,6 +459,36 @@ config DEBUG_IMX6Q_UART_PORT | |||
452 | Choose UART port on which kernel low-level debug messages | 459 | Choose UART port on which kernel low-level debug messages |
453 | should be output. | 460 | should be output. |
454 | 461 | ||
462 | choice | ||
463 | prompt "Low-level debug console UART" | ||
464 | depends on DEBUG_LL && DEBUG_TEGRA_UART | ||
465 | |||
466 | config TEGRA_DEBUG_UART_AUTO_ODMDATA | ||
467 | bool "Via ODMDATA" | ||
468 | help | ||
469 | Automatically determines which UART to use for low-level debug based | ||
470 | on the ODMDATA value. This value is part of the BCT, and is written | ||
471 | to the boot memory device using nvflash, or other flashing tool. | ||
472 | When bits 19:18 are 3, then bits 17:15 indicate which UART to use; | ||
473 | 0/1/2/3/4 are UART A/B/C/D/E. | ||
474 | |||
475 | config TEGRA_DEBUG_UARTA | ||
476 | bool "UART A" | ||
477 | |||
478 | config TEGRA_DEBUG_UARTB | ||
479 | bool "UART B" | ||
480 | |||
481 | config TEGRA_DEBUG_UARTC | ||
482 | bool "UART C" | ||
483 | |||
484 | config TEGRA_DEBUG_UARTD | ||
485 | bool "UART D" | ||
486 | |||
487 | config TEGRA_DEBUG_UARTE | ||
488 | bool "UART E" | ||
489 | |||
490 | endchoice | ||
491 | |||
455 | config DEBUG_LL_INCLUDE | 492 | config DEBUG_LL_INCLUDE |
456 | string | 493 | string |
457 | default "debug/icedcc.S" if DEBUG_ICEDCC | 494 | default "debug/icedcc.S" if DEBUG_ICEDCC |
@@ -469,6 +506,8 @@ config DEBUG_LL_INCLUDE | |||
469 | default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 | 506 | default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 |
470 | default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ | 507 | default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ |
471 | DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1 | 508 | DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1 |
509 | default "debug/tegra.S" if DEBUG_TEGRA_UART | ||
510 | default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 | ||
472 | default "mach/debug-macro.S" | 511 | default "mach/debug-macro.S" |
473 | 512 | ||
474 | config EARLY_PRINTK | 513 | config EARLY_PRINTK |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 9c60f474a559..30c443c406f3 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -202,7 +202,6 @@ machine-$(CONFIG_ARCH_SUNXI) += sunxi | |||
202 | plat-$(CONFIG_ARCH_OMAP) += omap | 202 | plat-$(CONFIG_ARCH_OMAP) += omap |
203 | plat-$(CONFIG_ARCH_S3C64XX) += samsung | 203 | plat-$(CONFIG_ARCH_S3C64XX) += samsung |
204 | plat-$(CONFIG_PLAT_IOP) += iop | 204 | plat-$(CONFIG_PLAT_IOP) += iop |
205 | plat-$(CONFIG_PLAT_NOMADIK) += nomadik | ||
206 | plat-$(CONFIG_PLAT_ORION) += orion | 205 | plat-$(CONFIG_PLAT_ORION) += orion |
207 | plat-$(CONFIG_PLAT_PXA) += pxa | 206 | plat-$(CONFIG_PLAT_PXA) += pxa |
208 | plat-$(CONFIG_PLAT_S3C24XX) += s3c24xx samsung | 207 | plat-$(CONFIG_PLAT_S3C24XX) += s3c24xx samsung |
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi index fba998e3954a..b8effa1cbda7 100644 --- a/arch/arm/boot/dts/tegra20.dtsi +++ b/arch/arm/boot/dts/tegra20.dtsi | |||
@@ -91,6 +91,12 @@ | |||
91 | }; | 91 | }; |
92 | }; | 92 | }; |
93 | 93 | ||
94 | timer@50004600 { | ||
95 | compatible = "arm,cortex-a9-twd-timer"; | ||
96 | reg = <0x50040600 0x20>; | ||
97 | interrupts = <1 13 0x304>; | ||
98 | }; | ||
99 | |||
94 | cache-controller@50043000 { | 100 | cache-controller@50043000 { |
95 | compatible = "arm,pl310-cache"; | 101 | compatible = "arm,pl310-cache"; |
96 | reg = <0x50043000 0x1000>; | 102 | reg = <0x50043000 0x1000>; |
@@ -108,6 +114,15 @@ | |||
108 | #interrupt-cells = <3>; | 114 | #interrupt-cells = <3>; |
109 | }; | 115 | }; |
110 | 116 | ||
117 | timer@60005000 { | ||
118 | compatible = "nvidia,tegra20-timer"; | ||
119 | reg = <0x60005000 0x60>; | ||
120 | interrupts = <0 0 0x04 | ||
121 | 0 1 0x04 | ||
122 | 0 41 0x04 | ||
123 | 0 42 0x04>; | ||
124 | }; | ||
125 | |||
111 | apbdma: dma { | 126 | apbdma: dma { |
112 | compatible = "nvidia,tegra20-apbdma"; | 127 | compatible = "nvidia,tegra20-apbdma"; |
113 | reg = <0x6000a000 0x1200>; | 128 | reg = <0x6000a000 0x1200>; |
@@ -225,6 +240,12 @@ | |||
225 | #pwm-cells = <2>; | 240 | #pwm-cells = <2>; |
226 | }; | 241 | }; |
227 | 242 | ||
243 | rtc { | ||
244 | compatible = "nvidia,tegra20-rtc"; | ||
245 | reg = <0x7000e000 0x100>; | ||
246 | interrupts = <0 2 0x04>; | ||
247 | }; | ||
248 | |||
228 | i2c@7000c000 { | 249 | i2c@7000c000 { |
229 | compatible = "nvidia,tegra20-i2c"; | 250 | compatible = "nvidia,tegra20-i2c"; |
230 | reg = <0x7000c000 0x100>; | 251 | reg = <0x7000c000 0x100>; |
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi index efa603d47a6a..529fdb82dfdb 100644 --- a/arch/arm/boot/dts/tegra30.dtsi +++ b/arch/arm/boot/dts/tegra30.dtsi | |||
@@ -91,6 +91,12 @@ | |||
91 | }; | 91 | }; |
92 | }; | 92 | }; |
93 | 93 | ||
94 | timer@50004600 { | ||
95 | compatible = "arm,cortex-a9-twd-timer"; | ||
96 | reg = <0x50040600 0x20>; | ||
97 | interrupts = <1 13 0xf04>; | ||
98 | }; | ||
99 | |||
94 | cache-controller@50043000 { | 100 | cache-controller@50043000 { |
95 | compatible = "arm,pl310-cache"; | 101 | compatible = "arm,pl310-cache"; |
96 | reg = <0x50043000 0x1000>; | 102 | reg = <0x50043000 0x1000>; |
@@ -108,6 +114,17 @@ | |||
108 | #interrupt-cells = <3>; | 114 | #interrupt-cells = <3>; |
109 | }; | 115 | }; |
110 | 116 | ||
117 | timer@60005000 { | ||
118 | compatible = "nvidia,tegra30-timer", "nvidia,tegra20-timer"; | ||
119 | reg = <0x60005000 0x400>; | ||
120 | interrupts = <0 0 0x04 | ||
121 | 0 1 0x04 | ||
122 | 0 41 0x04 | ||
123 | 0 42 0x04 | ||
124 | 0 121 0x04 | ||
125 | 0 122 0x04>; | ||
126 | }; | ||
127 | |||
111 | apbdma: dma { | 128 | apbdma: dma { |
112 | compatible = "nvidia,tegra30-apbdma", "nvidia,tegra20-apbdma"; | 129 | compatible = "nvidia,tegra30-apbdma", "nvidia,tegra20-apbdma"; |
113 | reg = <0x6000a000 0x1400>; | 130 | reg = <0x6000a000 0x1400>; |
@@ -219,6 +236,12 @@ | |||
219 | #pwm-cells = <2>; | 236 | #pwm-cells = <2>; |
220 | }; | 237 | }; |
221 | 238 | ||
239 | rtc { | ||
240 | compatible = "nvidia,tegra30-rtc", "nvidia,tegra20-rtc"; | ||
241 | reg = <0x7000e000 0x100>; | ||
242 | interrupts = <0 2 0x04>; | ||
243 | }; | ||
244 | |||
222 | i2c@7000c000 { | 245 | i2c@7000c000 { |
223 | compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c"; | 246 | compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c"; |
224 | reg = <0x7000c000 0x100>; | 247 | reg = <0x7000c000 0x100>; |
diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S new file mode 100644 index 000000000000..883d7c22fd9d --- /dev/null +++ b/arch/arm/include/debug/tegra.S | |||
@@ -0,0 +1,223 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010,2011 Google, Inc. | ||
3 | * Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved. | ||
4 | * | ||
5 | * Author: | ||
6 | * Colin Cross <ccross@google.com> | ||
7 | * Erik Gilling <konkers@google.com> | ||
8 | * Doug Anderson <dianders@chromium.org> | ||
9 | * Stephen Warren <swarren@nvidia.com> | ||
10 | * | ||
11 | * Portions based on mach-omap2's debug-macro.S | ||
12 | * Copyright (C) 1994-1999 Russell King | ||
13 | * | ||
14 | * This software is licensed under the terms of the GNU General Public | ||
15 | * License version 2, as published by the Free Software Foundation, and | ||
16 | * may be copied, distributed, and modified under those terms. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #include <linux/serial_reg.h> | ||
26 | |||
27 | #define UART_SHIFT 2 | ||
28 | |||
29 | /* Physical addresses */ | ||
30 | #define TEGRA_CLK_RESET_BASE 0x60006000 | ||
31 | #define TEGRA_APB_MISC_BASE 0x70000000 | ||
32 | #define TEGRA_UARTA_BASE 0x70006000 | ||
33 | #define TEGRA_UARTB_BASE 0x70006040 | ||
34 | #define TEGRA_UARTC_BASE 0x70006200 | ||
35 | #define TEGRA_UARTD_BASE 0x70006300 | ||
36 | #define TEGRA_UARTE_BASE 0x70006400 | ||
37 | #define TEGRA_PMC_BASE 0x7000e400 | ||
38 | |||
39 | #define TEGRA_CLK_RST_DEVICES_L (TEGRA_CLK_RESET_BASE + 0x04) | ||
40 | #define TEGRA_CLK_RST_DEVICES_H (TEGRA_CLK_RESET_BASE + 0x08) | ||
41 | #define TEGRA_CLK_RST_DEVICES_U (TEGRA_CLK_RESET_BASE + 0x0c) | ||
42 | #define TEGRA_CLK_OUT_ENB_L (TEGRA_CLK_RESET_BASE + 0x10) | ||
43 | #define TEGRA_CLK_OUT_ENB_H (TEGRA_CLK_RESET_BASE + 0x14) | ||
44 | #define TEGRA_CLK_OUT_ENB_U (TEGRA_CLK_RESET_BASE + 0x18) | ||
45 | #define TEGRA_PMC_SCRATCH20 (TEGRA_PMC_BASE + 0xa0) | ||
46 | #define TEGRA_APB_MISC_GP_HIDREV (TEGRA_APB_MISC_BASE + 0x804) | ||
47 | |||
48 | /* | ||
49 | * Must be 1MB-aligned since a 1MB mapping is used early on. | ||
50 | * Must not overlap with regions in mach-tegra/io.c:tegra_io_desc[]. | ||
51 | */ | ||
52 | #define UART_VIRTUAL_BASE 0xfe100000 | ||
53 | |||
54 | #define checkuart(rp, rv, lhu, bit, uart) \ | ||
55 | /* Load address of CLK_RST register */ \ | ||
56 | movw rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \ | ||
57 | movt rp, #TEGRA_CLK_RST_DEVICES_##lhu >> 16 ; \ | ||
58 | /* Load value from CLK_RST register */ \ | ||
59 | ldr rp, [rp, #0] ; \ | ||
60 | /* Test UART's reset bit */ \ | ||
61 | tst rp, #(1 << bit) ; \ | ||
62 | /* If set, can't use UART; jump to save no UART */ \ | ||
63 | bne 90f ; \ | ||
64 | /* Load address of CLK_OUT_ENB register */ \ | ||
65 | movw rp, #TEGRA_CLK_OUT_ENB_##lhu & 0xffff ; \ | ||
66 | movt rp, #TEGRA_CLK_OUT_ENB_##lhu >> 16 ; \ | ||
67 | /* Load value from CLK_OUT_ENB register */ \ | ||
68 | ldr rp, [rp, #0] ; \ | ||
69 | /* Test UART's clock enable bit */ \ | ||
70 | tst rp, #(1 << bit) ; \ | ||
71 | /* If clear, can't use UART; jump to save no UART */ \ | ||
72 | beq 90f ; \ | ||
73 | /* Passed all tests, load address of UART registers */ \ | ||
74 | movw rp, #TEGRA_UART##uart##_BASE & 0xffff ; \ | ||
75 | movt rp, #TEGRA_UART##uart##_BASE >> 16 ; \ | ||
76 | /* Jump to save UART address */ \ | ||
77 | b 91f | ||
78 | |||
79 | .macro addruart, rp, rv, tmp | ||
80 | adr \rp, 99f @ actual addr of 99f | ||
81 | ldr \rv, [\rp] @ linked addr is stored there | ||
82 | sub \rv, \rv, \rp @ offset between the two | ||
83 | ldr \rp, [\rp, #4] @ linked tegra_uart_config | ||
84 | sub \tmp, \rp, \rv @ actual tegra_uart_config | ||
85 | ldr \rp, [\tmp] @ Load tegra_uart_config | ||
86 | cmp \rp, #1 @ needs initialization? | ||
87 | bne 100f @ no; go load the addresses | ||
88 | mov \rv, #0 @ yes; record init is done | ||
89 | str \rv, [\tmp] | ||
90 | |||
91 | #ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA | ||
92 | /* Check ODMDATA */ | ||
93 | 10: movw \rp, #TEGRA_PMC_SCRATCH20 & 0xffff | ||
94 | movt \rp, #TEGRA_PMC_SCRATCH20 >> 16 | ||
95 | ldr \rp, [\rp, #0] @ Load PMC_SCRATCH20 | ||
96 | ubfx \rv, \rp, #18, #2 @ 19:18 are console type | ||
97 | cmp \rv, #2 @ 2 and 3 mean DCC, UART | ||
98 | beq 11f @ some boards swap the meaning | ||
99 | cmp \rv, #3 @ so accept either | ||
100 | bne 90f | ||
101 | 11: ubfx \rv, \rp, #15, #3 @ 17:15 are UART ID | ||
102 | cmp \rv, #0 @ UART 0? | ||
103 | beq 20f | ||
104 | cmp \rv, #1 @ UART 1? | ||
105 | beq 21f | ||
106 | cmp \rv, #2 @ UART 2? | ||
107 | beq 22f | ||
108 | cmp \rv, #3 @ UART 3? | ||
109 | beq 23f | ||
110 | cmp \rv, #4 @ UART 4? | ||
111 | beq 24f | ||
112 | b 90f @ invalid | ||
113 | #endif | ||
114 | |||
115 | #if defined(CONFIG_TEGRA_DEBUG_UARTA) || \ | ||
116 | defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) | ||
117 | /* Check UART A validity */ | ||
118 | 20: checkuart(\rp, \rv, L, 6, A) | ||
119 | #endif | ||
120 | |||
121 | #if defined(CONFIG_TEGRA_DEBUG_UARTB) || \ | ||
122 | defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) | ||
123 | /* Check UART B validity */ | ||
124 | 21: checkuart(\rp, \rv, L, 7, B) | ||
125 | #endif | ||
126 | |||
127 | #if defined(CONFIG_TEGRA_DEBUG_UARTC) || \ | ||
128 | defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) | ||
129 | /* Check UART C validity */ | ||
130 | 22: checkuart(\rp, \rv, H, 23, C) | ||
131 | #endif | ||
132 | |||
133 | #if defined(CONFIG_TEGRA_DEBUG_UARTD) || \ | ||
134 | defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) | ||
135 | /* Check UART D validity */ | ||
136 | 23: checkuart(\rp, \rv, U, 1, D) | ||
137 | #endif | ||
138 | |||
139 | #if defined(CONFIG_TEGRA_DEBUG_UARTE) || \ | ||
140 | defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) | ||
141 | /* Check UART E validity */ | ||
142 | 24: | ||
143 | checkuart(\rp, \rv, U, 2, E) | ||
144 | #endif | ||
145 | |||
146 | /* No valid UART found */ | ||
147 | 90: mov \rp, #0 | ||
148 | /* fall through */ | ||
149 | |||
150 | /* Record whichever UART we chose */ | ||
151 | 91: str \rp, [\tmp, #4] @ Store in tegra_uart_phys | ||
152 | cmp \rp, #0 @ Valid UART address? | ||
153 | bne 92f @ Yes, go process it | ||
154 | str \rp, [\tmp, #8] @ Store 0 in tegra_uart_virt | ||
155 | b 100f @ Done | ||
156 | 92: and \rv, \rp, #0xffffff @ offset within 1MB section | ||
157 | add \rv, \rv, #UART_VIRTUAL_BASE | ||
158 | str \rv, [\tmp, #8] @ Store in tegra_uart_virt | ||
159 | movw \rv, #TEGRA_APB_MISC_GP_HIDREV & 0xffff | ||
160 | movt \rv, #TEGRA_APB_MISC_GP_HIDREV >> 16 | ||
161 | ldr \rv, [\rv, #0] @ Load HIDREV | ||
162 | ubfx \rv, \rv, #8, #8 @ 15:8 are SoC version | ||
163 | cmp \rv, #0x20 @ Tegra20? | ||
164 | moveq \rv, #0x75 @ Tegra20 divisor | ||
165 | movne \rv, #0xdd @ Tegra30 divisor | ||
166 | str \rv, [\tmp, #12] @ Save divisor to scratch | ||
167 | /* uart[UART_LCR] = UART_LCR_WLEN8 | UART_LCR_DLAB; */ | ||
168 | mov \rv, #UART_LCR_WLEN8 | UART_LCR_DLAB | ||
169 | str \rv, [\rp, #UART_LCR << UART_SHIFT] | ||
170 | /* uart[UART_DLL] = div & 0xff; */ | ||
171 | ldr \rv, [\tmp, #12] | ||
172 | and \rv, \rv, #0xff | ||
173 | str \rv, [\rp, #UART_DLL << UART_SHIFT] | ||
174 | /* uart[UART_DLM] = div >> 8; */ | ||
175 | ldr \rv, [\tmp, #12] | ||
176 | lsr \rv, \rv, #8 | ||
177 | str \rv, [\rp, #UART_DLM << UART_SHIFT] | ||
178 | /* uart[UART_LCR] = UART_LCR_WLEN8; */ | ||
179 | mov \rv, #UART_LCR_WLEN8 | ||
180 | str \rv, [\rp, #UART_LCR << UART_SHIFT] | ||
181 | b 100f | ||
182 | |||
183 | .align | ||
184 | 99: .word . | ||
185 | .word tegra_uart_config | ||
186 | .ltorg | ||
187 | |||
188 | /* Load previously selected UART address */ | ||
189 | 100: ldr \rp, [\tmp, #4] @ Load tegra_uart_phys | ||
190 | ldr \rv, [\tmp, #8] @ Load tegra_uart_virt | ||
191 | .endm | ||
192 | |||
193 | /* | ||
194 | * Code below is swiped from <asm/hardware/debug-8250.S>, but add an extra | ||
195 | * check to make sure that the UART address is actually valid. | ||
196 | */ | ||
197 | |||
198 | .macro senduart, rd, rx | ||
199 | cmp \rx, #0 | ||
200 | strneb \rd, [\rx, #UART_TX << UART_SHIFT] | ||
201 | 1001: | ||
202 | .endm | ||
203 | |||
204 | .macro busyuart, rd, rx | ||
205 | cmp \rx, #0 | ||
206 | beq 1002f | ||
207 | 1001: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT] | ||
208 | and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
209 | teq \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
210 | bne 1001b | ||
211 | 1002: | ||
212 | .endm | ||
213 | |||
214 | .macro waituart, rd, rx | ||
215 | #ifdef FLOW_CONTROL | ||
216 | cmp \rx, #0 | ||
217 | beq 1002f | ||
218 | 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] | ||
219 | tst \rd, #UART_MSR_CTS | ||
220 | beq 1001b | ||
221 | 1002: | ||
222 | #endif | ||
223 | .endm | ||
diff --git a/arch/arm/mach-zynq/include/mach/debug-macro.S b/arch/arm/include/debug/zynq.S index 3ab0be1f6191..f9aa9740a73f 100644 --- a/arch/arm/mach-zynq/include/mach/debug-macro.S +++ b/arch/arm/include/debug/zynq.S | |||
@@ -1,5 +1,4 @@ | |||
1 | /* arch/arm/mach-zynq/include/mach/debug-macro.S | 1 | /* |
2 | * | ||
3 | * Debugging macro include header | 2 | * Debugging macro include header |
4 | * | 3 | * |
5 | * Copyright (C) 2011 Xilinx | 4 | * Copyright (C) 2011 Xilinx |
@@ -13,9 +12,25 @@ | |||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
15 | */ | 14 | */ |
15 | #define UART_CR_OFFSET 0x00 /* Control Register [8:0] */ | ||
16 | #define UART_SR_OFFSET 0x2C /* Channel Status [11:0] */ | ||
17 | #define UART_FIFO_OFFSET 0x30 /* FIFO [15:0] or [7:0] */ | ||
18 | |||
19 | #define UART_SR_TXFULL 0x00000010 /* TX FIFO full */ | ||
20 | #define UART_SR_TXEMPTY 0x00000008 /* TX FIFO empty */ | ||
21 | |||
22 | #define UART0_PHYS 0xE0000000 | ||
23 | #define UART1_PHYS 0xE0001000 | ||
24 | #define UART_SIZE SZ_4K | ||
25 | #define UART_VIRT 0xF0001000 | ||
26 | |||
27 | #if IS_ENABLED(CONFIG_DEBUG_ZYNQ_UART1) | ||
28 | # define LL_UART_PADDR UART1_PHYS | ||
29 | #else | ||
30 | # define LL_UART_PADDR UART0_PHYS | ||
31 | #endif | ||
16 | 32 | ||
17 | #include <mach/zynq_soc.h> | 33 | #define LL_UART_VADDR UART_VIRT |
18 | #include <mach/uart.h> | ||
19 | 34 | ||
20 | .macro addruart, rp, rv, tmp | 35 | .macro addruart, rp, rv, tmp |
21 | ldr \rp, =LL_UART_PADDR @ physical | 36 | ldr \rp, =LL_UART_PADDR @ physical |
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig index c744946ef022..706dc5727bbe 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig | |||
@@ -4,7 +4,7 @@ menu "Nomadik boards" | |||
4 | 4 | ||
5 | config MACH_NOMADIK_8815NHK | 5 | config MACH_NOMADIK_8815NHK |
6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" | 6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" |
7 | select HAS_MTU | 7 | select CLKSRC_NOMADIK_MTU |
8 | select NOMADIK_8815 | 8 | select NOMADIK_8815 |
9 | 9 | ||
10 | endmenu | 10 | endmenu |
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 22ef8a1abe08..5ccdf53c5a9d 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
@@ -25,18 +25,16 @@ | |||
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/pinctrl/machine.h> | 26 | #include <linux/pinctrl/machine.h> |
27 | #include <linux/platform_data/pinctrl-nomadik.h> | 27 | #include <linux/platform_data/pinctrl-nomadik.h> |
28 | #include <linux/platform_data/clocksource-nomadik-mtu.h> | ||
29 | #include <linux/platform_data/mtd-nomadik-nand.h> | ||
28 | #include <asm/hardware/vic.h> | 30 | #include <asm/hardware/vic.h> |
29 | #include <asm/sizes.h> | 31 | #include <asm/sizes.h> |
30 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
31 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/irq.h> | ||
33 | #include <asm/mach/flash.h> | 34 | #include <asm/mach/flash.h> |
34 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
35 | |||
36 | #include <plat/mtu.h> | ||
37 | |||
38 | #include <linux/platform_data/mtd-nomadik-nand.h> | ||
39 | #include <mach/fsmc.h> | 36 | #include <mach/fsmc.h> |
37 | #include <mach/irqs.h> | ||
40 | 38 | ||
41 | #include "cpu-8815.h" | 39 | #include "cpu-8815.h" |
42 | 40 | ||
@@ -260,7 +258,7 @@ static void __init nomadik_timer_init(void) | |||
260 | src_cr |= SRC_CR_INIT_VAL; | 258 | src_cr |= SRC_CR_INIT_VAL; |
261 | writel(src_cr, io_p2v(NOMADIK_SRC_BASE)); | 259 | writel(src_cr, io_p2v(NOMADIK_SRC_BASE)); |
262 | 260 | ||
263 | nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE)); | 261 | nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0); |
264 | } | 262 | } |
265 | 263 | ||
266 | static struct sys_timer nomadik_timer = { | 264 | static struct sys_timer nomadik_timer = { |
diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h index a118e615f865..b549d0571548 100644 --- a/arch/arm/mach-nomadik/include/mach/irqs.h +++ b/arch/arm/mach-nomadik/include/mach/irqs.h | |||
@@ -72,7 +72,7 @@ | |||
72 | #define NOMADIK_NR_GPIO 128 /* last 4 not wired to pins */ | 72 | #define NOMADIK_NR_GPIO 128 /* last 4 not wired to pins */ |
73 | #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + NOMADIK_GPIO_OFFSET) | 73 | #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + NOMADIK_GPIO_OFFSET) |
74 | #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - NOMADIK_GPIO_OFFSET) | 74 | #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - NOMADIK_GPIO_OFFSET) |
75 | #define NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) | 75 | #define NOMADIK_NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) |
76 | 76 | ||
77 | /* Following two are used by entry_macro.S, to access our dual-vic */ | 77 | /* Following two are used by entry_macro.S, to access our dual-vic */ |
78 | #define VIC_REG_IRQSR0 0 | 78 | #define VIC_REG_IRQSR0 0 |
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 9ff6f6ea3617..e426d1b7747e 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig | |||
@@ -57,57 +57,6 @@ config TEGRA_AHB | |||
57 | which controls AHB bus master arbitration and some | 57 | which controls AHB bus master arbitration and some |
58 | perfomance parameters(priority, prefech size). | 58 | perfomance parameters(priority, prefech size). |
59 | 59 | ||
60 | choice | ||
61 | prompt "Default low-level debug console UART" | ||
62 | default TEGRA_DEBUG_UART_NONE | ||
63 | |||
64 | config TEGRA_DEBUG_UART_NONE | ||
65 | bool "None" | ||
66 | |||
67 | config TEGRA_DEBUG_UARTA | ||
68 | bool "UART-A" | ||
69 | |||
70 | config TEGRA_DEBUG_UARTB | ||
71 | bool "UART-B" | ||
72 | |||
73 | config TEGRA_DEBUG_UARTC | ||
74 | bool "UART-C" | ||
75 | |||
76 | config TEGRA_DEBUG_UARTD | ||
77 | bool "UART-D" | ||
78 | |||
79 | config TEGRA_DEBUG_UARTE | ||
80 | bool "UART-E" | ||
81 | |||
82 | endchoice | ||
83 | |||
84 | choice | ||
85 | prompt "Automatic low-level debug console UART" | ||
86 | default TEGRA_DEBUG_UART_AUTO_NONE | ||
87 | |||
88 | config TEGRA_DEBUG_UART_AUTO_NONE | ||
89 | bool "None" | ||
90 | |||
91 | config TEGRA_DEBUG_UART_AUTO_ODMDATA | ||
92 | bool "Via ODMDATA" | ||
93 | help | ||
94 | Automatically determines which UART to use for low-level debug based | ||
95 | on the ODMDATA value. This value is part of the BCT, and is written | ||
96 | to the boot memory device using nvflash, or other flashing tool. | ||
97 | When bits 19:18 are 3, then bits 17:15 indicate which UART to use; | ||
98 | 0/1/2/3/4 are UART A/B/C/D/E. | ||
99 | |||
100 | config TEGRA_DEBUG_UART_AUTO_SCRATCH | ||
101 | bool "Via UART scratch register" | ||
102 | help | ||
103 | Automatically determines which UART to use for low-level debug based | ||
104 | on the UART scratch register value. Some bootloaders put ASCII 'D' | ||
105 | in this register when they initialize their own console UART output. | ||
106 | Using this option allows the kernel to automatically pick the same | ||
107 | UART. | ||
108 | |||
109 | endchoice | ||
110 | |||
111 | config TEGRA_EMC_SCALING_ENABLE | 60 | config TEGRA_EMC_SCALING_ENABLE |
112 | bool "Enable scaling the memory frequency" | 61 | bool "Enable scaling the memory frequency" |
113 | 62 | ||
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 11a74db51e5d..0816562725f6 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c | |||
@@ -45,14 +45,15 @@ | |||
45 | * kernel is loaded. The data is declared here rather than debug-macro.S so | 45 | * kernel is loaded. The data is declared here rather than debug-macro.S so |
46 | * that multiple inclusions of debug-macro.S point at the same data. | 46 | * that multiple inclusions of debug-macro.S point at the same data. |
47 | */ | 47 | */ |
48 | #define TEGRA_DEBUG_UART_OFFSET (TEGRA_DEBUG_UART_BASE & 0xFFFF) | 48 | u32 tegra_uart_config[4] = { |
49 | u32 tegra_uart_config[3] = { | ||
50 | /* Debug UART initialization required */ | 49 | /* Debug UART initialization required */ |
51 | 1, | 50 | 1, |
52 | /* Debug UART physical address */ | 51 | /* Debug UART physical address */ |
53 | (u32)(IO_APB_PHYS + TEGRA_DEBUG_UART_OFFSET), | 52 | 0, |
54 | /* Debug UART virtual address */ | 53 | /* Debug UART virtual address */ |
55 | (u32)(IO_APB_VIRT + TEGRA_DEBUG_UART_OFFSET), | 54 | 0, |
55 | /* Scratch space for debug macro */ | ||
56 | 0, | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | #ifdef CONFIG_OF | 59 | #ifdef CONFIG_OF |
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S deleted file mode 100644 index 44ca7b1d8b8a..000000000000 --- a/arch/arm/mach-tegra/include/mach/debug-macro.S +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/include/mach/debug-macro.S | ||
3 | * | ||
4 | * Copyright (C) 2010,2011 Google, Inc. | ||
5 | * Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved. | ||
6 | * | ||
7 | * Author: | ||
8 | * Colin Cross <ccross@google.com> | ||
9 | * Erik Gilling <konkers@google.com> | ||
10 | * Doug Anderson <dianders@chromium.org> | ||
11 | * Stephen Warren <swarren@nvidia.com> | ||
12 | * | ||
13 | * Portions based on mach-omap2's debug-macro.S | ||
14 | * Copyright (C) 1994-1999 Russell King | ||
15 | * | ||
16 | * This software is licensed under the terms of the GNU General Public | ||
17 | * License version 2, as published by the Free Software Foundation, and | ||
18 | * may be copied, distributed, and modified under those terms. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | #include <linux/serial_reg.h> | ||
28 | |||
29 | #include "../../iomap.h" | ||
30 | #include "../../irammap.h" | ||
31 | |||
32 | .macro addruart, rp, rv, tmp | ||
33 | adr \rp, 99f @ actual addr of 99f | ||
34 | ldr \rv, [\rp] @ linked addr is stored there | ||
35 | sub \rv, \rv, \rp @ offset between the two | ||
36 | ldr \rp, [\rp, #4] @ linked tegra_uart_config | ||
37 | sub \tmp, \rp, \rv @ actual tegra_uart_config | ||
38 | ldr \rp, [\tmp] @ Load tegra_uart_config | ||
39 | cmp \rp, #1 @ needs intitialization? | ||
40 | bne 100f @ no; go load the addresses | ||
41 | mov \rv, #0 @ yes; record init is done | ||
42 | str \rv, [\tmp] | ||
43 | mov \rp, #TEGRA_IRAM_BASE @ See if cookie is in IRAM | ||
44 | ldr \rv, [\rp, #TEGRA_IRAM_DEBUG_UART_OFFSET] | ||
45 | movw \rp, #TEGRA_IRAM_DEBUG_UART_COOKIE & 0xffff | ||
46 | movt \rp, #TEGRA_IRAM_DEBUG_UART_COOKIE >> 16 | ||
47 | cmp \rv, \rp @ Cookie present? | ||
48 | bne 100f @ No, use default UART | ||
49 | mov \rp, #TEGRA_IRAM_BASE @ Load UART address from IRAM | ||
50 | ldr \rv, [\rp, #TEGRA_IRAM_DEBUG_UART_OFFSET + 4] | ||
51 | str \rv, [\tmp, #4] @ Store in tegra_uart_phys | ||
52 | sub \rv, \rv, #IO_APB_PHYS @ Calculate virt address | ||
53 | add \rv, \rv, #IO_APB_VIRT | ||
54 | str \rv, [\tmp, #8] @ Store in tegra_uart_virt | ||
55 | b 100f | ||
56 | |||
57 | .align | ||
58 | 99: .word . | ||
59 | .word tegra_uart_config | ||
60 | .ltorg | ||
61 | |||
62 | 100: ldr \rp, [\tmp, #4] @ Load tegra_uart_phys | ||
63 | ldr \rv, [\tmp, #8] @ Load tegra_uart_virt | ||
64 | .endm | ||
65 | |||
66 | #define UART_SHIFT 2 | ||
67 | |||
68 | /* | ||
69 | * Code below is swiped from <asm/hardware/debug-8250.S>, but add an extra | ||
70 | * check to make sure that we aren't in the CONFIG_TEGRA_DEBUG_UART_NONE case. | ||
71 | * We use the fact that all 5 valid UART addresses all have something in the | ||
72 | * 2nd-to-lowest byte. | ||
73 | */ | ||
74 | |||
75 | .macro senduart, rd, rx | ||
76 | tst \rx, #0x0000ff00 | ||
77 | strneb \rd, [\rx, #UART_TX << UART_SHIFT] | ||
78 | 1001: | ||
79 | .endm | ||
80 | |||
81 | .macro busyuart, rd, rx | ||
82 | tst \rx, #0x0000ff00 | ||
83 | beq 1002f | ||
84 | 1001: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT] | ||
85 | and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
86 | teq \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
87 | bne 1001b | ||
88 | 1002: | ||
89 | .endm | ||
90 | |||
91 | .macro waituart, rd, rx | ||
92 | #ifdef FLOW_CONTROL | ||
93 | tst \rx, #0x0000ff00 | ||
94 | beq 1002f | ||
95 | 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] | ||
96 | tst \rd, #UART_MSR_CTS | ||
97 | beq 1001b | ||
98 | 1002: | ||
99 | #endif | ||
100 | .endm | ||
diff --git a/arch/arm/mach-tegra/include/mach/irqs.h b/arch/arm/mach-tegra/include/mach/irqs.h deleted file mode 100644 index aad1a2c1d714..000000000000 --- a/arch/arm/mach-tegra/include/mach/irqs.h +++ /dev/null | |||
@@ -1,182 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/include/mach/irqs.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Google, Inc. | ||
5 | * | ||
6 | * Author: | ||
7 | * Colin Cross <ccross@google.com> | ||
8 | * Erik Gilling <konkers@google.com> | ||
9 | * | ||
10 | * This software is licensed under the terms of the GNU General Public | ||
11 | * License version 2, as published by the Free Software Foundation, and | ||
12 | * may be copied, distributed, and modified under those terms. | ||
13 | * | ||
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 | */ | ||
20 | |||
21 | #ifndef __MACH_TEGRA_IRQS_H | ||
22 | #define __MACH_TEGRA_IRQS_H | ||
23 | |||
24 | #define INT_GIC_BASE 0 | ||
25 | |||
26 | #define IRQ_LOCALTIMER 29 | ||
27 | |||
28 | /* Primary Interrupt Controller */ | ||
29 | #define INT_PRI_BASE (INT_GIC_BASE + 32) | ||
30 | #define INT_TMR1 (INT_PRI_BASE + 0) | ||
31 | #define INT_TMR2 (INT_PRI_BASE + 1) | ||
32 | #define INT_RTC (INT_PRI_BASE + 2) | ||
33 | #define INT_I2S2 (INT_PRI_BASE + 3) | ||
34 | #define INT_SHR_SEM_INBOX_IBF (INT_PRI_BASE + 4) | ||
35 | #define INT_SHR_SEM_INBOX_IBE (INT_PRI_BASE + 5) | ||
36 | #define INT_SHR_SEM_OUTBOX_IBF (INT_PRI_BASE + 6) | ||
37 | #define INT_SHR_SEM_OUTBOX_IBE (INT_PRI_BASE + 7) | ||
38 | #define INT_VDE_UCQ_ERROR (INT_PRI_BASE + 8) | ||
39 | #define INT_VDE_SYNC_TOKEN (INT_PRI_BASE + 9) | ||
40 | #define INT_VDE_BSE_V (INT_PRI_BASE + 10) | ||
41 | #define INT_VDE_BSE_A (INT_PRI_BASE + 11) | ||
42 | #define INT_VDE_SXE (INT_PRI_BASE + 12) | ||
43 | #define INT_I2S1 (INT_PRI_BASE + 13) | ||
44 | #define INT_SDMMC1 (INT_PRI_BASE + 14) | ||
45 | #define INT_SDMMC2 (INT_PRI_BASE + 15) | ||
46 | #define INT_XIO (INT_PRI_BASE + 16) | ||
47 | #define INT_VDE (INT_PRI_BASE + 17) | ||
48 | #define INT_AVP_UCQ (INT_PRI_BASE + 18) | ||
49 | #define INT_SDMMC3 (INT_PRI_BASE + 19) | ||
50 | #define INT_USB (INT_PRI_BASE + 20) | ||
51 | #define INT_USB2 (INT_PRI_BASE + 21) | ||
52 | #define INT_PRI_RES_22 (INT_PRI_BASE + 22) | ||
53 | #define INT_EIDE (INT_PRI_BASE + 23) | ||
54 | #define INT_NANDFLASH (INT_PRI_BASE + 24) | ||
55 | #define INT_VCP (INT_PRI_BASE + 25) | ||
56 | #define INT_APB_DMA (INT_PRI_BASE + 26) | ||
57 | #define INT_AHB_DMA (INT_PRI_BASE + 27) | ||
58 | #define INT_GNT_0 (INT_PRI_BASE + 28) | ||
59 | #define INT_GNT_1 (INT_PRI_BASE + 29) | ||
60 | #define INT_OWR (INT_PRI_BASE + 30) | ||
61 | #define INT_SDMMC4 (INT_PRI_BASE + 31) | ||
62 | |||
63 | /* Secondary Interrupt Controller */ | ||
64 | #define INT_SEC_BASE (INT_PRI_BASE + 32) | ||
65 | #define INT_GPIO1 (INT_SEC_BASE + 0) | ||
66 | #define INT_GPIO2 (INT_SEC_BASE + 1) | ||
67 | #define INT_GPIO3 (INT_SEC_BASE + 2) | ||
68 | #define INT_GPIO4 (INT_SEC_BASE + 3) | ||
69 | #define INT_UARTA (INT_SEC_BASE + 4) | ||
70 | #define INT_UARTB (INT_SEC_BASE + 5) | ||
71 | #define INT_I2C (INT_SEC_BASE + 6) | ||
72 | #define INT_SPI (INT_SEC_BASE + 7) | ||
73 | #define INT_TWC (INT_SEC_BASE + 8) | ||
74 | #define INT_TMR3 (INT_SEC_BASE + 9) | ||
75 | #define INT_TMR4 (INT_SEC_BASE + 10) | ||
76 | #define INT_FLOW_RSM0 (INT_SEC_BASE + 11) | ||
77 | #define INT_FLOW_RSM1 (INT_SEC_BASE + 12) | ||
78 | #define INT_SPDIF (INT_SEC_BASE + 13) | ||
79 | #define INT_UARTC (INT_SEC_BASE + 14) | ||
80 | #define INT_MIPI (INT_SEC_BASE + 15) | ||
81 | #define INT_EVENTA (INT_SEC_BASE + 16) | ||
82 | #define INT_EVENTB (INT_SEC_BASE + 17) | ||
83 | #define INT_EVENTC (INT_SEC_BASE + 18) | ||
84 | #define INT_EVENTD (INT_SEC_BASE + 19) | ||
85 | #define INT_VFIR (INT_SEC_BASE + 20) | ||
86 | #define INT_DVC (INT_SEC_BASE + 21) | ||
87 | #define INT_SYS_STATS_MON (INT_SEC_BASE + 22) | ||
88 | #define INT_GPIO5 (INT_SEC_BASE + 23) | ||
89 | #define INT_CPU0_PMU_INTR (INT_SEC_BASE + 24) | ||
90 | #define INT_CPU1_PMU_INTR (INT_SEC_BASE + 25) | ||
91 | #define INT_SEC_RES_26 (INT_SEC_BASE + 26) | ||
92 | #define INT_S_LINK1 (INT_SEC_BASE + 27) | ||
93 | #define INT_APB_DMA_COP (INT_SEC_BASE + 28) | ||
94 | #define INT_AHB_DMA_COP (INT_SEC_BASE + 29) | ||
95 | #define INT_DMA_TX (INT_SEC_BASE + 30) | ||
96 | #define INT_DMA_RX (INT_SEC_BASE + 31) | ||
97 | |||
98 | /* Tertiary Interrupt Controller */ | ||
99 | #define INT_TRI_BASE (INT_SEC_BASE + 32) | ||
100 | #define INT_HOST1X_COP_SYNCPT (INT_TRI_BASE + 0) | ||
101 | #define INT_HOST1X_MPCORE_SYNCPT (INT_TRI_BASE + 1) | ||
102 | #define INT_HOST1X_COP_GENERAL (INT_TRI_BASE + 2) | ||
103 | #define INT_HOST1X_MPCORE_GENERAL (INT_TRI_BASE + 3) | ||
104 | #define INT_MPE_GENERAL (INT_TRI_BASE + 4) | ||
105 | #define INT_VI_GENERAL (INT_TRI_BASE + 5) | ||
106 | #define INT_EPP_GENERAL (INT_TRI_BASE + 6) | ||
107 | #define INT_ISP_GENERAL (INT_TRI_BASE + 7) | ||
108 | #define INT_2D_GENERAL (INT_TRI_BASE + 8) | ||
109 | #define INT_DISPLAY_GENERAL (INT_TRI_BASE + 9) | ||
110 | #define INT_DISPLAY_B_GENERAL (INT_TRI_BASE + 10) | ||
111 | #define INT_HDMI (INT_TRI_BASE + 11) | ||
112 | #define INT_TVO_GENERAL (INT_TRI_BASE + 12) | ||
113 | #define INT_MC_GENERAL (INT_TRI_BASE + 13) | ||
114 | #define INT_EMC_GENERAL (INT_TRI_BASE + 14) | ||
115 | #define INT_TRI_RES_15 (INT_TRI_BASE + 15) | ||
116 | #define INT_TRI_RES_16 (INT_TRI_BASE + 16) | ||
117 | #define INT_AC97 (INT_TRI_BASE + 17) | ||
118 | #define INT_SPI_2 (INT_TRI_BASE + 18) | ||
119 | #define INT_SPI_3 (INT_TRI_BASE + 19) | ||
120 | #define INT_I2C2 (INT_TRI_BASE + 20) | ||
121 | #define INT_KBC (INT_TRI_BASE + 21) | ||
122 | #define INT_EXTERNAL_PMU (INT_TRI_BASE + 22) | ||
123 | #define INT_GPIO6 (INT_TRI_BASE + 23) | ||
124 | #define INT_TVDAC (INT_TRI_BASE + 24) | ||
125 | #define INT_GPIO7 (INT_TRI_BASE + 25) | ||
126 | #define INT_UARTD (INT_TRI_BASE + 26) | ||
127 | #define INT_UARTE (INT_TRI_BASE + 27) | ||
128 | #define INT_I2C3 (INT_TRI_BASE + 28) | ||
129 | #define INT_SPI_4 (INT_TRI_BASE + 29) | ||
130 | #define INT_TRI_RES_30 (INT_TRI_BASE + 30) | ||
131 | #define INT_SW_RESERVED (INT_TRI_BASE + 31) | ||
132 | |||
133 | /* Quaternary Interrupt Controller */ | ||
134 | #define INT_QUAD_BASE (INT_TRI_BASE + 32) | ||
135 | #define INT_SNOR (INT_QUAD_BASE + 0) | ||
136 | #define INT_USB3 (INT_QUAD_BASE + 1) | ||
137 | #define INT_PCIE_INTR (INT_QUAD_BASE + 2) | ||
138 | #define INT_PCIE_MSI (INT_QUAD_BASE + 3) | ||
139 | #define INT_QUAD_RES_4 (INT_QUAD_BASE + 4) | ||
140 | #define INT_QUAD_RES_5 (INT_QUAD_BASE + 5) | ||
141 | #define INT_QUAD_RES_6 (INT_QUAD_BASE + 6) | ||
142 | #define INT_QUAD_RES_7 (INT_QUAD_BASE + 7) | ||
143 | #define INT_APB_DMA_CH0 (INT_QUAD_BASE + 8) | ||
144 | #define INT_APB_DMA_CH1 (INT_QUAD_BASE + 9) | ||
145 | #define INT_APB_DMA_CH2 (INT_QUAD_BASE + 10) | ||
146 | #define INT_APB_DMA_CH3 (INT_QUAD_BASE + 11) | ||
147 | #define INT_APB_DMA_CH4 (INT_QUAD_BASE + 12) | ||
148 | #define INT_APB_DMA_CH5 (INT_QUAD_BASE + 13) | ||
149 | #define INT_APB_DMA_CH6 (INT_QUAD_BASE + 14) | ||
150 | #define INT_APB_DMA_CH7 (INT_QUAD_BASE + 15) | ||
151 | #define INT_APB_DMA_CH8 (INT_QUAD_BASE + 16) | ||
152 | #define INT_APB_DMA_CH9 (INT_QUAD_BASE + 17) | ||
153 | #define INT_APB_DMA_CH10 (INT_QUAD_BASE + 18) | ||
154 | #define INT_APB_DMA_CH11 (INT_QUAD_BASE + 19) | ||
155 | #define INT_APB_DMA_CH12 (INT_QUAD_BASE + 20) | ||
156 | #define INT_APB_DMA_CH13 (INT_QUAD_BASE + 21) | ||
157 | #define INT_APB_DMA_CH14 (INT_QUAD_BASE + 22) | ||
158 | #define INT_APB_DMA_CH15 (INT_QUAD_BASE + 23) | ||
159 | #define INT_QUAD_RES_24 (INT_QUAD_BASE + 24) | ||
160 | #define INT_QUAD_RES_25 (INT_QUAD_BASE + 25) | ||
161 | #define INT_QUAD_RES_26 (INT_QUAD_BASE + 26) | ||
162 | #define INT_QUAD_RES_27 (INT_QUAD_BASE + 27) | ||
163 | #define INT_QUAD_RES_28 (INT_QUAD_BASE + 28) | ||
164 | #define INT_QUAD_RES_29 (INT_QUAD_BASE + 29) | ||
165 | #define INT_QUAD_RES_30 (INT_QUAD_BASE + 30) | ||
166 | #define INT_QUAD_RES_31 (INT_QUAD_BASE + 31) | ||
167 | |||
168 | /* Tegra30 has 5 banks of 32 IRQs */ | ||
169 | #define INT_MAIN_NR (32 * 5) | ||
170 | #define INT_GPIO_BASE (INT_PRI_BASE + INT_MAIN_NR) | ||
171 | |||
172 | /* Tegra30 has 8 banks of 32 GPIOs */ | ||
173 | #define INT_GPIO_NR (32 * 8) | ||
174 | |||
175 | #define TEGRA_NR_IRQS (INT_GPIO_BASE + INT_GPIO_NR) | ||
176 | |||
177 | #define INT_BOARD_BASE TEGRA_NR_IRQS | ||
178 | #define NR_BOARD_IRQS 32 | ||
179 | |||
180 | #define NR_IRQS (INT_BOARD_BASE + NR_BOARD_IRQS) | ||
181 | |||
182 | #endif | ||
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h index 27725750ca3e..485003f9b636 100644 --- a/arch/arm/mach-tegra/include/mach/uncompress.h +++ b/arch/arm/mach-tegra/include/mach/uncompress.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/serial_reg.h> | 29 | #include <linux/serial_reg.h> |
30 | 30 | ||
31 | #include "../../iomap.h" | 31 | #include "../../iomap.h" |
32 | #include "../../irammap.h" | ||
33 | 32 | ||
34 | #define BIT(x) (1 << (x)) | 33 | #define BIT(x) (1 << (x)) |
35 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) | 34 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) |
@@ -52,17 +51,6 @@ static inline void flush(void) | |||
52 | { | 51 | { |
53 | } | 52 | } |
54 | 53 | ||
55 | static inline void save_uart_address(void) | ||
56 | { | ||
57 | u32 *buf = (u32 *)(TEGRA_IRAM_BASE + TEGRA_IRAM_DEBUG_UART_OFFSET); | ||
58 | |||
59 | if (uart) { | ||
60 | buf[0] = TEGRA_IRAM_DEBUG_UART_COOKIE; | ||
61 | buf[1] = (u32)uart; | ||
62 | } else | ||
63 | buf[0] = 0; | ||
64 | } | ||
65 | |||
66 | static const struct { | 54 | static const struct { |
67 | u32 base; | 55 | u32 base; |
68 | u32 reset_reg; | 56 | u32 reset_reg; |
@@ -139,51 +127,19 @@ int auto_odmdata(void) | |||
139 | } | 127 | } |
140 | #endif | 128 | #endif |
141 | 129 | ||
142 | #ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH | ||
143 | int auto_scratch(void) | ||
144 | { | ||
145 | int i; | ||
146 | |||
147 | /* | ||
148 | * Look for the first UART that: | ||
149 | * a) Is not in reset. | ||
150 | * b) Is clocked. | ||
151 | * c) Has a 'D' in the scratchpad register. | ||
152 | * | ||
153 | * Note that on Tegra30, the first two conditions are required, since | ||
154 | * if not true, accesses to the UART scratch register will hang. | ||
155 | * Tegra20 doesn't have this issue. | ||
156 | * | ||
157 | * The intent is that the bootloader will tell the kernel which UART | ||
158 | * to use by setting up those conditions. If nothing found, we'll fall | ||
159 | * back to what's specified in TEGRA_DEBUG_UART_BASE. | ||
160 | */ | ||
161 | for (i = 0; i < ARRAY_SIZE(uarts); i++) { | ||
162 | if (!uart_clocked(i)) | ||
163 | continue; | ||
164 | |||
165 | uart = (volatile u8 *)uarts[i].base; | ||
166 | if (uart[UART_SCR << DEBUG_UART_SHIFT] != 'D') | ||
167 | continue; | ||
168 | |||
169 | return i; | ||
170 | } | ||
171 | |||
172 | return -1; | ||
173 | } | ||
174 | #endif | ||
175 | |||
176 | /* | 130 | /* |
177 | * Setup before decompression. This is where we do UART selection for | 131 | * Setup before decompression. This is where we do UART selection for |
178 | * earlyprintk and init the uart_base register. | 132 | * earlyprintk and init the uart_base register. |
179 | */ | 133 | */ |
180 | static inline void arch_decomp_setup(void) | 134 | static inline void arch_decomp_setup(void) |
181 | { | 135 | { |
182 | int uart_id, auto_uart_id; | 136 | int uart_id; |
183 | volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE; | 137 | volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE; |
184 | u32 chip, div; | 138 | u32 chip, div; |
185 | 139 | ||
186 | #if defined(CONFIG_TEGRA_DEBUG_UARTA) | 140 | #if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) |
141 | uart_id = auto_odmdata(); | ||
142 | #elif defined(CONFIG_TEGRA_DEBUG_UARTA) | ||
187 | uart_id = 0; | 143 | uart_id = 0; |
188 | #elif defined(CONFIG_TEGRA_DEBUG_UARTB) | 144 | #elif defined(CONFIG_TEGRA_DEBUG_UARTB) |
189 | uart_id = 1; | 145 | uart_id = 1; |
@@ -193,19 +149,7 @@ static inline void arch_decomp_setup(void) | |||
193 | uart_id = 3; | 149 | uart_id = 3; |
194 | #elif defined(CONFIG_TEGRA_DEBUG_UARTE) | 150 | #elif defined(CONFIG_TEGRA_DEBUG_UARTE) |
195 | uart_id = 4; | 151 | uart_id = 4; |
196 | #else | ||
197 | uart_id = -1; | ||
198 | #endif | ||
199 | |||
200 | #if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) | ||
201 | auto_uart_id = auto_odmdata(); | ||
202 | #elif defined(CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH) | ||
203 | auto_uart_id = auto_scratch(); | ||
204 | #else | ||
205 | auto_uart_id = -1; | ||
206 | #endif | 152 | #endif |
207 | if (auto_uart_id != -1) | ||
208 | uart_id = auto_uart_id; | ||
209 | 153 | ||
210 | if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) || | 154 | if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) || |
211 | !uart_clocked(uart_id)) | 155 | !uart_clocked(uart_id)) |
@@ -213,7 +157,6 @@ static inline void arch_decomp_setup(void) | |||
213 | else | 157 | else |
214 | uart = (volatile u8 *)uarts[uart_id].base; | 158 | uart = (volatile u8 *)uarts[uart_id].base; |
215 | 159 | ||
216 | save_uart_address(); | ||
217 | if (uart == NULL) | 160 | if (uart == NULL) |
218 | return; | 161 | return; |
219 | 162 | ||
diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c index 7d09f301b3a1..bb9c9c29d181 100644 --- a/arch/arm/mach-tegra/io.c +++ b/arch/arm/mach-tegra/io.c | |||
@@ -59,5 +59,6 @@ static struct map_desc tegra_io_desc[] __initdata = { | |||
59 | 59 | ||
60 | void __init tegra_map_common_io(void) | 60 | void __init tegra_map_common_io(void) |
61 | { | 61 | { |
62 | debug_ll_io_init(); | ||
62 | iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc)); | 63 | iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc)); |
63 | } | 64 | } |
diff --git a/arch/arm/mach-tegra/iomap.h b/arch/arm/mach-tegra/iomap.h index 53151030a07d..db8be51cad80 100644 --- a/arch/arm/mach-tegra/iomap.h +++ b/arch/arm/mach-tegra/iomap.h | |||
@@ -261,20 +261,6 @@ | |||
261 | #define TEGRA_SDMMC4_BASE 0xC8000600 | 261 | #define TEGRA_SDMMC4_BASE 0xC8000600 |
262 | #define TEGRA_SDMMC4_SIZE SZ_512 | 262 | #define TEGRA_SDMMC4_SIZE SZ_512 |
263 | 263 | ||
264 | #if defined(CONFIG_TEGRA_DEBUG_UART_NONE) | ||
265 | # define TEGRA_DEBUG_UART_BASE 0 | ||
266 | #elif defined(CONFIG_TEGRA_DEBUG_UARTA) | ||
267 | # define TEGRA_DEBUG_UART_BASE TEGRA_UARTA_BASE | ||
268 | #elif defined(CONFIG_TEGRA_DEBUG_UARTB) | ||
269 | # define TEGRA_DEBUG_UART_BASE TEGRA_UARTB_BASE | ||
270 | #elif defined(CONFIG_TEGRA_DEBUG_UARTC) | ||
271 | # define TEGRA_DEBUG_UART_BASE TEGRA_UARTC_BASE | ||
272 | #elif defined(CONFIG_TEGRA_DEBUG_UARTD) | ||
273 | # define TEGRA_DEBUG_UART_BASE TEGRA_UARTD_BASE | ||
274 | #elif defined(CONFIG_TEGRA_DEBUG_UARTE) | ||
275 | # define TEGRA_DEBUG_UART_BASE TEGRA_UARTE_BASE | ||
276 | #endif | ||
277 | |||
278 | /* On TEGRA, many peripherals are very closely packed in | 264 | /* On TEGRA, many peripherals are very closely packed in |
279 | * two 256MB io windows (that actually only use about 64KB | 265 | * two 256MB io windows (that actually only use about 64KB |
280 | * at the start of each). | 266 | * at the start of each). |
diff --git a/arch/arm/mach-tegra/irammap.h b/arch/arm/mach-tegra/irammap.h index 0cbe63261854..501952a84344 100644 --- a/arch/arm/mach-tegra/irammap.h +++ b/arch/arm/mach-tegra/irammap.h | |||
@@ -23,13 +23,4 @@ | |||
23 | #define TEGRA_IRAM_RESET_HANDLER_OFFSET 0 | 23 | #define TEGRA_IRAM_RESET_HANDLER_OFFSET 0 |
24 | #define TEGRA_IRAM_RESET_HANDLER_SIZE SZ_1K | 24 | #define TEGRA_IRAM_RESET_HANDLER_SIZE SZ_1K |
25 | 25 | ||
26 | /* | ||
27 | * These locations are written to by uncompress.h, and read by debug-macro.S. | ||
28 | * The first word holds the cookie value if the data is valid. The second | ||
29 | * word holds the UART physical address. | ||
30 | */ | ||
31 | #define TEGRA_IRAM_DEBUG_UART_OFFSET SZ_1K | ||
32 | #define TEGRA_IRAM_DEBUG_UART_SIZE 8 | ||
33 | #define TEGRA_IRAM_DEBUG_UART_COOKIE 0x55415254 | ||
34 | |||
35 | #endif | 26 | #endif |
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c index f18fc3ab4e58..53d085871798 100644 --- a/arch/arm/mach-tegra/pcie.c +++ b/arch/arm/mach-tegra/pcie.c | |||
@@ -43,6 +43,9 @@ | |||
43 | #include "board.h" | 43 | #include "board.h" |
44 | #include "iomap.h" | 44 | #include "iomap.h" |
45 | 45 | ||
46 | /* Hack - need to parse this from DT */ | ||
47 | #define INT_PCIE_INTR 130 | ||
48 | |||
46 | /* register definitions */ | 49 | /* register definitions */ |
47 | #define AFI_OFFSET 0x3800 | 50 | #define AFI_OFFSET 0x3800 |
48 | #define PADS_OFFSET 0x3000 | 51 | #define PADS_OFFSET 0x3000 |
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c index 6ff503536512..e4863f3e9ee7 100644 --- a/arch/arm/mach-tegra/timer.c +++ b/arch/arm/mach-tegra/timer.c | |||
@@ -26,16 +26,14 @@ | |||
26 | #include <linux/clocksource.h> | 26 | #include <linux/clocksource.h> |
27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/of_address.h> | ||
30 | #include <linux/of_irq.h> | ||
29 | 31 | ||
30 | #include <asm/mach/time.h> | 32 | #include <asm/mach/time.h> |
31 | #include <asm/smp_twd.h> | 33 | #include <asm/smp_twd.h> |
32 | #include <asm/sched_clock.h> | 34 | #include <asm/sched_clock.h> |
33 | 35 | ||
34 | #include <mach/irqs.h> | ||
35 | |||
36 | #include "board.h" | 36 | #include "board.h" |
37 | #include "clock.h" | ||
38 | #include "iomap.h" | ||
39 | 37 | ||
40 | #define RTC_SECONDS 0x08 | 38 | #define RTC_SECONDS 0x08 |
41 | #define RTC_SHADOW_SECONDS 0x0c | 39 | #define RTC_SHADOW_SECONDS 0x0c |
@@ -53,8 +51,8 @@ | |||
53 | #define TIMER_PTV 0x0 | 51 | #define TIMER_PTV 0x0 |
54 | #define TIMER_PCR 0x4 | 52 | #define TIMER_PCR 0x4 |
55 | 53 | ||
56 | static void __iomem *timer_reg_base = IO_ADDRESS(TEGRA_TMR1_BASE); | 54 | static void __iomem *timer_reg_base; |
57 | static void __iomem *rtc_base = IO_ADDRESS(TEGRA_RTC_BASE); | 55 | static void __iomem *rtc_base; |
58 | 56 | ||
59 | static struct timespec persistent_ts; | 57 | static struct timespec persistent_ts; |
60 | static u64 persistent_ms, last_persistent_ms; | 58 | static u64 persistent_ms, last_persistent_ms; |
@@ -158,40 +156,66 @@ static struct irqaction tegra_timer_irq = { | |||
158 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_HIGH, | 156 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_HIGH, |
159 | .handler = tegra_timer_interrupt, | 157 | .handler = tegra_timer_interrupt, |
160 | .dev_id = &tegra_clockevent, | 158 | .dev_id = &tegra_clockevent, |
161 | .irq = INT_TMR3, | ||
162 | }; | 159 | }; |
163 | 160 | ||
164 | #ifdef CONFIG_HAVE_ARM_TWD | 161 | static const struct of_device_id timer_match[] __initconst = { |
165 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, | 162 | { .compatible = "nvidia,tegra20-timer" }, |
166 | TEGRA_ARM_PERIF_BASE + 0x600, | 163 | {} |
167 | IRQ_LOCALTIMER); | 164 | }; |
168 | 165 | ||
169 | static void __init tegra_twd_init(void) | 166 | static const struct of_device_id rtc_match[] __initconst = { |
170 | { | 167 | { .compatible = "nvidia,tegra20-rtc" }, |
171 | int err = twd_local_timer_register(&twd_local_timer); | 168 | {} |
172 | if (err) | 169 | }; |
173 | pr_err("twd_local_timer_register failed %d\n", err); | ||
174 | } | ||
175 | #else | ||
176 | #define tegra_twd_init() do {} while(0) | ||
177 | #endif | ||
178 | 170 | ||
179 | static void __init tegra_init_timer(void) | 171 | static void __init tegra_init_timer(void) |
180 | { | 172 | { |
173 | struct device_node *np; | ||
181 | struct clk *clk; | 174 | struct clk *clk; |
182 | unsigned long rate; | 175 | unsigned long rate; |
183 | int ret; | 176 | int ret; |
184 | 177 | ||
178 | np = of_find_matching_node(NULL, timer_match); | ||
179 | if (!np) { | ||
180 | pr_err("Failed to find timer DT node\n"); | ||
181 | BUG(); | ||
182 | } | ||
183 | |||
184 | timer_reg_base = of_iomap(np, 0); | ||
185 | if (!timer_reg_base) { | ||
186 | pr_err("Can't map timer registers"); | ||
187 | BUG(); | ||
188 | } | ||
189 | |||
190 | tegra_timer_irq.irq = irq_of_parse_and_map(np, 2); | ||
191 | if (tegra_timer_irq.irq <= 0) { | ||
192 | pr_err("Failed to map timer IRQ\n"); | ||
193 | BUG(); | ||
194 | } | ||
195 | |||
185 | clk = clk_get_sys("timer", NULL); | 196 | clk = clk_get_sys("timer", NULL); |
186 | if (IS_ERR(clk)) { | 197 | if (IS_ERR(clk)) { |
187 | pr_warn("Unable to get timer clock." | 198 | pr_warn("Unable to get timer clock. Assuming 12Mhz input clock.\n"); |
188 | " Assuming 12Mhz input clock.\n"); | ||
189 | rate = 12000000; | 199 | rate = 12000000; |
190 | } else { | 200 | } else { |
191 | clk_prepare_enable(clk); | 201 | clk_prepare_enable(clk); |
192 | rate = clk_get_rate(clk); | 202 | rate = clk_get_rate(clk); |
193 | } | 203 | } |
194 | 204 | ||
205 | of_node_put(np); | ||
206 | |||
207 | np = of_find_matching_node(NULL, rtc_match); | ||
208 | if (!np) { | ||
209 | pr_err("Failed to find RTC DT node\n"); | ||
210 | BUG(); | ||
211 | } | ||
212 | |||
213 | rtc_base = of_iomap(np, 0); | ||
214 | if (!rtc_base) { | ||
215 | pr_err("Can't map RTC registers"); | ||
216 | BUG(); | ||
217 | } | ||
218 | |||
195 | /* | 219 | /* |
196 | * rtc registers are used by read_persistent_clock, keep the rtc clock | 220 | * rtc registers are used by read_persistent_clock, keep the rtc clock |
197 | * enabled | 221 | * enabled |
@@ -202,6 +226,8 @@ static void __init tegra_init_timer(void) | |||
202 | else | 226 | else |
203 | clk_prepare_enable(clk); | 227 | clk_prepare_enable(clk); |
204 | 228 | ||
229 | of_node_put(np); | ||
230 | |||
205 | switch (rate) { | 231 | switch (rate) { |
206 | case 12000000: | 232 | case 12000000: |
207 | timer_writel(0x000b, TIMERUS_USEC_CFG); | 233 | timer_writel(0x000b, TIMERUS_USEC_CFG); |
@@ -223,13 +249,13 @@ static void __init tegra_init_timer(void) | |||
223 | 249 | ||
224 | if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US, | 250 | if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US, |
225 | "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) { | 251 | "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) { |
226 | printk(KERN_ERR "Failed to register clocksource\n"); | 252 | pr_err("Failed to register clocksource\n"); |
227 | BUG(); | 253 | BUG(); |
228 | } | 254 | } |
229 | 255 | ||
230 | ret = setup_irq(tegra_timer_irq.irq, &tegra_timer_irq); | 256 | ret = setup_irq(tegra_timer_irq.irq, &tegra_timer_irq); |
231 | if (ret) { | 257 | if (ret) { |
232 | printk(KERN_ERR "Failed to register timer IRQ: %d\n", ret); | 258 | pr_err("Failed to register timer IRQ: %d\n", ret); |
233 | BUG(); | 259 | BUG(); |
234 | } | 260 | } |
235 | 261 | ||
@@ -241,7 +267,9 @@ static void __init tegra_init_timer(void) | |||
241 | tegra_clockevent.cpumask = cpu_all_mask; | 267 | tegra_clockevent.cpumask = cpu_all_mask; |
242 | tegra_clockevent.irq = tegra_timer_irq.irq; | 268 | tegra_clockevent.irq = tegra_timer_irq.irq; |
243 | clockevents_register_device(&tegra_clockevent); | 269 | clockevents_register_device(&tegra_clockevent); |
244 | tegra_twd_init(); | 270 | #ifdef CONFIG_HAVE_ARM_TWD |
271 | twd_local_timer_of_register(); | ||
272 | #endif | ||
245 | register_persistent_clock(NULL, tegra_read_persistent_clock); | 273 | register_persistent_clock(NULL, tegra_read_persistent_clock); |
246 | } | 274 | } |
247 | 275 | ||
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index e8c3f0d70ca6..5dea90636d94 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig | |||
@@ -7,8 +7,8 @@ config UX500_SOC_COMMON | |||
7 | select ARM_ERRATA_764369 if SMP | 7 | select ARM_ERRATA_764369 if SMP |
8 | select ARM_GIC | 8 | select ARM_GIC |
9 | select CACHE_L2X0 | 9 | select CACHE_L2X0 |
10 | select CLKSRC_NOMADIK_MTU | ||
10 | select COMMON_CLK | 11 | select COMMON_CLK |
11 | select HAS_MTU | ||
12 | select PINCTRL | 12 | select PINCTRL |
13 | select PINCTRL_NOMADIK | 13 | select PINCTRL_NOMADIK |
14 | select PL310_ERRATA_753970 if CACHE_PL310 | 14 | select PL310_ERRATA_753970 if CACHE_PL310 |
diff --git a/arch/arm/mach-ux500/board-mop500-audio.c b/arch/arm/mach-ux500/board-mop500-audio.c index bde91a58e105..7209db7cdc72 100644 --- a/arch/arm/mach-ux500/board-mop500-audio.c +++ b/arch/arm/mach-ux500/board-mop500-audio.c | |||
@@ -8,8 +8,7 @@ | |||
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/gpio.h> | 9 | #include <linux/gpio.h> |
10 | #include <linux/platform_data/pinctrl-nomadik.h> | 10 | #include <linux/platform_data/pinctrl-nomadik.h> |
11 | 11 | #include <linux/platform_data/dma-ste-dma40.h> | |
12 | #include <plat/ste_dma40.h> | ||
13 | 12 | ||
14 | #include <mach/devices.h> | 13 | #include <mach/devices.h> |
15 | #include <mach/hardware.h> | 14 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 9c8e4a9e83ee..051b62c27102 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c | |||
@@ -11,9 +11,9 @@ | |||
11 | #include <linux/amba/mmci.h> | 11 | #include <linux/amba/mmci.h> |
12 | #include <linux/mmc/host.h> | 12 | #include <linux/mmc/host.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/platform_data/dma-ste-dma40.h> | ||
14 | 15 | ||
15 | #include <asm/mach-types.h> | 16 | #include <asm/mach-types.h> |
16 | #include <plat/ste_dma40.h> | ||
17 | #include <mach/devices.h> | 17 | #include <mach/devices.h> |
18 | #include <mach/hardware.h> | 18 | #include <mach/hardware.h> |
19 | 19 | ||
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 5b70212c2536..d453522edb0d 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -36,13 +36,12 @@ | |||
36 | #include <linux/leds.h> | 36 | #include <linux/leds.h> |
37 | #include <linux/pinctrl/consumer.h> | 37 | #include <linux/pinctrl/consumer.h> |
38 | #include <linux/platform_data/pinctrl-nomadik.h> | 38 | #include <linux/platform_data/pinctrl-nomadik.h> |
39 | #include <linux/platform_data/dma-ste-dma40.h> | ||
39 | 40 | ||
40 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
41 | #include <asm/mach/arch.h> | 42 | #include <asm/mach/arch.h> |
42 | #include <asm/hardware/gic.h> | 43 | #include <asm/hardware/gic.h> |
43 | 44 | ||
44 | #include <plat/ste_dma40.h> | ||
45 | |||
46 | #include <mach/hardware.h> | 45 | #include <mach/hardware.h> |
47 | #include <mach/setup.h> | 46 | #include <mach/setup.h> |
48 | #include <mach/devices.h> | 47 | #include <mach/devices.h> |
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 93442fcd9eb0..db0bb75e2c76 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -21,16 +21,19 @@ | |||
21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
22 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
23 | #include <linux/regulator/machine.h> | 23 | #include <linux/regulator/machine.h> |
24 | #include <linux/platform_data/pinctrl-nomadik.h> | ||
24 | #include <linux/random.h> | 25 | #include <linux/random.h> |
25 | 26 | ||
26 | #include <asm/pmu.h> | 27 | #include <asm/pmu.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
28 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
29 | #include <asm/hardware/gic.h> | 30 | #include <asm/hardware/gic.h> |
31 | |||
30 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
31 | #include <mach/setup.h> | 33 | #include <mach/setup.h> |
32 | #include <mach/devices.h> | 34 | #include <mach/devices.h> |
33 | #include <mach/db8500-regs.h> | 35 | #include <mach/db8500-regs.h> |
36 | #include <mach/irqs.h> | ||
34 | 37 | ||
35 | #include "devices-db8500.h" | 38 | #include "devices-db8500.h" |
36 | #include "ste-dma40-db8500.h" | 39 | #include "ste-dma40-db8500.h" |
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index 692a77a1c153..16b5f71e6974 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/platform_data/pinctrl-nomadik.h> | 14 | #include <linux/platform_data/pinctrl-nomadik.h> |
15 | 15 | ||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | #include <mach/irqs.h> | ||
17 | 18 | ||
18 | #include "devices-common.h" | 19 | #include "devices-common.h" |
19 | 20 | ||
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index 91754a8a0d49..318d49020894 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c | |||
@@ -12,11 +12,11 @@ | |||
12 | #include <linux/gpio.h> | 12 | #include <linux/gpio.h> |
13 | #include <linux/amba/bus.h> | 13 | #include <linux/amba/bus.h> |
14 | #include <linux/amba/pl022.h> | 14 | #include <linux/amba/pl022.h> |
15 | 15 | #include <linux/platform_data/dma-ste-dma40.h> | |
16 | #include <plat/ste_dma40.h> | ||
17 | 16 | ||
18 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
19 | #include <mach/setup.h> | 18 | #include <mach/setup.h> |
19 | #include <mach/irqs.h> | ||
20 | 20 | ||
21 | #include "ste-dma40-db8500.h" | 21 | #include "ste-dma40-db8500.h" |
22 | 22 | ||
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h index 3c8010f4fb3f..4b24c9992654 100644 --- a/arch/arm/mach-ux500/devices-db8500.h +++ b/arch/arm/mach-ux500/devices-db8500.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #ifndef __DEVICES_DB8500_H | 8 | #ifndef __DEVICES_DB8500_H |
9 | #define __DEVICES_DB8500_H | 9 | #define __DEVICES_DB8500_H |
10 | 10 | ||
11 | #include <mach/irqs.h> | ||
11 | #include "devices-common.h" | 12 | #include "devices-common.h" |
12 | 13 | ||
13 | struct ske_keypad_platform_data; | 14 | struct ske_keypad_platform_data; |
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h index e8928548b6a3..fc77b4274c8d 100644 --- a/arch/arm/mach-ux500/include/mach/irqs.h +++ b/arch/arm/mach-ux500/include/mach/irqs.h | |||
@@ -46,6 +46,6 @@ | |||
46 | #include <mach/irqs-board-mop500.h> | 46 | #include <mach/irqs-board-mop500.h> |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #define NR_IRQS IRQ_BOARD_END | 49 | #define UX500_NR_IRQS IRQ_BOARD_END |
50 | 50 | ||
51 | #endif /* ASM_ARCH_IRQS_H */ | 51 | #endif /* ASM_ARCH_IRQS_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/msp.h b/arch/arm/mach-ux500/include/mach/msp.h index 3cc7142eee02..9991aea3d577 100644 --- a/arch/arm/mach-ux500/include/mach/msp.h +++ b/arch/arm/mach-ux500/include/mach/msp.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #ifndef __MSP_H | 8 | #ifndef __MSP_H |
9 | #define __MSP_H | 9 | #define __MSP_H |
10 | 10 | ||
11 | #include <plat/ste_dma40.h> | 11 | #include <linux/platform_data/dma-ste-dma40.h> |
12 | 12 | ||
13 | enum msp_i2s_id { | 13 | enum msp_i2s_id { |
14 | MSP_I2S_0 = 0, | 14 | MSP_I2S_0 = 0, |
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c index 6f39731951b0..875309acb022 100644 --- a/arch/arm/mach-ux500/timer.c +++ b/arch/arm/mach-ux500/timer.c | |||
@@ -9,11 +9,10 @@ | |||
9 | #include <linux/clksrc-dbx500-prcmu.h> | 9 | #include <linux/clksrc-dbx500-prcmu.h> |
10 | #include <linux/of.h> | 10 | #include <linux/of.h> |
11 | #include <linux/of_address.h> | 11 | #include <linux/of_address.h> |
12 | #include <linux/platform_data/clocksource-nomadik-mtu.h> | ||
12 | 13 | ||
13 | #include <asm/smp_twd.h> | 14 | #include <asm/smp_twd.h> |
14 | 15 | ||
15 | #include <plat/mtu.h> | ||
16 | |||
17 | #include <mach/setup.h> | 16 | #include <mach/setup.h> |
18 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
19 | #include <mach/irqs.h> | 18 | #include <mach/irqs.h> |
@@ -96,7 +95,7 @@ dt_fail: | |||
96 | * | 95 | * |
97 | */ | 96 | */ |
98 | 97 | ||
99 | nmdk_timer_init(mtu_timer_base); | 98 | nmdk_timer_init(mtu_timer_base, IRQ_MTU0); |
100 | clksrc_dbx500_prcmu_init(prcmu_timer_base); | 99 | clksrc_dbx500_prcmu_init(prcmu_timer_base); |
101 | ux500_twd_init(); | 100 | ux500_twd_init(); |
102 | } | 101 | } |
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c index 145482e74418..78ac65f62e87 100644 --- a/arch/arm/mach-ux500/usb.c +++ b/arch/arm/mach-ux500/usb.c | |||
@@ -7,10 +7,10 @@ | |||
7 | #include <linux/platform_device.h> | 7 | #include <linux/platform_device.h> |
8 | #include <linux/usb/musb.h> | 8 | #include <linux/usb/musb.h> |
9 | #include <linux/dma-mapping.h> | 9 | #include <linux/dma-mapping.h> |
10 | #include <linux/platform_data/usb-musb-ux500.h> | ||
11 | #include <linux/platform_data/dma-ste-dma40.h> | ||
10 | 12 | ||
11 | #include <plat/ste_dma40.h> | ||
12 | #include <mach/hardware.h> | 13 | #include <mach/hardware.h> |
13 | #include <linux/platform_data/usb-musb-ux500.h> | ||
14 | 14 | ||
15 | #define MUSB_DMA40_RX_CH { \ | 15 | #define MUSB_DMA40_RX_CH { \ |
16 | .mode = STEDMA40_MODE_LOGICAL, \ | 16 | .mode = STEDMA40_MODE_LOGICAL, \ |
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig new file mode 100644 index 000000000000..2ed0b7d95db6 --- /dev/null +++ b/arch/arm/mach-vt8500/Kconfig | |||
@@ -0,0 +1,12 @@ | |||
1 | config ARCH_VT8500 | ||
2 | bool "VIA/WonderMedia 85xx" if ARCH_MULTI_V5 | ||
3 | default ARCH_VT8500_SINGLE | ||
4 | select ARCH_HAS_CPUFREQ | ||
5 | select ARCH_REQUIRE_GPIOLIB | ||
6 | select CLKDEV_LOOKUP | ||
7 | select CPU_ARM926T | ||
8 | select GENERIC_CLOCKEVENTS | ||
9 | select GENERIC_GPIO | ||
10 | select HAVE_CLK | ||
11 | help | ||
12 | Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip. | ||
diff --git a/arch/arm/mach-vt8500/common.h b/arch/arm/mach-vt8500/common.h index 2b2419646e95..6f2b843115db 100644 --- a/arch/arm/mach-vt8500/common.h +++ b/arch/arm/mach-vt8500/common.h | |||
@@ -25,4 +25,7 @@ int __init vt8500_irq_init(struct device_node *node, | |||
25 | /* defined in drivers/clk/clk-vt8500.c */ | 25 | /* defined in drivers/clk/clk-vt8500.c */ |
26 | void __init vtwm_clk_init(void __iomem *pmc_base); | 26 | void __init vtwm_clk_init(void __iomem *pmc_base); |
27 | 27 | ||
28 | /* defined in irq.c */ | ||
29 | asmlinkage void vt8500_handle_irq(struct pt_regs *regs); | ||
30 | |||
28 | #endif | 31 | #endif |
diff --git a/arch/arm/mach-vt8500/include/mach/entry-macro.S b/arch/arm/mach-vt8500/include/mach/entry-macro.S deleted file mode 100644 index 367d1b55fb9a..000000000000 --- a/arch/arm/mach-vt8500/include/mach/entry-macro.S +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vt8500/include/mach/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for VIA VT8500 | ||
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 | .macro get_irqnr_preamble, base, tmp | ||
12 | @ physical 0xd8140000 is virtual 0xf8140000 | ||
13 | mov \base, #0xf8000000 | ||
14 | orr \base, \base, #0x00140000 | ||
15 | .endm | ||
16 | |||
17 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
18 | ldr \irqnr, [\base] | ||
19 | cmp \irqnr, #63 @ may be false positive, check interrupt status | ||
20 | bne 1001f | ||
21 | ldr \irqstat, [\base, #0x84] | ||
22 | ands \irqstat, #0x80000000 | ||
23 | moveq \irqnr, #0 | ||
24 | 1001: | ||
25 | .endm | ||
26 | |||
diff --git a/arch/arm/mach-vt8500/include/mach/irqs.h b/arch/arm/mach-vt8500/include/mach/irqs.h deleted file mode 100644 index a129fd1222fb..000000000000 --- a/arch/arm/mach-vt8500/include/mach/irqs.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vt8500/include/mach/irqs.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Alexey Charkov <alchark@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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | /* This value is just to make the core happy, never used otherwise */ | ||
22 | #define NR_IRQS 128 | ||
diff --git a/arch/arm/mach-vt8500/irq.c b/arch/arm/mach-vt8500/irq.c index f8f9ab9bc56e..b9cf5ce9efbb 100644 --- a/arch/arm/mach-vt8500/irq.c +++ b/arch/arm/mach-vt8500/irq.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <linux/of_address.h> | 36 | #include <linux/of_address.h> |
37 | 37 | ||
38 | #include <asm/irq.h> | 38 | #include <asm/irq.h> |
39 | 39 | #include <asm/exception.h> | |
40 | 40 | ||
41 | #define VT8500_ICPC_IRQ 0x20 | 41 | #define VT8500_ICPC_IRQ 0x20 |
42 | #define VT8500_ICPC_FIQ 0x24 | 42 | #define VT8500_ICPC_FIQ 0x24 |
@@ -66,30 +66,34 @@ | |||
66 | #define VT8500_EDGE ( VT8500_TRIGGER_RISING \ | 66 | #define VT8500_EDGE ( VT8500_TRIGGER_RISING \ |
67 | | VT8500_TRIGGER_FALLING) | 67 | | VT8500_TRIGGER_FALLING) |
68 | 68 | ||
69 | static int irq_cnt; | 69 | /* vt8500 has 1 intc, wm8505 and wm8650 have 2 */ |
70 | #define VT8500_INTC_MAX 2 | ||
70 | 71 | ||
71 | struct vt8500_irq_priv { | 72 | struct vt8500_irq_data { |
72 | void __iomem *base; | 73 | void __iomem *base; /* IO Memory base address */ |
74 | struct irq_domain *domain; /* Domain for this controller */ | ||
73 | }; | 75 | }; |
74 | 76 | ||
77 | /* Global variable for accessing io-mem addresses */ | ||
78 | static struct vt8500_irq_data intc[VT8500_INTC_MAX]; | ||
79 | static u32 active_cnt = 0; | ||
80 | |||
75 | static void vt8500_irq_mask(struct irq_data *d) | 81 | static void vt8500_irq_mask(struct irq_data *d) |
76 | { | 82 | { |
77 | struct vt8500_irq_priv *priv = | 83 | struct vt8500_irq_data *priv = d->domain->host_data; |
78 | (struct vt8500_irq_priv *)(d->domain->host_data); | ||
79 | void __iomem *base = priv->base; | 84 | void __iomem *base = priv->base; |
80 | u8 edge; | 85 | void __iomem *stat_reg = base + VT8500_ICIS + (d->hwirq < 32 ? 0 : 4); |
86 | u8 edge, dctr; | ||
87 | u32 status; | ||
81 | 88 | ||
82 | edge = readb(base + VT8500_ICDC + d->hwirq) & VT8500_EDGE; | 89 | edge = readb(base + VT8500_ICDC + d->hwirq) & VT8500_EDGE; |
83 | if (edge) { | 90 | if (edge) { |
84 | void __iomem *stat_reg = base + VT8500_ICIS | 91 | status = readl(stat_reg); |
85 | + (d->hwirq < 32 ? 0 : 4); | ||
86 | unsigned status = readl(stat_reg); | ||
87 | 92 | ||
88 | status |= (1 << (d->hwirq & 0x1f)); | 93 | status |= (1 << (d->hwirq & 0x1f)); |
89 | writel(status, stat_reg); | 94 | writel(status, stat_reg); |
90 | } else { | 95 | } else { |
91 | u8 dctr = readb(base + VT8500_ICDC + d->hwirq); | 96 | dctr = readb(base + VT8500_ICDC + d->hwirq); |
92 | |||
93 | dctr &= ~VT8500_INT_ENABLE; | 97 | dctr &= ~VT8500_INT_ENABLE; |
94 | writeb(dctr, base + VT8500_ICDC + d->hwirq); | 98 | writeb(dctr, base + VT8500_ICDC + d->hwirq); |
95 | } | 99 | } |
@@ -97,8 +101,7 @@ static void vt8500_irq_mask(struct irq_data *d) | |||
97 | 101 | ||
98 | static void vt8500_irq_unmask(struct irq_data *d) | 102 | static void vt8500_irq_unmask(struct irq_data *d) |
99 | { | 103 | { |
100 | struct vt8500_irq_priv *priv = | 104 | struct vt8500_irq_data *priv = d->domain->host_data; |
101 | (struct vt8500_irq_priv *)(d->domain->host_data); | ||
102 | void __iomem *base = priv->base; | 105 | void __iomem *base = priv->base; |
103 | u8 dctr; | 106 | u8 dctr; |
104 | 107 | ||
@@ -109,8 +112,7 @@ static void vt8500_irq_unmask(struct irq_data *d) | |||
109 | 112 | ||
110 | static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type) | 113 | static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type) |
111 | { | 114 | { |
112 | struct vt8500_irq_priv *priv = | 115 | struct vt8500_irq_data *priv = d->domain->host_data; |
113 | (struct vt8500_irq_priv *)(d->domain->host_data); | ||
114 | void __iomem *base = priv->base; | 116 | void __iomem *base = priv->base; |
115 | u8 dctr; | 117 | u8 dctr; |
116 | 118 | ||
@@ -148,17 +150,15 @@ static struct irq_chip vt8500_irq_chip = { | |||
148 | 150 | ||
149 | static void __init vt8500_init_irq_hw(void __iomem *base) | 151 | static void __init vt8500_init_irq_hw(void __iomem *base) |
150 | { | 152 | { |
151 | unsigned int i; | 153 | u32 i; |
152 | 154 | ||
153 | /* Enable rotating priority for IRQ */ | 155 | /* Enable rotating priority for IRQ */ |
154 | writel(ICPC_ROTATE, base + VT8500_ICPC_IRQ); | 156 | writel(ICPC_ROTATE, base + VT8500_ICPC_IRQ); |
155 | writel(0x00, base + VT8500_ICPC_FIQ); | 157 | writel(0x00, base + VT8500_ICPC_FIQ); |
156 | 158 | ||
157 | for (i = 0; i < 64; i++) { | 159 | /* Disable all interrupts and route them to IRQ */ |
158 | /* Disable all interrupts and route them to IRQ */ | 160 | for (i = 0; i < 64; i++) |
159 | writeb(VT8500_INT_DISABLE | ICDC_IRQ, | 161 | writeb(VT8500_INT_DISABLE | ICDC_IRQ, base + VT8500_ICDC + i); |
160 | base + VT8500_ICDC + i); | ||
161 | } | ||
162 | } | 162 | } |
163 | 163 | ||
164 | static int vt8500_irq_map(struct irq_domain *h, unsigned int virq, | 164 | static int vt8500_irq_map(struct irq_domain *h, unsigned int virq, |
@@ -175,33 +175,67 @@ static struct irq_domain_ops vt8500_irq_domain_ops = { | |||
175 | .xlate = irq_domain_xlate_onecell, | 175 | .xlate = irq_domain_xlate_onecell, |
176 | }; | 176 | }; |
177 | 177 | ||
178 | asmlinkage void __exception_irq_entry vt8500_handle_irq(struct pt_regs *regs) | ||
179 | { | ||
180 | u32 stat, i; | ||
181 | int irqnr, virq; | ||
182 | void __iomem *base; | ||
183 | |||
184 | /* Loop through each active controller */ | ||
185 | for (i=0; i<active_cnt; i++) { | ||
186 | base = intc[i].base; | ||
187 | irqnr = readl_relaxed(base) & 0x3F; | ||
188 | /* | ||
189 | Highest Priority register default = 63, so check that this | ||
190 | is a real interrupt by checking the status register | ||
191 | */ | ||
192 | if (irqnr == 63) { | ||
193 | stat = readl_relaxed(base + VT8500_ICIS + 4); | ||
194 | if (!(stat & BIT(31))) | ||
195 | continue; | ||
196 | } | ||
197 | |||
198 | virq = irq_find_mapping(intc[i].domain, irqnr); | ||
199 | handle_IRQ(virq, regs); | ||
200 | } | ||
201 | } | ||
202 | |||
178 | int __init vt8500_irq_init(struct device_node *node, struct device_node *parent) | 203 | int __init vt8500_irq_init(struct device_node *node, struct device_node *parent) |
179 | { | 204 | { |
180 | struct irq_domain *vt8500_irq_domain; | ||
181 | struct vt8500_irq_priv *priv; | ||
182 | int irq, i; | 205 | int irq, i; |
183 | struct device_node *np = node; | 206 | struct device_node *np = node; |
184 | 207 | ||
185 | priv = kzalloc(sizeof(struct vt8500_irq_priv), GFP_KERNEL); | 208 | if (active_cnt == VT8500_INTC_MAX) { |
186 | priv->base = of_iomap(np, 0); | 209 | pr_err("%s: Interrupt controllers > VT8500_INTC_MAX\n", |
210 | __func__); | ||
211 | goto out; | ||
212 | } | ||
213 | |||
214 | intc[active_cnt].base = of_iomap(np, 0); | ||
215 | intc[active_cnt].domain = irq_domain_add_linear(node, 64, | ||
216 | &vt8500_irq_domain_ops, &intc[active_cnt]); | ||
187 | 217 | ||
188 | vt8500_irq_domain = irq_domain_add_legacy(node, 64, irq_cnt, 0, | 218 | if (!intc[active_cnt].base) { |
189 | &vt8500_irq_domain_ops, priv); | 219 | pr_err("%s: Unable to map IO memory\n", __func__); |
190 | if (!vt8500_irq_domain) | 220 | goto out; |
191 | pr_err("%s: Unable to add wmt irq domain!\n", __func__); | 221 | } |
222 | |||
223 | if (!intc[active_cnt].domain) { | ||
224 | pr_err("%s: Unable to add irq domain!\n", __func__); | ||
225 | goto out; | ||
226 | } | ||
192 | 227 | ||
193 | irq_set_default_host(vt8500_irq_domain); | 228 | vt8500_init_irq_hw(intc[active_cnt].base); |
194 | 229 | ||
195 | vt8500_init_irq_hw(priv->base); | 230 | pr_info("vt8500-irq: Added interrupt controller\n"); |
196 | 231 | ||
197 | pr_info("Added IRQ Controller @ %x [virq_base = %d]\n", | 232 | active_cnt++; |
198 | (u32)(priv->base), irq_cnt); | ||
199 | 233 | ||
200 | /* check if this is a slaved controller */ | 234 | /* check if this is a slaved controller */ |
201 | if (of_irq_count(np) != 0) { | 235 | if (of_irq_count(np) != 0) { |
202 | /* check that we have the correct number of interrupts */ | 236 | /* check that we have the correct number of interrupts */ |
203 | if (of_irq_count(np) != 8) { | 237 | if (of_irq_count(np) != 8) { |
204 | pr_err("%s: Incorrect IRQ map for slave controller\n", | 238 | pr_err("%s: Incorrect IRQ map for slaved controller\n", |
205 | __func__); | 239 | __func__); |
206 | return -EINVAL; | 240 | return -EINVAL; |
207 | } | 241 | } |
@@ -213,9 +247,7 @@ int __init vt8500_irq_init(struct device_node *node, struct device_node *parent) | |||
213 | 247 | ||
214 | pr_info("vt8500-irq: Enabled slave->parent interrupts\n"); | 248 | pr_info("vt8500-irq: Enabled slave->parent interrupts\n"); |
215 | } | 249 | } |
216 | 250 | out: | |
217 | irq_cnt += 64; | ||
218 | |||
219 | return 0; | 251 | return 0; |
220 | } | 252 | } |
221 | 253 | ||
diff --git a/arch/arm/mach-vt8500/vt8500.c b/arch/arm/mach-vt8500/vt8500.c index a5bd28692b06..3c66d48ea082 100644 --- a/arch/arm/mach-vt8500/vt8500.c +++ b/arch/arm/mach-vt8500/vt8500.c | |||
@@ -192,5 +192,6 @@ DT_MACHINE_START(WMT_DT, "VIA/Wondermedia SoC (Device Tree Support)") | |||
192 | .timer = &vt8500_timer, | 192 | .timer = &vt8500_timer, |
193 | .init_machine = vt8500_init, | 193 | .init_machine = vt8500_init, |
194 | .restart = vt8500_restart, | 194 | .restart = vt8500_restart, |
195 | .handle_irq = vt8500_handle_irq, | ||
195 | MACHINE_END | 196 | MACHINE_END |
196 | 197 | ||
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig new file mode 100644 index 000000000000..adb6c0ea0e53 --- /dev/null +++ b/arch/arm/mach-zynq/Kconfig | |||
@@ -0,0 +1,13 @@ | |||
1 | config ARCH_ZYNQ | ||
2 | bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 | ||
3 | select ARM_AMBA | ||
4 | select ARM_GIC | ||
5 | select COMMON_CLK | ||
6 | select CPU_V7 | ||
7 | select GENERIC_CLOCKEVENTS | ||
8 | select ICST | ||
9 | select MIGHT_HAVE_CACHE_L2X0 | ||
10 | select USE_OF | ||
11 | select SPARSE_IRQ | ||
12 | help | ||
13 | Support for Xilinx Zynq ARM Cortex A9 Platform | ||
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 79bf5fb4dad3..e16d4bed0f7a 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -30,10 +30,10 @@ | |||
30 | #include <asm/mach/time.h> | 30 | #include <asm/mach/time.h> |
31 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
32 | #include <asm/page.h> | 32 | #include <asm/page.h> |
33 | #include <asm/pgtable.h> | ||
33 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
34 | #include <asm/hardware/cache-l2x0.h> | 35 | #include <asm/hardware/cache-l2x0.h> |
35 | 36 | ||
36 | #include <mach/zynq_soc.h> | ||
37 | #include "common.h" | 37 | #include "common.h" |
38 | 38 | ||
39 | static struct of_device_id zynq_of_bus_ids[] __initdata = { | 39 | static struct of_device_id zynq_of_bus_ids[] __initdata = { |
@@ -68,32 +68,15 @@ static void __init xilinx_irq_init(void) | |||
68 | of_irq_init(irq_match); | 68 | of_irq_init(irq_match); |
69 | } | 69 | } |
70 | 70 | ||
71 | /* The minimum devices needed to be mapped before the VM system is up and | 71 | #define SCU_PERIPH_PHYS 0xF8F00000 |
72 | * running include the GIC, UART and Timer Counter. | 72 | #define SCU_PERIPH_SIZE SZ_8K |
73 | */ | 73 | #define SCU_PERIPH_VIRT (VMALLOC_END - SCU_PERIPH_SIZE) |
74 | |||
75 | static struct map_desc io_desc[] __initdata = { | ||
76 | { | ||
77 | .virtual = TTC0_VIRT, | ||
78 | .pfn = __phys_to_pfn(TTC0_PHYS), | ||
79 | .length = TTC0_SIZE, | ||
80 | .type = MT_DEVICE, | ||
81 | }, { | ||
82 | .virtual = SCU_PERIPH_VIRT, | ||
83 | .pfn = __phys_to_pfn(SCU_PERIPH_PHYS), | ||
84 | .length = SCU_PERIPH_SIZE, | ||
85 | .type = MT_DEVICE, | ||
86 | }, | ||
87 | |||
88 | #ifdef CONFIG_DEBUG_LL | ||
89 | { | ||
90 | .virtual = LL_UART_VADDR, | ||
91 | .pfn = __phys_to_pfn(LL_UART_PADDR), | ||
92 | .length = UART_SIZE, | ||
93 | .type = MT_DEVICE, | ||
94 | }, | ||
95 | #endif | ||
96 | 74 | ||
75 | static struct map_desc scu_desc __initdata = { | ||
76 | .virtual = SCU_PERIPH_VIRT, | ||
77 | .pfn = __phys_to_pfn(SCU_PERIPH_PHYS), | ||
78 | .length = SCU_PERIPH_SIZE, | ||
79 | .type = MT_DEVICE, | ||
97 | }; | 80 | }; |
98 | 81 | ||
99 | static void __init xilinx_zynq_timer_init(void) | 82 | static void __init xilinx_zynq_timer_init(void) |
@@ -122,7 +105,8 @@ static struct sys_timer xttcpss_sys_timer = { | |||
122 | */ | 105 | */ |
123 | static void __init xilinx_map_io(void) | 106 | static void __init xilinx_map_io(void) |
124 | { | 107 | { |
125 | iotable_init(io_desc, ARRAY_SIZE(io_desc)); | 108 | debug_ll_io_init(); |
109 | iotable_init(&scu_desc, 1); | ||
126 | } | 110 | } |
127 | 111 | ||
128 | static const char *xilinx_dt_match[] = { | 112 | static const char *xilinx_dt_match[] = { |
diff --git a/arch/arm/mach-zynq/include/mach/hardware.h b/arch/arm/mach-zynq/include/mach/hardware.h deleted file mode 100644 index d558d8a94be7..000000000000 --- a/arch/arm/mach-zynq/include/mach/hardware.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* arch/arm/mach-zynq/include/mach/hardware.h | ||
2 | * | ||
3 | * Copyright (C) 2011 Xilinx | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
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 | #ifndef __MACH_HARDWARE_H__ | ||
16 | #define __MACH_HARDWARE_H__ | ||
17 | |||
18 | #endif | ||
diff --git a/arch/arm/mach-zynq/include/mach/irqs.h b/arch/arm/mach-zynq/include/mach/irqs.h deleted file mode 100644 index 5fb04fd3bac8..000000000000 --- a/arch/arm/mach-zynq/include/mach/irqs.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* arch/arm/mach-zynq/include/mach/irqs.h | ||
2 | * | ||
3 | * Copyright (C) 2011 Xilinx | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
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 | #ifndef __MACH_IRQS_H | ||
16 | #define __MACH_IRQS_H | ||
17 | |||
18 | #define ARCH_NR_GPIOS 118 | ||
19 | #define NR_IRQS (128 + ARCH_NR_GPIOS) | ||
20 | |||
21 | #endif | ||
diff --git a/arch/arm/mach-zynq/include/mach/timex.h b/arch/arm/mach-zynq/include/mach/timex.h deleted file mode 100644 index 6c0245e42a5e..000000000000 --- a/arch/arm/mach-zynq/include/mach/timex.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* arch/arm/mach-zynq/include/mach/timex.h | ||
2 | * | ||
3 | * Copyright (C) 2011 Xilinx | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
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 | #ifndef __MACH_TIMEX_H__ | ||
16 | #define __MACH_TIMEX_H__ | ||
17 | |||
18 | /* the following is needed for the system to build but will be removed | ||
19 | in the future, the value is not important but won't hurt | ||
20 | */ | ||
21 | #define CLOCK_TICK_RATE (100 * HZ) | ||
22 | |||
23 | #endif | ||
diff --git a/arch/arm/mach-zynq/include/mach/uart.h b/arch/arm/mach-zynq/include/mach/uart.h deleted file mode 100644 index 5c47c97156f3..000000000000 --- a/arch/arm/mach-zynq/include/mach/uart.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* arch/arm/mach-zynq/include/mach/uart.h | ||
2 | * | ||
3 | * Copyright (C) 2011 Xilinx | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
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 | #ifndef __MACH_UART_H__ | ||
16 | #define __MACH_UART_H__ | ||
17 | |||
18 | #define UART_CR_OFFSET 0x00 /* Control Register [8:0] */ | ||
19 | #define UART_SR_OFFSET 0x2C /* Channel Status [11:0] */ | ||
20 | #define UART_FIFO_OFFSET 0x30 /* FIFO [15:0] or [7:0] */ | ||
21 | |||
22 | #define UART_SR_TXFULL 0x00000010 /* TX FIFO full */ | ||
23 | #define UART_SR_TXEMPTY 0x00000008 /* TX FIFO empty */ | ||
24 | |||
25 | #endif | ||
diff --git a/arch/arm/mach-zynq/include/mach/uncompress.h b/arch/arm/mach-zynq/include/mach/uncompress.h deleted file mode 100644 index af4e8447bfa3..000000000000 --- a/arch/arm/mach-zynq/include/mach/uncompress.h +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | /* arch/arm/mach-zynq/include/mach/uncompress.h | ||
2 | * | ||
3 | * Copyright (C) 2011 Xilinx | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
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 | #ifndef __MACH_UNCOMPRESS_H__ | ||
16 | #define __MACH_UNCOMPRESS_H__ | ||
17 | |||
18 | #include <linux/io.h> | ||
19 | #include <asm/processor.h> | ||
20 | #include <mach/zynq_soc.h> | ||
21 | #include <mach/uart.h> | ||
22 | |||
23 | void arch_decomp_setup(void) | ||
24 | { | ||
25 | } | ||
26 | |||
27 | static inline void flush(void) | ||
28 | { | ||
29 | /* | ||
30 | * Wait while the FIFO is not empty | ||
31 | */ | ||
32 | while (!(__raw_readl(IOMEM(LL_UART_PADDR + UART_SR_OFFSET)) & | ||
33 | UART_SR_TXEMPTY)) | ||
34 | cpu_relax(); | ||
35 | } | ||
36 | |||
37 | #define arch_decomp_wdog() | ||
38 | |||
39 | static void putc(char ch) | ||
40 | { | ||
41 | /* | ||
42 | * Wait for room in the FIFO, then write the char into the FIFO | ||
43 | */ | ||
44 | while (__raw_readl(IOMEM(LL_UART_PADDR + UART_SR_OFFSET)) & | ||
45 | UART_SR_TXFULL) | ||
46 | cpu_relax(); | ||
47 | |||
48 | __raw_writel(ch, IOMEM(LL_UART_PADDR + UART_FIFO_OFFSET)); | ||
49 | } | ||
50 | |||
51 | #endif | ||
diff --git a/arch/arm/mach-zynq/include/mach/zynq_soc.h b/arch/arm/mach-zynq/include/mach/zynq_soc.h deleted file mode 100644 index 5ebbd8e6eeee..000000000000 --- a/arch/arm/mach-zynq/include/mach/zynq_soc.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* arch/arm/mach-zynq/include/mach/zynq_soc.h | ||
2 | * | ||
3 | * Copyright (C) 2011 Xilinx | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
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 | #ifndef __MACH_XILINX_SOC_H__ | ||
16 | #define __MACH_XILINX_SOC_H__ | ||
17 | |||
18 | #include <asm/pgtable.h> | ||
19 | |||
20 | #define PERIPHERAL_CLOCK_RATE 2500000 | ||
21 | |||
22 | /* Static peripheral mappings are mapped at the top of the vmalloc region. The | ||
23 | * early uart mapping causes intermediate problems/failure at certain | ||
24 | * addresses, including the very top of the vmalloc region. Map it at an | ||
25 | * address that is known to work. | ||
26 | */ | ||
27 | #define UART0_PHYS 0xE0000000 | ||
28 | #define UART1_PHYS 0xE0001000 | ||
29 | #define UART_SIZE SZ_4K | ||
30 | #define UART_VIRT 0xF0001000 | ||
31 | |||
32 | #define TTC0_PHYS 0xF8001000 | ||
33 | #define TTC0_SIZE SZ_4K | ||
34 | #define TTC0_VIRT (VMALLOC_END - TTC0_SIZE) | ||
35 | |||
36 | #define SCU_PERIPH_PHYS 0xF8F00000 | ||
37 | #define SCU_PERIPH_SIZE SZ_8K | ||
38 | #define SCU_PERIPH_VIRT (TTC0_VIRT - SCU_PERIPH_SIZE) | ||
39 | |||
40 | #if IS_ENABLED(CONFIG_DEBUG_ZYNQ_UART1) | ||
41 | # define LL_UART_PADDR UART1_PHYS | ||
42 | #else | ||
43 | # define LL_UART_PADDR UART0_PHYS | ||
44 | #endif | ||
45 | |||
46 | #define LL_UART_VADDR UART_VIRT | ||
47 | |||
48 | /* The following are intended for the devices that are mapped early */ | ||
49 | |||
50 | #define TTC0_BASE IOMEM(TTC0_VIRT) | ||
51 | #define SCU_PERIPH_BASE IOMEM(SCU_PERIPH_VIRT) | ||
52 | |||
53 | #endif | ||
diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c index 9662306aa12f..de3df283da74 100644 --- a/arch/arm/mach-zynq/timer.c +++ b/arch/arm/mach-zynq/timer.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/clk-provider.h> | 30 | #include <linux/clk-provider.h> |
31 | 31 | ||
32 | #include <mach/zynq_soc.h> | ||
33 | #include "common.h" | 32 | #include "common.h" |
34 | 33 | ||
35 | /* | 34 | /* |
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig deleted file mode 100644 index 19f55cae5d73..000000000000 --- a/arch/arm/plat-nomadik/Kconfig +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | # We keep common IP's here for Nomadik and other similar | ||
2 | # familiy of processors from ST-Ericsson. At the moment we have | ||
3 | # just MTU, others to follow soon. | ||
4 | |||
5 | config PLAT_NOMADIK | ||
6 | bool | ||
7 | depends on ARCH_NOMADIK || ARCH_U8500 | ||
8 | default y | ||
9 | select CLKSRC_MMIO | ||
10 | help | ||
11 | Common platform code for Nomadik and other ST-Ericsson | ||
12 | platforms. | ||
13 | |||
14 | if PLAT_NOMADIK | ||
15 | |||
16 | config HAS_MTU | ||
17 | bool | ||
18 | help | ||
19 | Support for Multi Timer Unit. MTU provides access | ||
20 | to multiple interrupt generating programmable | ||
21 | 32-bit free running decrementing counters. | ||
22 | |||
23 | config NOMADIK_MTU_SCHED_CLOCK | ||
24 | bool | ||
25 | depends on HAS_MTU | ||
26 | help | ||
27 | Use the Multi Timer Unit as the sched_clock. | ||
28 | |||
29 | endif | ||
diff --git a/arch/arm/plat-nomadik/Makefile b/arch/arm/plat-nomadik/Makefile deleted file mode 100644 index 37c7cdd0f8f0..000000000000 --- a/arch/arm/plat-nomadik/Makefile +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | # arch/arm/plat-nomadik/Makefile | ||
2 | # Copyright 2009 ST-Ericsson | ||
3 | # Licensed under GPLv2 | ||
4 | |||
5 | obj-$(CONFIG_HAS_MTU) += timer.o | ||
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index c58ea9b80b1a..c5a0262251bc 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig | |||
@@ -216,7 +216,7 @@ config HW_RANDOM_MXC_RNGA | |||
216 | 216 | ||
217 | config HW_RANDOM_NOMADIK | 217 | config HW_RANDOM_NOMADIK |
218 | tristate "ST-Ericsson Nomadik Random Number Generator support" | 218 | tristate "ST-Ericsson Nomadik Random Number Generator support" |
219 | depends on HW_RANDOM && PLAT_NOMADIK | 219 | depends on HW_RANDOM && ARCH_NOMADIK |
220 | ---help--- | 220 | ---help--- |
221 | This driver provides kernel-side support for the Random Number | 221 | This driver provides kernel-side support for the Random Number |
222 | Generator hardware found on ST-Ericsson SoCs (8815 and 8500). | 222 | Generator hardware found on ST-Ericsson SoCs (8815 and 8500). |
diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c index 7d0e0258f204..6b889a0e90b3 100644 --- a/drivers/clk/ux500/u8500_clk.c +++ b/drivers/clk/ux500/u8500_clk.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/clk-provider.h> | 12 | #include <linux/clk-provider.h> |
13 | #include <linux/mfd/dbx500-prcmu.h> | 13 | #include <linux/mfd/dbx500-prcmu.h> |
14 | #include <linux/platform_data/clk-ux500.h> | 14 | #include <linux/platform_data/clk-ux500.h> |
15 | 15 | #include <mach/db8500-regs.h> | |
16 | #include "clk.h" | 16 | #include "clk.h" |
17 | 17 | ||
18 | void u8500_clk_init(void) | 18 | void u8500_clk_init(void) |
@@ -160,12 +160,6 @@ void u8500_clk_init(void) | |||
160 | clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT); | 160 | clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT); |
161 | clk_register_clkdev(clk, NULL, "uicc"); | 161 | clk_register_clkdev(clk, NULL, "uicc"); |
162 | 162 | ||
163 | /* | ||
164 | * FIXME: The MTU clocks might need some kind of "parent muxed join" | ||
165 | * and these have no K-clocks. For now, we ignore the missing | ||
166 | * connection to the corresponding P-clocks, p6_mtu0_clk and | ||
167 | * p6_mtu1_clk. Instead timclk is used which is the valid parent. | ||
168 | */ | ||
169 | clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT); | 163 | clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT); |
170 | clk_register_clkdev(clk, NULL, "mtu0"); | 164 | clk_register_clkdev(clk, NULL, "mtu0"); |
171 | clk_register_clkdev(clk, NULL, "mtu1"); | 165 | clk_register_clkdev(clk, NULL, "mtu1"); |
@@ -405,8 +399,11 @@ void u8500_clk_init(void) | |||
405 | 399 | ||
406 | clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", U8500_CLKRST6_BASE, | 400 | clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", U8500_CLKRST6_BASE, |
407 | BIT(6), 0); | 401 | BIT(6), 0); |
402 | clk_register_clkdev(clk, "apb_pclk", "mtu0"); | ||
403 | |||
408 | clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", U8500_CLKRST6_BASE, | 404 | clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", U8500_CLKRST6_BASE, |
409 | BIT(7), 0); | 405 | BIT(7), 0); |
406 | clk_register_clkdev(clk, "apb_pclk", "mtu1"); | ||
410 | 407 | ||
411 | /* PRCC K-clocks | 408 | /* PRCC K-clocks |
412 | * | 409 | * |
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index a0985732f1e2..7fdcbd3f4da5 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
@@ -25,6 +25,21 @@ config ARMADA_370_XP_TIMER | |||
25 | config SUNXI_TIMER | 25 | config SUNXI_TIMER |
26 | bool | 26 | bool |
27 | 27 | ||
28 | config CLKSRC_NOMADIK_MTU | ||
29 | bool | ||
30 | depends on (ARCH_NOMADIK || ARCH_U8500) | ||
31 | select CLKSRC_MMIO | ||
32 | help | ||
33 | Support for Multi Timer Unit. MTU provides access | ||
34 | to multiple interrupt generating programmable | ||
35 | 32-bit free running decrementing counters. | ||
36 | |||
37 | config CLKSRC_NOMADIK_MTU_SCHED_CLOCK | ||
38 | bool | ||
39 | depends on CLKSRC_NOMADIK_MTU | ||
40 | help | ||
41 | Use the Multi Timer Unit as the sched_clock. | ||
42 | |||
28 | config CLKSRC_DBX500_PRCMU | 43 | config CLKSRC_DBX500_PRCMU |
29 | bool "Clocksource PRCMU Timer" | 44 | bool "Clocksource PRCMU Timer" |
30 | depends on UX500_SOC_DB8500 | 45 | depends on UX500_SOC_DB8500 |
@@ -34,7 +49,7 @@ config CLKSRC_DBX500_PRCMU | |||
34 | 49 | ||
35 | config CLKSRC_DBX500_PRCMU_SCHED_CLOCK | 50 | config CLKSRC_DBX500_PRCMU_SCHED_CLOCK |
36 | bool "Clocksource PRCMU Timer sched_clock" | 51 | bool "Clocksource PRCMU Timer sched_clock" |
37 | depends on (CLKSRC_DBX500_PRCMU && !NOMADIK_MTU_SCHED_CLOCK) | 52 | depends on (CLKSRC_DBX500_PRCMU && !CLKSRC_NOMADIK_MTU_SCHED_CLOCK) |
38 | default y | 53 | default y |
39 | help | 54 | help |
40 | Use the always on PRCMU Timer as sched_clock | 55 | Use the always on PRCMU Timer as sched_clock |
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index 36f06de4c5ab..f93453d01673 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile | |||
@@ -11,6 +11,7 @@ obj-$(CONFIG_CLKBLD_I8253) += i8253.o | |||
11 | obj-$(CONFIG_CLKSRC_MMIO) += mmio.o | 11 | obj-$(CONFIG_CLKSRC_MMIO) += mmio.o |
12 | obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o | 12 | obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o |
13 | obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o | 13 | obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o |
14 | obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o | ||
14 | obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o | 15 | obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o |
15 | obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o | 16 | obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o |
16 | obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o | 17 | obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o |
diff --git a/arch/arm/plat-nomadik/timer.c b/drivers/clocksource/nomadik-mtu.c index 9222e5522a43..8914c3c1c88b 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/drivers/clocksource/nomadik-mtu.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/plat-nomadik/timer.c | ||
3 | * | ||
4 | * Copyright (C) 2008 STMicroelectronics | 2 | * Copyright (C) 2008 STMicroelectronics |
5 | * Copyright (C) 2010 Alessandro Rubini | 3 | * Copyright (C) 2010 Alessandro Rubini |
6 | * Copyright (C) 2010 Linus Walleij for ST-Ericsson | 4 | * Copyright (C) 2010 Linus Walleij for ST-Ericsson |
@@ -14,9 +12,11 @@ | |||
14 | #include <linux/irq.h> | 12 | #include <linux/irq.h> |
15 | #include <linux/io.h> | 13 | #include <linux/io.h> |
16 | #include <linux/clockchips.h> | 14 | #include <linux/clockchips.h> |
15 | #include <linux/clocksource.h> | ||
17 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
18 | #include <linux/jiffies.h> | 17 | #include <linux/jiffies.h> |
19 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/platform_data/clocksource-nomadik-mtu.h> | ||
20 | #include <asm/mach/time.h> | 20 | #include <asm/mach/time.h> |
21 | #include <asm/sched_clock.h> | 21 | #include <asm/sched_clock.h> |
22 | 22 | ||
@@ -174,12 +174,18 @@ void nmdk_clksrc_reset(void) | |||
174 | mtu_base + MTU_CR(0)); | 174 | mtu_base + MTU_CR(0)); |
175 | } | 175 | } |
176 | 176 | ||
177 | void __init nmdk_timer_init(void __iomem *base) | 177 | void __init nmdk_timer_init(void __iomem *base, int irq) |
178 | { | 178 | { |
179 | unsigned long rate; | 179 | unsigned long rate; |
180 | struct clk *clk0; | 180 | struct clk *clk0, *pclk0; |
181 | 181 | ||
182 | mtu_base = base; | 182 | mtu_base = base; |
183 | |||
184 | pclk0 = clk_get_sys("mtu0", "apb_pclk"); | ||
185 | BUG_ON(IS_ERR(pclk0)); | ||
186 | BUG_ON(clk_prepare(pclk0) < 0); | ||
187 | BUG_ON(clk_enable(pclk0) < 0); | ||
188 | |||
183 | clk0 = clk_get_sys("mtu0", NULL); | 189 | clk0 = clk_get_sys("mtu0", NULL); |
184 | BUG_ON(IS_ERR(clk0)); | 190 | BUG_ON(IS_ERR(clk0)); |
185 | BUG_ON(clk_prepare(clk0) < 0); | 191 | BUG_ON(clk_prepare(clk0) < 0); |
@@ -201,7 +207,8 @@ void __init nmdk_timer_init(void __iomem *base) | |||
201 | clk_prescale = MTU_CRn_PRESCALE_1; | 207 | clk_prescale = MTU_CRn_PRESCALE_1; |
202 | } | 208 | } |
203 | 209 | ||
204 | nmdk_cycle = (rate + HZ/2) / HZ; | 210 | /* Cycles for periodic mode */ |
211 | nmdk_cycle = DIV_ROUND_CLOSEST(rate, HZ); | ||
205 | 212 | ||
206 | 213 | ||
207 | /* Timer 0 is the free running clocksource */ | 214 | /* Timer 0 is the free running clocksource */ |
@@ -217,7 +224,7 @@ void __init nmdk_timer_init(void __iomem *base) | |||
217 | #endif | 224 | #endif |
218 | 225 | ||
219 | /* Timer 1 is used for events, register irq and clockevents */ | 226 | /* Timer 1 is used for events, register irq and clockevents */ |
220 | setup_irq(IRQ_MTU0, &nmdk_timer_irq); | 227 | setup_irq(irq, &nmdk_timer_irq); |
221 | nmdk_clkevt.cpumask = cpumask_of(0); | 228 | nmdk_clkevt.cpumask = cpumask_of(0); |
222 | clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU); | 229 | clockevents_config_and_register(&nmdk_clkevt, rate, 2, 0xffffffffU); |
223 | } | 230 | } |
diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index bc615cc56266..8bc5fef07e7a 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/regulator/consumer.h> | 24 | #include <linux/regulator/consumer.h> |
25 | #include <linux/semaphore.h> | 25 | #include <linux/semaphore.h> |
26 | #include <linux/platform_data/dma-ste-dma40.h> | ||
26 | 27 | ||
27 | #include <crypto/aes.h> | 28 | #include <crypto/aes.h> |
28 | #include <crypto/algapi.h> | 29 | #include <crypto/algapi.h> |
@@ -30,8 +31,6 @@ | |||
30 | #include <crypto/des.h> | 31 | #include <crypto/des.h> |
31 | #include <crypto/scatterwalk.h> | 32 | #include <crypto/scatterwalk.h> |
32 | 33 | ||
33 | #include <plat/ste_dma40.h> | ||
34 | |||
35 | #include <linux/platform_data/crypto-ux500.h> | 34 | #include <linux/platform_data/crypto-ux500.h> |
36 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
37 | 36 | ||
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index ae55091c2272..23c5573e62dd 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -19,8 +19,7 @@ | |||
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/amba/bus.h> | 20 | #include <linux/amba/bus.h> |
21 | #include <linux/regulator/consumer.h> | 21 | #include <linux/regulator/consumer.h> |
22 | 22 | #include <linux/platform_data/dma-ste-dma40.h> | |
23 | #include <plat/ste_dma40.h> | ||
24 | 23 | ||
25 | #include "dmaengine.h" | 24 | #include "dmaengine.h" |
26 | #include "ste_dma40_ll.h" | 25 | #include "ste_dma40_ll.h" |
diff --git a/drivers/dma/ste_dma40_ll.c b/drivers/dma/ste_dma40_ll.c index cad9e1daedff..851ad56e8409 100644 --- a/drivers/dma/ste_dma40_ll.c +++ b/drivers/dma/ste_dma40_ll.c | |||
@@ -6,7 +6,7 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <plat/ste_dma40.h> | 9 | #include <linux/platform_data/dma-ste-dma40.h> |
10 | 10 | ||
11 | #include "ste_dma40_ll.h" | 11 | #include "ste_dma40_ll.h" |
12 | 12 | ||
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index de0874054e9f..77629d33f03f 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -409,7 +409,7 @@ config KEYBOARD_NEWTON | |||
409 | 409 | ||
410 | config KEYBOARD_NOMADIK | 410 | config KEYBOARD_NOMADIK |
411 | tristate "ST-Ericsson Nomadik SKE keyboard" | 411 | tristate "ST-Ericsson Nomadik SKE keyboard" |
412 | depends on PLAT_NOMADIK | 412 | depends on (ARCH_NOMADIK || ARCH_U8500) |
413 | select INPUT_MATRIXKMAP | 413 | select INPUT_MATRIXKMAP |
414 | help | 414 | help |
415 | Say Y here if you want to use a keypad provided on the SKE controller | 415 | Say Y here if you want to use a keypad provided on the SKE controller |
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 127b00aadae3..3e27c031aeaa 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c | |||
@@ -565,15 +565,10 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) | |||
565 | else | 565 | else |
566 | num_irqs = AB8500_NR_IRQS; | 566 | num_irqs = AB8500_NR_IRQS; |
567 | 567 | ||
568 | if (ab8500->irq_base) { | 568 | /* If ->irq_base is zero this will give a linear mapping */ |
569 | ab8500->domain = irq_domain_add_legacy( | 569 | ab8500->domain = irq_domain_add_simple(NULL, |
570 | NULL, num_irqs, ab8500->irq_base, | 570 | num_irqs, ab8500->irq_base, |
571 | 0, &ab8500_irq_ops, ab8500); | 571 | &ab8500_irq_ops, ab8500); |
572 | } | ||
573 | else { | ||
574 | ab8500->domain = irq_domain_add_linear( | ||
575 | np, num_irqs, &ab8500_irq_ops, ab8500); | ||
576 | } | ||
577 | 572 | ||
578 | if (!ab8500->domain) { | 573 | if (!ab8500->domain) { |
579 | dev_err(ab8500->dev, "Failed to create irqdomain\n"); | 574 | dev_err(ab8500->dev, "Failed to create irqdomain\n"); |
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index dc5691569370..29710565a08f 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -2743,9 +2743,15 @@ static struct irq_domain_ops db8500_irq_ops = { | |||
2743 | 2743 | ||
2744 | static int db8500_irq_init(struct device_node *np) | 2744 | static int db8500_irq_init(struct device_node *np) |
2745 | { | 2745 | { |
2746 | db8500_irq_domain = irq_domain_add_legacy( | 2746 | int irq_base = -1; |
2747 | np, NUM_PRCMU_WAKEUPS, IRQ_PRCMU_BASE, | 2747 | |
2748 | 0, &db8500_irq_ops, NULL); | 2748 | /* In the device tree case, just take some IRQs */ |
2749 | if (!np) | ||
2750 | irq_base = IRQ_PRCMU_BASE; | ||
2751 | |||
2752 | db8500_irq_domain = irq_domain_add_simple( | ||
2753 | np, NUM_PRCMU_WAKEUPS, irq_base, | ||
2754 | &db8500_irq_ops, NULL); | ||
2749 | 2755 | ||
2750 | if (!db8500_irq_domain) { | 2756 | if (!db8500_irq_domain) { |
2751 | pr_err("Failed to create irqdomain\n"); | 2757 | pr_err("Failed to create irqdomain\n"); |
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 531807dec6b3..dae191b3c081 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
@@ -546,7 +546,7 @@ config MTD_NAND_JZ4740 | |||
546 | 546 | ||
547 | config MTD_NAND_FSMC | 547 | config MTD_NAND_FSMC |
548 | tristate "Support for NAND on ST Micros FSMC" | 548 | tristate "Support for NAND on ST Micros FSMC" |
549 | depends on PLAT_SPEAR || PLAT_NOMADIK || MACH_U300 | 549 | depends on PLAT_SPEAR || ARCH_NOMADIK || ARCH_U8500 || MACH_U300 |
550 | help | 550 | help |
551 | Enables support for NAND Flash chips on the ST Microelectronics | 551 | Enables support for NAND Flash chips on the ST Microelectronics |
552 | Flexible Static Memory Controller (FSMC) | 552 | Flexible Static Memory Controller (FSMC) |
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 8ef3e85cb011..ef66f98e9202 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -31,9 +31,8 @@ | |||
31 | /* Since we request GPIOs from ourself */ | 31 | /* Since we request GPIOs from ourself */ |
32 | #include <linux/pinctrl/consumer.h> | 32 | #include <linux/pinctrl/consumer.h> |
33 | #include <linux/platform_data/pinctrl-nomadik.h> | 33 | #include <linux/platform_data/pinctrl-nomadik.h> |
34 | |||
35 | #include <asm/mach/irq.h> | 34 | #include <asm/mach/irq.h> |
36 | 35 | #include <mach/irqs.h> | |
37 | #include "pinctrl-nomadik.h" | 36 | #include "pinctrl-nomadik.h" |
38 | 37 | ||
39 | /* | 38 | /* |
diff --git a/arch/arm/plat-nomadik/include/plat/mtu.h b/include/linux/platform_data/clocksource-nomadik-mtu.h index 582641f3dc01..80088973b734 100644 --- a/arch/arm/plat-nomadik/include/plat/mtu.h +++ b/include/linux/platform_data/clocksource-nomadik-mtu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __PLAT_MTU_H | 1 | #ifndef __PLAT_MTU_H |
2 | #define __PLAT_MTU_H | 2 | #define __PLAT_MTU_H |
3 | 3 | ||
4 | void nmdk_timer_init(void __iomem *base); | 4 | void nmdk_timer_init(void __iomem *base, int irq); |
5 | void nmdk_clkevt_reset(void); | 5 | void nmdk_clkevt_reset(void); |
6 | void nmdk_clksrc_reset(void); | 6 | void nmdk_clksrc_reset(void); |
7 | 7 | ||
diff --git a/include/linux/platform_data/crypto-ux500.h b/include/linux/platform_data/crypto-ux500.h index 5b2d0817e26a..94df96d9a336 100644 --- a/include/linux/platform_data/crypto-ux500.h +++ b/include/linux/platform_data/crypto-ux500.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #ifndef _CRYPTO_UX500_H | 7 | #ifndef _CRYPTO_UX500_H |
8 | #define _CRYPTO_UX500_H | 8 | #define _CRYPTO_UX500_H |
9 | #include <linux/dmaengine.h> | 9 | #include <linux/dmaengine.h> |
10 | #include <plat/ste_dma40.h> | 10 | #include <linux/platform_data/dma-ste-dma40.h> |
11 | 11 | ||
12 | struct hash_platform_data { | 12 | struct hash_platform_data { |
13 | void *mem_to_engine; | 13 | void *mem_to_engine; |
diff --git a/arch/arm/plat-nomadik/include/plat/ste_dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 9ff93b065686..9ff93b065686 100644 --- a/arch/arm/plat-nomadik/include/plat/ste_dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index 1a04e248453c..b55b79f7536c 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c | |||
@@ -18,8 +18,7 @@ | |||
18 | #include <linux/dma-mapping.h> | 18 | #include <linux/dma-mapping.h> |
19 | #include <linux/dmaengine.h> | 19 | #include <linux/dmaengine.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | 21 | #include <linux/platform_data/dma-ste-dma40.h> | |
22 | #include <plat/ste_dma40.h> | ||
23 | 22 | ||
24 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
25 | #include <sound/pcm_params.h> | 24 | #include <sound/pcm_params.h> |