Skip to contentSkip to conversation

mx25: Fix relocation by adding specific relocate_vectors

PATCH New Fabio Estevam 1 participant 3 messages Jan 5, 2015 – Jan 6, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx25: Fix relocation by adding specific relocate_vectors

From: Fabio Estevam <[email protected]>

Since commit ("arm: relocate the exception vectors") mx25pdk hangs like this:

CPU:   Freescale i.MX25 rev1.2 at 399 MHz
Reset cause: WDOG
Board: MX25PDK
I2C:   ready
DRAM:  64 MiB

(hangs)

We need to add a specific relocate_vectors macro, just like it was done for mx27 SoC in commit db544b9662622826b8 ("imx: fix exception vectors relocation in imx27").

This allows mx25 to boot again.

---
 arch/arm/cpu/arm926ejs/mx25/Makefile   |  4 +++
 arch/arm/cpu/arm926ejs/mx25/relocate.S | 51 ++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/mx25/relocate.S
arch/arm/cpu/arm926ejs/mx25/Makefile +4 -0
index 134c69d..ebc0407 100644
@@ -5,3 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 
 obj-y	= generic.o timer.o reset.o
+
+ifndef CONFIG_SPL_BUILD
+obj-y	+= relocate.o
+endif
arch/arm/cpu/arm926ejs/mx25/relocate.S new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 mx25: Fix relocation by adding specific relocate_vectors

From: Fabio Estevam <[email protected]>

Since commit ("arm: relocate the exception vectors") mx25pdk hangs like this:

CPU:   Freescale i.MX25 rev1.2 at 399 MHz
Reset cause: WDOG
Board: MX25PDK
I2C:   ready
DRAM:  64 MiB

(hangs)

We need to add a specific relocate_vectors macro, just like it was done for mx27 SoC in commit db544b9662622826b8 ("imx: fix exception vectors relocation in imx27").

This allows mx25 to boot again.

---
 arch/arm/cpu/arm926ejs/mx25/Makefile   |  4 +++
 arch/arm/cpu/arm926ejs/mx25/relocate.S | 51 ++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 arch/arm/cpu/arm926ejs/mx25/relocate.S
arch/arm/cpu/arm926ejs/mx25/Makefile +4 -0
index 134c69d..ebc0407 100644
@@ -5,3 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 
 obj-y	= generic.o timer.o reset.o
+
+ifndef CONFIG_SPL_BUILD
+obj-y	+= relocate.o
+endif
arch/arm/cpu/arm926ejs/mx25/relocate.S new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/1 mx25: Fix relocation by adding specific relocate_vectors

In reply to Fabio Estevam

arch/arm/cpu/arm926ejs/mx25/relocate.S line 51

Quoted 12 lines · Fabio Estevam
arch/arm/cpu/arm926ejs/mx25/relocate.S new file +12 -0
+ENTRY(relocate_vectors)
+
+       ldr     r0, [r9, #GD_RELOCADDR] /* r0 = gd->relocaddr */
+       ldr     r1, =32                 /* size of vector table */
+       add     r0, r0, r1              /* skip to indirect table */
+       ldr     r1, =0xFFFFFEF0         /* i.MX25 indirect table */
+       ldmia   r0!, {r2-r8}            /* load indirect vectors 1..7 */
+       stmia   r1!, {r2-r5, r7,r8}     /* write all but vector 5 */
+
+       bx      lr
+
+ENDPROC(relocate_vectors)

If I simply do like this:

ENTRY(relocate_vectors)
bx lr
ENDPROC(relocate_vectors)

,then it also boots fine. So maybe we don't even need to do the relocation on mx25?

Thanks