diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2013-09-22 13:48:48 -0400 |
---|---|---|
committer | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2013-09-22 13:48:48 -0400 |
commit | 615c924febda9e219a9b6e43512b322f25bd995a (patch) | |
tree | 957a2815fe853c85d16e4722c655ce148f16c373 | |
parent | 272b98c6455f00884f0350f775c5342358ebb73f (diff) | |
parent | d2207071b3c74b144a860cbe6a46496a44963972 (diff) |
Merge tag 'tegra-for-3.13-deps-for-arm-init-time-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into clk-of-init-v2_for-3.13
ARM: tegra: dependencies for ARM .init_time cleanup
This patch is a dependency for Sebastian Hesselbarth's series that
cleans up the ARM machine descriptor's .init_time hook. It may also end
up being a dependency for cleanup/development in the Tegra tree, and
hence is contained in its own topic branch, to allow conflicts to be
easily resolved.
-rw-r--r-- | arch/arm/mach-tegra/common.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/pmc.c | 41 | ||||
-rw-r--r-- | arch/arm/mach-tegra/pmc.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra.c | 12 |
4 files changed, 35 insertions, 23 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 94a119a35af8..58dc91c56ccb 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/reboot.h> | 25 | #include <linux/reboot.h> |
26 | #include <linux/irqchip.h> | 26 | #include <linux/irqchip.h> |
27 | #include <linux/clk-provider.h> | ||
28 | 27 | ||
29 | #include <asm/hardware/cache-l2x0.h> | 28 | #include <asm/hardware/cache-l2x0.h> |
30 | 29 | ||
@@ -61,8 +60,7 @@ u32 tegra_uart_config[4] = { | |||
61 | #ifdef CONFIG_OF | 60 | #ifdef CONFIG_OF |
62 | void __init tegra_dt_init_irq(void) | 61 | void __init tegra_dt_init_irq(void) |
63 | { | 62 | { |
64 | of_clk_init(NULL); | 63 | tegra_pmc_init_irq(); |
65 | tegra_pmc_init(); | ||
66 | tegra_init_irq(); | 64 | tegra_init_irq(); |
67 | irqchip_init(); | 65 | irqchip_init(); |
68 | tegra_legacy_irq_syscore_init(); | 66 | tegra_legacy_irq_syscore_init(); |
diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c index 8acb881f7cfe..7916ff91f969 100644 --- a/arch/arm/mach-tegra/pmc.c +++ b/arch/arm/mach-tegra/pmc.c | |||
@@ -285,13 +285,10 @@ static const struct of_device_id matches[] __initconst = { | |||
285 | { } | 285 | { } |
286 | }; | 286 | }; |
287 | 287 | ||
288 | static void __init tegra_pmc_parse_dt(void) | 288 | void __init tegra_pmc_init_irq(void) |
289 | { | 289 | { |
290 | struct device_node *np; | 290 | struct device_node *np; |
291 | u32 prop; | 291 | u32 val; |
292 | enum tegra_suspend_mode suspend_mode; | ||
293 | u32 core_good_time[2] = {0, 0}; | ||
294 | u32 lp0_vec[2] = {0, 0}; | ||
295 | 292 | ||
296 | np = of_find_matching_node(NULL, matches); | 293 | np = of_find_matching_node(NULL, matches); |
297 | BUG_ON(!np); | 294 | BUG_ON(!np); |
@@ -300,6 +297,26 @@ static void __init tegra_pmc_parse_dt(void) | |||
300 | 297 | ||
301 | tegra_pmc_invert_interrupt = of_property_read_bool(np, | 298 | tegra_pmc_invert_interrupt = of_property_read_bool(np, |
302 | "nvidia,invert-interrupt"); | 299 | "nvidia,invert-interrupt"); |
300 | |||
301 | val = tegra_pmc_readl(PMC_CTRL); | ||
302 | if (tegra_pmc_invert_interrupt) | ||
303 | val |= PMC_CTRL_INTR_LOW; | ||
304 | else | ||
305 | val &= ~PMC_CTRL_INTR_LOW; | ||
306 | tegra_pmc_writel(val, PMC_CTRL); | ||
307 | } | ||
308 | |||
309 | void __init tegra_pmc_init(void) | ||
310 | { | ||
311 | struct device_node *np; | ||
312 | u32 prop; | ||
313 | enum tegra_suspend_mode suspend_mode; | ||
314 | u32 core_good_time[2] = {0, 0}; | ||
315 | u32 lp0_vec[2] = {0, 0}; | ||
316 | |||
317 | np = of_find_matching_node(NULL, matches); | ||
318 | BUG_ON(!np); | ||
319 | |||
303 | tegra_pclk = of_clk_get_by_name(np, "pclk"); | 320 | tegra_pclk = of_clk_get_by_name(np, "pclk"); |
304 | WARN_ON(IS_ERR(tegra_pclk)); | 321 | WARN_ON(IS_ERR(tegra_pclk)); |
305 | 322 | ||
@@ -365,17 +382,3 @@ static void __init tegra_pmc_parse_dt(void) | |||
365 | 382 | ||
366 | pmc_pm_data.suspend_mode = suspend_mode; | 383 | pmc_pm_data.suspend_mode = suspend_mode; |
367 | } | 384 | } |
368 | |||
369 | void __init tegra_pmc_init(void) | ||
370 | { | ||
371 | u32 val; | ||
372 | |||
373 | tegra_pmc_parse_dt(); | ||
374 | |||
375 | val = tegra_pmc_readl(PMC_CTRL); | ||
376 | if (tegra_pmc_invert_interrupt) | ||
377 | val |= PMC_CTRL_INTR_LOW; | ||
378 | else | ||
379 | val &= ~PMC_CTRL_INTR_LOW; | ||
380 | tegra_pmc_writel(val, PMC_CTRL); | ||
381 | } | ||
diff --git a/arch/arm/mach-tegra/pmc.h b/arch/arm/mach-tegra/pmc.h index 549f8c7b762c..4d5f8f32225c 100644 --- a/arch/arm/mach-tegra/pmc.h +++ b/arch/arm/mach-tegra/pmc.h | |||
@@ -39,6 +39,7 @@ bool tegra_pmc_cpu_is_powered(int cpuid); | |||
39 | int tegra_pmc_cpu_power_on(int cpuid); | 39 | int tegra_pmc_cpu_power_on(int cpuid); |
40 | int tegra_pmc_cpu_remove_clamping(int cpuid); | 40 | int tegra_pmc_cpu_remove_clamping(int cpuid); |
41 | 41 | ||
42 | void tegra_pmc_init_irq(void); | ||
42 | void tegra_pmc_init(void); | 43 | void tegra_pmc_init(void); |
43 | 44 | ||
44 | #endif | 45 | #endif |
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index 5b8605547a09..4da271df2e6c 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | #include <linux/sys_soc.h> | 34 | #include <linux/sys_soc.h> |
35 | #include <linux/usb/tegra_usb_phy.h> | 35 | #include <linux/usb/tegra_usb_phy.h> |
36 | #include <linux/clk-provider.h> | ||
36 | #include <linux/clk/tegra.h> | 37 | #include <linux/clk/tegra.h> |
37 | 38 | ||
38 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
@@ -44,6 +45,7 @@ | |||
44 | #include "common.h" | 45 | #include "common.h" |
45 | #include "fuse.h" | 46 | #include "fuse.h" |
46 | #include "iomap.h" | 47 | #include "iomap.h" |
48 | #include "pmc.h" | ||
47 | 49 | ||
48 | static void __init tegra_dt_init(void) | 50 | static void __init tegra_dt_init(void) |
49 | { | 51 | { |
@@ -51,6 +53,8 @@ static void __init tegra_dt_init(void) | |||
51 | struct soc_device *soc_dev; | 53 | struct soc_device *soc_dev; |
52 | struct device *parent = NULL; | 54 | struct device *parent = NULL; |
53 | 55 | ||
56 | tegra_pmc_init(); | ||
57 | |||
54 | tegra_clocks_apply_init_table(); | 58 | tegra_clocks_apply_init_table(); |
55 | 59 | ||
56 | soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); | 60 | soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); |
@@ -80,6 +84,12 @@ out: | |||
80 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); | 84 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); |
81 | } | 85 | } |
82 | 86 | ||
87 | static void __init tegra_dt_init_time(void) | ||
88 | { | ||
89 | of_clk_init(NULL); | ||
90 | clocksource_of_init(); | ||
91 | } | ||
92 | |||
83 | static void __init paz00_init(void) | 93 | static void __init paz00_init(void) |
84 | { | 94 | { |
85 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) | 95 | if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) |
@@ -119,7 +129,7 @@ DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)") | |||
119 | .smp = smp_ops(tegra_smp_ops), | 129 | .smp = smp_ops(tegra_smp_ops), |
120 | .init_early = tegra_init_early, | 130 | .init_early = tegra_init_early, |
121 | .init_irq = tegra_dt_init_irq, | 131 | .init_irq = tegra_dt_init_irq, |
122 | .init_time = clocksource_of_init, | 132 | .init_time = tegra_dt_init_time, |
123 | .init_machine = tegra_dt_init, | 133 | .init_machine = tegra_dt_init, |
124 | .init_late = tegra_dt_init_late, | 134 | .init_late = tegra_dt_init_late, |
125 | .restart = tegra_assert_system_reset, | 135 | .restart = tegra_assert_system_reset, |