diff options
author | Pankaj Dubey <pankaj.dubey@samsung.com> | 2014-07-10 19:08:29 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-07-14 19:40:32 -0400 |
commit | fce9e5bb25264153f9f002eada41757118d25ba9 (patch) | |
tree | fe13933c80c122ffd0cd782edfc2ef1535f86223 /arch/arm/mach-exynos | |
parent | 632b98ae8adbe12fda9d1f4cc6c0c177bcb44b1e (diff) |
ARM: EXYNOS: Add support for mapping PMU base address via DT
Add support for mapping Samsung Power Management Unit (PMU)
base address from device tree.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r-- | arch/arm/mach-exynos/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/exynos.c | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 152b46417112..f8daa9cc5617 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -113,6 +113,7 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK) | |||
113 | 113 | ||
114 | extern void __iomem *sysram_ns_base_addr; | 114 | extern void __iomem *sysram_ns_base_addr; |
115 | extern void __iomem *sysram_base_addr; | 115 | extern void __iomem *sysram_base_addr; |
116 | extern void __iomem *pmu_base_addr; | ||
116 | void exynos_sysram_init(void); | 117 | void exynos_sysram_init(void); |
117 | 118 | ||
118 | void exynos_firmware_init(void); | 119 | void exynos_firmware_init(void); |
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 269526bcc039..80cbbc74d2c8 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/pm_domain.h> | 21 | #include <linux/pm_domain.h> |
22 | #include <linux/irqchip.h> | ||
22 | 23 | ||
23 | #include <asm/cacheflush.h> | 24 | #include <asm/cacheflush.h> |
24 | #include <asm/hardware/cache-l2x0.h> | 25 | #include <asm/hardware/cache-l2x0.h> |
@@ -31,6 +32,8 @@ | |||
31 | #include "regs-pmu.h" | 32 | #include "regs-pmu.h" |
32 | #include "regs-sys.h" | 33 | #include "regs-sys.h" |
33 | 34 | ||
35 | void __iomem *pmu_base_addr; | ||
36 | |||
34 | static struct map_desc exynos4_iodesc[] __initdata = { | 37 | static struct map_desc exynos4_iodesc[] __initdata = { |
35 | { | 38 | { |
36 | .virtual = (unsigned long)S3C_VA_SYS, | 39 | .virtual = (unsigned long)S3C_VA_SYS, |
@@ -264,6 +267,39 @@ static void __init exynos_init_io(void) | |||
264 | exynos_map_io(); | 267 | exynos_map_io(); |
265 | } | 268 | } |
266 | 269 | ||
270 | static const struct of_device_id exynos_dt_pmu_match[] = { | ||
271 | { .compatible = "samsung,exynos3250-pmu" }, | ||
272 | { .compatible = "samsung,exynos4210-pmu" }, | ||
273 | { .compatible = "samsung,exynos4212-pmu" }, | ||
274 | { .compatible = "samsung,exynos4412-pmu" }, | ||
275 | { .compatible = "samsung,exynos5250-pmu" }, | ||
276 | { .compatible = "samsung,exynos5420-pmu" }, | ||
277 | { /*sentinel*/ }, | ||
278 | }; | ||
279 | |||
280 | static void exynos_map_pmu(void) | ||
281 | { | ||
282 | struct device_node *np; | ||
283 | |||
284 | np = of_find_matching_node(NULL, exynos_dt_pmu_match); | ||
285 | if (np) | ||
286 | pmu_base_addr = of_iomap(np, 0); | ||
287 | |||
288 | if (!pmu_base_addr) | ||
289 | panic("failed to find exynos pmu register\n"); | ||
290 | } | ||
291 | |||
292 | static void __init exynos_init_irq(void) | ||
293 | { | ||
294 | irqchip_init(); | ||
295 | /* | ||
296 | * Since platsmp.c needs pmu base address by the time | ||
297 | * DT is not unflatten so we can't use DT APIs before | ||
298 | * init_irq | ||
299 | */ | ||
300 | exynos_map_pmu(); | ||
301 | } | ||
302 | |||
267 | static void __init exynos_dt_machine_init(void) | 303 | static void __init exynos_dt_machine_init(void) |
268 | { | 304 | { |
269 | struct device_node *i2c_np; | 305 | struct device_node *i2c_np; |
@@ -344,6 +380,7 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)") | |||
344 | .smp = smp_ops(exynos_smp_ops), | 380 | .smp = smp_ops(exynos_smp_ops), |
345 | .map_io = exynos_init_io, | 381 | .map_io = exynos_init_io, |
346 | .init_early = exynos_firmware_init, | 382 | .init_early = exynos_firmware_init, |
383 | .init_irq = exynos_init_irq, | ||
347 | .init_machine = exynos_dt_machine_init, | 384 | .init_machine = exynos_dt_machine_init, |
348 | .init_late = exynos_init_late, | 385 | .init_late = exynos_init_late, |
349 | .dt_compat = exynos_dt_compat, | 386 | .dt_compat = exynos_dt_compat, |