mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] MIPS: starts.S fixup
@ 2011-07-08  7:29 Antony Pavlov
  0 siblings, 0 replies; only message in thread
From: Antony Pavlov @ 2011-07-08  7:29 UTC (permalink / raw)
  To: barebox

---
 arch/mips/boot/start.S |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/mips/boot/start.S b/arch/mips/boot/start.S
index 53077e9..6996b33 100644
--- a/arch/mips/boot/start.S
+++ b/arch/mips/boot/start.S
@@ -70,10 +70,14 @@ _start:
 	mtc0	zero, CP0_COUNT
 	mtc0	zero, CP0_COMPARE
 
-	ADR	a0, _start, t1	/* a0 <- current position of _start */
+	/* copy barebox to link location */
+	ADR	a0, _start, t1	/* a0 <- pc-relative position of _start */
 
 	la	a1, _start	/* link (RAM) _start address */
 
+	beq	a0, a1, clear_bss
+	 nop
+
 	la	t0, _start
 	la	t1, __bss_start
 	subu	t2, t1, t0	/* t2 <- size of barebox */
@@ -82,11 +86,13 @@ _start:
 #define LONGSIZE	4
 
 copy_loop:
-	lw		t4, LONGSIZE * 0(a0)	# copy from source address [t0]
+	/* copy from source address [a0] */
+	lw		t4, LONGSIZE * 0(a0)
 	lw		t5, LONGSIZE * 1(a0)
 	lw		t6, LONGSIZE * 2(a0)
 	lw		t7, LONGSIZE * 3(a0)
-	sw		t4, LONGSIZE * 0(a1)	# copy fo target address [t1]
+	/* copy fo target address [a1] */
+	sw		t4, LONGSIZE * 0(a1)
 	sw		t5, LONGSIZE * 1(a1)
 	sw		t6, LONGSIZE * 2(a1)
 	sw		t7, LONGSIZE * 3(a1)
@@ -100,7 +106,7 @@ clear_bss:
 	sw	zero, (t0)
 	la	t1, _end - 4
 1:
-	addiu	t0, 4
+	addiu	t0, LONGSIZE
 	sw	zero, (t0)
 	bne	t0, t1, 1b
 	 nop
-- 
1.7.5.4


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-08  7:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-08  7:29 [PATCH] MIPS: starts.S fixup Antony Pavlov

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