linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: add diagnostic register access helpers
@ 2013-04-16 14:30 Shawn Guo
  2013-04-16 14:30 ` [PATCH 2/2] ARM: imx: replicate the diagnostic register of boot cpu into secondary cores Shawn Guo
  2013-04-16 14:48 ` [PATCH 1/2] ARM: add diagnostic register access helpers Will Deacon
  0 siblings, 2 replies; 4+ messages in thread
From: Shawn Guo @ 2013-04-16 14:30 UTC (permalink / raw)
  To: linux-arm-kernel

The CP15 diagnostic register holds many ARM errata bits.  Add a pair of
access helpers for it.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/include/asm/cp15.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/include/asm/cp15.h b/arch/arm/include/asm/cp15.h
index 5ef4d80..0b14dfb 100644
--- a/arch/arm/include/asm/cp15.h
+++ b/arch/arm/include/asm/cp15.h
@@ -82,6 +82,19 @@ static inline void set_copro_access(unsigned int val)
 	isb();
 }
 
+static inline unsigned int get_diag_reg(void)
+{
+	unsigned int val;
+	asm("mrc p15, 0, %0, c15, c0, 1" : "=r" (val) : : "cc");
+	return val;
+}
+
+static inline void set_diag_reg(unsigned int val)
+{
+	asm volatile("mcr p15, 0, %0, c15, c0, 1" : : "r" (val) : "cc");
+	isb();
+}
+
 #endif
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-16 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16 14:30 [PATCH 1/2] ARM: add diagnostic register access helpers Shawn Guo
2013-04-16 14:30 ` [PATCH 2/2] ARM: imx: replicate the diagnostic register of boot cpu into secondary cores Shawn Guo
2013-04-16 14:48 ` [PATCH 1/2] ARM: add diagnostic register access helpers Will Deacon
2013-04-16 15:11   ` Shawn Guo

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).