You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.2 KiB

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