From: Peter De Schrijver <pdeschrijver@nvidia.com>
To: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Joseph Lo <josephl@nvidia.com>,
Mike Turquette <mturquette@linaro.org>,
Prashant Gaikwad <pgaikwad@nvidia.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Thierry Reding <thierry.reding@gmail.com>,
Rob Herring <rob.herring@calxeda.com>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-tegra@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: [PATCH v2 6/7] clk: tegra124: add wait_for_reset and disable_clock for tegra_cpu_car_ops
Date: Tue, 15 Oct 2013 18:14:49 +0300 [thread overview]
Message-ID: <1381850098-12357-7-git-send-email-pdeschrijver@nvidia.com> (raw)
In-Reply-To: <1381850098-12357-1-git-send-email-pdeschrijver@nvidia.com>
From: Joseph Lo <josephl@nvidia.com>
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>
---
drivers/clk/tegra/clk-tegra124.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/drivers/clk/tegra/clk-tegra124.c b/drivers/clk/tegra/clk-tegra124.c
index 004a0c9..22fce42 100644
--- a/drivers/clk/tegra/clk-tegra124.c
+++ b/drivers/clk/tegra/clk-tegra124.c
@@ -114,6 +114,9 @@
#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_OVERRIDE BIT(1)
#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_SWCTL BIT(0)
+/* Tegra CPU clock and reset control regs */
+#define CLK_RST_CONTROLLER_CPU_CMPLX_STATUS 0x470
+
static void __iomem *clk_base;
static void __iomem *pmc_base;
@@ -1289,6 +1292,27 @@ static void __init tegra124_pll_init(void __iomem *clk_base,
}
+/* Tegra124 CPU clock and reset control functions */
+static void tegra124_wait_cpu_in_reset(u32 cpu)
+{
+ unsigned int reg;
+
+ do {
+ reg = readl(clk_base + CLK_RST_CONTROLLER_CPU_CMPLX_STATUS);
+ cpu_relax();
+ } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
+}
+
+static void tegra124_disable_cpu_clock(u32 cpu)
+{
+ /* flow controller would take care in the power sequence. */
+}
+
+static struct tegra_cpu_car_ops tegra124_cpu_car_ops = {
+ .wait_for_reset = tegra124_wait_cpu_in_reset,
+ .disable_clock = tegra124_disable_cpu_clock,
+};
+
static const struct of_device_id pmc_match[] __initconst = {
{ .compatible = "nvidia,tegra124-pmc" },
{},
@@ -1373,5 +1397,7 @@ static void __init tegra124_clock_init(struct device_node *np)
tegra_register_devclks(devclks, ARRAY_SIZE(devclks));
tegra_clk_apply_init_table = tegra124_clock_apply_init_table;
+
+ tegra_cpu_car_ops = &tegra124_cpu_car_ops;
}
CLK_OF_DECLARE(tegra124, "nvidia,tegra124-car", tegra124_clock_init);
--
1.7.7.rc0.72.g4b5ea.dirty
next prev parent reply other threads:[~2013-10-15 15:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 15:14 [PATCH v2 0/7] Tegra124 clock support Peter De Schrijver
2013-10-15 15:14 ` [PATCH v2 1/7] clk: tegra: Add support for PLLSS Peter De Schrijver
2013-10-15 20:20 ` Stephen Warren
2013-10-16 7:48 ` Peter De Schrijver
2013-10-16 17:21 ` Stephen Warren
2013-10-17 7:57 ` Peter De Schrijver
2013-10-15 15:14 ` [PATCH v2 2/7] clk: tegra: Add periph regs bank X Peter De Schrijver
2013-10-15 15:14 ` [PATCH v2 3/7] clk: tegra124: Add common clk IDs to clk-id.h Peter De Schrijver
2013-10-15 15:14 ` [PATCH v2 4/7] clk: tegra124: Add new peripheral clocks Peter De Schrijver
2013-10-15 20:21 ` Stephen Warren
2013-10-15 15:14 ` [PATCH v2 5/7] clk: tegra124: Add support for Tegra124 clocks Peter De Schrijver
2013-10-15 20:29 ` Stephen Warren
2013-10-16 16:13 ` Peter De Schrijver
2013-10-15 15:14 ` Peter De Schrijver [this message]
2013-10-15 15:14 ` [PATCH v2 7/7] clk: tegra124: add suspend/resume function for tegra_cpu_car_ops Peter De Schrijver
2013-10-15 18:14 ` [PATCH v2 0/7] Tegra124 clock support Olof Johansson
2013-10-15 20:31 ` Stephen Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381850098-12357-7-git-send-email-pdeschrijver@nvidia.com \
--to=pdeschrijver@nvidia.com \
--cc=devicetree@vger.kernel.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=josephl@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mturquette@linaro.org \
--cc=pawel.moll@arm.com \
--cc=pgaikwad@nvidia.com \
--cc=rob.herring@calxeda.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome