Skip to contentSkip to conversation

armv7: setup vector

RFC PATCH New Aneesh V 1 participant 1 message Jul 20, 2011 Arm (32-bit)

lore
Share & tools
lore

Aneesh V

author
#0 lore raw

RFC PATCH 1/1 armv7: setup vector

The vector is not correctly setup in armv7 except for OMAP3. Correcting this.

Cc Albert Aribaud <[email protected]>
---
 arch/arm/cpu/armv7/start.S |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/start.S +10 -0
index 89ea01f..9ffdfe2 100644
@@ -32,6 +32,7 @@
 #include <asm-offsets.h>
 #include <config.h>
 #include <version.h>
+#include <asm/system.h>
 
 .globl _start
 _start: b	reset
@@ -143,6 +144,15 @@ reset:
 	orr	r0, r0, #0xd3
 	msr	cpsr,r0
 
+	/* Set V=0 in CP15 SCTRL register - for VBAR to point to vector */
+	mrc	p15, 0, r0, c1, c0, 0	@ Read CP15 SCTRL Register
+	bic	r0, #CR_V		@ V = 0
+	mcr	p15, 0, r0, c1, c0, 0	@ Write CP15 SCTRL Register
+
+	/* Set vector address in CP15 VBAR register */
+	ldr	r0, =_start
+	mcr	p15, 0, r0, c12, c0, 0	@Set VBAR
+
 #if defined(CONFIG_OMAP34XX)
 	/* Copy vectors to mask ROM indirect addr */
 	adr	r0, _start		@ r0 <- current position of code
Signature · 1 line
1.7.0.4