From: michal.simek@xilinx.com (Michal Simek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/7] ARM: zynq: Introduce zynq_slcr_unlock()
Date: Mon, 6 Jan 2014 15:36:43 +0100 [thread overview]
Message-ID: <bf130aff62c16b98b2372c328ee593de92431c41.1389018985.git.michal.simek@xilinx.com> (raw)
In-Reply-To: <cover.1389018985.git.michal.simek@xilinx.com>
Call special function for unlocking SLCR.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
arch/arm/mach-zynq/slcr.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index f0f6a69..c1f1499 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)
}
/**
+ * zynq_slcr_unlock - Unlock SLCR registers
+ *
+ * return: a negative value on error, 0 on success
+ */
+static inline int zynq_slcr_unlock(void)
+{
+ zynq_slcr_write(SLCR_UNLOCK_MAGIC, SLCR_UNLOCK_OFFSET);
+
+ return 0;
+}
+
+/**
* zynq_slcr_system_reset - Reset the entire system.
*/
void zynq_slcr_system_reset(void)
@@ -82,7 +94,7 @@ void zynq_slcr_system_reset(void)
* Note that this seems to require raw i/o
* functions or there's a lockup?
*/
- writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET);
+ zynq_slcr_unlock();
/*
* Clear 0x0F000000 bits of reboot status register to workaround
@@ -164,7 +176,7 @@ int __init zynq_early_slcr_init(void)
np->data = (__force void *)zynq_slcr_base;
/* unlock the SLCR so that registers can be changed */
- writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET);
+ zynq_slcr_unlock();
pr_info("%s mapped to %p\n", np->name, zynq_slcr_base);
--
1.8.2.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140106/38ae2957/attachment.sig>
prev parent reply other threads:[~2014-01-06 14:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 14:36 [PATCH 0/7] Xilinx Zynq SLCR changes Michal Simek
2014-01-06 14:36 ` [PATCH 1/7] ARM: zynq: Move clock_init from slcr to common Michal Simek
2014-01-06 14:36 ` [PATCH 2/7] ARM: zynq: Split slcr in two parts Michal Simek
2014-01-06 14:36 ` [PATCH 3/7] ARM: zynq: Hang iomapped slcr address on device_node Michal Simek
2014-03-11 21:26 ` Olof Johansson
2014-03-12 11:51 ` Michal Simek
2014-01-06 14:36 ` [PATCH 4/7] ARM: zynq: Map I/O memory on clkc init Michal Simek
2014-01-06 14:36 ` [PATCH 5/7] ARM: zynq: Make zynq_slcr_base static Michal Simek
2014-01-06 14:36 ` [PATCH 6/7] ARM: zynq: Add and use zynq_slcr_read/write() helper functions Michal Simek
2014-01-06 14:36 ` Michal Simek [this message]
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=bf130aff62c16b98b2372c328ee593de92431c41.1389018985.git.michal.simek@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).