All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Dubey <pankaj.dubey@samsung.com>
To: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: kgene.kim@samsung.com, linux@arm.linux.org.uk,
	t.figa@samsung.com, chow.kim@samsung.com,
	yg1004.jang@samsung.com, vikas.sajjan@samsung.com,
	Pankaj Dubey <pankaj.dubey@samsung.com>
Subject: [PATCH v4 06/11] ARM: EXYNOS: Add support for mapping PMU base address via DT
Date: Sat, 10 May 2014 15:56:33 +0900	[thread overview]
Message-ID: <1399704998-13321-7-git-send-email-pankaj.dubey@samsung.com> (raw)
In-Reply-To: <1399704998-13321-1-git-send-email-pankaj.dubey@samsung.com>

From: Young-Gun Jang <yg1004.jang@samsung.com>

Add support for mapping Samsung Power Management Unit (PMU)
base address from device tree. This patch also adds helper
function as "get_exynos_pmuregmap". This function can be used
by other machine files such as "pm.c", "hotplug.c" for accessing
PMU regmap handle.

Signed-off-by: Young-Gun Jang <yg1004.jang@samsung.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/Kconfig              |    1 +
 arch/arm/mach-exynos/common.h |    2 ++
 arch/arm/mach-exynos/exynos.c |   39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 732a134..a4eac2f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -855,6 +855,7 @@ config ARCH_EXYNOS
 	select SPARSE_IRQ
 	select SRAM
 	select USE_OF
+	select MFD_SYSCON
 	help
 	  Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
 
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 69739e4..d533e2d 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -57,4 +57,6 @@ struct exynos_pmu_conf {
 extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
 extern void exynos_enter_aftr(void);
 
+extern struct regmap *get_exynos_pmuregmap(void);
+
 #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index e4a4be0..3b1d245 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -19,6 +19,7 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
+#include <linux/mfd/syscon.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -36,6 +37,8 @@
 #define L2_AUX_VAL 0x7C470001
 #define L2_AUX_MASK 0xC200ffff
 
+static struct regmap *exynos_pmu_regmap;
+
 static struct map_desc exynos4_iodesc[] __initdata = {
 	{
 		.virtual	= (unsigned long)S3C_VA_SYS,
@@ -210,6 +213,14 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
 	return 1;
 }
 
+static const struct of_device_id exynos_dt_pmu_match[] = {
+	{ .compatible = "samsung,exynos4210-pmu" },
+	{ .compatible = "samsung,exynos4212-pmu" },
+	{ .compatible = "samsung,exynos4412-pmu" },
+	{ .compatible = "samsung,exynos5250-pmu" },
+	{},
+};
+
 /*
  * exynos_map_io
  *
@@ -263,6 +274,32 @@ static int __init exynos4_l2x0_cache_init(void)
 }
 early_initcall(exynos4_l2x0_cache_init);
 
+
+struct regmap *get_exynos_pmuregmap()
+{
+	return exynos_pmu_regmap;
+}
+
+void __init exynos_map_pmu(void)
+{
+	struct device_node *np = NULL;
+
+	early_syscon_init();
+
+	np = of_find_matching_node(NULL, exynos_dt_pmu_match);
+
+	if (!np) {
+		pr_err("Failed to find PMU node\n");
+		return;
+	} else {
+		exynos_pmu_regmap = syscon_early_regmap_lookup_by_phandle(np,
+				NULL);
+	}
+
+	if (IS_ERR(exynos_pmu_regmap))
+		pr_err("failed to find exynos_pmu_regmap\n");
+}
+
 static void __init exynos_dt_machine_init(void)
 {
 	struct device_node *i2c_np;
@@ -291,6 +328,8 @@ static void __init exynos_dt_machine_init(void)
 		}
 	}
 
+	exynos_map_pmu();
+
 	if (!soc_is_exynos5440())
 		platform_device_register(&exynos_cpuidle);
 
-- 
1.7.10.4


WARNING: multiple messages have this Message-ID (diff)
From: Pankaj Dubey <pankaj.dubey@samsung.com>
To: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: kgene.kim@samsung.com, linux@arm.linux.org.uk,
	Pankaj Dubey <pankaj.dubey@samsung.com>,
	t.figa@samsung.com, yg1004.jang@samsung.com,
	vikas.sajjan@samsung.com, chow.kim@samsung.com
Subject: [PATCH v4 06/11] ARM: EXYNOS: Add support for mapping PMU base address via DT
Date: Sat, 10 May 2014 15:56:33 +0900	[thread overview]
Message-ID: <1399704998-13321-7-git-send-email-pankaj.dubey@samsung.com> (raw)
In-Reply-To: <1399704998-13321-1-git-send-email-pankaj.dubey@samsung.com>

From: Young-Gun Jang <yg1004.jang@samsung.com>

Add support for mapping Samsung Power Management Unit (PMU)
base address from device tree. This patch also adds helper
function as "get_exynos_pmuregmap". This function can be used
by other machine files such as "pm.c", "hotplug.c" for accessing
PMU regmap handle.

Signed-off-by: Young-Gun Jang <yg1004.jang@samsung.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/Kconfig              |    1 +
 arch/arm/mach-exynos/common.h |    2 ++
 arch/arm/mach-exynos/exynos.c |   39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 732a134..a4eac2f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -855,6 +855,7 @@ config ARCH_EXYNOS
 	select SPARSE_IRQ
 	select SRAM
 	select USE_OF
+	select MFD_SYSCON
 	help
 	  Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
 
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 69739e4..d533e2d 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -57,4 +57,6 @@ struct exynos_pmu_conf {
 extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
 extern void exynos_enter_aftr(void);
 
+extern struct regmap *get_exynos_pmuregmap(void);
+
 #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index e4a4be0..3b1d245 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -19,6 +19,7 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
+#include <linux/mfd/syscon.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -36,6 +37,8 @@
 #define L2_AUX_VAL 0x7C470001
 #define L2_AUX_MASK 0xC200ffff
 
+static struct regmap *exynos_pmu_regmap;
+
 static struct map_desc exynos4_iodesc[] __initdata = {
 	{
 		.virtual	= (unsigned long)S3C_VA_SYS,
@@ -210,6 +213,14 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
 	return 1;
 }
 
+static const struct of_device_id exynos_dt_pmu_match[] = {
+	{ .compatible = "samsung,exynos4210-pmu" },
+	{ .compatible = "samsung,exynos4212-pmu" },
+	{ .compatible = "samsung,exynos4412-pmu" },
+	{ .compatible = "samsung,exynos5250-pmu" },
+	{},
+};
+
 /*
  * exynos_map_io
  *
@@ -263,6 +274,32 @@ static int __init exynos4_l2x0_cache_init(void)
 }
 early_initcall(exynos4_l2x0_cache_init);
 
+
+struct regmap *get_exynos_pmuregmap()
+{
+	return exynos_pmu_regmap;
+}
+
+void __init exynos_map_pmu(void)
+{
+	struct device_node *np = NULL;
+
+	early_syscon_init();
+
+	np = of_find_matching_node(NULL, exynos_dt_pmu_match);
+
+	if (!np) {
+		pr_err("Failed to find PMU node\n");
+		return;
+	} else {
+		exynos_pmu_regmap = syscon_early_regmap_lookup_by_phandle(np,
+				NULL);
+	}
+
+	if (IS_ERR(exynos_pmu_regmap))
+		pr_err("failed to find exynos_pmu_regmap\n");
+}
+
 static void __init exynos_dt_machine_init(void)
 {
 	struct device_node *i2c_np;
@@ -291,6 +328,8 @@ static void __init exynos_dt_machine_init(void)
 		}
 	}
 
+	exynos_map_pmu();
+
 	if (!soc_is_exynos5440())
 		platform_device_register(&exynos_cpuidle);
 
-- 
1.7.10.4

WARNING: multiple messages have this Message-ID (diff)
From: pankaj.dubey@samsung.com (Pankaj Dubey)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 06/11] ARM: EXYNOS: Add support for mapping PMU base address via DT
Date: Sat, 10 May 2014 15:56:33 +0900	[thread overview]
Message-ID: <1399704998-13321-7-git-send-email-pankaj.dubey@samsung.com> (raw)
In-Reply-To: <1399704998-13321-1-git-send-email-pankaj.dubey@samsung.com>

From: Young-Gun Jang <yg1004.jang@samsung.com>

Add support for mapping Samsung Power Management Unit (PMU)
base address from device tree. This patch also adds helper
function as "get_exynos_pmuregmap". This function can be used
by other machine files such as "pm.c", "hotplug.c" for accessing
PMU regmap handle.

Signed-off-by: Young-Gun Jang <yg1004.jang@samsung.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/Kconfig              |    1 +
 arch/arm/mach-exynos/common.h |    2 ++
 arch/arm/mach-exynos/exynos.c |   39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 732a134..a4eac2f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -855,6 +855,7 @@ config ARCH_EXYNOS
 	select SPARSE_IRQ
 	select SRAM
 	select USE_OF
+	select MFD_SYSCON
 	help
 	  Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
 
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 69739e4..d533e2d 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -57,4 +57,6 @@ struct exynos_pmu_conf {
 extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
 extern void exynos_enter_aftr(void);
 
+extern struct regmap *get_exynos_pmuregmap(void);
+
 #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index e4a4be0..3b1d245 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -19,6 +19,7 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
+#include <linux/mfd/syscon.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -36,6 +37,8 @@
 #define L2_AUX_VAL 0x7C470001
 #define L2_AUX_MASK 0xC200ffff
 
+static struct regmap *exynos_pmu_regmap;
+
 static struct map_desc exynos4_iodesc[] __initdata = {
 	{
 		.virtual	= (unsigned long)S3C_VA_SYS,
@@ -210,6 +213,14 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
 	return 1;
 }
 
+static const struct of_device_id exynos_dt_pmu_match[] = {
+	{ .compatible = "samsung,exynos4210-pmu" },
+	{ .compatible = "samsung,exynos4212-pmu" },
+	{ .compatible = "samsung,exynos4412-pmu" },
+	{ .compatible = "samsung,exynos5250-pmu" },
+	{},
+};
+
 /*
  * exynos_map_io
  *
@@ -263,6 +274,32 @@ static int __init exynos4_l2x0_cache_init(void)
 }
 early_initcall(exynos4_l2x0_cache_init);
 
+
+struct regmap *get_exynos_pmuregmap()
+{
+	return exynos_pmu_regmap;
+}
+
+void __init exynos_map_pmu(void)
+{
+	struct device_node *np = NULL;
+
+	early_syscon_init();
+
+	np = of_find_matching_node(NULL, exynos_dt_pmu_match);
+
+	if (!np) {
+		pr_err("Failed to find PMU node\n");
+		return;
+	} else {
+		exynos_pmu_regmap = syscon_early_regmap_lookup_by_phandle(np,
+				NULL);
+	}
+
+	if (IS_ERR(exynos_pmu_regmap))
+		pr_err("failed to find exynos_pmu_regmap\n");
+}
+
 static void __init exynos_dt_machine_init(void)
 {
 	struct device_node *i2c_np;
@@ -291,6 +328,8 @@ static void __init exynos_dt_machine_init(void)
 		}
 	}
 
+	exynos_map_pmu();
+
 	if (!soc_is_exynos5440())
 		platform_device_register(&exynos_cpuidle);
 
-- 
1.7.10.4

  parent reply	other threads:[~2014-05-10  6:41 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-10  6:56 [PATCH v4 00/11] ARM: Exynos: PMU cleanup and refactoring for using DT Pankaj Dubey
2014-05-10  6:56 ` Pankaj Dubey
2014-05-10  6:56 ` [PATCH v4 01/11] ARM: EXYNOS: Make exynos machine_ops as static Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-06-10 11:43   ` Tomasz Figa
2014-06-10 11:43     ` Tomasz Figa
2014-05-10  6:56 ` [PATCH v4 02/11] ARM: EXYNOS: Move cpufreq and cpuidle device registration to init_machine Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-06-10 11:46   ` Tomasz Figa
2014-06-10 11:46     ` Tomasz Figa
2014-06-17  3:48     ` Pankaj Dubey
2014-06-17  3:48       ` Pankaj Dubey
2014-05-10  6:56 ` [PATCH v4 03/11] ARM: EXYNOS: Move SYSREG definition into sys-reg specific file Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-05-10  6:56 ` [PATCH v4 04/11] ARM: EXYNOS: Remove file path from comment section Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-05-10  6:56 ` [PATCH v4 05/11] ARM: EXYNOS: Remove regs-pmu.h header dependency from pm_domain Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-05-10  6:56 ` Pankaj Dubey [this message]
2014-05-10  6:56   ` [PATCH v4 06/11] ARM: EXYNOS: Add support for mapping PMU base address via DT Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-06-10 17:10   ` Tomasz Figa
2014-06-10 17:10     ` Tomasz Figa
2014-06-17  6:43     ` Pankaj Dubey
2014-06-17  6:43       ` Pankaj Dubey
2014-06-17 15:26       ` Tomasz Figa
2014-06-17 15:26         ` Tomasz Figa
2014-06-17 15:32         ` [PATCH RFC] mfd: syscon: Decouple syscon interface from syscon devices Tomasz Figa
2014-06-17 15:32           ` Tomasz Figa
2014-06-17 15:42           ` Arnd Bergmann
2014-06-17 15:42             ` Arnd Bergmann
2014-06-17 21:26             ` Tomasz Figa
2014-06-17 21:26               ` Tomasz Figa
2014-06-18  8:26               ` Lee Jones
2014-06-18  8:26                 ` Lee Jones
2014-06-24 11:03                 ` Pankaj Dubey
2014-06-24 11:03                   ` Pankaj Dubey
2014-06-18 12:57               ` Arnd Bergmann
2014-06-18 12:57                 ` Arnd Bergmann
2014-06-19  0:06                 ` Michal Simek
2014-06-19  0:06                   ` Michal Simek
2014-07-28  4:15                 ` Pankaj Dubey
2014-07-28  4:15                   ` Pankaj Dubey
2014-05-10  6:56 ` [PATCH v4 07/11] ARM: EXYNOS: Remove "linux/bug.h" from pmu.c Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-05-10  6:56 ` [PATCH v4 08/11] ARM: EXYNOS: Refactored code for using PMU address via DT Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-06-17 16:02   ` Tomasz Figa
2014-06-17 16:02     ` Tomasz Figa
2014-05-10  6:56 ` [PATCH v4 09/11] ARM: EXYNOS: Move "mach/map.h" inclusion from regs-pmu.h to platsmp.c Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-06-17 16:04   ` Tomasz Figa
2014-06-17 16:04     ` Tomasz Figa
2014-05-10  6:56 ` [PATCH v4 10/11] ARM: EXYNOS: Add platform driver support for Exynos PMU Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-06-17 17:12   ` Tomasz Figa
2014-06-17 17:12     ` Tomasz Figa
2014-06-24 11:28     ` Pankaj Dubey
2014-06-24 11:28       ` Pankaj Dubey
2014-06-25  0:11       ` Tomasz Figa
2014-06-25  0:11         ` Tomasz Figa
2014-06-25  4:30         ` Pankaj Dubey
2014-06-25  4:30           ` Pankaj Dubey
2014-05-10  6:56 ` [PATCH v4 11/11] ARM: EXYNOS: Move PMU specific definitions from common.h Pankaj Dubey
2014-05-10  6:56   ` Pankaj Dubey
2014-05-27 11:26 ` [PATCH v4 00/11] ARM: Exynos: PMU cleanup and refactoring for using DT Vikas Sajjan
2014-05-27 11:26   ` Vikas Sajjan
2014-05-27 11:26   ` Vikas Sajjan
2014-05-30 11:58   ` Tomasz Figa
2014-05-30 11:58     ` Tomasz Figa
2014-05-30 11:58     ` Tomasz Figa

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=1399704998-13321-7-git-send-email-pankaj.dubey@samsung.com \
    --to=pankaj.dubey@samsung.com \
    --cc=chow.kim@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=t.figa@samsung.com \
    --cc=vikas.sajjan@samsung.com \
    --cc=yg1004.jang@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.