aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 21:49:36 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 21:49:36 -0500
commit0ba3307a8ec35252f7b1e222e32889a6f3d9ceb3 (patch)
tree26126ed7a2080a706f0488c215549fc9f5f76a59 /arch/arm
parent903a9f77d1d00c8621bc37afd959ac45a4b3ebec (diff)
parentcd2f43a1f7400a74a084094502f70df2e169c6e8 (diff)
Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM driver updates from Olof Johansson: "Updates of SoC-near drivers and other driver updates that makes more sense to take through our tree. The largest part of this is a conversion of device registration for some renesas shmobile/sh devices over to use resources. This has required coordination with the corresponding arch/sh changes, and we've agreed to merge the arch/sh changes through our tree. Added in this branch is support for Trusted Foundations secure firmware, which is what is used on many of the commercial Nvidia Tegra products that are in the market, including the Nvidia Shield. The code is local to arch/arm at this time since it's uncertain whether it will be shared with arm64 longer-term, if needed we will refactor later. A couple of new RTC drivers used on ARM boards, merged through our tree on request by the RTC maintainer. ... plus a bunch of smaller updates across the board, gpio conversions for davinci, etc" * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits) watchdog: davinci: rename platform driver to davinci-wdt tty: serial: Limit msm_serial_hs driver to platforms that use it mmc: msm_sdcc: Limit driver to platforms that use it usb: phy: msm: Move mach dependent code to platform data clk: versatile: fixup IM-PD1 clock implementation clk: versatile: pass a name to ICST clock provider ARM: integrator: pass parent IRQ to the SIC irqchip: versatile FPGA: support cascaded interrupts from DT gpio: davinci: don't create irq_domain in case of unbanked irqs gpio: davinci: use chained_irq_enter/chained_irq_exit API gpio: davinci: add OF support gpio: davinci: remove unused variable intc_irq_num gpio: davinci: convert to use irqdomain support. gpio: introduce GPIO_DAVINCI kconfig option gpio: davinci: get rid of DAVINCI_N_GPIO gpio: davinci: use {readl|writel}_relaxed() instead of __raw_* serial: sh-sci: Add OF support serial: sh-sci: Add device tree bindings documentation serial: sh-sci: Remove platform data mapbase and irqs fields serial: sh-sci: Remove platform data scbrr_algo_id field ...
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig4
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boot/dts/integratorcp.dts3
-rw-r--r--arch/arm/configs/tegra_defconfig1
-rw-r--r--arch/arm/firmware/Kconfig28
-rw-r--r--arch/arm/firmware/Makefile1
-rw-r--r--arch/arm/firmware/trusted_foundations.c81
-rw-r--r--arch/arm/include/asm/trusted_foundations.h67
-rw-r--r--arch/arm/mach-davinci/da830.c3
-rw-r--r--arch/arm/mach-davinci/da850.c3
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c2
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c4
-rw-r--r--arch/arm/mach-davinci/devices.c2
-rw-r--r--arch/arm/mach-davinci/dm355.c3
-rw-r--r--arch/arm/mach-davinci/dm365.c3
-rw-r--r--arch/arm/mach-davinci/dm644x.c3
-rw-r--r--arch/arm/mach-davinci/dm646x.c3
-rw-r--r--arch/arm/mach-msm/board-msm7x30.c35
-rw-r--r--arch/arm/mach-msm/board-qsd8x50.c35
-rw-r--r--arch/arm/mach-tegra/Kconfig1
-rw-r--r--arch/arm/mach-tegra/reset.c40
-rw-r--r--arch/arm/mach-tegra/tegra.c2
22 files changed, 298 insertions, 27 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 35e6d6b5d7d1..f9b0fd387c6f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -317,6 +317,8 @@ config ARCH_INTEGRATOR
317 bool "ARM Ltd. Integrator family" 317 bool "ARM Ltd. Integrator family"
318 select ARCH_HAS_CPUFREQ 318 select ARCH_HAS_CPUFREQ
319 select ARM_AMBA 319 select ARM_AMBA
320 select ARM_PATCH_PHYS_VIRT
321 select AUTO_ZRELADDR
320 select COMMON_CLK 322 select COMMON_CLK
321 select COMMON_CLK_VERSATILE 323 select COMMON_CLK_VERSATILE
322 select GENERIC_CLOCKEVENTS 324 select GENERIC_CLOCKEVENTS
@@ -1084,6 +1086,8 @@ config ARM_TIMER_SP804
1084 select CLKSRC_MMIO 1086 select CLKSRC_MMIO
1085 select CLKSRC_OF if OF 1087 select CLKSRC_OF if OF
1086 1088
1089source "arch/arm/firmware/Kconfig"
1090
1087source arch/arm/mm/Kconfig 1091source arch/arm/mm/Kconfig
1088 1092
1089config ARM_NR_BANKS 1093config ARM_NR_BANKS
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d8605046792c..23d5e3946589 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -267,6 +267,7 @@ core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
267core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ 267core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
268core-y += arch/arm/net/ 268core-y += arch/arm/net/
269core-y += arch/arm/crypto/ 269core-y += arch/arm/crypto/
270core-y += arch/arm/firmware/
270core-y += $(machdirs) $(platdirs) 271core-y += $(machdirs) $(platdirs)
271 272
272drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ 273drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts
index 7deb3a3182b4..a21c17de9a5e 100644
--- a/arch/arm/boot/dts/integratorcp.dts
+++ b/arch/arm/boot/dts/integratorcp.dts
@@ -47,8 +47,11 @@
47 valid-mask = <0x00000007>; 47 valid-mask = <0x00000007>;
48 }; 48 };
49 49
50 /* The SIC is cascaded off IRQ 26 on the PIC */
50 sic: sic@ca000000 { 51 sic: sic@ca000000 {
51 compatible = "arm,versatile-fpga-irq"; 52 compatible = "arm,versatile-fpga-irq";
53 interrupt-parent = <&pic>;
54 interrupts = <26>;
52 #interrupt-cells = <1>; 55 #interrupt-cells = <1>;
53 interrupt-controller; 56 interrupt-controller;
54 reg = <0xca000000 0x100>; 57 reg = <0xca000000 0x100>;
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index e38653876541..5fdc9a09d339 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -33,6 +33,7 @@ CONFIG_PCI=y
33CONFIG_PCI_MSI=y 33CONFIG_PCI_MSI=y
34CONFIG_PCI_TEGRA=y 34CONFIG_PCI_TEGRA=y
35CONFIG_PCIEPORTBUS=y 35CONFIG_PCIEPORTBUS=y
36CONFIG_TRUSTED_FOUNDATIONS=y
36CONFIG_SMP=y 37CONFIG_SMP=y
37CONFIG_PREEMPT=y 38CONFIG_PREEMPT=y
38CONFIG_AEABI=y 39CONFIG_AEABI=y
diff --git a/arch/arm/firmware/Kconfig b/arch/arm/firmware/Kconfig
new file mode 100644
index 000000000000..bb00ccf00d66
--- /dev/null
+++ b/arch/arm/firmware/Kconfig
@@ -0,0 +1,28 @@
1config ARCH_SUPPORTS_FIRMWARE
2 bool
3
4config ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
5 bool
6 select ARCH_SUPPORTS_FIRMWARE
7
8menu "Firmware options"
9 depends on ARCH_SUPPORTS_FIRMWARE
10
11config TRUSTED_FOUNDATIONS
12 bool "Trusted Foundations secure monitor support"
13 depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
14 help
15 Some devices (including most Tegra-based consumer devices on the
16 market) are booted with the Trusted Foundations secure monitor
17 active, requiring some core operations to be performed by the secure
18 monitor instead of the kernel.
19
20 This option allows the kernel to invoke the secure monitor whenever
21 required on devices using Trusted Foundations. See
22 arch/arm/include/asm/trusted_foundations.h or the
23 tl,trusted-foundations device tree binding documentation for details
24 on how to use it.
25
26 Say n if you don't know what this is about.
27
28endmenu
diff --git a/arch/arm/firmware/Makefile b/arch/arm/firmware/Makefile
new file mode 100644
index 000000000000..a71f16536b6c
--- /dev/null
+++ b/arch/arm/firmware/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
diff --git a/arch/arm/firmware/trusted_foundations.c b/arch/arm/firmware/trusted_foundations.c
new file mode 100644
index 000000000000..ef1e3d8f4af0
--- /dev/null
+++ b/arch/arm/firmware/trusted_foundations.c
@@ -0,0 +1,81 @@
1/*
2 * Trusted Foundations support for ARM CPUs
3 *
4 * Copyright (c) 2013, NVIDIA Corporation.
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, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 */
16
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/of.h>
20#include <asm/firmware.h>
21#include <asm/trusted_foundations.h>
22
23#define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200
24
25static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2)
26{
27 asm volatile(
28 ".arch_extension sec\n\t"
29 "stmfd sp!, {r4 - r11, lr}\n\t"
30 __asmeq("%0", "r0")
31 __asmeq("%1", "r1")
32 __asmeq("%2", "r2")
33 "mov r3, #0\n\t"
34 "mov r4, #0\n\t"
35 "smc #0\n\t"
36 "ldmfd sp!, {r4 - r11, pc}"
37 :
38 : "r" (type), "r" (arg1), "r" (arg2)
39 : "memory");
40}
41
42static int tf_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
43{
44 tf_generic_smc(TF_SET_CPU_BOOT_ADDR_SMC, boot_addr, 0);
45
46 return 0;
47}
48
49static const struct firmware_ops trusted_foundations_ops = {
50 .set_cpu_boot_addr = tf_set_cpu_boot_addr,
51};
52
53void register_trusted_foundations(struct trusted_foundations_platform_data *pd)
54{
55 /*
56 * we are not using version information for now since currently
57 * supported SMCs are compatible with all TF releases
58 */
59 register_firmware_ops(&trusted_foundations_ops);
60}
61
62void of_register_trusted_foundations(void)
63{
64 struct device_node *node;
65 struct trusted_foundations_platform_data pdata;
66 int err;
67
68 node = of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations");
69 if (!node)
70 return;
71
72 err = of_property_read_u32(node, "tlm,version-major",
73 &pdata.version_major);
74 if (err != 0)
75 panic("Trusted Foundation: missing version-major property\n");
76 err = of_property_read_u32(node, "tlm,version-minor",
77 &pdata.version_minor);
78 if (err != 0)
79 panic("Trusted Foundation: missing version-minor property\n");
80 register_trusted_foundations(&pdata);
81}
diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h
new file mode 100644
index 000000000000..3bd36e2c5f2e
--- /dev/null
+++ b/arch/arm/include/asm/trusted_foundations.h
@@ -0,0 +1,67 @@
1/*
2 * Copyright (c) 2013, NVIDIA Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 */
14
15/*
16 * Support for the Trusted Foundations secure monitor.
17 *
18 * Trusted Foundation comes active on some ARM consumer devices (most
19 * Tegra-based devices sold on the market are concerned). Such devices can only
20 * perform some basic operations, like setting the CPU reset vector, through
21 * SMC calls to the secure monitor. The calls are completely specific to
22 * Trusted Foundations, and do *not* follow the SMC calling convention or the
23 * PSCI standard.
24 */
25
26#ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H
27#define __ASM_ARM_TRUSTED_FOUNDATIONS_H
28
29#include <linux/kconfig.h>
30#include <linux/printk.h>
31#include <linux/bug.h>
32#include <linux/of.h>
33
34struct trusted_foundations_platform_data {
35 unsigned int version_major;
36 unsigned int version_minor;
37};
38
39#if IS_ENABLED(CONFIG_TRUSTED_FOUNDATIONS)
40
41void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
42void of_register_trusted_foundations(void);
43
44#else /* CONFIG_TRUSTED_FOUNDATIONS */
45
46static inline void register_trusted_foundations(
47 struct trusted_foundations_platform_data *pd)
48{
49 /*
50 * If we try to register TF, this means the system needs it to continue.
51 * Its absence if thus a fatal error.
52 */
53 panic("No support for Trusted Foundations, stopping...\n");
54}
55
56static inline void of_register_trusted_foundations(void)
57{
58 /*
59 * If we find the target should enable TF but does not support it,
60 * fail as the system won't be able to do much anyway
61 */
62 if (of_find_compatible_node(NULL, NULL, "tl,trusted-foundations"))
63 register_trusted_foundations(NULL);
64}
65#endif /* CONFIG_TRUSTED_FOUNDATIONS */
66
67#endif
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 0813b5167e05..115d5736da80 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -385,7 +385,7 @@ static struct clk_lookup da830_clks[] = {
385 CLK(NULL, "pll0_sysclk7", &pll0_sysclk7), 385 CLK(NULL, "pll0_sysclk7", &pll0_sysclk7),
386 CLK("i2c_davinci.1", NULL, &i2c0_clk), 386 CLK("i2c_davinci.1", NULL, &i2c0_clk),
387 CLK(NULL, "timer0", &timerp64_0_clk), 387 CLK(NULL, "timer0", &timerp64_0_clk),
388 CLK("watchdog", NULL, &timerp64_1_clk), 388 CLK("davinci-wdt", NULL, &timerp64_1_clk),
389 CLK(NULL, "arm_rom", &arm_rom_clk), 389 CLK(NULL, "arm_rom", &arm_rom_clk),
390 CLK(NULL, "scr0_ss", &scr0_ss_clk), 390 CLK(NULL, "scr0_ss", &scr0_ss_clk),
391 CLK(NULL, "scr1_ss", &scr1_ss_clk), 391 CLK(NULL, "scr1_ss", &scr1_ss_clk),
@@ -1153,7 +1153,6 @@ static struct davinci_id da830_ids[] = {
1153 1153
1154static struct davinci_gpio_platform_data da830_gpio_platform_data = { 1154static struct davinci_gpio_platform_data da830_gpio_platform_data = {
1155 .ngpio = 128, 1155 .ngpio = 128,
1156 .intc_irq_num = DA830_N_CP_INTC_IRQ,
1157}; 1156};
1158 1157
1159int __init da830_register_gpio(void) 1158int __init da830_register_gpio(void)
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 352984e1528a..2ab00434b2eb 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -443,7 +443,7 @@ static struct clk_lookup da850_clks[] = {
443 CLK(NULL, "pll1_sysclk3", &pll1_sysclk3), 443 CLK(NULL, "pll1_sysclk3", &pll1_sysclk3),
444 CLK("i2c_davinci.1", NULL, &i2c0_clk), 444 CLK("i2c_davinci.1", NULL, &i2c0_clk),
445 CLK(NULL, "timer0", &timerp64_0_clk), 445 CLK(NULL, "timer0", &timerp64_0_clk),
446 CLK("watchdog", NULL, &timerp64_1_clk), 446 CLK("davinci-wdt", NULL, &timerp64_1_clk),
447 CLK(NULL, "arm_rom", &arm_rom_clk), 447 CLK(NULL, "arm_rom", &arm_rom_clk),
448 CLK(NULL, "tpcc0", &tpcc0_clk), 448 CLK(NULL, "tpcc0", &tpcc0_clk),
449 CLK(NULL, "tptc0", &tptc0_clk), 449 CLK(NULL, "tptc0", &tptc0_clk),
@@ -1283,7 +1283,6 @@ int __init da850_register_vpif_capture(struct vpif_capture_config
1283 1283
1284static struct davinci_gpio_platform_data da850_gpio_platform_data = { 1284static struct davinci_gpio_platform_data da850_gpio_platform_data = {
1285 .ngpio = 144, 1285 .ngpio = 144,
1286 .intc_irq_num = DA850_N_CP_INTC_IRQ,
1287}; 1286};
1288 1287
1289int __init da850_register_gpio(void) 1288int __init da850_register_gpio(void)
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index d2bc574ae172..ed1928740b5f 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -32,7 +32,7 @@ static void __init da8xx_init_irq(void)
32 32
33static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { 33static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
34 OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), 34 OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
35 OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), 35 OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "davinci-wdt", NULL),
36 OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL), 36 OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL),
37 OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL), 37 OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL),
38 OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL), 38 OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL),
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 78829c513fdc..0486cdf28c8d 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -389,7 +389,7 @@ static struct resource da8xx_watchdog_resources[] = {
389}; 389};
390 390
391static struct platform_device da8xx_wdt_device = { 391static struct platform_device da8xx_wdt_device = {
392 .name = "watchdog", 392 .name = "davinci-wdt",
393 .id = -1, 393 .id = -1,
394 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), 394 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources),
395 .resource = da8xx_watchdog_resources, 395 .resource = da8xx_watchdog_resources,
@@ -399,7 +399,7 @@ void da8xx_restart(enum reboot_mode mode, const char *cmd)
399{ 399{
400 struct device *dev; 400 struct device *dev;
401 401
402 dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog"); 402 dev = bus_find_device_by_name(&platform_bus_type, NULL, "davinci-wdt");
403 if (!dev) { 403 if (!dev) {
404 pr_err("%s: failed to find watchdog device\n", __func__); 404 pr_err("%s: failed to find watchdog device\n", __func__);
405 return; 405 return;
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 3996e98f52fb..5cf9a027dcc6 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -302,7 +302,7 @@ static struct resource wdt_resources[] = {
302}; 302};
303 303
304struct platform_device davinci_wdt_device = { 304struct platform_device davinci_wdt_device = {
305 .name = "watchdog", 305 .name = "davinci-wdt",
306 .id = -1, 306 .id = -1,
307 .num_resources = ARRAY_SIZE(wdt_resources), 307 .num_resources = ARRAY_SIZE(wdt_resources),
308 .resource = wdt_resources, 308 .resource = wdt_resources,
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 6117fc644188..4668c0e19767 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -375,7 +375,7 @@ static struct clk_lookup dm355_clks[] = {
375 CLK(NULL, "pwm3", &pwm3_clk), 375 CLK(NULL, "pwm3", &pwm3_clk),
376 CLK(NULL, "timer0", &timer0_clk), 376 CLK(NULL, "timer0", &timer0_clk),
377 CLK(NULL, "timer1", &timer1_clk), 377 CLK(NULL, "timer1", &timer1_clk),
378 CLK("watchdog", NULL, &timer2_clk), 378 CLK("davinci-wdt", NULL, &timer2_clk),
379 CLK(NULL, "timer3", &timer3_clk), 379 CLK(NULL, "timer3", &timer3_clk),
380 CLK(NULL, "rto", &rto_clk), 380 CLK(NULL, "rto", &rto_clk),
381 CLK(NULL, "usb", &usb_clk), 381 CLK(NULL, "usb", &usb_clk),
@@ -901,7 +901,6 @@ static struct resource dm355_gpio_resources[] = {
901 901
902static struct davinci_gpio_platform_data dm355_gpio_platform_data = { 902static struct davinci_gpio_platform_data dm355_gpio_platform_data = {
903 .ngpio = 104, 903 .ngpio = 104,
904 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
905}; 904};
906 905
907int __init dm355_gpio_register(void) 906int __init dm355_gpio_register(void)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index d7c6f85d3fc9..b44b49e2801a 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -473,7 +473,7 @@ static struct clk_lookup dm365_clks[] = {
473 CLK(NULL, "pwm3", &pwm3_clk), 473 CLK(NULL, "pwm3", &pwm3_clk),
474 CLK(NULL, "timer0", &timer0_clk), 474 CLK(NULL, "timer0", &timer0_clk),
475 CLK(NULL, "timer1", &timer1_clk), 475 CLK(NULL, "timer1", &timer1_clk),
476 CLK("watchdog", NULL, &timer2_clk), 476 CLK("davinci-wdt", NULL, &timer2_clk),
477 CLK(NULL, "timer3", &timer3_clk), 477 CLK(NULL, "timer3", &timer3_clk),
478 CLK(NULL, "usb", &usb_clk), 478 CLK(NULL, "usb", &usb_clk),
479 CLK("davinci_emac.1", NULL, &emac_clk), 479 CLK("davinci_emac.1", NULL, &emac_clk),
@@ -713,7 +713,6 @@ static struct resource dm365_gpio_resources[] = {
713 713
714static struct davinci_gpio_platform_data dm365_gpio_platform_data = { 714static struct davinci_gpio_platform_data dm365_gpio_platform_data = {
715 .ngpio = 104, 715 .ngpio = 104,
716 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
717 .gpio_unbanked = 8, 716 .gpio_unbanked = 8,
718}; 717};
719 718
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 3ce47997bb46..5c3e0be95ef3 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -322,7 +322,7 @@ static struct clk_lookup dm644x_clks[] = {
322 CLK(NULL, "pwm2", &pwm2_clk), 322 CLK(NULL, "pwm2", &pwm2_clk),
323 CLK(NULL, "timer0", &timer0_clk), 323 CLK(NULL, "timer0", &timer0_clk),
324 CLK(NULL, "timer1", &timer1_clk), 324 CLK(NULL, "timer1", &timer1_clk),
325 CLK("watchdog", NULL, &timer2_clk), 325 CLK("davinci-wdt", NULL, &timer2_clk),
326 CLK(NULL, NULL, NULL), 326 CLK(NULL, NULL, NULL),
327}; 327};
328 328
@@ -787,7 +787,6 @@ static struct resource dm644_gpio_resources[] = {
787 787
788static struct davinci_gpio_platform_data dm644_gpio_platform_data = { 788static struct davinci_gpio_platform_data dm644_gpio_platform_data = {
789 .ngpio = 71, 789 .ngpio = 71,
790 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
791}; 790};
792 791
793int __init dm644x_gpio_register(void) 792int __init dm644x_gpio_register(void)
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 0e81fea65e7f..81768dd47096 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -356,7 +356,7 @@ static struct clk_lookup dm646x_clks[] = {
356 CLK(NULL, "pwm1", &pwm1_clk), 356 CLK(NULL, "pwm1", &pwm1_clk),
357 CLK(NULL, "timer0", &timer0_clk), 357 CLK(NULL, "timer0", &timer0_clk),
358 CLK(NULL, "timer1", &timer1_clk), 358 CLK(NULL, "timer1", &timer1_clk),
359 CLK("watchdog", NULL, &timer2_clk), 359 CLK("davinci-wdt", NULL, &timer2_clk),
360 CLK("palm_bk3710", NULL, &ide_clk), 360 CLK("palm_bk3710", NULL, &ide_clk),
361 CLK(NULL, "vpif0", &vpif0_clk), 361 CLK(NULL, "vpif0", &vpif0_clk),
362 CLK(NULL, "vpif1", &vpif1_clk), 362 CLK(NULL, "vpif1", &vpif1_clk),
@@ -763,7 +763,6 @@ static struct resource dm646x_gpio_resources[] = {
763 763
764static struct davinci_gpio_platform_data dm646x_gpio_platform_data = { 764static struct davinci_gpio_platform_data dm646x_gpio_platform_data = {
765 .ngpio = 43, 765 .ngpio = 43,
766 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
767}; 766};
768 767
769int __init dm646x_gpio_register(void) 768int __init dm646x_gpio_register(void)
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index f9af5a46e8b6..46de789ad3ae 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -30,6 +30,7 @@
30#include <asm/memory.h> 30#include <asm/memory.h>
31#include <asm/setup.h> 31#include <asm/setup.h>
32 32
33#include <mach/clk.h>
33#include <mach/msm_iomap.h> 34#include <mach/msm_iomap.h>
34#include <mach/dma.h> 35#include <mach/dma.h>
35 36
@@ -60,10 +61,44 @@ static int hsusb_phy_init_seq[] = {
60 -1 61 -1
61}; 62};
62 63
64static int hsusb_link_clk_reset(struct clk *link_clk, bool assert)
65{
66 int ret;
67
68 if (assert) {
69 ret = clk_reset(link_clk, CLK_RESET_ASSERT);
70 if (ret)
71 pr_err("usb hs_clk assert failed\n");
72 } else {
73 ret = clk_reset(link_clk, CLK_RESET_DEASSERT);
74 if (ret)
75 pr_err("usb hs_clk deassert failed\n");
76 }
77 return ret;
78}
79
80static int hsusb_phy_clk_reset(struct clk *phy_clk)
81{
82 int ret;
83
84 ret = clk_reset(phy_clk, CLK_RESET_ASSERT);
85 if (ret) {
86 pr_err("usb phy clk assert failed\n");
87 return ret;
88 }
89 usleep_range(10000, 12000);
90 ret = clk_reset(phy_clk, CLK_RESET_DEASSERT);
91 if (ret)
92 pr_err("usb phy clk deassert failed\n");
93 return ret;
94}
95
63static struct msm_otg_platform_data msm_otg_pdata = { 96static struct msm_otg_platform_data msm_otg_pdata = {
64 .phy_init_seq = hsusb_phy_init_seq, 97 .phy_init_seq = hsusb_phy_init_seq,
65 .mode = USB_PERIPHERAL, 98 .mode = USB_PERIPHERAL,
66 .otg_control = OTG_PHY_CONTROL, 99 .otg_control = OTG_PHY_CONTROL,
100 .link_clk_reset = hsusb_link_clk_reset,
101 .phy_clk_reset = hsusb_phy_clk_reset,
67}; 102};
68 103
69struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { 104struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index 5f933bc50783..9169ec324a43 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -31,6 +31,7 @@
31#include <mach/irqs.h> 31#include <mach/irqs.h>
32#include <mach/sirc.h> 32#include <mach/sirc.h>
33#include <mach/vreg.h> 33#include <mach/vreg.h>
34#include <mach/clk.h>
34#include <linux/platform_data/mmc-msm_sdcc.h> 35#include <linux/platform_data/mmc-msm_sdcc.h>
35 36
36#include "devices.h" 37#include "devices.h"
@@ -81,10 +82,44 @@ static int hsusb_phy_init_seq[] = {
81 -1 82 -1
82}; 83};
83 84
85static int hsusb_link_clk_reset(struct clk *link_clk, bool assert)
86{
87 int ret;
88
89 if (assert) {
90 ret = clk_reset(link_clk, CLK_RESET_ASSERT);
91 if (ret)
92 pr_err("usb hs_clk assert failed\n");
93 } else {
94 ret = clk_reset(link_clk, CLK_RESET_DEASSERT);
95 if (ret)
96 pr_err("usb hs_clk deassert failed\n");
97 }
98 return ret;
99}
100
101static int hsusb_phy_clk_reset(struct clk *phy_clk)
102{
103 int ret;
104
105 ret = clk_reset(phy_clk, CLK_RESET_ASSERT);
106 if (ret) {
107 pr_err("usb phy clk assert failed\n");
108 return ret;
109 }
110 usleep_range(10000, 12000);
111 ret = clk_reset(phy_clk, CLK_RESET_DEASSERT);
112 if (ret)
113 pr_err("usb phy clk deassert failed\n");
114 return ret;
115}
116
84static struct msm_otg_platform_data msm_otg_pdata = { 117static struct msm_otg_platform_data msm_otg_pdata = {
85 .phy_init_seq = hsusb_phy_init_seq, 118 .phy_init_seq = hsusb_phy_init_seq,
86 .mode = USB_PERIPHERAL, 119 .mode = USB_PERIPHERAL,
87 .otg_control = OTG_PHY_CONTROL, 120 .otg_control = OTG_PHY_CONTROL,
121 .link_clk_reset = hsusb_link_clk_reset,
122 .phy_clk_reset = hsusb_phy_clk_reset,
88}; 123};
89 124
90static struct platform_device *devices[] __initdata = { 125static struct platform_device *devices[] __initdata = {
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index d1a12a496525..b1232d8be6f5 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -2,6 +2,7 @@ config ARCH_TEGRA
2 bool "NVIDIA Tegra" if ARCH_MULTI_V7 2 bool "NVIDIA Tegra" if ARCH_MULTI_V7
3 select ARCH_HAS_CPUFREQ 3 select ARCH_HAS_CPUFREQ
4 select ARCH_REQUIRE_GPIOLIB 4 select ARCH_REQUIRE_GPIOLIB
5 select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
5 select ARM_GIC 6 select ARM_GIC
6 select CLKSRC_MMIO 7 select CLKSRC_MMIO
7 select CLKSRC_OF 8 select CLKSRC_OF
diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c
index 568f5bbf979d..146fe8e0ae7c 100644
--- a/arch/arm/mach-tegra/reset.c
+++ b/arch/arm/mach-tegra/reset.c
@@ -21,6 +21,7 @@
21 21
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/hardware/cache-l2x0.h> 23#include <asm/hardware/cache-l2x0.h>
24#include <asm/firmware.h>
24 25
25#include "iomap.h" 26#include "iomap.h"
26#include "irammap.h" 27#include "irammap.h"
@@ -33,26 +34,18 @@
33 34
34static bool is_enabled; 35static bool is_enabled;
35 36
36static void __init tegra_cpu_reset_handler_enable(void) 37static void __init tegra_cpu_reset_handler_set(const u32 reset_address)
37{ 38{
38 void __iomem *iram_base = IO_ADDRESS(TEGRA_IRAM_RESET_BASE);
39 void __iomem *evp_cpu_reset = 39 void __iomem *evp_cpu_reset =
40 IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE + 0x100); 40 IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE + 0x100);
41 void __iomem *sb_ctrl = IO_ADDRESS(TEGRA_SB_BASE); 41 void __iomem *sb_ctrl = IO_ADDRESS(TEGRA_SB_BASE);
42 u32 reg; 42 u32 reg;
43 43
44 BUG_ON(is_enabled);
45 BUG_ON(tegra_cpu_reset_handler_size > TEGRA_IRAM_RESET_HANDLER_SIZE);
46
47 memcpy(iram_base, (void *)__tegra_cpu_reset_handler_start,
48 tegra_cpu_reset_handler_size);
49
50 /* 44 /*
51 * NOTE: This must be the one and only write to the EVP CPU reset 45 * NOTE: This must be the one and only write to the EVP CPU reset
52 * vector in the entire system. 46 * vector in the entire system.
53 */ 47 */
54 writel(TEGRA_IRAM_RESET_BASE + tegra_cpu_reset_handler_offset, 48 writel(reset_address, evp_cpu_reset);
55 evp_cpu_reset);
56 wmb(); 49 wmb();
57 reg = readl(evp_cpu_reset); 50 reg = readl(evp_cpu_reset);
58 51
@@ -66,8 +59,33 @@ static void __init tegra_cpu_reset_handler_enable(void)
66 writel(reg, sb_ctrl); 59 writel(reg, sb_ctrl);
67 wmb(); 60 wmb();
68 } 61 }
62}
63
64static void __init tegra_cpu_reset_handler_enable(void)
65{
66 void __iomem *iram_base = IO_ADDRESS(TEGRA_IRAM_RESET_BASE);
67 const u32 reset_address = TEGRA_IRAM_RESET_BASE +
68 tegra_cpu_reset_handler_offset;
69 int err;
70
71 BUG_ON(is_enabled);
72 BUG_ON(tegra_cpu_reset_handler_size > TEGRA_IRAM_RESET_HANDLER_SIZE);
69 73
70 is_enabled = true; 74 memcpy(iram_base, (void *)__tegra_cpu_reset_handler_start,
75 tegra_cpu_reset_handler_size);
76
77 err = call_firmware_op(set_cpu_boot_addr, 0, reset_address);
78 switch (err) {
79 case -ENOSYS:
80 tegra_cpu_reset_handler_set(reset_address);
81 /* pass-through */
82 case 0:
83 is_enabled = true;
84 break;
85 default:
86 pr_crit("Cannot set CPU reset handler: %d\n", err);
87 BUG();
88 }
71} 89}
72 90
73void __init tegra_cpu_reset_handler_init(void) 91void __init tegra_cpu_reset_handler_init(void)
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index ea14d380fc0c..303a285d80fd 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -40,6 +40,7 @@
40#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
41#include <asm/mach/time.h> 41#include <asm/mach/time.h>
42#include <asm/setup.h> 42#include <asm/setup.h>
43#include <asm/trusted_foundations.h>
43 44
44#include "apbio.h" 45#include "apbio.h"
45#include "board.h" 46#include "board.h"
@@ -88,6 +89,7 @@ static void __init tegra_init_cache(void)
88 89
89static void __init tegra_init_early(void) 90static void __init tegra_init_early(void)
90{ 91{
92 of_register_trusted_foundations();
91 tegra_apb_io_init(); 93 tegra_apb_io_init();
92 tegra_init_fuse(); 94 tegra_init_fuse();
93 tegra_cpu_reset_handler_init(); 95 tegra_cpu_reset_handler_init();