From 00b95def09f7e9cda56423c812a41b94afcd0617 Mon Sep 17 00:00:00 2001
From: Armin Luntzer <armin.luntzer@univie.ac.at>
Date: Thu, 23 Mar 2017 12:00:41 +0100
Subject: [PATCH] add asm/processor.h

---
 arch/sparc/include/asm/processor.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 arch/sparc/include/asm/processor.h

diff --git a/arch/sparc/include/asm/processor.h b/arch/sparc/include/asm/processor.h
new file mode 100644
index 0000000..d3af5f5
--- /dev/null
+++ b/arch/sparc/include/asm/processor.h
@@ -0,0 +1,26 @@
+/**
+ * @file arch/sparc/include/asm/processor.h
+ */
+
+#ifndef _SPARC_PROCESSOR_H_
+#define _SPARC_PROCESSOR_H_
+
+#include <asm/leon.h>
+#include <asm/io.h>
+
+#ifdef CONFIG_MPPB
+/* write/read the leon2 power down register */
+#define cpu_relax() do {					\
+		iowrite32be(0xFEE1DEAD, (void *) 0x80000018);	\
+		ioread32be((void *) 0x80000018);		\
+		} while(0);
+
+#else
+/* XXX should not assume that this is always a valid physical address
+ * (see also LEON3FT Cache Controller Power Down erratum
+ */
+#define cpu_relax() leon3_powerdown_safe(0x40000000)
+#endif
+
+#endif /* _SPARC_PROCESSOR_H_ */
+
-- 
GitLab