diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-11-26 08:46:58 -0500 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2014-02-10 05:21:45 -0500 |
commit | 568800731a5b0f6b03d3ee9435b42fecd342454e (patch) | |
tree | d3b2aecb1f570ef1166ad3a5007c88327a54817e | |
parent | 871c6971ec38d485fa601f6d9f60cb8d25a5aae1 (diff) |
ARM: zynq: Introduce zynq_slcr_unlock()
Call special function for unlocking SLCR.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
-rw-r--r-- | arch/arm/mach-zynq/slcr.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c index ab85f4e8edb0..a37d49a6e657 100644 --- a/arch/arm/mach-zynq/slcr.c +++ b/arch/arm/mach-zynq/slcr.c | |||
@@ -71,6 +71,18 @@ static int zynq_slcr_read(u32 *val, u32 offset) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * zynq_slcr_unlock - Unlock SLCR registers | ||
75 | * | ||
76 | * Return: a negative value on error, 0 on success | ||
77 | */ | ||
78 | static inline int zynq_slcr_unlock(void) | ||
79 | { | ||
80 | zynq_slcr_write(SLCR_UNLOCK_MAGIC, SLCR_UNLOCK_OFFSET); | ||
81 | |||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | /** | ||
74 | * zynq_slcr_system_reset - Reset the entire system. | 86 | * zynq_slcr_system_reset - Reset the entire system. |
75 | */ | 87 | */ |
76 | void zynq_slcr_system_reset(void) | 88 | void zynq_slcr_system_reset(void) |
@@ -82,7 +94,7 @@ void zynq_slcr_system_reset(void) | |||
82 | * Note that this seems to require raw i/o | 94 | * Note that this seems to require raw i/o |
83 | * functions or there's a lockup? | 95 | * functions or there's a lockup? |
84 | */ | 96 | */ |
85 | writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); | 97 | zynq_slcr_unlock(); |
86 | 98 | ||
87 | /* | 99 | /* |
88 | * Clear 0x0F000000 bits of reboot status register to workaround | 100 | * Clear 0x0F000000 bits of reboot status register to workaround |
@@ -166,7 +178,7 @@ int __init zynq_early_slcr_init(void) | |||
166 | np->data = (__force void *)zynq_slcr_base; | 178 | np->data = (__force void *)zynq_slcr_base; |
167 | 179 | ||
168 | /* unlock the SLCR so that registers can be changed */ | 180 | /* unlock the SLCR so that registers can be changed */ |
169 | writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); | 181 | zynq_slcr_unlock(); |
170 | 182 | ||
171 | pr_info("%s mapped to %p\n", np->name, zynq_slcr_base); | 183 | pr_info("%s mapped to %p\n", np->name, zynq_slcr_base); |
172 | 184 | ||