aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/tegra
diff options
context:
space:
mode:
authorJoseph Lo <josephl@nvidia.com>2013-05-20 06:39:28 -0400
committerStephen Warren <swarren@nvidia.com>2013-05-22 17:19:22 -0400
commit31972fd95527a5942b777e89404501d5421a0df0 (patch)
tree5d49004a70546486376fc947274c082a1af4c111 /drivers/clk/tegra
parent18901e9f4fc9c99667516974d82c437453f83348 (diff)
clk: tegra114: implement wait_for_reset and disable_clock for tegra_cpu_car_ops
The conventional CPU hotplug sequence on the other Tegra chips, we will also clock gate the CPU in tegra_cpu_kill() after the CPU was power gated. For Tegra114, the flow controller will clock gate the CPU after the power down sequence. But we still need to implement a empty function for disable_clock to avoid kernel warning message. Signed-off-by: Joseph Lo <josephl@nvidia.com> Acked-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/clk/tegra')
-rw-r--r--drivers/clk/tegra/clk-tegra114.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index d78e16ee161c..40d939d091bf 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -250,6 +250,9 @@
250#define CLK_SOURCE_XUSB_DEV_SRC 0x60c 250#define CLK_SOURCE_XUSB_DEV_SRC 0x60c
251#define CLK_SOURCE_EMC 0x19c 251#define CLK_SOURCE_EMC 0x19c
252 252
253/* Tegra CPU clock and reset control regs */
254#define CLK_RST_CONTROLLER_CPU_CMPLX_STATUS 0x470
255
253static int periph_clk_enb_refcnt[CLK_OUT_ENB_NUM * 32]; 256static int periph_clk_enb_refcnt[CLK_OUT_ENB_NUM * 32];
254 257
255static void __iomem *clk_base; 258static void __iomem *clk_base;
@@ -2000,7 +2003,25 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base)
2000 } 2003 }
2001} 2004}
2002 2005
2003static struct tegra_cpu_car_ops tegra114_cpu_car_ops; 2006/* Tegra114 CPU clock and reset control functions */
2007static void tegra114_wait_cpu_in_reset(u32 cpu)
2008{
2009 unsigned int reg;
2010
2011 do {
2012 reg = readl(clk_base + CLK_RST_CONTROLLER_CPU_CMPLX_STATUS);
2013 cpu_relax();
2014 } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
2015}
2016static void tegra114_disable_cpu_clock(u32 cpu)
2017{
2018 /* flow controller would take care in the power sequence. */
2019}
2020
2021static struct tegra_cpu_car_ops tegra114_cpu_car_ops = {
2022 .wait_for_reset = tegra114_wait_cpu_in_reset,
2023 .disable_clock = tegra114_disable_cpu_clock,
2024};
2004 2025
2005static const struct of_device_id pmc_match[] __initconst = { 2026static const struct of_device_id pmc_match[] __initconst = {
2006 { .compatible = "nvidia,tegra114-pmc" }, 2027 { .compatible = "nvidia,tegra114-pmc" },