diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-11-26 09:41:31 -0500 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2014-02-10 05:20:54 -0500 |
commit | 016f4dcae81e842a2b7dbfbc0fc9257f9f16e785 (patch) | |
tree | 8f8ba77ad9ae0d0c1636af037e35f2ab4fdba6d1 /arch/arm/mach-zynq | |
parent | 6f69c7f21ce89409ccc54bd596434fa61d5b26ff (diff) |
ARM: zynq: Split slcr in two parts
Split the slcr into an early part for unlocking and cpu starting
and a later syscon driver.
Also add "syscon" compatible property for slcr.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm/mach-zynq')
-rw-r--r-- | arch/arm/mach-zynq/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-zynq/common.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-zynq/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-zynq/slcr.c | 26 |
4 files changed, 29 insertions, 3 deletions
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig index 6b04260aa142..323e5053cb9f 100644 --- a/arch/arm/mach-zynq/Kconfig +++ b/arch/arm/mach-zynq/Kconfig | |||
@@ -14,5 +14,6 @@ config ARCH_ZYNQ | |||
14 | select SPARSE_IRQ | 14 | select SPARSE_IRQ |
15 | select CADENCE_TTC_TIMER | 15 | select CADENCE_TTC_TIMER |
16 | select ARM_GLOBAL_TIMER | 16 | select ARM_GLOBAL_TIMER |
17 | select MFD_SYSCON | ||
17 | help | 18 | help |
18 | Support for Xilinx Zynq ARM Cortex A9 Platform | 19 | Support for Xilinx Zynq ARM Cortex A9 Platform |
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index bf6717f5cd3c..38401cf78383 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -59,11 +59,13 @@ static void __init zynq_init_machine(void) | |||
59 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 59 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
60 | 60 | ||
61 | platform_device_register(&zynq_cpuidle_device); | 61 | platform_device_register(&zynq_cpuidle_device); |
62 | |||
63 | zynq_slcr_init(); | ||
62 | } | 64 | } |
63 | 65 | ||
64 | static void __init zynq_timer_init(void) | 66 | static void __init zynq_timer_init(void) |
65 | { | 67 | { |
66 | zynq_slcr_init(); | 68 | zynq_early_slcr_init(); |
67 | 69 | ||
68 | zynq_clock_init(zynq_slcr_base); | 70 | zynq_clock_init(zynq_slcr_base); |
69 | clocksource_of_init(); | 71 | clocksource_of_init(); |
diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h index c22c92cea8cb..1548b85b56ad 100644 --- a/arch/arm/mach-zynq/common.h +++ b/arch/arm/mach-zynq/common.h | |||
@@ -20,6 +20,7 @@ | |||
20 | void zynq_secondary_startup(void); | 20 | void zynq_secondary_startup(void); |
21 | 21 | ||
22 | extern int zynq_slcr_init(void); | 22 | extern int zynq_slcr_init(void); |
23 | extern int zynq_early_slcr_init(void); | ||
23 | extern void zynq_slcr_system_reset(void); | 24 | extern void zynq_slcr_system_reset(void); |
24 | extern void zynq_slcr_cpu_stop(int cpu); | 25 | extern void zynq_slcr_cpu_stop(int cpu); |
25 | extern void zynq_slcr_cpu_start(int cpu); | 26 | extern void zynq_slcr_cpu_start(int cpu); |
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c index 59ad09ff3bc0..899f97925729 100644 --- a/arch/arm/mach-zynq/slcr.c +++ b/arch/arm/mach-zynq/slcr.c | |||
@@ -15,7 +15,9 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/mfd/syscon.h> | ||
18 | #include <linux/of_address.h> | 19 | #include <linux/of_address.h> |
20 | #include <linux/regmap.h> | ||
19 | #include <linux/clk/zynq.h> | 21 | #include <linux/clk/zynq.h> |
20 | #include "common.h" | 22 | #include "common.h" |
21 | 23 | ||
@@ -30,6 +32,7 @@ | |||
30 | #define SLCR_A9_CPU_RST 0x1 | 32 | #define SLCR_A9_CPU_RST 0x1 |
31 | 33 | ||
32 | void __iomem *zynq_slcr_base; | 34 | void __iomem *zynq_slcr_base; |
35 | static struct regmap *zynq_slcr_regmap; | ||
33 | 36 | ||
34 | /** | 37 | /** |
35 | * zynq_slcr_system_reset - Reset the entire system. | 38 | * zynq_slcr_system_reset - Reset the entire system. |
@@ -80,13 +83,32 @@ void zynq_slcr_cpu_stop(int cpu) | |||
80 | } | 83 | } |
81 | 84 | ||
82 | /** | 85 | /** |
83 | * zynq_slcr_init | 86 | * zynq_slcr_init - Regular slcr driver init |
84 | * Returns 0 on success, negative errno otherwise. | 87 | * |
88 | * Return: 0 on success, negative errno otherwise. | ||
85 | * | 89 | * |
86 | * Called early during boot from platform code to remap SLCR area. | 90 | * Called early during boot from platform code to remap SLCR area. |
87 | */ | 91 | */ |
88 | int __init zynq_slcr_init(void) | 92 | int __init zynq_slcr_init(void) |
89 | { | 93 | { |
94 | zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr"); | ||
95 | if (IS_ERR(zynq_slcr_regmap)) { | ||
96 | pr_err("%s: failed to find zynq-slcr\n", __func__); | ||
97 | return -ENODEV; | ||
98 | } | ||
99 | |||
100 | return 0; | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * zynq_early_slcr_init - Early slcr init function | ||
105 | * | ||
106 | * Return: 0 on success, negative errno otherwise. | ||
107 | * | ||
108 | * Called very early during boot from platform code to unlock SLCR. | ||
109 | */ | ||
110 | int __init zynq_early_slcr_init(void) | ||
111 | { | ||
90 | struct device_node *np; | 112 | struct device_node *np; |
91 | 113 | ||
92 | np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr"); | 114 | np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr"); |