]> git.sur5r.net Git - openocd/blob - ecosflash/flash.S
dc30d1633173d9c41aa7b93aef553700a4002e18
[openocd] / ecosflash / flash.S
1 /*
2         Jump table for flash driver
3         
4         Registers in ARM callling convention is to place args in registers 
5         starting at r0.
6         
7         So for:
8         
9         void foo(int a, int b, int c).
10         
11         a=r0
12         b=r1
13         c=r2
14         
15         
16 */
17         .global _stack_base
18         .global _stack_start
19         .global _workarea
20         .global _start
21         .global _start_bss_clear
22 _start:
23         // offset=0
24         // int erase(void *address, int len)
25         ldr     sp,=_stack_start                
26         bl erase
27         nop // Stop CPU here using hw breakpoint
28         
29         // offset=0xc
30         // int program(void *buffer, void *address, int len)    
31         ldr     sp,=_stack_start              
32         bl program
33         nop // Stop CPU here using hw breakpoint
34         
35         // offset=0x18
36         ldr     r0,=_workarea                
37         nop // Stop CPU here using hw breakpoint
38         
39         // offset=0x20
40         // int init() - returns error message if the flash chip can't be detected       
41         ldr     sp,=_stack_start              
42         bl init
43         nop // Stop CPU here using hw breakpoint
44
45     .section ".bss"
46     .balign 4
47 _stack_base:
48         .rept 4096
49         .byte 0
50         .endr
51 _stack_start:
52     .balign 4
53 _workarea:
54         .rept 8192
55         .byte 0
56         .endr
57         // NB!!! we clear bss while the stack is in use, so we start BSS clearing here !!! :-)
58 _start_bss_clear: