public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: tegra: Remove duplicate powergate defines
@ 2013-10-16 17:19 Thierry Reding
       [not found] ` <1381943942-30375-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2013-10-16 17:19 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

Instead of duplicating powergate defines, reuse the ones from the
include/linux/tegra-powergate.h header file.

Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/mach-tegra/pmc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c
index 3744af9..fb79202 100644
--- a/arch/arm/mach-tegra/pmc.c
+++ b/arch/arm/mach-tegra/pmc.c
@@ -20,6 +20,7 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/tegra-powergate.h>
 
 #include "flowctrl.h"
 #include "fuse.h"
@@ -43,12 +44,6 @@
 #define PMC_CPUPWRGOOD_TIMER	0xc8
 #define PMC_CPUPWROFF_TIMER	0xcc
 
-#define TEGRA_POWERGATE_PCIE	3
-#define TEGRA_POWERGATE_VDEC	4
-#define TEGRA_POWERGATE_CPU1	9
-#define TEGRA_POWERGATE_CPU2	10
-#define TEGRA_POWERGATE_CPU3	11
-
 static u8 tegra_cpu_domains[] = {
 	0xFF,			/* not available for CPU0 */
 	TEGRA_POWERGATE_CPU1,
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ARM: tegra: Constify list of CPU domains
       [not found] ` <1381943942-30375-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2013-10-16 17:19   ` Thierry Reding
  2013-10-16 17:19   ` [PATCH 3/3] ARM: tegra: Add Tegra114 powergate support Thierry Reding
  2013-10-16 18:11   ` [PATCH 1/3] ARM: tegra: Remove duplicate powergate defines Stephen Warren
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2013-10-16 17:19 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

There's no need to modify these at runtime, it is static data and never
needs to change.

Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/mach-tegra/powergate.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index f076f0f..bd10822 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -42,8 +42,9 @@
 
 static int tegra_num_powerdomains;
 static int tegra_num_cpu_domains;
-static u8 *tegra_cpu_domains;
-static u8 tegra30_cpu_domains[] = {
+static const u8 *tegra_cpu_domains;
+
+static const u8 tegra30_cpu_domains[] = {
 	TEGRA_POWERGATE_CPU0,
 	TEGRA_POWERGATE_CPU1,
 	TEGRA_POWERGATE_CPU2,
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ARM: tegra: Add Tegra114 powergate support
       [not found] ` <1381943942-30375-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2013-10-16 17:19   ` [PATCH 2/3] ARM: tegra: Constify list of CPU domains Thierry Reding
@ 2013-10-16 17:19   ` Thierry Reding
  2013-10-16 18:11   ` [PATCH 1/3] ARM: tegra: Remove duplicate powergate defines Stephen Warren
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2013-10-16 17:19 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

Extend the list of power gates found on Tegra114. Note that there are
now holes in the list, so perhaps a simple array is no longer the best
data structure to represent it.

Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
Changes in v2:
- remove entries from powergate list that aren't available on Tegra114
- rename disa/DISA to dis/DIS for consistency with the TRM
- update debugfs to cope with holes in powergate list
---
 arch/arm/mach-tegra/powergate.c | 43 ++++++++++++++++++++++++++++++++++++++++-
 include/linux/tegra-powergate.h |  9 ++++++++-
 2 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index bd10822..85d28e7 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -45,6 +45,13 @@ static int tegra_num_cpu_domains;
 static const u8 *tegra_cpu_domains;
 
 static const u8 tegra30_cpu_domains[] = {
+	TEGRA_POWERGATE_CPU,
+	TEGRA_POWERGATE_CPU1,
+	TEGRA_POWERGATE_CPU2,
+	TEGRA_POWERGATE_CPU3,
+};
+
+static const u8 tegra114_cpu_domains[] = {
 	TEGRA_POWERGATE_CPU0,
 	TEGRA_POWERGATE_CPU1,
 	TEGRA_POWERGATE_CPU2,
@@ -190,6 +197,11 @@ int __init tegra_powergate_init(void)
 		tegra_num_cpu_domains = 4;
 		tegra_cpu_domains = tegra30_cpu_domains;
 		break;
+	case TEGRA114:
+		tegra_num_powerdomains = 23;
+		tegra_num_cpu_domains = 4;
+		tegra_cpu_domains = tegra114_cpu_domains;
+		break;
 	default:
 		/* Unknown Tegra variant. Disable powergating */
 		tegra_num_powerdomains = 0;
@@ -230,6 +242,27 @@ static const char * const powergate_name_t30[] = {
 	[TEGRA_POWERGATE_3D1]	= "3d1",
 };
 
+static const char * const powergate_name_t114[] = {
+	[TEGRA_POWERGATE_CPU]	= "cpu0",
+	[TEGRA_POWERGATE_3D]	= "3d",
+	[TEGRA_POWERGATE_VENC]	= "venc",
+	[TEGRA_POWERGATE_VDEC]	= "vdec",
+	[TEGRA_POWERGATE_MPE]	= "mpe",
+	[TEGRA_POWERGATE_HEG]	= "heg",
+	[TEGRA_POWERGATE_CPU1]	= "cpu1",
+	[TEGRA_POWERGATE_CPU2]	= "cpu2",
+	[TEGRA_POWERGATE_CPU3]	= "cpu3",
+	[TEGRA_POWERGATE_CELP]	= "celp",
+	[TEGRA_POWERGATE_CPU0]	= "cpu0",
+	[TEGRA_POWERGATE_C0NC]	= "c0nc",
+	[TEGRA_POWERGATE_C1NC]	= "c1nc",
+	[TEGRA_POWERGATE_DIS]	= "dis",
+	[TEGRA_POWERGATE_DISB]	= "disb",
+	[TEGRA_POWERGATE_XUSBA]	= "xusba",
+	[TEGRA_POWERGATE_XUSBB]	= "xusbb",
+	[TEGRA_POWERGATE_XUSBC]	= "xusbc",
+};
+
 static int powergate_show(struct seq_file *s, void *data)
 {
 	int i;
@@ -237,9 +270,14 @@ static int powergate_show(struct seq_file *s, void *data)
 	seq_printf(s, " powergate powered\n");
 	seq_printf(s, "------------------\n");
 
-	for (i = 0; i < tegra_num_powerdomains; i++)
+	for (i = 0; i < tegra_num_powerdomains; i++) {
+		if (!powergate_name[i])
+			continue;
+
 		seq_printf(s, " %9s %7s\n", powergate_name[i],
 			tegra_powergate_is_powered(i) ? "yes" : "no");
+	}
+
 	return 0;
 }
 
@@ -266,6 +304,9 @@ int __init tegra_powergate_debugfs_init(void)
 	case TEGRA30:
 		powergate_name = powergate_name_t30;
 		break;
+	case TEGRA114:
+		powergate_name = powergate_name_t114;
+		break;
 	}
 
 	if (powergate_name) {
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h
index 55c29a8..c98cfa4 100644
--- a/include/linux/tegra-powergate.h
+++ b/include/linux/tegra-powergate.h
@@ -34,8 +34,15 @@ struct clk;
 #define TEGRA_POWERGATE_CPU3	11
 #define TEGRA_POWERGATE_CELP	12
 #define TEGRA_POWERGATE_3D1	13
+#define TEGRA_POWERGATE_CPU0	14
+#define TEGRA_POWERGATE_C0NC	15
+#define TEGRA_POWERGATE_C1NC	16
+#define TEGRA_POWERGATE_DIS	18
+#define TEGRA_POWERGATE_DISB	19
+#define TEGRA_POWERGATE_XUSBA	20
+#define TEGRA_POWERGATE_XUSBB	21
+#define TEGRA_POWERGATE_XUSBC	22
 
-#define TEGRA_POWERGATE_CPU0	TEGRA_POWERGATE_CPU
 #define TEGRA_POWERGATE_3D0	TEGRA_POWERGATE_3D
 
 int tegra_powergate_is_powered(int id);
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ARM: tegra: Remove duplicate powergate defines
       [not found] ` <1381943942-30375-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2013-10-16 17:19   ` [PATCH 2/3] ARM: tegra: Constify list of CPU domains Thierry Reding
  2013-10-16 17:19   ` [PATCH 3/3] ARM: tegra: Add Tegra114 powergate support Thierry Reding
@ 2013-10-16 18:11   ` Stephen Warren
       [not found]     ` <525ED6CD.4050708-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2013-10-16 18:11 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 10/16/2013 11:19 AM, Thierry Reding wrote:
> Instead of duplicating powergate defines, reuse the ones from the
> include/linux/tegra-powergate.h header file.

OK, these turned out simple enough, and CPU hotplug still works fine on
Tegra114/Dalmore. So, I've applied these to Tegra's for-3.13/soc branch.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ARM: tegra: Remove duplicate powergate defines
       [not found]     ` <525ED6CD.4050708-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-10-17  2:46       ` Joseph Lo
  0 siblings, 0 replies; 5+ messages in thread
From: Joseph Lo @ 2013-10-17  2:46 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Thierry Reding,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Thu, 2013-10-17 at 02:11 +0800, Stephen Warren wrote:
> On 10/16/2013 11:19 AM, Thierry Reding wrote:
> > Instead of duplicating powergate defines, reuse the ones from the
> > include/linux/tegra-powergate.h header file.
> 
> OK, these turned out simple enough, and CPU hotplug still works fine on
> Tegra114/Dalmore. So, I've applied these to Tegra's for-3.13/soc branch.

Yes, that is because the CPU power control function was switched to use
the one in the pmc.c. FYI.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-17  2:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 17:19 [PATCH 1/3] ARM: tegra: Remove duplicate powergate defines Thierry Reding
     [not found] ` <1381943942-30375-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-10-16 17:19   ` [PATCH 2/3] ARM: tegra: Constify list of CPU domains Thierry Reding
2013-10-16 17:19   ` [PATCH 3/3] ARM: tegra: Add Tegra114 powergate support Thierry Reding
2013-10-16 18:11   ` [PATCH 1/3] ARM: tegra: Remove duplicate powergate defines Stephen Warren
     [not found]     ` <525ED6CD.4050708-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-10-17  2:46       ` Joseph Lo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox