aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Lo <josephl@nvidia.com>2013-09-25 05:27:51 -0400
committerPeter De Schrijver <pdeschrijver@nvidia.com>2013-11-26 11:46:55 -0500
commit9e036d3ef0b9fcb34acce5a89d1f2157f4f7b4ab (patch)
tree5ffbaab964b0e48d0f2bb2d9f2c2a31165654e71
parent76da314df603a08ebc463853030752251b260ab8 (diff)
clk: tegra124: add wait_for_reset and disable_clock for tegra_cpu_car_ops
Hook the functions for CPU hotplug support. After the CPU is hot unplugged, the flow controller will handle to clock gate the CPU clock. But still need to implement an empty function to avoid warning message. Cc: Mike Turquette <mturquette@linaro.org> Signed-off-by: Joseph Lo <josephl@nvidia.com>
-rw-r--r--drivers/clk/tegra/clk-tegra124.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/clk/tegra/clk-tegra124.c b/drivers/clk/tegra/clk-tegra124.c
index f69367a14777..345192233871 100644
--- a/drivers/clk/tegra/clk-tegra124.c
+++ b/drivers/clk/tegra/clk-tegra124.c
@@ -112,6 +112,9 @@
112#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_OVERRIDE BIT(1) 112#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_OVERRIDE BIT(1)
113#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_SWCTL BIT(0) 113#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_SWCTL BIT(0)
114 114
115/* Tegra CPU clock and reset control regs */
116#define CLK_RST_CONTROLLER_CPU_CMPLX_STATUS 0x470
117
115static void __iomem *clk_base; 118static void __iomem *clk_base;
116static void __iomem *pmc_base; 119static void __iomem *pmc_base;
117 120
@@ -1283,6 +1286,27 @@ static void __init tegra124_pll_init(void __iomem *clk_base,
1283 1286
1284} 1287}
1285 1288
1289/* Tegra124 CPU clock and reset control functions */
1290static void tegra124_wait_cpu_in_reset(u32 cpu)
1291{
1292 unsigned int reg;
1293
1294 do {
1295 reg = readl(clk_base + CLK_RST_CONTROLLER_CPU_CMPLX_STATUS);
1296 cpu_relax();
1297 } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
1298}
1299
1300static void tegra124_disable_cpu_clock(u32 cpu)
1301{
1302 /* flow controller would take care in the power sequence. */
1303}
1304
1305static struct tegra_cpu_car_ops tegra124_cpu_car_ops = {
1306 .wait_for_reset = tegra124_wait_cpu_in_reset,
1307 .disable_clock = tegra124_disable_cpu_clock,
1308};
1309
1286static const struct of_device_id pmc_match[] __initconst = { 1310static const struct of_device_id pmc_match[] __initconst = {
1287 { .compatible = "nvidia,tegra124-pmc" }, 1311 { .compatible = "nvidia,tegra124-pmc" },
1288 {}, 1312 {},
@@ -1366,5 +1390,7 @@ static void __init tegra124_clock_init(struct device_node *np)
1366 tegra_register_devclks(devclks, ARRAY_SIZE(devclks)); 1390 tegra_register_devclks(devclks, ARRAY_SIZE(devclks));
1367 1391
1368 tegra_clk_apply_init_table = tegra124_clock_apply_init_table; 1392 tegra_clk_apply_init_table = tegra124_clock_apply_init_table;
1393
1394 tegra_cpu_car_ops = &tegra124_cpu_car_ops;
1369} 1395}
1370CLK_OF_DECLARE(tegra124, "nvidia,tegra124-car", tegra124_clock_init); 1396CLK_OF_DECLARE(tegra124, "nvidia,tegra124-car", tegra124_clock_init);