From: Erik Mouw <erikm@us...> - 2002-07-19 15:20:08
Update of /cvsroot/blob/blob/src/blob
In directory usw-pr-cvs1:/tmp/cvs-serv15961
A bit of IRC log to explain:
16:59 <erikm> blob prints something before it even starts the mem test loop
17:00 <erikm> if it doesn't, it's time for LED/scope debugging
17:04 <xhomie> I Try to make LED debugging :-). I can turn the LED on in
mem_test_loop: but not in relocate:. So I think the Problem
is in mem_test_loop.
17:04 <erikm> oh, it is still stuck in the first stage loader?
17:05 <xhomie> It looks so.
17:06 * erikm spots a bug in mem_test_loop
17:07 <erikm> moveq pc, lr /* oops, something went wrong :( */
17:07 <erikm> that's obviously wrong
17:08 <erikm> mem_test_loop isn't called from another function, so lr still
contains the value of the instruction just above it
17:08 <erikm> in that case we'll get a tight loop containing only two
17:08 <erikm> teq r0, #1
17:08 <erikm> moveq pc, lr /* oops, something went wrong :( */
17:11 * erikm looks for a good idea to fix it
17:11 <erikm> hmmm'
17:11 <erikm> need to rewrite start.S a bit
17:11 <erikm> hmmm
This is a temporary fix, I need to make something better, but I need to
rewrite start.S anyway (I also want to be able to do IRQ and FIQ).
Note: this patch is not tested, but should be obviously OK. xhomie should
be able to put LED blink code in endless_loop.
RCS file: /cvsroot/blob/blob/src/blob/start.S,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- start.S 18 Jan 2002 22:32:00 -0000 1.8
+++ start.S 19 Jul 2002 15:20:03 -0000 1.9
@@ -72,7 +72,7 @@
mov r0, r5
teq r0, #1
- moveq pc, lr /* oops, something went wrong :( */
+ beq endless_loop /* oops, something went wrong :( */
add r5, r5, r7
subs r6, r6, r7
@@ -101,3 +101,11 @@
/* blob is copied to ram, so jump to it */
ldr r0, BLOB_START
mov pc, r0
+ /* either the second stage loader returned, or we got here from
+ * mem_test_loop. both is bad, and we really want to toggle a
+ * GPIO line or so. for the time being we just do an endless
+ * loop. FIXME! -- erik
+ b endless_loop