public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: bugfix: Move vector table before jumping relocated code
@ 2012-06-25 12:40 Tetsuyuki Kobayashi
  2012-06-25 15:10 ` Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tetsuyuki Kobayashi @ 2012-06-25 12:40 UTC (permalink / raw)
  To: u-boot

Interrupts and exceptions doesn't work in relocated code.
It badly use IRQ_STACK_START_IN in rom area as interrupt stack.
It is because the vecotr table is not moved to ram area.
This patch moves vector table before jumping relocated code.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
 arch/arm/cpu/armv7/start.S |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 52f7f6e..5098f7b 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -277,6 +277,18 @@ jump_2_ram:
 	mcr     p15, 0, r0, c7, c10, 4	@ DSB
 	mcr     p15, 0, r0, c7, c5, 4	@ ISB
 #endif
+/*
+ * Move vector table
+ */
+#if !defined(CONFIG_TEGRA2)
+#if !(defined(CONFIG_OMAP44XX) && defined(CONFIG_SPL_BUILD))
+	/* Set vector address in CP15 VBAR register */
+	ldr     r0, =_start
+	add     r0, r0, r9
+	mcr     p15, 0, r0, c12, c0, 0  @Set VBAR
+#endif
+#endif /* !Tegra2 */
+	
 	ldr	r0, _board_init_r_ofs
 	adr	r1, _start
 	add	lr, r0, r1
-- 
1.7.9.5

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

end of thread, other threads:[~2012-12-26  0:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 12:40 [U-Boot] [PATCH] arm: bugfix: Move vector table before jumping relocated code Tetsuyuki Kobayashi
2012-06-25 15:10 ` Stephen Warren
2012-06-26  1:03   ` Tetsuyuki Kobayashi
2012-06-26 16:24     ` Stephen Warren
2012-07-05  9:27       ` Albert ARIBAUD
2012-06-27 18:23 ` Tom Rini
2012-06-28  1:27   ` Tetsuyuki Kobayashi
2012-12-21 15:17     ` Joel A Fernandes
2012-12-25 23:18       ` Tetsuyuki Kobayashi
2012-12-26  0:08         ` Joel A Fernandes
2012-07-05 12:00 ` Albert ARIBAUD

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