openrisc: Work around potential relocation issues

When reset code is in flash, the jump instructions emitted by the
compiler are relative instead of absolute jumps.

A fix to the reset code to make correct jumps to the beginning of
code relocated to RAM have also been added.

Signed-off-by: Julius Baxter <juliusbaxter@gmail.com>
diff --git a/arch/openrisc/cpu/cpu.c b/arch/openrisc/cpu/cpu.c
index 25cd624..73ecc6f 100644
--- a/arch/openrisc/cpu/cpu.c
+++ b/arch/openrisc/cpu/cpu.c
@@ -151,7 +151,11 @@
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	disable_interrupts();
-	__reset();
+	/* Code the jump to __reset here as the compiler is prone to
+	   emitting a bad jump instruction if the function is in flash */
+	__asm__("l.movhi r1,hi(__reset);  \
+                 l.ori r1,r1,lo(__reset); \
+                 l.jr r1");
 	/* not reached, __reset does not return */
 	return 0;
 }