aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/tegra.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2013-08-20 17:17:35 -0400
committerStephen Warren <swarren@nvidia.com>2013-09-17 15:42:17 -0400
commitd2207071b3c74b144a860cbe6a46496a44963972 (patch)
tree957a2815fe853c85d16e4722c655ce148f16c373 /arch/arm/mach-tegra/tegra.c
parent272b98c6455f00884f0350f775c5342358ebb73f (diff)
ARM: tegra: split tegra_pmc_init() in two
Tegra's board file currently initializes clocks much earlier than those for most other ARM SoCs. The reason is: * The PMC HW block is involved in the path of some interrupts (i.e. it inverts, or not, the IRQ input pin dedicated to the PMIC). * So, that part of the PMC must be initialized early so that the IRQ polarity is correct. * The PMC initialization is currently monolithic, and the PMC has some clock inputs, so the init routine ends up calling of_clk_get_by_name(), and hence clocks must be set up early too. In order to defer clock initialization to the more typical location, split out the portions of tegra_pmc_init() that are truly IRQ-related into a separate tegra_pmc_init_irq(), which can be called from the machine descriptor's .init_irq() function, and defer the rest until the machine descriptor's .init_machine() function. This allows the clock initiliazation to happen from the machine descriptor's .init_time() function, as is typical. Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra.c')
-rw-r--r--arch/arm/mach-tegra/tegra.c12
1 files changed, 11 insertions, 1 deletions
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
48static void __init tegra_dt_init(void) 50static 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
87static void __init tegra_dt_init_time(void)
88{
89 of_clk_init(NULL);
90 clocksource_of_init();
91}
92
83static void __init paz00_init(void) 93static 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,