aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2014-07-22 19:18:08 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-07-22 19:18:08 -0400
commit036c37c5809585495661d0eb6e78e0a3612ccde3 (patch)
treefd57213411c54bc09844e91d49a1eb86214ca8ed /arch/arm
parent9a3c4145af32125c5ee39c0272662b47307a8323 (diff)
parentfce9e5bb25264153f9f002eada41757118d25ba9 (diff)
Merge branch 'v3.17-next/cleanup-samsung' into v3.17-next/power-exynos
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig.debug20
-rw-r--r--arch/arm/mach-exynos/common.h13
-rw-r--r--arch/arm/mach-exynos/exynos.c44
-rw-r--r--arch/arm/mach-exynos/headsmp.S1
-rw-r--r--arch/arm/mach-exynos/hotplug.c3
-rw-r--r--arch/arm/mach-exynos/include/mach/map.h3
-rw-r--r--arch/arm/mach-exynos/include/mach/memory.h3
-rw-r--r--arch/arm/mach-exynos/platsmp.c3
-rw-r--r--arch/arm/mach-exynos/pm.c1
-rw-r--r--arch/arm/mach-exynos/pm_domains.c9
-rw-r--r--arch/arm/mach-exynos/pmu.c1
-rw-r--r--arch/arm/mach-exynos/regs-pmu.h4
-rw-r--r--arch/arm/mach-exynos/regs-sys.h22
13 files changed, 77 insertions, 50 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 8f90595069a1..b7acfa396679 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -617,53 +617,41 @@ choice
617 depends on PLAT_SAMSUNG 617 depends on PLAT_SAMSUNG
618 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 618 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
619 select DEBUG_S3C24XX_UART if ARCH_S3C24XX 619 select DEBUG_S3C24XX_UART if ARCH_S3C24XX
620 bool "Use S3C UART 0 for low-level debug" 620 bool "Use Samsung S3C UART 0 for low-level debug"
621 help 621 help
622 Say Y here if you want the debug print routines to direct 622 Say Y here if you want the debug print routines to direct
623 their output to UART 0. The port must have been initialised 623 their output to UART 0. The port must have been initialised
624 by the boot-loader before use. 624 by the boot-loader before use.
625 625
626 The uncompressor code port configuration is now handled
627 by CONFIG_S3C_LOWLEVEL_UART_PORT.
628
629 config DEBUG_S3C_UART1 626 config DEBUG_S3C_UART1
630 depends on PLAT_SAMSUNG 627 depends on PLAT_SAMSUNG
631 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 628 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
632 select DEBUG_S3C24XX_UART if ARCH_S3C24XX 629 select DEBUG_S3C24XX_UART if ARCH_S3C24XX
633 bool "Use S3C UART 1 for low-level debug" 630 bool "Use Samsung S3C UART 1 for low-level debug"
634 help 631 help
635 Say Y here if you want the debug print routines to direct 632 Say Y here if you want the debug print routines to direct
636 their output to UART 1. The port must have been initialised 633 their output to UART 1. The port must have been initialised
637 by the boot-loader before use. 634 by the boot-loader before use.
638 635
639 The uncompressor code port configuration is now handled
640 by CONFIG_S3C_LOWLEVEL_UART_PORT.
641
642 config DEBUG_S3C_UART2 636 config DEBUG_S3C_UART2
643 depends on PLAT_SAMSUNG 637 depends on PLAT_SAMSUNG
644 select DEBUG_EXYNOS_UART if ARCH_EXYNOS 638 select DEBUG_EXYNOS_UART if ARCH_EXYNOS
645 select DEBUG_S3C24XX_UART if ARCH_S3C24XX 639 select DEBUG_S3C24XX_UART if ARCH_S3C24XX
646 bool "Use S3C UART 2 for low-level debug" 640 bool "Use Samsung S3C UART 2 for low-level debug"
647 help 641 help
648 Say Y here if you want the debug print routines to direct 642 Say Y here if you want the debug print routines to direct
649 their output to UART 2. The port must have been initialised 643 their output to UART 2. The port must have been initialised
650 by the boot-loader before use. 644 by the boot-loader before use.
651 645
652 The uncompressor code port configuration is now handled
653 by CONFIG_S3C_LOWLEVEL_UART_PORT.
654
655 config DEBUG_S3C_UART3 646 config DEBUG_S3C_UART3
656 depends on PLAT_SAMSUNG && ARCH_EXYNOS 647 depends on PLAT_SAMSUNG && ARCH_EXYNOS
657 select DEBUG_EXYNOS_UART 648 select DEBUG_EXYNOS_UART
658 bool "Use S3C UART 3 for low-level debug" 649 bool "Use Samsung S3C UART 3 for low-level debug"
659 help 650 help
660 Say Y here if you want the debug print routines to direct 651 Say Y here if you want the debug print routines to direct
661 their output to UART 3. The port must have been initialised 652 their output to UART 3. The port must have been initialised
662 by the boot-loader before use. 653 by the boot-loader before use.
663 654
664 The uncompressor code port configuration is now handled
665 by CONFIG_S3C_LOWLEVEL_UART_PORT.
666
667 config DEBUG_S3C2410_UART0 655 config DEBUG_S3C2410_UART0
668 depends on ARCH_S3C24XX 656 depends on ARCH_S3C24XX
669 select DEBUG_S3C2410_UART 657 select DEBUG_S3C2410_UART
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 1ee91763fa7c..f8daa9cc5617 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -111,25 +111,14 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
111#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \ 111#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
112 soc_is_exynos5420() || soc_is_exynos5800()) 112 soc_is_exynos5420() || soc_is_exynos5800())
113 113
114void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1);
115
116struct map_desc;
117extern void __iomem *sysram_ns_base_addr; 114extern void __iomem *sysram_ns_base_addr;
118extern void __iomem *sysram_base_addr; 115extern void __iomem *sysram_base_addr;
119void exynos_init_io(void); 116extern void __iomem *pmu_base_addr;
120void exynos_restart(enum reboot_mode mode, const char *cmd);
121void exynos_sysram_init(void); 117void exynos_sysram_init(void);
122void exynos_cpuidle_init(void);
123void exynos_cpufreq_init(void);
124void exynos_init_late(void);
125 118
126void exynos_firmware_init(void); 119void exynos_firmware_init(void);
127 120
128#ifdef CONFIG_PINCTRL_EXYNOS
129extern u32 exynos_get_eint_wake_mask(void); 121extern u32 exynos_get_eint_wake_mask(void);
130#else
131static inline u32 exynos_get_eint_wake_mask(void) { return 0xffffffff; }
132#endif
133 122
134#ifdef CONFIG_PM_SLEEP 123#ifdef CONFIG_PM_SLEEP
135extern void __init exynos_pm_init(void); 124extern void __init exynos_pm_init(void);
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 46d893fcbe85..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>
@@ -29,6 +30,9 @@
29#include "common.h" 30#include "common.h"
30#include "mfc.h" 31#include "mfc.h"
31#include "regs-pmu.h" 32#include "regs-pmu.h"
33#include "regs-sys.h"
34
35void __iomem *pmu_base_addr;
32 36
33static struct map_desc exynos4_iodesc[] __initdata = { 37static struct map_desc exynos4_iodesc[] __initdata = {
34 { 38 {
@@ -143,7 +147,7 @@ static struct map_desc exynos5_iodesc[] __initdata = {
143 }, 147 },
144}; 148};
145 149
146void exynos_restart(enum reboot_mode mode, const char *cmd) 150static void exynos_restart(enum reboot_mode mode, const char *cmd)
147{ 151{
148 struct device_node *np; 152 struct device_node *np;
149 u32 val = 0x1; 153 u32 val = 0x1;
@@ -204,7 +208,7 @@ void __init exynos_sysram_init(void)
204 } 208 }
205} 209}
206 210
207void __init exynos_init_late(void) 211static void __init exynos_init_late(void)
208{ 212{
209 if (of_machine_is_compatible("samsung,exynos5440")) 213 if (of_machine_is_compatible("samsung,exynos5440"))
210 /* to be supported later */ 214 /* to be supported later */
@@ -251,7 +255,7 @@ static void __init exynos_map_io(void)
251 iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc)); 255 iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc));
252} 256}
253 257
254void __init exynos_init_io(void) 258static void __init exynos_init_io(void)
255{ 259{
256 debug_ll_io_init(); 260 debug_ll_io_init();
257 261
@@ -263,6 +267,39 @@ void __init exynos_init_io(void)
263 exynos_map_io(); 267 exynos_map_io();
264} 268}
265 269
270static 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
280static 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
292static 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
266static void __init exynos_dt_machine_init(void) 303static void __init exynos_dt_machine_init(void)
267{ 304{
268 struct device_node *i2c_np; 305 struct device_node *i2c_np;
@@ -343,6 +380,7 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
343 .smp = smp_ops(exynos_smp_ops), 380 .smp = smp_ops(exynos_smp_ops),
344 .map_io = exynos_init_io, 381 .map_io = exynos_init_io,
345 .init_early = exynos_firmware_init, 382 .init_early = exynos_firmware_init,
383 .init_irq = exynos_init_irq,
346 .init_machine = exynos_dt_machine_init, 384 .init_machine = exynos_dt_machine_init,
347 .init_late = exynos_init_late, 385 .init_late = exynos_init_late,
348 .dt_compat = exynos_dt_compat, 386 .dt_compat = exynos_dt_compat,
diff --git a/arch/arm/mach-exynos/headsmp.S b/arch/arm/mach-exynos/headsmp.S
index cdd9d91e9933..b54f9701e421 100644
--- a/arch/arm/mach-exynos/headsmp.S
+++ b/arch/arm/mach-exynos/headsmp.S
@@ -1,5 +1,4 @@
1/* 1/*
2 * linux/arch/arm/mach-exynos4/headsmp.S
3 * 2 *
4 * Cloned from linux/arch/arm/mach-realview/headsmp.S 3 * Cloned from linux/arch/arm/mach-realview/headsmp.S
5 * 4 *
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 920a4baa53cd..4d86961a7957 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -1,5 +1,4 @@
1/* linux arch/arm/mach-exynos4/hotplug.c 1/*
2 *
3 * Cloned from linux/arch/arm/mach-realview/hotplug.c 2 * Cloned from linux/arch/arm/mach-realview/hotplug.c
4 * 3 *
5 * Copyright (C) 2002 ARM Ltd. 4 * Copyright (C) 2002 ARM Ltd.
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 548269a60634..963002fb15c3 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-exynos/include/mach/map.h 1/*
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 2 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 3 * http://www.samsung.com/
5 * 4 *
diff --git a/arch/arm/mach-exynos/include/mach/memory.h b/arch/arm/mach-exynos/include/mach/memory.h
index 2a4cdb7cb326..e19df1f18c0d 100644
--- a/arch/arm/mach-exynos/include/mach/memory.h
+++ b/arch/arm/mach-exynos/include/mach/memory.h
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-exynos4/include/mach/memory.h 1/*
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 2 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 3 * http://www.samsung.com
5 * 4 *
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 50b9aad5e27b..a43822698361 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -1,5 +1,4 @@
1/* linux/arch/arm/mach-exynos4/platsmp.c 1 /*
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 2 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 3 * http://www.samsung.com
5 * 4 *
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 202ca73e49c4..f127c0cefbb8 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -35,6 +35,7 @@
35 35
36#include "common.h" 36#include "common.h"
37#include "regs-pmu.h" 37#include "regs-pmu.h"
38#include "regs-sys.h"
38 39
39/** 40/**
40 * struct exynos_wkup_irq - Exynos GIC to PMU IRQ mapping 41 * struct exynos_wkup_irq - Exynos GIC to PMU IRQ mapping
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index 797cb134bfff..fd76e1b5a471 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -23,8 +23,7 @@
23#include <linux/of_platform.h> 23#include <linux/of_platform.h>
24#include <linux/sched.h> 24#include <linux/sched.h>
25 25
26#include "regs-pmu.h" 26#define INT_LOCAL_PWR_EN 0x7
27
28#define MAX_CLK_PER_DOMAIN 4 27#define MAX_CLK_PER_DOMAIN 4
29 28
30/* 29/*
@@ -63,13 +62,13 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
63 } 62 }
64 } 63 }
65 64
66 pwr = power_on ? S5P_INT_LOCAL_PWR_EN : 0; 65 pwr = power_on ? INT_LOCAL_PWR_EN : 0;
67 __raw_writel(pwr, base); 66 __raw_writel(pwr, base);
68 67
69 /* Wait max 1ms */ 68 /* Wait max 1ms */
70 timeout = 10; 69 timeout = 10;
71 70
72 while ((__raw_readl(base + 0x4) & S5P_INT_LOCAL_PWR_EN) != pwr) { 71 while ((__raw_readl(base + 0x4) & INT_LOCAL_PWR_EN) != pwr) {
73 if (!timeout) { 72 if (!timeout) {
74 op = (power_on) ? "enable" : "disable"; 73 op = (power_on) ? "enable" : "disable";
75 pr_err("Power domain %s %s failed\n", domain->name, op); 74 pr_err("Power domain %s %s failed\n", domain->name, op);
@@ -231,7 +230,7 @@ static __init int exynos4_pm_init_power_domain(void)
231no_clk: 230no_clk:
232 platform_set_drvdata(pdev, pd); 231 platform_set_drvdata(pdev, pd);
233 232
234 on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN; 233 on = __raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN;
235 234
236 pm_genpd_init(&pd->pd, NULL, !on); 235 pm_genpd_init(&pd->pd, NULL, !on);
237 } 236 }
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index fb0deda3b3a4..dcfcb44c3c55 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -11,7 +11,6 @@
11 11
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/bug.h>
15 14
16#include "common.h" 15#include "common.h"
17#include "regs-pmu.h" 16#include "regs-pmu.h"
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index 1d13b08708f0..1993e6bd5388 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -15,7 +15,6 @@
15#include <mach/map.h> 15#include <mach/map.h>
16 16
17#define S5P_PMUREG(x) (S5P_VA_PMU + (x)) 17#define S5P_PMUREG(x) (S5P_VA_PMU + (x))
18#define S5P_SYSREG(x) (S3C_VA_SYS + (x))
19 18
20#define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200) 19#define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200)
21 20
@@ -127,7 +126,6 @@
127#define S5P_PAD_RET_EBIB_OPTION S5P_PMUREG(0x31A8) 126#define S5P_PAD_RET_EBIB_OPTION S5P_PMUREG(0x31A8)
128 127
129#define S5P_CORE_LOCAL_PWR_EN 0x3 128#define S5P_CORE_LOCAL_PWR_EN 0x3
130#define S5P_INT_LOCAL_PWR_EN 0x7
131 129
132/* Only for EXYNOS4210 */ 130/* Only for EXYNOS4210 */
133#define S5P_CMU_CLKSTOP_LCD1_LOWPWR S5P_PMUREG(0x1154) 131#define S5P_CMU_CLKSTOP_LCD1_LOWPWR S5P_PMUREG(0x1154)
@@ -188,8 +186,6 @@
188 186
189/* For EXYNOS5 */ 187/* For EXYNOS5 */
190 188
191#define EXYNOS5_SYS_I2C_CFG S5P_SYSREG(0x0234)
192
193#define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408) 189#define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408)
194#define EXYNOS5_MASK_WDTRESET_REQUEST S5P_PMUREG(0x040C) 190#define EXYNOS5_MASK_WDTRESET_REQUEST S5P_PMUREG(0x040C)
195 191
diff --git a/arch/arm/mach-exynos/regs-sys.h b/arch/arm/mach-exynos/regs-sys.h
new file mode 100644
index 000000000000..84332b0dd7a6
--- /dev/null
+++ b/arch/arm/mach-exynos/regs-sys.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * EXYNOS - system register definition
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#ifndef __ASM_ARCH_REGS_SYS_H
13#define __ASM_ARCH_REGS_SYS_H __FILE__
14
15#include <mach/map.h>
16
17#define S5P_SYSREG(x) (S3C_VA_SYS + (x))
18
19/* For EXYNOS5 */
20#define EXYNOS5_SYS_I2C_CFG S5P_SYSREG(0x0234)
21
22#endif /* __ASM_ARCH_REGS_SYS_H */