* [PATCH V2 1/4] clk: tegra124: add wait_for_reset and disable_clock for tegra_cpu_car_ops
2013-10-11 9:57 [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support for Tegra124 Joseph Lo
@ 2013-10-11 9:57 ` Joseph Lo
2013-10-11 9:57 ` [PATCH V2 2/4] ARM: tegra: CPU hotplug support for Tegra124 Joseph Lo
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Joseph Lo @ 2013-10-11 9:57 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
This patch depends on the patch series "[PATCH 0/5] Tegra124 clock support"
that sent by Peter on 10/4/2013.
V2:
* no change
---
drivers/clk/tegra/clk-tegra124.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/clk/tegra/clk-tegra124.c b/drivers/clk/tegra/clk-tegra124.c
index 26ba059..c1c9330 100644
--- a/drivers/clk/tegra/clk-tegra124.c
+++ b/drivers/clk/tegra/clk-tegra124.c
@@ -106,6 +106,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;
@@ -1120,6 +1123,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" },
{},
@@ -1202,5 +1226,7 @@ static void __init tegra124_clock_init(struct device_node *np)
tegra_add_of_provider(np);
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.8.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH V2 2/4] ARM: tegra: CPU hotplug support for Tegra124
2013-10-11 9:57 [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support for Tegra124 Joseph Lo
2013-10-11 9:57 ` [PATCH V2 1/4] clk: tegra124: add wait_for_reset and disable_clock for tegra_cpu_car_ops Joseph Lo
@ 2013-10-11 9:57 ` Joseph Lo
2013-10-11 9:57 ` [PATCH V2 3/4] ARM: tegra: make tegra_resume can work with current and later chips Joseph Lo
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Joseph Lo @ 2013-10-11 9:57 UTC (permalink / raw)
To: linux-arm-kernel
The procedure of CPU hotplug for Tegra124 is same with Tegra114. We
re-use the same function with it.
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
V2:
* no change
---
arch/arm/mach-tegra/Makefile | 1 +
arch/arm/mach-tegra/hotplug.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 97eb48e..04ca2b3 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -35,5 +35,6 @@ obj-$(CONFIG_ARCH_TEGRA_114_SOC) += pm-tegra30.o
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
+obj-$(CONFIG_ARCH_TEGRA_124_SOC) += sleep-tegra30.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index 04de2e8..ff26af2 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -57,4 +57,6 @@ void __init tegra_hotplug_init(void)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
+ if (IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC) && tegra_chip_id == TEGRA124)
+ tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
}
--
1.8.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH V2 3/4] ARM: tegra: make tegra_resume can work with current and later chips
2013-10-11 9:57 [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support for Tegra124 Joseph Lo
2013-10-11 9:57 ` [PATCH V2 1/4] clk: tegra124: add wait_for_reset and disable_clock for tegra_cpu_car_ops Joseph Lo
2013-10-11 9:57 ` [PATCH V2 2/4] ARM: tegra: CPU hotplug support for Tegra124 Joseph Lo
@ 2013-10-11 9:57 ` Joseph Lo
2013-10-11 9:57 ` [PATCH V2 4/4] ARM: tegra: enable CPU idle for Tegra124 Joseph Lo
2013-10-11 18:39 ` [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support " Stephen Warren
4 siblings, 0 replies; 6+ messages in thread
From: Joseph Lo @ 2013-10-11 9:57 UTC (permalink / raw)
To: linux-arm-kernel
Because the CPU0 was the first up and the last down core when cluster
power up/down or platform suspend. So only CPU0 needs the rest of the
functions to reset flow controller and re-enable SCU and L2. We also
move the L2 init function for Cortex-A15 to there. The secondery CPU
can just call cpu_resume.
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
V2:
* fix the label name of not_ca9 to end_ca9_scu_l2_resume
---
arch/arm/mach-tegra/reset-handler.S | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index f527b2c..8c1ba4f 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -45,17 +45,11 @@
ENTRY(tegra_resume)
check_cpu_part_num 0xc09, r8, r9
bleq v7_invalidate_l1
- blne tegra_init_l2_for_a15
cpu_id r0
- tegra_get_soc_id TEGRA_APB_MISC_BASE, r6
- cmp r6, #TEGRA114
- beq no_cpu0_chk
-
cmp r0, #0 @ CPU0?
THUMB( it ne )
bne cpu_resume @ no
-no_cpu0_chk:
/* Are we on Tegra20? */
cmp r6, #TEGRA20
@@ -75,7 +69,7 @@ no_cpu0_chk:
mov32 r9, 0xc09
cmp r8, r9
- bne not_ca9
+ bne end_ca9_scu_l2_resume
#ifdef CONFIG_HAVE_ARM_SCU
/* enable SCU */
mov32 r0, TEGRA_ARM_PERIF_BASE
@@ -86,7 +80,10 @@ no_cpu0_chk:
/* L2 cache resume & re-enable */
l2_cache_resume r0, r1, r2, l2x0_saved_regs_addr
-not_ca9:
+end_ca9_scu_l2_resume:
+ mov32 r9, 0xc0f
+ cmp r8, r9
+ bleq tegra_init_l2_for_a15
b cpu_resume
ENDPROC(tegra_resume)
--
1.8.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH V2 4/4] ARM: tegra: enable CPU idle for Tegra124
2013-10-11 9:57 [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support for Tegra124 Joseph Lo
` (2 preceding siblings ...)
2013-10-11 9:57 ` [PATCH V2 3/4] ARM: tegra: make tegra_resume can work with current and later chips Joseph Lo
@ 2013-10-11 9:57 ` Joseph Lo
2013-10-11 18:39 ` [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support " Stephen Warren
4 siblings, 0 replies; 6+ messages in thread
From: Joseph Lo @ 2013-10-11 9:57 UTC (permalink / raw)
To: linux-arm-kernel
The CPUIdle function of Tegra124 is identical to Tegra114, so we share
the same driver with Tegra114.
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
V2:
* no change
---
arch/arm/mach-tegra/Makefile | 3 +++
arch/arm/mach-tegra/cpuidle.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 04ca2b3..de3748e 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -36,5 +36,8 @@ ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += sleep-tegra30.o
+ifeq ($(CONFIG_CPU_IDLE),y)
+obj-$(CONFIG_ARCH_TEGRA_124_SOC) += cpuidle-tegra114.o
+endif
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 0961dfc..7bc5d8d 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -39,7 +39,9 @@ void __init tegra_cpuidle_init(void)
tegra30_cpuidle_init();
break;
case TEGRA114:
- if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC))
+ case TEGRA124:
+ if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) ||
+ IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC))
tegra114_cpuidle_init();
break;
}
--
1.8.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support for Tegra124
2013-10-11 9:57 [PATCH V2 0/4] ARM: tegra: add CPU hot-plug and idle support for Tegra124 Joseph Lo
` (3 preceding siblings ...)
2013-10-11 9:57 ` [PATCH V2 4/4] ARM: tegra: enable CPU idle for Tegra124 Joseph Lo
@ 2013-10-11 18:39 ` Stephen Warren
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Warren @ 2013-10-11 18:39 UTC (permalink / raw)
To: linux-arm-kernel
On 10/11/2013 03:57 AM, Joseph Lo wrote:
> The CPU hot-plug and idle function for Tegra124 was identical to Tegra114,
> so we share the driver with it.
>
> Note:
> This patch series depends on the patch series below.
> * [PATCH 0/5] Tegra124 clock support
> * [PATCH V2 0/6] ARM: tegra: basic support for Tegra124 SoC
> * [PATCH] ARM: tegra: add clock properties for devices of Tegra124
I have applied patches 2-4 to Tegra's for-3.13/soc branch.
I have not applied patch 1, since that's a clock driver change. Please
work with Mike and/or Peter to send that patch through the clock tree.
In general, if there aren't any compile-time or run-time dependencies
(for existing features, not new ones) between patches, patches for
different subsystems should be sent separately, rather than as a
combined series.
Note that "[PATCH] ARM: tegra: add clock properties for devices of
Tegra124" is not yet applied; I'm waiting for Peter's Tegra124 clock
series to be finalized before applying that. There's no compile-time
dependency here, and the patch only enables new features without
breaking existing ones, so there's no bisection issue here.
^ permalink raw reply [flat|nested] 6+ messages in thread