From d2207071b3c74b144a860cbe6a46496a44963972 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 20 Aug 2013 15:17:35 -0600 Subject: 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 --- arch/arm/mach-tegra/pmc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-tegra/pmc.h') 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); int tegra_pmc_cpu_power_on(int cpuid); int tegra_pmc_cpu_remove_clamping(int cpuid); +void tegra_pmc_init_irq(void); void tegra_pmc_init(void); #endif -- cgit v1.2.3 From 51100bdc067706624f0ffe285e63a6099336e11a Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 20 Aug 2013 15:47:38 -0600 Subject: ARM: tegra: remove common.c common.c was create to contain code shared across the various Tegra board files. There is now only one board file, tegra.c. So, move the code there. One exception is the PMC reboot routine, which moves to pmc.c, and now takes advantage of the 'standard' tegra_pmc_readl/writel functions. Signed-off-by: Stephen Warren --- arch/arm/mach-tegra/pmc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/arm/mach-tegra/pmc.h') diff --git a/arch/arm/mach-tegra/pmc.h b/arch/arm/mach-tegra/pmc.h index 4d5f8f32225c..59e19c344298 100644 --- a/arch/arm/mach-tegra/pmc.h +++ b/arch/arm/mach-tegra/pmc.h @@ -18,6 +18,8 @@ #ifndef __MACH_TEGRA_PMC_H #define __MACH_TEGRA_PMC_H +#include + enum tegra_suspend_mode { TEGRA_SUSPEND_NONE = 0, TEGRA_SUSPEND_LP2, /* CPU voltage off */ @@ -39,6 +41,8 @@ bool tegra_pmc_cpu_is_powered(int cpuid); int tegra_pmc_cpu_power_on(int cpuid); int tegra_pmc_cpu_remove_clamping(int cpuid); +void tegra_pmc_restart(enum reboot_mode mode, const char *cmd); + void tegra_pmc_init_irq(void); void tegra_pmc_init(void); -- cgit v1.2.3