From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>,
<linux-kernel@vger.kernel.org>,
James Hogan <james.hogan@imgtec.com>,
Markos Chandras <markos.chandras@imgtec.com>,
Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 4/5] MIPS: allow read64 GCR accessors to work on MIPS32 kernels
Date: Tue, 22 Sep 2015 10:26:40 -0700 [thread overview]
Message-ID: <1442942801-2883-5-git-send-email-paul.burton@imgtec.com> (raw)
In-Reply-To: <1442942801-2883-1-git-send-email-paul.burton@imgtec.com>
If we run a MIPS32 kernel on a system using CM3 we may still need to
access 64 bit GCRs, as will be done in later patches. Allow this by
having the read64_gcr_* accessor functions perform 2 x 32 bit reads on
those systems.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
arch/mips/include/asm/mips-cm.h | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h
index 2a70b76..b9df4b2 100644
--- a/arch/mips/include/asm/mips-cm.h
+++ b/arch/mips/include/asm/mips-cm.h
@@ -125,7 +125,17 @@ static inline u32 read32_gcr_##name(void) \
\
static inline u64 read64_gcr_##name(void) \
{ \
- return __raw_readq(addr_gcr_##name()); \
+ void __iomem *addr = addr_gcr_##name(); \
+ u64 ret; \
+ \
+ if (mips_cm_is64) { \
+ ret = __raw_readq(addr); \
+ } else { \
+ ret = __raw_readl(addr); \
+ ret |= (u64)__raw_readl(addr + 0x4) << 32; \
+ } \
+ \
+ return ret; \
} \
\
static inline unsigned long read_gcr_##name(void) \
--
2.5.3
next prev parent reply other threads:[~2015-09-22 17:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 17:26 [PATCH 0/5] CM error report fixes Paul Burton
2015-09-22 17:26 ` [PATCH 1/5] MIPS: clarify mips_cm_is64 documentation Paul Burton
2015-09-22 17:26 ` [PATCH 2/5] MIPS: don't read GCRs when a CM is not present Paul Burton
2015-09-22 17:26 ` [PATCH 3/5] MIPS: avoid buffer overrun in mips_cm_error_report Paul Burton
2015-09-22 17:26 ` Paul Burton [this message]
2015-09-22 17:26 ` [PATCH 5/5] MIPS: always read full 64 bit CM error GCRs for CM3 Paul Burton
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=1442942801-2883-5-git-send-email-paul.burton@imgtec.com \
--to=paul.burton@imgtec.com \
--cc=james.hogan@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=markos.chandras@imgtec.com \
--cc=ralf@linux-mips.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
all inboxes | Powered by JetHome®