mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/6] ARM: asm: Add convenience fucntions to access VBAR
@ 2016-01-01  5:58 Andrey Smirnov
  2016-01-01  5:58 ` [PATCH 2/6] ARM: mmu: Add VBAR setup Andrey Smirnov
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Andrey Smirnov @ 2016-01-01  5:58 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Add two functions to get/set VBAR register.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/include/asm/system.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 26fb18c..2e37675 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -71,6 +71,31 @@ static inline void set_cr(unsigned int val)
 	isb();
 }

+#if __LINUX_ARM_ARCH__ >= 7
+static inline unsigned int get_vbar(void)
+{
+	unsigned int vbar;
+	asm volatile("mrc p15, 0, %0, c12, c0, 0 @ get VBAR"
+		     : "=r" (vbar) : : "cc");
+	return vbar;
+}
+
+static inline void set_vbar(unsigned int vbar)
+{
+	asm volatile("mcr p15, 0, %0, c12, c0, 0 @ set VBAR"
+		     : : "r" (vbar) : "cc");
+	isb();
+}
+#else
+/*
+   Pre ARMv7 CPUs do not implement Security Extensions so normal
+   exceptions base address cannot be re-mapped from 0x00000000
+ */
+static inline unsigned int get_vbar(void) { return 0; }
+static inline void set_vbar(u32 vbar) {}
+#endif
+
+
 #endif

 #endif /* __ASM_ARM_SYSTEM_H */
--
2.5.0

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2016-01-08  7:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-01  5:58 [PATCH 1/6] ARM: asm: Add convenience fucntions to access VBAR Andrey Smirnov
2016-01-01  5:58 ` [PATCH 2/6] ARM: mmu: Add VBAR setup Andrey Smirnov
2016-01-04  9:04   ` Sascha Hauer
2016-01-01  5:58 ` [PATCH 3/6] ARM: Fix exception table setup in MMU-less mode Andrey Smirnov
2016-01-04  9:27   ` Sascha Hauer
2016-01-04 17:01     ` Andrey Smirnov
2016-01-05  7:40       ` Sascha Hauer
2016-01-01  5:58 ` [PATCH 4/6] i.MX6: pci: Replace magic number with a named constant Andrey Smirnov
2016-01-07  9:04   ` Lucas Stach
2016-01-08  7:53     ` Sascha Hauer
2016-01-01  5:58 ` [PATCH 5/6] i.MX6: pci: Reconcile imx6_pcie_start_link with the kernel code Andrey Smirnov
2016-01-07  9:08   ` Lucas Stach
2016-01-01  5:58 ` [PATCH 6/6] i.MX6: pci: Avoid aborts when asserting PCIe reset Andrey Smirnov
2016-01-04  9:30   ` Sascha Hauer
2016-01-07  9:13   ` Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox