From: Erik M. <er...@us...> - 2002-01-18 22:32:03
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv25602 Modified Files: start.S start-sa11x0.S Log Message: All machine specific initialisation is now done in start-sa11x0.S. This should make it easier to port blob to non-StrongARM architectures. Index: start.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/start.S,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- start.S 2002/01/12 01:45:57 1.7 +++ start.S 2002/01/18 22:32:00 1.8 @@ -42,6 +42,7 @@ #include <blob/arch.h> + .text /* Jump vector table as in table 3.1 in [1] */ @@ -71,7 +72,7 @@ mov r0, r5 bl testram teq r0, #1 - beq badram + moveq pc, lr /* oops, something went wrong :( */ add r5, r5, r7 subs r6, r6, r7 @@ -97,89 +98,6 @@ ble copy_loop - /* turn off the LED. if it stays off it is an indication that - * we didn't make it into the C code - */ - bl led_off - - /* blob is copied to ram, so jump to it */ ldr r0, BLOB_START mov pc, r0 - - -badram: - mov r6, #2 - b endless_blink - - - -endless_blink: - bl wait - mov r0, r6 - bl led_blink - b endless_blink - -wait: - /* busy wait loop*/ - mov r5, #0x1000000 -wait0: - subs r5, r5, #1 - bne wait0 - mov pc, lr - - - - -undefined_instruction: - mov r6, #3 - b endless_blink - - - - -software_interrupt: - /* NOTE: This is NOT an error! If you think that blob should return - * from software interrupts, you're plain WRONG. The source of the - * problem is in the kernel: you should *disable* CONFIG_ANGELBOOT - * simply because blob is not angel. -- Erik - */ - mov r6, #4 - b endless_blink - - - - - -prefetch_abort: - mov r6, #5 - b endless_blink - - - - -data_abort: - mov r6, #6 - b endless_blink - - - - -not_used: - /* we *should* never reach this */ - mov r6, #7 - b endless_blink - - - - -irq: - mov r6, #8 - b endless_blink - - - - -fiq: - mov r6, #9 - b endless_blink Index: start-sa11x0.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/start-sa11x0.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- start-sa11x0.S 2002/01/12 01:45:57 1.1 +++ start-sa11x0.S 2002/01/18 22:32:00 1.2 @@ -94,7 +94,7 @@ ldr r1, [r0, #RCSR] and r1, r1, #0x0f teq r1, #0x08 - bne normal_boot /* no, continue booting */ + bne real_reset /* no, continue booting */ /* yes, a wake-up. clear RCSR by writing a 1 (see 9.6.2.1 from [1]) */ mov r1, #0x08 @@ -114,11 +114,111 @@ ldr r1, [r0, #PSPR] mov pc, r1 +real_reset: + /* turn off the LED. if it stays off it is an indication that + * we didn't make it into the C code */ + bl led_off + /* everything is said and done over here, call normal_boot in * the generic startup code to continue the boot procedure */ bl normal_boot + /* oops, normal_boot returns, something went wrong. signal an + * error to the user */ + mov r6, #2 + b endless_blink + + + + +/* we could choose to handle all exceptions in a nice way, but the + * best is to treat them as errors because blob should not contain + * errors + */ + +/* Undefined instruction exception */ +.globl undefined_instruction +undefined_instruction: + mov r6, #3 + b endless_blink + + + + +/* SWI */ +.globl software_interrupt +software_interrupt: + /* NOTE: This is NOT an error! If you think that blob should return + * from software interrupts, you're plain WRONG. The source of the + * problem is in the kernel: you should *disable* CONFIG_ANGELBOOT + * simply because blob is not angel. -- Erik + */ + mov r6, #4 + b endless_blink + + + + +/* prefetch exception. shouldn't happen though we usually run with + * i-cache enabled */ +.globl prefetch_abort +prefetch_abort: + mov r6, #5 + b endless_blink + + +/* data abort */ +.globl data_abort +data_abort: + mov r6, #6 + b endless_blink + + + + +/* we *should* never reach this */ +.globl not_used +not_used: + mov r6, #7 + b endless_blink + + + + +/* interrupt. we could handle this differently later if some kind of + * driver in blob wants to be interrupt driven. for the time being we + * treat it as an error. + */ +.globl irq +irq: + mov r6, #8 + b endless_blink + + +/* FIQ. same as IRQ */ +.globl fiq +fiq: + mov r6, #9 + b endless_blink + + + + +/* endless loop that blinks the LED. r6 contains the number of blinks */ +endless_blink: + bl wait + mov r0, r6 + bl led_blink + b endless_blink + +wait: + /* busy wait loop*/ + mov r5, #0x1000000 +wait0: + subs r5, r5, #1 + bne wait0 + mov pc, lr |